LOGBOOK

HELP

Quiz Entry - updated: 2026.07.05

What are the two primary functions of a router?

A router's two functions are: (1) determine the best path to the destination using its routing table, and (2) forward the packet toward that destination by encapsulating it in the appropriate Layer 2 frame.

Path determination (longest-prefix lookup) then forwarding (rebuild L2 frame, send).

* A router's two jobs: path determination and forwarding. *

Function 1 — Path Determination:

  • Router receives a packet on an interface
  • Examines the destination IP (Internet Protocol) address
  • Searches its routing table for the best matching route
  • The best match is determined by the longest prefix match — the route with the most specific (longest) subnet mask wins

Function 2 — Packet Forwarding:

  • After determining the best path, the router identifies the exit interface and next-hop IP
  • De-encapsulates the received Layer 2 frame
  • Re-encapsulates the packet in a new Layer 2 frame for the exit interface
  • Forwards the new frame out the exit interface

Key insight: The IP (Internet Protocol) packet (Layer 3) stays essentially unchanged hop-by-hop — only the TTL (Time to Live) decrements. But the Layer 2 frame (Ethernet header) is rebuilt at every router hop with new source and destination MACs (Media Access Control addresses).

Tip: Think of the router as a mail sorting facility: it reads the destination address (IP), determines which truck goes to that zip code (routing table), and puts the letter in a new envelope for the next leg of the journey (new L2 frame).

Go deeper:

From Quiz: NETW2 / Routing Concepts | Updated: Jul 05, 2026