TECHNOLOGY 

Published on
KembaraXtra-Computer Science - A Trip Through the Internet
Overview
This guide summarizes the journey of data across the internet using the TCP/IP model, illustrating how different devices interact at each layer.
Scenario
  • A client device (connected to Wi-Fi) wants to access a web page hosted on a server (connected via wired connection).
  • The client knows the server's IP address.
Step-by-Step Data Transmission
  1. Application Layer (Client):
    • The web browser creates an HTTP request.
    • The browser hands off the HTTP request to the OS's TCP/IP stack.
  2. Transport Layer (Client):
    • The TCP layer encapsulates the HTTP payload into a TCP segment.
    • It sets the destination port to 80 (standard for HTTP) in the segment header.
    • If the data is too large, TCP divides it into multiple segments.
  3. Internet Layer (Client):
    • The IP layer wraps the TCP segment in an IP packet.
    • The packet header includes the destination IP address of the server.
    • If necessary, IP divides the packet into smaller fragments.
  4. Link Layer (Client):
    • The IP packet is encapsulated in a frame.
    • The frame header includes the MAC address of the local router.
    • The client's Wi-Fi hardware transmits the frame wirelessly.
  5. Wireless Access Point:
    • Receives the frame.
    • Sends the frame to the router (operates at the link layer).
  6. Router(s):
    • Examines the IP packet to determine the destination IP address.
    • Encapsulates the packet in a new frame with the MAC address of the next router.
    • Sends the new frame on its way.
    • This routing process continues through multiple routers.
  7. Final Router (Server's Subnet):
    • Encapsulates the packet in a frame suitable for the server's local network.
    • The frame header includes the MAC address of the server.
  8. Switch (Server's Subnet):
    • Looks at the MAC address in the frame.
    • Forwards the frame out the appropriate physical port to the server.
    • Doesn't need to look at higher layers.
  9. Server:
    • Receives the frame.
    • The network interface driver passes the TCP/IP packet up to the TCP/IP stack.
    • The TCP/IP stack hands off the HTTP data to the process listening on TCP port 80.
    • The web server software (listening on port 80) handles the request.
  10. Reverse Process (Server to Client):
    • The server replies to the client, and the entire process happens again in reverse order.
Key Concepts
  • Encapsulation: Each layer adds its own header to the data from the layer above.
  • Decapsulation: Each layer removes its header to reveal the data for that layer.
  • Routers: Operate at the internet layer (primarily) to forward packets between networks based on IP addresses.
  • Switches: Operate at the link layer to forward frames within a local network based on MAC addresses.
  • Ports: Used by the transport layer (TCP/UDP) to identify specific applications or services on a host.
Important Notes
  • Devices interact at different layers of the TCP/IP stack.
  • The routing process involves multiple routers, each forwarding the packet closer to its destination.
  • The switch forwards data based on MAC addresses within the local network.



Picture
0 Comments