- 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
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.
- Application Layer (Client):
- The web browser creates an HTTP request.
- The browser hands off the HTTP request to the OS's TCP/IP stack.
- 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.
- 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.
- 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.
- Wireless Access Point:
- Receives the frame.
- Sends the frame to the router (operates at the link layer).
- 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.
- 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.
- 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.
- 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.
- Reverse Process (Server to Client):
- The server replies to the client, and the entire process happens again in reverse order.
- 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.
- 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.
0 Comments