Port (protocol)

from Wikipedia, the free encyclopedia

A port is part of a network - address , the assignment of TCP - and UDP connections and -Datenpaketen to Server and - Client programs by operating systems causes. Each connection of these two protocols has two ports, one on the client and one on the server.

Valid port numbers are 0 to 65 535 (= 2 16  - 1).

purpose

Ports serve two purposes:

  • Primarily, ports are a feature used to distinguish multiple connections between the same pair of endpoints.
  • Ports can also identify network protocols and corresponding network services .

Examples

  • A web browser can start another download from the same server during a download because the browser then opens another port and establishes an additional connection to the same port 80 of the server. The server replies to the different ports of the browser with different content that belongs together. Different port numbers on just one of the two end points are sufficient to distinguish the connections.
  • Port 25 is reserved for the Simple Mail Transfer Protocol (SMTP). When a connection to port 25 of a server is established, this connection is accepted by the server's SMTP service, if this service is available.

functionality

Starting servers request certain ports from the operating system in order to be able to accept connections. As a rule, these are ' well-known ports ', since the port number does not need to be published or known. Rather, the numbers are permanently assigned to the programs concerned.

Clients normally request a random port from the operating system (usually in the very high range over 30000) in order to be able to establish connections. However, a client can also bind to a specific port (call from bind()); this is necessary, for example, for certain connectionless protocols, but limits the use of this client to one process per computer.

The connection is established by the client, which must know the port of the server. When the connection is established, the server learns the port of the client so that it can respond. If a “well-known port” is used, the port number is changed on the server side at the same time in order to be able to continue to provide the known, standardized port number for new connections.

history

Port numbers were originally called AEN , which stood for Another Eightbit Number .

In 1981, the Transmission Control Protocol defined a much larger area of ​​16  bits .

The standardization goes back largely to initiatives by Jon Postel in the early 1970s.

standardization

Since 2011, RFC 6335 has been a request for comments describing the procedure by which the Internet Assigned Numbers Authority (IANA) assigns ports to protocols. There are three areas:

System ports

Ports 0 to 1023 (0 hex to 3FF hex )

These ports are also called well-known ports and are reserved for services if they have not already been assigned as "reserved ports" of the IANA itself (e.g. for future extensions), which applies in particular to the interval limits (for example: 0, 1023, 1024), which are therefore not available for use for servers. New assignments are only made with the participation of the Internet Engineering Task Force (IETF).

User ports

Ports 1024 to 49151 (400 hex to BFFF hex )

These ports are intended for registered services, but can also be used for client programs. The majority of current operating systems no longer carry out dynamic assignment for client programs, as the “dynamic ports” are provided for this. In this area, new assignments can be made on request without the involvement of the IETF .

Dynamic ports

Ports 49152 to 65535 (C000 hex to FFFF hex )

These ports are dynamically assigned to client programs by the operating system.

Complemental description: Linux systems very often do not adhere to this standard and assign the client ports in the range between 32768 and 61000. Originally, the IANA intended the ports from 1024 for client programs. When changing the port area, however, there were some discussions until today's classification prevailed. In Linux, however, the changeover was made during the discussion period and was not converted to the final standard. The reason given time and again is that the dynamic port range is too small. Some NAT routers use even lower ports.

meaning

Deviations from the IANA assignments make contacting difficult without being able to prevent it.

The list of standardized ports provides an overview of assignments .

Service name

In addition to protocols, ports are also assigned names for the corresponding services. Such a service name can be used for SRV resource records , for example.

This list is defined in the file on a Unix computer /etc/services.

Under operating systems of the Windows NT line this can be found under %WINDIR%\system32\drivers\etc\services, for the Windows 9x line directly in the Windows folder ( %WINDIR%\services).

Port filter

A port forwarding causes a Intended port is forwarded via a second port to another system.

A port block is the blocking or throttling of a certain port or the service accessing it. Some Internet service providers use blocking of ports to block unwanted services. With providers, for example, services can be undesirable because they cause a lot of data traffic , for example with file sharing .

Ports can also be blocked with a firewall . With a local firewall, the procedure is usually the other way around: only the ports actually required are released and all other ports remain blocked. This reduces the points of attack on the protected network or the PC .

Port scanner

Port scanners are used to find ports and can be a sign of an attack. Supports the firewall or packet filter that port knocking , so a port scan may be hampered by ports are opened only when they were sent a previously agreed sequence of packets.

See also

Web links

Individual evidence

  1. Internet Engineering Task Force (Ed.): Internet Assigned Numbers Authority (IANA) Procedures for the Management of the Service Name and Transport Protocol Port Number Registry (=  Best Current Practice . Volume 165 ). ISSN  2070-1721 , p. 6 ( BCP 165 [accessed February 22, 2012]).
  2. RFC 433 - Socket Number List , December 1972
  3. RFC 793 - Transmission Control Protocol , September 1981
  4. RFC 204 - Sockets in Use , August 1971
  5. RFC 349 - Socket Number List , May 1972