TheHingineer

  • Computer Networks


  • CN Part-1

  • CN Part-2

  • CN Part-3

  • CN Part-4

  • CN Part-5

  •  Process-to-Process Delivery, Ports, and Sockets in Computer Networks

     Process-to-Process Delivery kya hoti hai?

    • Network communication teen levels par hoti hai:

      • Node-to-Node Delivery (Data Link Layer): Frame ko ek cable ke ek sire se doosre sire tak pahunchana (using MAC Address).
      • Host-to-Host Delivery (Network Layer): Packet ko source computer se destination computer tak pahunchana (using IP Address).
      • Process-to-Process Delivery (Transport Layer): Packet ko computer ke andar chal rahe specific running program (Process) tak deliver karna (using Port Address).
    • Ek operating system mein hazaron programs (processes) chal sakte hain. Jab koi message aata hai, toh Transport layer use sahi program (jaise browser tab ya WhatsApp app) tak route karti hai.

     1. Port Numbers (Service-Point Addressing)

    • Har running application process ko identify karne ke liye ek 16-bit integer use hota hai jise Port Number kehte hain.

    • Port numbers ki total range 0 se 65,535 (yani 2^16 - 1) hoti hai.

    • IANA (Internet Assigned Numbers Authority) ne port numbers ko teen ranges mein divide kiya hai:

    Port Category Range Description aur Popular Examples
    Well-Known Ports 0 – 1023 Standard server services ke liye permanently assigned:
    – Port 20, 21: FTP (File Transfer)
    – Port 22: SSH (Secure Shell)
    – Port 25: SMTP (Email sending)
    – Port 53: DNS (Domain Name Resolution)
    – Port 80: HTTP (Web unencrypted)
    – Port 443: HTTPS (Web encrypted)
    Registered Ports 1024 – 49,151 Specific software vendors ya user processes dwara IANA se register karwaye gaye ports (e.g., MySQL: 3306, MongoDB: 27017).
    Dynamic / Private (Ephemeral) Ports 49,152 – 65,535 Temporary client-side ports jo OS browser ya app ko session ke duration ke liye dynamically allocate karta hai. Session close hote hi release ho jaate hain.

     2. Sockets aur Socket Address

    • Akela IP Address sirf device identify kar sakta hai, process nahi. Aur akela Port Number sirf process identify kar sakta hai, internet par device nahi.

    • Isliye dono ko jodkar ek unique global address banaya jaata hai jise Socket Address kehte hain:

    Socket Address = IP Address + Port Number Example: 192.168.1.10 : 8080

    Socket kya hota hai? (Network Endpoint):

    Socket do network devices ke beech bidirectional communication channel ka software endpoint (doorway) hota hai. Ek connection hamesha ek Socket Pair (Source Socket + Destination Socket) se define hota hai:

    Connection = {Source IP : Source Port, Destination IP : Destination Port} Example: {192.168.1.5 : 51234, 142.250.190.46 : 443}

     Multiplexing and Demultiplexing

    [ Browser (Port 52140) ]   [ Spotify (Port 53200) ]   [ WhatsApp (Port 54110) ]
               \                         |                         /
                +------------------------+------------------------+
                                         |
                           [ Multiplexing at Transport Layer ]  <-- Appends Source/Dest Ports
                                         |
                             [ Single Network Layer (IP) ]
                                         |
                                   ( The Internet )
                                         |
                             [ Single Network Layer (IP) ]
                                         |
                          [ Demultiplexing at Transport Layer ] <-- Checks Dest Port
                +------------------------+------------------------+
               /                         |                         \
    [ Web Server (Port 443) ]  [ Audio Server (Port 4070) ] [ Chat Server (Port 5222) ]

    -> Multiplexing (Sender Side): Ek hi computer par multiple application processes ke data chunks ko collect karke, unpar respective port headers lagakar ek single IP stream mein transmit karna.
    -> Demultiplexing (Receiver Side): Incoming packet ke header mein Destination Port Number check karke data ko theek usi specific running process ke socket buffer mein deliver karna.

     Summary Table

    Addressing Concept Summary Punchline
    Port Number 16-bit integer (0 to 65535) identifying a running process.
    Socket Combination of IP Address + Port Number. Acts as communication endpoint.
    Well-Known Ports 0 to 1023 (HTTP: 80, HTTPS: 443, DNS: 53, SSH: 22).
    Scroll to Top