What is port addressing?

Introduction

The transfer of data amongst processesA running instance of a program lays the foundation for every application on the internet. Therefore, it follows that there must exist some addressing system that uniquely identifies every process that sends and receives data.

An analogy

Let's suppose it's our friend's birthday, and we want to send them a gift. For this, we need to know the following about their home address:

  • Their street number
  • Their house number

Now, the house number and street number together must be unique for every single house to ensure that the gift does indeed reach our friend's house.

This is how port addressing works.

Port addressing

Port addressing refers to using the port numbers assigned to every process to exchange data between them. Now, for processes that send and receive data over the internet, the following information must be assigned to every process:

  • The IP address: We use this to uniquely identify the machines that run the processes over the internet.
  • The port address (port number): We use this to identify the processes uniquely on a machine. This number can range from 0–65535.

Collectively, the IP address and port number form a socket address (socket number). This enables every single process to be uniquely identified over the internet.

Forming the socket address

Socket addressing

The sender must provide the receiver's socket address for a packet to reach its intended destination. The first part of the socket address (the IP address) enables the packet to reach the receiver's machine. It will then route the packet to the designated process through the second part of the socket address (the port number).

The animation below illustrates how two processes on different machines can communicate using port addressing.

Process 1 on Machine 1 sends a request for data from Process 3 on Machine 2
1 of 6

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved