What Is a Listening Port?

by Stephen Byron Cooper
Computer applications listen on ports for incoming messages.

Computer applications listen on ports for incoming messages.

A port is an address for a program when data travels from one computer to another over a network. Just as computers have addresses, so do programs. The port number is a quick way to tell the network program receiving the data which application should receive it. Those applications run constantly awaiting data to trigger an action. This waiting state is called listening.

Network Communications

The port concept specifically relates to data transferred across networks by the TCP/IP protocol suite. TCP/IP stands for Transmission Control Protocol/Internet Protocol. A series of standards explain how data should be packaged and addressed to reach their destination. This involves dividing up the data into segments and then placing each data segment in a structure called a packet. The packet has a header where the network protocols store information for their receiving counterpart. The last header to go onto the packet is the IP header, which contains the address of the destination computer. This header goes in front of the transport header, which is where the port number of the receiving application is written.

Transport Protocols

The two alternative transport protocols in TCP/IP are the Transmission Control Protocol and the User Datagram Protocol. These two protocols deal with port numbers. They package the data and place the port number in the header. TCP establishes a connection with its counterpart and maintains that connection throughout the session. The protocol defines how data packets are sequenced so that the receiving program can know the order in which to reassemble data. UDP is a lightweight alternative that is usually used by multimedia applications. Ports are known by a number but also by the transport protocol, and so there is a port called TCP 25 and one called UDP 25. These are not the same port.

Well Known Ports

A number of applications have a port number reserved for them. These allocations are called "well known ports" and the list is maintained and distributed by the Internet Assigned Numbers Authority, which is better known as IANA. Programmers sending data to a particular port cannot expect another program to pick that data. For example, there is no point sending data to port 21, which is registered for the File Transfer protocol, hoping that Kerberos will pick it up, because Kerberos is listening on port 88.

Receiving Procedures

Networking software in the receiving computer strips off the headers and reassembles the data, before passing it on to the application associated with the port number written in the packets' headers. That application must be running to receive the data. With many applications, the receipt of data is an interactive process, with the corresponding applications on each computer messaging back and forth for the duration of the session.

About the Author

Stephen Byron Cooper began writing professionally in 2010. He holds a Bachelor of Science in computing from the University of Plymouth and a Master of Science in manufacturing systems from Kingston University. A career as a programmer gives him experience in technology. Cooper also has experience in hospitality management with knowledge in tourism.

Photo Credits

  • photo_camera Hemera Technologies/AbleStock.com/Getty Images