Skip to main content
KBY Technologies Logo
Lexicon
Lexicon
TCP/IP

Router

Difficulty: Introductory
4 min read
Updated 2026-12-05

In plain English

Plain definition

Think of the sorting office at the edge of a town. Letters arrive from many streets, and the staff look only at the town and postcode, then put each one in the right outgoing bag. They never open the envelope, and they do not need to know the whole country, only which bag leads closer. At home, the box your broadband plugs into is a router. At work you will meet one wherever two networks touch: an office and the internet, two VLANs, or a cloud network and a data centre.

A router is a device that forwards IP packets between networks, choosing each packet’s next hop from its destination address and a routing table. RFC 1812 calls the forwarders that join constituent networks “routers” or “IP routers”, and notes that older documents call them gateways. It works at the internet layer, not the link layer, so it connects different networks rather than devices on one.

How a router works, technically

When a packet arrives, the router first decides whether it is addressed to the router itself, to be forwarded, or both. For a packet to forward, it looks the destination up in its routing table to find the next hop and the outgoing interface. RFC 1812 requires routers to use the most specific matching route, meaning the longest matching network prefix.

The router then checks that forwarding is permitted, reduces the packet’s TTL by at least one, fragments the packet if the outgoing link needs it, finds the link-layer address of the next hop and sends the packet on. Each router does this independently, so a journey is a chain of separate local decisions.

The TTL stops packets circling for ever. RFC 1812 requires a router to discard a packet whose TTL reaches zero and, for non-multicast destinations, to send an ICMP Time Exceeded message, Code 0, to the source. In IPv6 the same job is done by the Hop Limit field, which RFC 8200 says each forwarding node decrements by 1.

Where you meet routers day to day

Routers show up in nearly every connectivity fault. A host can reach its own subnet but nothing beyond it, a branch office loses a route after a change, or traffic takes a longer path than expected. In each case the question is the same: what does the router on the path know about this destination?

The ICMP Time Exceeded behaviour is also why trace tools work. They send packets with small TTL values and read the replies, so each router on the path reveals itself. A silent hop in the output does not prove a fault, since RFC 1812 lets a router disable these messages per interface.

Where it fits between two networks

A router sits between layer 2 and the transport layer. Switches move frames inside one network using link-layer addresses, while a router moves packets between networks using IP addresses, and it rewrites the link-layer header at every hop. Hosts hand off-network traffic to their default gateway, which is a router.

A router also has at least one IP address, and usually one per connected network. For the wider stack, see the TCP/IP technology page on KBY Technologies. For a TCP fault that looks like a routing problem but concerns reachability of one service, see the runbook for a YubiHSM 2 connector unreachable on TCP port 12345.

Example: a packet crossing two routers

A laptop at 192.0.2.10 sends a packet to a server at 198.51.100.20 on another network. The laptop sees the server is off its subnet and sends the packet, in a frame addressed to its default gateway, router A.

  1. Router A finds the most specific route for 198.51.100.20, lowers the TTL by one and forwards to router B.
  2. Router B has the server’s network directly connected, lowers the TTL again and delivers the packet to the server.

Following along? Tap a step’s number to tick it off.

The source and destination IP addresses stay the same throughout, while the link-layer addresses change at each hop. To check a router is behaving, run a trace from a test host and confirm each hop appears in the expected order. This is read-only, changes nothing and needs no rollback.

Often confused with a switch

The first mistake is calling any box with ports a router. A switch forwards frames within a network and does not route between them, although some switches also have routing features. The second is assuming a router inspects or rewrites the payload: forwarding looks at the IP header, not the content.

The third is expecting one packet’s route to match the next. Each router decides on its own table, and tables change, so two packets in one connection can take different paths. A route that exists in one direction does not guarantee a return route.

  • Default gateway: the router a host uses for any destination outside its own subnet.
  • Routing table: the router’s list of destination prefixes, next hops and outgoing interfaces.
  • Next hop: the next router, or the destination, to which a packet is handed.
  • TTL and Hop Limit: the counters that limit how many routers a packet may cross.
  • ICMP: the protocol carrying Time Exceeded and other error messages.

Further reading on routers

  • IETF: RFC 1812, “Requirements for IP Version 4 Routers”.
  • IETF: RFC 8200, “Internet Protocol, Version 6 (IPv6) Specification”.

Checks before you rely on a router’s path

Confirm the path with a read-only trace from a test host, and compare each hop with the route you expect. The next safe decision is to find which router lacks the route before changing any configuration.

About this page

Credited to

Dates

Published

Corrections

No corrections are listed for this page. Some review sweeps corrected pages without naming each one; those are in the corrections log.

Was this useful?

Reports go to the site owner and are used to correct pages. Corrections are listed at /corrections.

Found this useful? Follow KBY for more like it.

More from KBY that goes with this term.