Objective: Describe the role and function of a router in a network
A router is a networking device that connects two or more separate networks and forwards data packets between them. It operates at the Network layer (Layer 3) of the OSI model, using logical addressing (IP addresses) to determine the best path for each packet.
Key Functions of a Router
Packet Forwarding – Receives packets on one interface, examines the destination IP address, and sends the packet out through the appropriate outgoing interface.
Routing Decision – Uses a routing table and routing algorithms (e.g., distance‑vector, link‑state) to select the optimal route.
Address Translation – Performs Network Address Translation (NAT) to map private IP addresses to a public address, enabling multiple devices to share a single Internet connection.
DHCP Relay – Forwards DHCP requests from clients on one network to a DHCP server on another network.
Security – Implements Access Control Lists (ACLs) and firewall rules to filter traffic based on source/destination IP, ports, or protocols.
Quality of Service (QoS) – Prioritises time‑sensitive traffic such as \cdot oIP or video streaming.
How a Router Works – Step by Step
Incoming packet arrives on an interface.
The router reads the packet’s destination IP address.
It looks up the destination in its routing table.
If a matching entry is found, the router determines the next‑hop address and the outgoing interface.
The packet’s header is updated (e.g., decrementing TTL, recalculating checksum).
The packet is transmitted out the selected interface.
Routing Table Example
Destination Network
Subnet Mask
Next Hop
Interface
Metric
192.168.1.0
255.255.255.0
Direct
eth0
0
10.0.0.0
255.0.0.0
192.168.1.254
eth0
10
0.0.0.0
0.0.0.0
203.0.113.1
eth1
20
Mathematical \cdot iew of Routing
The shortest‑path problem can be expressed as:
\$\min{p \in P{s,d}} \sum_{(u,v) \in p} w(u,v)\$
where \$P_{s,d}\$ is the set of all possible paths from source \$s\$ to destination \$d\$, and \$w(u,v)\$ is the cost (metric) associated with traversing link \$(u,v)\$. Routing algorithms such as Dijkstra’s algorithm compute this minimum efficiently.
Suggested diagram: A simple network showing two LANs connected by a router, with arrows indicating packet flow and the routing table entries.
Why Routers Are Essential for the Internet
They interconnect millions of autonomous systems, forming the global Internet backbone.
Through routing protocols (e.g., BGP), routers exchange reachability information, allowing data to travel across diverse networks.
They enable scalability by abstracting complex internal topologies behind a single IP prefix.
Summary
A router’s primary role is to direct traffic between distinct networks using logical IP addresses. By maintaining routing tables, performing address translation, enforcing security policies, and supporting advanced features such as QoS, routers ensure efficient, reliable, and secure communication across both local and global networks.