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
  • 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

Client and Server Configuration

  • Computer 1: Client (desktop) on Network A
    • Assigned IP: 10.1.1.100
  • Computer 2: Server (data center) on Network C
    • Assigned IP: 172.16.1.100
    • Running web server on port 80

Steps in Data Transmission

  1. 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.
  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.
  3. ARP Process

    • Computer 1 sends an ARP request for 10.1.1.1 to the broadcast address.
    • Router A receives the request and responds with its MAC address (00:11:22:33:44:55).
  4. 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.
    • The IP header includes the source and destination IPs and a TTL of 64.
    • An Ethernet frame is constructed with MAC addresses.
  5. 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.
  6. 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.
  7. 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.
  8. 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.
  9. 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.