Tcp/ip networking internet

TCP/IP: The Backbone Of The Internet

TCP/IP (Transmission Control Protocol/Internet Protocol) is the foundational suite of networking protocols that governs how data is packaged, addressed, transmitted, routed, and received across the internet.
Without TCP/IP, modern interconnected global networking would not exist—it provides the universal language that allows disparate hardware, operating systems, and networks to communicate seamlessly.

The Core Partnership: TCP vs. IP

Although often named together, TCP and IP perform distinct, complementary functions:

  • IP (Internet Protocol): The Postal Service
    Responsible for addressing and routing. IP assigns unique addresses (IPv4 or IPv6) to devices and splits data into small packets. It handles delivering those packets to their final destination without guaranteeing delivery order or checking if packets get lost along the way.
  • TCP (Transmission Control Protocol): The Reliable Courier
    Responsible for connection and integrity. Operating on top of IP, TCP establishes a reliable connection between the sender and receiver. It numbers each packet, reassembles them in the correct order, requests retransmission for lost packets, and manages network congestion.

The 4 Layers of TCP/IP

  1. Application Layer
    Generates the raw data
    High-level protocols like HTTP/HTTPS (web browsing), SMTP (email), and SSH (secure terminal) interact directly with applications to generate data payloads.
  2. Transport Layer
    Ensures reliable delivery
    TCP breaks data into segments, attaches port numbers (e.g., Port 443 for HTTPS), and manages error checking and flow control.
  3. Internet Layer
    Routes packets across networks
    IP wraps transport segments into packets, adding source and destination IP addresses to determine the path across routers.
  4. Network Access Layer
    Transmits physical signals
    Converts packets into frames and streams them as physical bits over network hardware, such as Ethernet cables, Wi-Fi radio waves, or fiber optics.
Tcp/ip 3-way handshake

The TCP 3-way handshake (also called SYN-SYN-ACK) is the process used by a client and a server to establish a reliable connection before any actual data transfer begins.
It ensures both sides are ready to communicate and syncs their starting sequence numbers so packets arrive in order.

How the 3-Way Handshake Works

  1. Client –
    Server” title=”1. SYN (Synchronize)”>
    The client sends a TCP packet with the SYN flag set and an Initial Sequence Number (ISN), e.g., seq = x.
    Analogy: “Hello! Can we talk? My starting sequence is X.”
  2. Server –
    Client” title=”2. SYN-ACK (Synchronize-Acknowledge)”>
    The server receives the SYN, acknowledges it by sending ack = x + 1, sets its own initial sequence number (seq = y), and returns the packet with both SYN and ACK flags set.
    Analogy: “Got your message X! Yes, let’s talk. My starting sequence is Y.”
  3. Client –
    Server” title=”3. ACK (Acknowledge)”>
    The client receives the SYN-ACK and sends a final packet with the ACK flag set, confirming receipt of the server’s sequence number (ack = y + 1).
    Analogy: “Got your message Y! We are ready to transmit data.”

Key Concepts

  • Connection Status: After Step 3 completes, both devices set their socket connection status to ESTABLISHED.
  • Why 3 steps? Three steps are the minimum required for two independent devices to bi-directionally acknowledge each other’s sequence numbers and confirm both can send and receive.
Leave a Comment

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *