Ports and Sockets

Filter Course


Ports and Sockets

Published by: Zaya

Published date: 22 Jun 2021

Ports and Sockets Photo

Ports and Sockets

A Client machine is capable of browsing multiple web pages originated from different web servers simultaneously.

Ports and Sockets help to identify the process running in the host machine uniquely.

Every process is identified by a 16-bit port number.

The socket is the program that is associated with every process.

When a web page is opened, automatically a socket program is initialized to receive/send packets to the process.

A Port number is also created to identify the process uniquely.

Port

Port is one of the circuit connection points on a front-end processor or local intelligent controller. The TCP and UDP protocols use ports to map incoming data to a particular process running on a computer.

Port

At the transport layer, and address is needed to choose among multiple processes running on the destination host called port number.

  • Destination Port number for delivery
  • Source port number for reply

Port Number is represented by a positive 16-bit integer value between 0 and 65,535.

Some ports have been reserved to support common services

  • FTP 21/TCP
  • TelNet 23/TCP
  • SMTP 25/TCP
  • Login 513/TCP

The user-level processeses generally use port number value 1024.

PORT Numbers

Internet Assigned Number Authority (IANA) has divided Port numbers into three ranges:

Well-Known Ports

  • Ranges from 0 to 1023
  • Assigned and controlled by IANA

Registered Ports

  • Ranges from 1024 to 49,151
  • Not assigned and controlled, but registered by IANA

Dynamic Ports

  • Ranges from 49,152 to 65,535
  • Neither registered nor controlled by IANA
  • Used by any process temporarily

Socket

A socket is one endpoint of a two-way communication link between two processes running on the network. Sockets provide an interface for programming networks at the transport layer.

A socket is bound to a port number so that the TCP layer can identify the application that data is destined to be sent.

Socket address is the combination of an IP address and a Port number.