Application Layer - Layers Working in Unison
Overview of Network Communication
- This section covers the process of data transmission between computers across networks.
Network Configuration
- Network A: Address space
10.1.0.0/24 - Network B: Address space
192.168.1.0/24 - Network C: Address space
172.16.1.0/24
Routers
- Router A: Connects Network A and Network B
- Interface IP on Network A:
10.1.1.1 - Interface IP on Network B:
192.168.1.254
- Interface IP on Network A:
- Router B: Connects Network B and Network C
- Interface IP on Network B:
192.168.1.1 - Interface IP on Network C:
172.16.1.1
- Interface IP on Network B:
Client and Server Configuration
- Computer 1: Client (desktop) on Network A
- Assigned IP:
10.1.1.100
- Assigned IP:
- Computer 2: Server (data center) on Network C
- Assigned IP:
172.16.1.100 - Running web server on port
80
- Assigned IP:
Steps in Data Transmission
Initiating Connection
- User on Computer 1 opens a browser and enters the IP of Computer 2 (
172.16.1.100). - The browser requests to establish a TCP connection to
172.16.1.100:80.
- User on Computer 1 opens a browser and enters the IP of Computer 2 (
Local Networking Stack Interaction
- The networking stack identifies that Computer 2 is on a different network, and data must go through the gateway (
10.1.1.1). - It checks its ARP table for the MAC address of the gateway but finds no entry.
- The networking stack identifies that Computer 2 is on a different network, and data must go through the gateway (
ARP Process
- Computer 1 sends an ARP request for
10.1.1.1to the broadcast address. - Router A receives the request and responds with its MAC address (
00:11:22:33:44:55).
- Computer 1 sends an ARP request for
Constructing the Outbound Packet
- Computer 1 forms an outbound TCP packet:
- Source Port:
50000 - Destination Port:
80 - Sequence Number: Chosen randomly.
- SYN Flag: Set to initiate TCP connection.
- Source Port:
- The IP header includes the source and destination IPs and a TTL of
64. - An Ethernet frame is constructed with MAC addresses.
- Computer 1 forms an outbound TCP packet:
Sending the Frame
- The Ethernet frame is sent across a physical connection to Router A through a switch.
- Router A receives the frame, checks the checksum, and validates the data.
Routing Data
- After checking its routing table, Router A forwards the data to Router B using the quickest path to reach Network C.
- Updates the TTL, recalculates the checksum, and creates a new IP datagram.
- An Ethernet frame is again constructed and sent to Router B.
Router B Processing
- Router B receives the frame and processes it much like Router A.
- It identifies that the destination is locally connected to Network C (Computer 2).
- Updates TTL, creates a new IP datagram, and sends it to Computer 2.
Final Delivery to Computer 2
- Computer 2 receives the frame, verifies data integrity (checksum), and extracts the IP datagram.
- It identifies the TCP segment and checks the destination port (80) which is open due to the Apache web server.
- The SYN flag from Computer 1 is noted.
Response to Computer 1
- Computer 2 needs to send a SYN-ACK back to Computer 1.
- It goes through similar steps: constructing packets, setting flags, and ensuring checksums match.
Conclusion
- The process highlighted illustrates the layer-wise workings of computer networking.
- Emphasizes how each component must work collaboratively to ensure data reaches its destination successfully, showcasing the complexity and efficiency of modern networks.