Skip to main content

Router

In Turkish
Yönlendirici
Pronunciation
ROO-ter or ROUT-er
Updated 3 min read

Share this page

Send the link, quote the definition with a link back, or show it as a card on your own site.

https://softwaredictionary.org/terms/router

In short

A router is a networking device that forwards packets between different networks, choosing the next hop for each one based on its destination IP address.

What is a router?

A router is a device that connects two or more networks and moves packets between them. When a packet arrives, the router reads its destination IP address, decides where to send it next, and forwards it out of the right interface. Routers work at the network layer, layer 3 of the OSI model, which is what lets traffic travel from your home network across many other networks to a server on the other side of the world.

Each router keeps a routing table: a list of network prefixes, such as 10.0.2.0/24, together with the next router, or hop, that matching packets should go to. For each packet it picks the most specific matching entry, called the longest prefix match, and falls back to a default route when nothing else fits. Small networks use static routes configured by hand, while larger ones run routing protocols such as OSPF inside an organization and BGP between the networks that make up the internet, so routers learn routes from each other and can route around failures. Each time a router forwards a packet, it also lowers the packet's time-to-live (TTL) counter and drops the packet when it reaches zero, which stops packets from looping forever.

Routers work like the sorting centers of a postal system: no single center knows the full route to every address, but each one knows which center to pass a letter to next. The box usually called a home router actually combines several devices: a router, a small network switch, a Wi-Fi access point, a DHCP server, a firewall, and NAT so the whole household can share one public IP address. In data centers and the cloud, routers, often virtual ones, connect subnets and link private networks to the internet.

A router is often confused with a network switch. A switch connects devices within the same local network and forwards frames by MAC address, while a router connects different networks and forwards packets by IP address. A router is also not the same as a modem, which only converts signals between your network and your internet provider's line, although many providers ship a single box that does both jobs.

Key takeaways

  • A router forwards packets between different networks based on their destination IP address.
  • It works at the network layer, layer 3 of the OSI model.
  • A routing table maps network prefixes to next hops, and the most specific match wins.
  • Routing protocols such as OSPF and BGP let routers learn routes from each other automatically.
  • A home router usually bundles a router, a switch, a Wi-Fi access point, a DHCP server, a firewall, and NAT.

Example

Inspecting the routing table on Linuxbash
# Show the routing table: where each network's traffic is sent
ip route show
# default via 192.168.1.1 dev wlan0          <- the default route
# 192.168.1.0/24 dev wlan0 scope link        <- the local subnet

# Ask which route a specific destination would use
ip route get 203.0.113.10

# Add a static route: reach 10.20.0.0/16 through the router at 192.168.1.254
sudo ip route add 10.20.0.0/16 via 192.168.1.254

Readers ask

What is the difference between a router and a switch?

A switch connects devices inside one local network and forwards frames using MAC addresses. A router connects separate networks, such as your home network and the internet, and forwards packets using IP addresses.

What is the difference between a router and a modem?

A modem converts the signal on your provider's line, such as cable, DSL, or fiber, into a network connection. A router shares that connection among your devices and forwards traffic between your local network and the internet; many providers combine both in one box.

What is a routing table?

A routing table is the list a router, or any computer, uses to decide where to send each packet. Each entry maps a range of destination addresses to a next hop or an interface, and a default route handles every destination that isn't listed.

See also

Spotted a mistake or something missing on this page?Suggest an edit

Read a random page
Open today's review
Switch to the dark theme
Read this page in Türkçe

More

Settings