Cisco Systems CCNA 2 Network Router User Manual


 
116 - 238 CCNA 2: Routers and Routing Basics v3.1 Instructor Guide – Module 10 Copyright © 2004, Cisco Systems, Inc.
10.2.2 Ports for services
Services that are used on hosts must have a port numbers assigned so communication can
occur. Some ports are reserved in both TCP and UDP. These are considered well-known
ports. Students must know these port numbers. Explain to the student that a question mark (?)
can be used in the router to display the port numbers. However, students must learn the most
common port numbers. These ports and their activities can be examined on a workstation from
the command prompt with the netstat –a command. The ports that are listed as listening
are services.
A good way to explain this concept is a server service listens on a given port number. A client
will initiate a session with the server by addressing that particular port number. All inbound
segments have a destination port number. An application layer protocol or service looks at this
port number to see if its port number is being addressed. If it is not, then the service ignores
the segment. Emphasize that the client initiates the session. The server is listening and will
respond when addressed.
10.2.3 Ports for clients
When a client connects to a service on a server, a source and destination port must be
specified. Source ports, which are set by the client, are determined dynamically. A client
usually determines the source port by randomly assigning a number above 1023. Clients and
servers use ports to distinguish what process each segment is associated with. This is an
important concept for the students to understand about port numbers. Explain that the server
responds with the same port numbers except the source and destination port numbers are
swapped. For example, if the client initiates a session with a source port number of 1094 and a
destination port number of 23, then the server will respond with a source port number of 23
and a destination port number of 1094.
10.2.4 Port numbering and well known port numbers
Port numbers are represented by two bytes in the header of a TCP or UDP segment. This 16-
bit value can result in port numbers that range from 0 to 65535. Port numbers are divided into
three different categories:
Well known ports
Registered ports
Dynamic or private ports
The first 1023 are well known ports. Registered ports range from 1024 to 49151. Ports
between 49152 and 65535 are dynamic or private ports. Discuss the differences between
these ports with the students. Also, let the students know that services can use the upper port
numbers. This can be done for private applications or for security. An example of using a
private port for security is running a Telnet server listening to port 14002, instead of the well-
known port 23. Since the port is not the standard port 23, the open port 14002 would have to
be known or discovered by a user to successfully telnet to this host.