Consider the example packet capture below. This request shows an HTTP connection between a client and a web server. Notice the TCP header portion of the frame. It specifies that the destination port is 80 (the web server) and the source port is 4773 (the client web browser).
Ethernet II
Internet Protocol, Src Addr: 192.168.1.21 (192.168.1.21), Dst Addr: 192.168.1.200 (192.168.1.200)
Transmission Control Protocol, Src Port: 4773 (4773), Dst Port: 80 (80), Seq: 1935801179, Ack: 2272844446
Source port: 4773 (4773)
Destination port: 80 (80)
Sequence number: 1935801179
Next sequence number: 1935801513
Acknowledgement number: 2272844446
Header length: 20 bytes
Flags: 0x0018 (PSH, ACK)
Window size: 17520
Checksum: 0xf4e3 (correct)
Hypertext Transfer Protocol
Remember that a connection is uniquely identified by a combination of both the client and server port numbers and IP addresses. In this case the connection is uniquely identified as:
(192.168.1.21 port 4773) and (192.168.1.200 port 80)
Many simultaneous connections between different clients and a single server are possible. The server will keep track of where data needs to be sent according to the connection information.
Tip: Sometimes “seeing” connections can help you to better understand the network communication process. If you’re running Windows on your workstation, open a command prompt and type netstat.exe to view current connection information.
The list below outlines some of the more common TCP port numbers that you should be familiar with.
FTP 20, 21
Telnet 23
SMTP 25
HTTP 80
POP3 110
Tip: For a complete list of well-known port numbers see http://www.iana.org/assignments/port-numbers. This list obsoletes the previous list found in RFC 1700.
It’s worth noting that some applications actually use more than one port number. With FTP, for example, port 21 is used as the control channel, where username and password information is passed when a connection is attempted. Port 20 is then used for the actual transfer of data.
Server side port numbers can usually also be custom configured. For example, you could set up a web server to answer on TCP port 2222. The only issue is that users would have to be aware of the port number and explicitly state it when attempting to connect from their web browser, which will automatically assume port 80 for an HTTP request. In this case, a user would need to connect to https://www.2000trainers.com:2222 – the number after the colon explicitly specifies the port number.