Learning Objectives
By the end of this topic you will be able to:
Explain what packet switching is and how data is broken into packets
Describe the structure of a packet (header, payload, trailer)
Explain how routers use routing tables to forward packets
Describe routing algorithms and compare static vs dynamic routing
Routing
Routing Tables and Algorithms
Routing table: a table held by each router listing known networks and the best next-hop to reach them. When a packet arrives, the router looks up the destination IP, finds the best match in the table, and forwards accordingly.
Static routing: routes are manually configured by a network administrator. Simple and predictable, but does not adapt to network changes or failures. Suitable for small, stable networks.
Dynamic routing: routers exchange routing information automatically using protocols (RIP, OSPF, BGP). Routes adapt to topology changes. More complex but resilient and scalable for large networks like the internet.
TTL (Time To Live): a counter decremented by each router. When TTL reaches 0, the packet is discarded. Prevents packets from circulating indefinitely in routing loops.
Common Mistakes
Don't Lose Marks
!
Saying packets always arrive in order — packets are routed independently and may arrive out of order. The receiving end reassembles them in the correct sequence using the sequence numbers in the packet header.
!
Confusing the checksum with the sequence number — the checksum detects transmission errors in a packet; the sequence number identifies the packet's position in the original data stream for reassembly. These are different fields serving different purposes.
!
Saying TTL is a time limit in seconds — TTL is a hop count, not a time value. It is decremented by 1 at each router hop. When it reaches 0 the packet is discarded to prevent infinite loops.