Because several application programs can be running on one machine using a single network interface, TCP needs to keep track of which data goes to which program. This tracking is done by assigning a port number to every TCP connection. The TCP port number does not need to be the same on the local and remote processes. When a TCP segment is received, TCP knows which process to pass it to by looking at the port number in the TCP header. For example, a user web browsing and polling the e-mail server at the same time is not aware that TCP is playing traffic director to the received data; all data from TCP port 80 is pointed to the web browser, and all data from TCP port 25 is pointed to the e-mail client.
A TCP socket is defined as the combination of the local IP address and the TCP port number. An application wanting to use the facilities of TCP must request a unique socket from the TCP. This is known as opening a socket. The local socket and the remote socket define a connection. An application must know these two things in order to successfully communicate to a remote application through TCP.
Routers and firewalls use the TCP port number to block or allow traffic to pass through a network. A complete list of TCP port numbers can be found in RFC 1700 (www.ietf.org/rfc/rfc1700.txt?number=1700). The following table lists some of the more common TCP port numbers.
Port Number | Process Name (Abbreviation) | Description |
---|---|---|
20 | FTP-Data | FTP (File Transfer Protocol) Data |
21 | FTP | FTP Control |
23 | TelNet | Telnet |
25 | SMTP | Simple Mail Transfer Protocol |
53 | DNS | Domain Name System |
69 | TFTP | Trivial File Transfer Protocol |
80 | HTTP | HTTP (HyperText Transfer Protocol) (WWW) |
110 | POP3 | Post Office Protocol version 3 |
115 | SFTP | Simple File Transfer Protocol |
161 | SNMP | SNMP (Simple Network Management Protocol) |
179 | BGP | Border Gateway Protocol |
443 | HTTPS | Secure HTTP |