Port (computer networking)
In
A port number is always associated with a
Ports provide a multiplexing service for multiple services or multiple communication sessions at one network address. In the client–server model of application architecture, multiple simultaneous communication sessions may be initiated for the same service.
Port number
For TCP and UDP, a port number is a 16-bit unsigned integer, thus ranging from 0 to 65535. For TCP, port number 0 is reserved and cannot be used, while for UDP, the source port is optional and a value of zero means no port. A
Applications implementing common services often use specifically reserved
Common port numbers
IANA is responsible for the global coordination of the DNS root, IP addressing, and other protocol resources. This includes the registration of commonly used TCP and UDP port numbers for well-known internet services.
The port numbers are divided into three ranges: the well-known ports, the registered ports, and the dynamic or private ports.
The well-known ports (also known as system ports) are those numbered from 0 through 1023. The requirements for new assignments in this range are stricter than for other registrations.[2]
Number | Assignment |
---|---|
20 | File Transfer Protocol (FTP) Data Transfer |
21 | File Transfer Protocol (FTP) Command Control |
22 | Secure Shell (SSH) Secure Login |
23 | Telnet remote login service, unencrypted text messages |
25 | Simple Mail Transfer Protocol (SMTP) email delivery |
53 | Domain Name System (DNS) service |
67, 68 | Dynamic Host Configuration Protocol (DHCP) |
80 | Hypertext Transfer Protocol (HTTP) used in the World Wide Web
|
110 | Post Office Protocol (POP3) |
119 | Network News Transfer Protocol (NNTP) |
123 | Network Time Protocol (NTP) |
143 | Internet Message Access Protocol (IMAP) Management of digital mail |
161 | Simple Network Management Protocol (SNMP) |
194 | Internet Relay Chat (IRC)
|
443 | HTTP Secure (HTTPS) HTTP over TLS/SSL
|
546, 547 | DHCPv6 IPv6 version of DHCP |
The registered ports are those from 1024 through 49151. IANA maintains the official list of well-known and registered ranges.[3]
The dynamic or private ports are those from 49152 through 65535. One common use for this range is for ephemeral ports.
Network behavior
Port scanning
The practice of attempting to connect to a range of ports in sequence on a single host is commonly known as
Examples
An example of the use of ports is the delivery of email. A server used for sending and receiving email generally needs two services. The first service is used to transport email to and from other servers. This is accomplished with the Simple Mail Transfer Protocol (SMTP). A standard SMTP service application listens on TCP port 25 for incoming requests. The second service is usually either the Post Office Protocol (POP) or the Internet Message Access Protocol (IMAP) which is used by email client applications on users' personal computers to fetch email messages from the server. The POP service listens on TCP port number 110. Both services may be running on the same host computer, in which case the port number distinguishes the service that was requested by a remote computer, be it a user's computer or another mail server.
While the listening port number of a server is well defined (IANA calls these the well-known ports), the client's port number is often chosen from the dynamic port range (see below). In some applications, the clients and the server each use specific port numbers assigned by the IANA. A good example of this is
Use in URLs
Port numbers are sometimes seen in web or other
http://www.example.com:8080/path/
specifies that the web browserHistory
The concept of port numbers was established by the early developers of the ARPANET in informal cooperation of software authors and system administrators. The term port number was not yet in use. It was preceded by the use of the term socket number in the early development stages of the network. A socket number for a remote host was a 40-bit quantity.[4] The first 32 bits were similar to today's IPv4 address, but at the time the most-significant 8 bits were the host number. The least-significant portion of the socket number (bits 33 through 40) was an entity called Another Eightbit Number, abbreviated AEN.[5] Today, network socket refers to a related but distinct concept, namely the internal address of an endpoint used only within the node.
On March 26, 1972, Vint Cerf and Jon Postel called for documenting the then-current usages and establishing a socket number catalog in RFC 322. Network administrators were asked to submit a note or place a phone call, "describing the function and socket numbers of network service programs at each HOST".[6] This catalog was subsequently published as RFC 433 in December 1972 and included a list of hosts and their port numbers and the corresponding function used at each host in the network. This first registry function served primarily as documentation of usage and indicated that port number usage was conflicting between some hosts for "useful public services".[5] The document promised a resolution of the conflicts based on a standard that Postel had published in May 1972 in RFC 349, in which he first proposed official assignments of port numbers to network services and suggested a dedicated administrative function, which he called a czar, to maintain a registry.[7] The 256 values of the AEN were divided into the following ranges:
Port number range | Assignment |
---|---|
0 through 63 | Network-wide standard functions |
64 through 127 | Host-specific functions |
128 through 239 | Reserved for future use |
240 through 255 | Any experimental function |
The Telnet service received the first official assignment of the value 1. In detail, the first set of assignments was:[7]
Port number | Assignment |
---|---|
1 | Telnet |
3 | File transfer |
5 | Remote job entry |
7 | Echo |
9 | Discard |
In the early ARPANET, the AEN was also called a socket name,[8] and was used with the Initial Connection Protocol (ICP), a component of the Network Control Protocol (NCP).[9][10] NCP was the forerunner of the modern Internet protocols. Today the terminology service name is still closely connected with port numbers, the former being text strings used in some network functions to represent a numerical port number.
References
- . Retrieved 1 January 2023.
- .
- ^ "Port Numbers". Internet Assigned Numbers Authority (IANA).
- .
- ^ .
- .
- ^ .
- .
- ^ NIC 7104, ARPANET Protocol Handbook
- ^ Postel, Jon; Feinler, E. (1978). ARPANET Protocol Handbook. Menlo Park, CA: Network Information Center.