9.4 Port Numbers Flashcards
PORT NUMBERS
The TCP and UDP transport layer protocols use port numbers to manage multiple, simultaneous conversations.
The source port number is associated with the originating application on the local host whereas the destination port number is associated with the destination application on the remote host.
In the request, the destination port number is what identifies the type of service being requested of the destination web server.
Socket
The source and destination ports are placed within the segment. The segments are then encapsulated within an IP packet. The IP packet contains the IP address of the source and destination. The combination of the source IP address and source port number, or the destination IP address and destination port number is known as a socket.
Sockets enable multiple processes, running on a client, to distinguish themselves from each other, and multiple connections to a server process to be distinguished from each other.
The source port number acts as a return address for the requesting application. The transport layer keeps track of this port and the application that initiated the request so that when a response is returned, it can be forwarded to the correct application.
Socket Pair
Together, the two sockets combine to form a socket pair:
Port Number Groups
The 16 bits used to identify the source and destination port numbers provides a range of ports from 0 through 65535.
The IANA has divided the range of numbers into the following three port groups.
WELL KNOWN ports: 0 - 1023
REGISTERED PORTS: 1024 - 49151
PRIVATE PORTS: 49151 - 65535
NETSTAT
Netstat is an important network utility that can be used to verify active TCP connections.
Enter the command netstat to list the protocols in use, the local address and port numbers, the foreign address and port numbers, and the connection state.
By default, the netstat command will attempt to resolve IP addresses to domain names and port numbers to well-known applications. The -n option can be used to display IP addresses and port numbers in their numerical form.
The netstat Windows command would display protocols in use, the local address and port numbers, the foreign address and port numbers, and the connection state.