📡

Understanding Packet Movement in Networks

May 22, 2025

Packet Movement Through a Network: Lecture Notes

Introduction

  • Video series finale by Ed from practicalnetworking.net
  • Focus on how packets move through a network
  • Recommended to read the previous article series for better understanding

Sample Topology

  • Contains 4 hosts, 2 switches, and 1 router
  • Routers facilitate communication between networks
  • Each host has an IP address and a MAC address
  • Example IP address for Host A: 11.11.11.10
  • Router interfaces:
    • ETH1: 11.11.11.1 (connected to 11.11.11.0/24 network)
    • ETH2: 22.22.22.1 (connected to 22.22.22.0/24 network)
  • Switches:
    • Switch X: Ports 1, 2, 3
    • Switch Y: Ports 4, 5, 6

Key Tables in Network Devices

  1. ARP Table
    • Maps IP addresses to MAC addresses
    • Used by all Layer 3 devices
  2. MAC Address Table
    • Maps switch ports to MAC addresses
    • Helps switches know which devices are connected to which ports
  3. Routing Table
    • Maps IP networks to egress interfaces
    • Pre-populated before traffic arrives

Data Flow from Host A to Host D

  1. Initial Set-Up

    • Host A knows Host D's IP address (22.22.22.40)
    • Creates a Layer 3 header with source IP (11.11.11.10) and destination IP (22.22.22.40)
    • Determines that Host D is on a foreign network, needs to send data to the router (default gateway)
  2. ARP Request

    • Host A does not know router's MAC address, sends ARP request to discover it
    • ARP request reaches Switch X, which learns Host A's MAC address
    • Switch floods the ARP request to all ports except port 2
    • Router receives ARP request, learns Host A's MAC mapping
    • Router sends ARP response back to Host A
  3. Forwarding Data

    • Host A receives ARP response, now knows router's MAC address
    • Host A creates Layer 2 header and sends data to the router
    • Switch X forwards the frame to the router based on MAC address table
    • Router receives the packet, strips Layer 2 header, consults routing table for destination
    • Router determines it needs to send the packet to Host D, requires Host D's MAC address
  4. Second ARP Request

    • Router sends ARP request to discover Host D's MAC address
    • Switch Y receives the ARP request, floods it out to all ports
    • Host D receives the request, generates ARP response back to the router
    • Router receives the response, updates ARP table for Host D's MAC
  5. Final Delivery

    • Router creates Layer 2 header for final delivery to Host D
    • Switch Y forwards the frame to Host D
    • Host D strips Layer 2 and Layer 3 headers, processes data

Response from Host D to Host A

  • Much quicker due to populated tables
  • Host D creates response data with destination IP of Host A
  • Sends the packet back through the same process with existing ARP entries
  • Final delivery back to Host A

Conclusion

  • 30 steps needed to successfully transfer data from Host A to Host D and back
  • For more details, refer to the packet traveling series at practicalnetworking.net.
  • Suggestions for sharing the video if found useful.