A port is a physical point that allows an external device to be connected with the computer. There are over 65,000 virtual computer ports on your machine. A port can be both hardware and software. When associated with hardware, it performs as an interface between the main computer and other computers. In general, a port can mean different things, but in a computer language, it is used to transfer signals from one device to another. You can use these ports to connect with webcams, monitors, speakers and other peripheral devices. It serves as an outlet on equipment that enables the user to plug in or connect a cable.
When associated with software, ports allow the flow of information from one computer to another device or over the Internet. Ports have different meanings in terms of software but the basic functionality or working protocol remains the same. A port is an application specific or software specific, which serves a computer’s host operating system’s communication endpoint. The main purpose of this is to identify different processes which are running on a single computer and thereby enable it to share physical connection to a packet switched network. A basic example for this would be the internet. Every port is associated with an Internet protocol address of a host and the type of protocol being used for communication.
Protocols that use ports are Transport Layer protocols which are TCP, also known as Transmission Control Protocol and UDP (User Datagram Protocol). Ports are unique 16-bit numbers for every address. This port number contains the destination address and the address of host for the communication session. The data is first routed to the specified IP address and then to the particular port number specified in the port number. The combination port number and IP are unique globally and this is the reason as to why different permutations of port and IP addresses are used throughout the world. Different protocols can use the same port numbers for communication provided the port is not being used by another service.
Transmission Control Protocol (TCP)
Known as the core protocol of an IP, it is used so frequently that the entire suite is called TCP/IP. In addition, it also provides error-checking, reliability and ordered delivery of a bit stream of octets between the running computers connected on the local area network, Internet, or an intranet. It’s basically used by web browsers to connect to servers and transfer files and deliver emails from one particular location to another. It’s a connection-oriented transmission protocol used by a browser when you connect to the World Wide Web.
A variety of protocols like HTTP, HTTPS, SMTP, IMAP and many more are defined by TCP. It provides services at intermediate leves between the IP and an application. TCP is used to send large chunks of data through a single TCP request as it handles the IP automatically.
User Datagram Protocol (UDP)
This is a connectionless protocol i.e. the information is sent regardless of the status of its destination. It is an unreliable method since there is no guarantee of data being received. A concept of retransmission or acknowledgement doesn’t exist in the protocol. It does not follow acknowledgement protocol and therefore, it can lead to duplication of packets as the receiver will not inform the sender about received packets. However, it does provide a checksum, which allows the destination to check the integrity of data received. This protocol is used in applications where correction or error-checking is not necessary, so it removes the overhead at a network-interface level.
Example of a Software Port
A server used for receiving and sending email uses two services. The first service is to transport email to and from servers. This can be accomplished by SMTP (Simple Mail Transfer Protocol). SMTP looks at the TCP port for incoming requests.
The second service is POP (Post Office Protocol) or IMAP (Internet Message Access Protocol), which is generally used by email client applications like Microsoft Outlook on users’ computers to fetch email messages from the email server. In addition, these emails can be accessed in offline mode too once they are downloaded. POP service works on port number 110 with TCP. These services can run on the same host computer or a remote computer (mail server).
Common Port Numbers
The Internet Assigned Numbers Authority (IANA) is a global organization that does registration for commonly used Internet service port numbers. Port numbers are divided in three parts:
- Well-known ports or system ports
- Registered ports
- Dynamic or private port
A well known port lies between 0 and 1023. For instance, FTP (File Transfer Protocol) and HTTP (Hypertext Transfer Protocol) are two common services that run on ports 21 and 80 respectively. Registered ports range from 1024 through 49151. Lists of these ports are officially maintained by IANA. Dynamic or private ports range from 49152 through 65535.
A hardware port is a physical interface between devices connected through the cables and a computer. It’s an outlet that allows many devices to connect. Connected devices include the mouse, keyboard, monitor, microphone speaker, and flash drive. Hardware port xamples are PS2 ports, serial ports and USB ports.
Electronic Signal Transfer
When ports are connected, they require a handshake to start the process of exchanging information. A handshake is the concept of acknowledging basic details exchanged between the connected port such as the rate of transfer, type of transfer and other important details.
Plug-and-Play ports are generally used in computers. These ports work to start the handshake process as soon as the connection is established by hot-swapping. Hot swapping allows the devices to get connected while they are still running. Examples of plug and play device are USB ports and FireWire ports.
Two Types of Hardware Ports
Serial Ports: A serial communication’s physical interface through which data transmission is done. It sends and receives one bit at a time through a single wire pair, but the technology is old.
Example: Ethernet, FireWire.
Parallel Ports: An interface for connecting devices. Parallel ports are a parallel communication physical interface. It allows multiple bits to send at the same time to multiple connecting wires.