- TCP and UDP port
In
computer networking , a port is an application-specific or process-specific software construct serving as a communications endpoint used by Transport Layer protocols of the Internet Protocol Suite such asTransmission Control Protocol (TCP) andUser Datagram Protocol (UDP). A specific port is identified by its number commonly known as the port number.Example
An example for the use of ports is the Internet mail system (
e-mail ). A server used for sending and receiving e-mail provides both anSMTP service (for sending) and aPOP3 service (for receiving). These are handled by different server processes, and the port number is used to determine which data is associated with which process. By convention, the SMTP server listens on port 25, while POP3 listens on port 110.The concept of ports can be readily explained with an analogy: think of
IP address es as the street address of an apartment building, and the port number as the number of a particular apartment within that building. If a letter (a data packet) is sent to the apartment building (IP) without an apartment number (port number) on it, then nobody knows whom (which service) it is intended for. In order for the delivery to be successful, the sender needs to include an apartment number along with the address to ensure the letter gets to the right domicile.Technical details
Transport Layer protocol, such asTCP ,UDP ,SCTP , andDCCP specify a source and destination port in their packet headers. A port number is a 16-bit unsigned integer, ranging from 0 to 65535. A process "binds" to a particular port to send and receive data, meaning that it will listen for incoming packets whose destination port matches that port number, and/or send outgoing packets whose source port is set to that port number. Processes may bind to multiple ports.Applications implementing common services will normally listen on specific port numbers which have been defined by convention for use with the given protocol — see
list of TCP and UDP port numbers . Typically, these will be low port numbers, and inUnix only processes owned by thesuperuser can create ports with numbers from 0 to 1023. This is for security to prevent untrusted processes from acting as system services. Conversely, the client end of the connection will typically use a varying, high port number (ephemeral port ).Because the port number is a part of the packet header, it is readily interpreted not only by the sending and receiving computers, but also by other components of the networking infrastructure. In particular, firewalls are commonly configured to respond differently to packets depending on their source and/or destination port numbers.
Port forwarding is an example application of this.Processes implement connections to transport protocol ports by means of sockets. A socket is the software structure used as the transport end-point. It is created by the process and bound to a socket address which consists of a combination of a port and an IP address. Sockets may be set to send/receive data in one direction at a time, called "half duplex", or simultaneously in both directions, called "full duplex". In addition to the transport protocols, sockets are also used by interprocess communications protocols within a single host.
Because different services commonly listen on different port numbers, the practice of attempting to connect in sequence to a wide range of services on a single computer is commonly known as
port scanning . This is usually associated either with malicious cracking attempts or with a search for possible vulnerabilities to help prevent such attacks.Port connection attempts are frequently monitored and logged by computers connected to networks. The technique of
port knocking uses a series of port connections or "knocks" from a client computer to enable a server connection.Use in URLs
Port numbers can occasionally be seen in the URLs of websites. By default, HTTP uses port 80 and HTTPS uses port 443, but a URL like
http://www.example.com:8000/blah/ would try to connect to an HTTP server on port 8000 instead of the default port 80.Common ports
"See
list of TCP and UDP port numbers ."IANA
The
Internet Assigned Numbers Authority (IANA) is responsible for the global coordination of the DNS Root, IP addressing, and other Internet protocol resources.The port numbers are divided into three ranges: the Well Known Ports, the Registered Ports, and the Dynamic and/or Private Ports.
The "Well Known Ports" are those from 0 through 1023.
The "Registered Ports" are those from 1024 through 49151.
A list of registered ports can be found on the IANA Website - http://www.iana.org/assignments/port-numbers
Wikimedia Foundation. 2010.