Lesson

Routers

Learning objective

Explain how routers connect different IP networks and act as default gateways.

What is a router?

A router is a network device that connects different IP networks. It gives devices on one network a doorway to another network. A home router, for example, connects a home network to an internet provider's network.

A switch mainly connects devices inside one local network. A router connects that network to other networks. Later modules will explain how a router chooses paths; for now, focus on its place between networks.

Does this message need to leave the Office LAN?
Office LANAnother IP networkLaptopPrinterSwitchRouterServerSenderLocal destinationNo copyLAN interfaceDefault gatewayOther interfaceFaces the other network

The laptop sends to the printer through the switch. This delivery stays inside the Office LAN; it does not pass through the router.

Highlighted cables show this message's path; grey cables remain connected. The gateway is the router's local interface, not the final destination. This simplified example joins two IP networks directly; reaching the Internet can involve more routers. Detailed addressing and path decisions come later. On small screens, swipe across the diagram.

Router interfaces

A router has two or more network interfaces. Each interface connects to a different network and normally has an IP address that belongs to that network.

Think of each interface as one side of a doorway. One interface may face the office network while another faces the internet provider.

In the diagram, the two dots on the router mark its interfaces. The office-facing interface belongs to the Office LAN; the other interface faces the second network. The switch's ports connect local cables, while the router's interfaces connect it to different IP networks.

Routers connect networks

A network boundary is where one IP network ends and another begins. A router belongs at this boundary because it has an interface connected to each side.

For example, an office switch connects laptops and printers inside the Office LAN. A router then connects the Office LAN to the internet. Detailed forwarding decisions belong in the later Network Layer module.

Routers as default gateways

A host's default gateway is normally the router interface on its own network. When a destination is outside the local network, the host sends the traffic to this gateway for help reaching the other network.

The default gateway is the first router on the journey. It is not the remote website or the final destination.

Compare the two choices above: a print job to the office printer stays local, but a message to the server on the other network uses the gateway. A router is not a compulsory stop for every message inside the LAN.

Place the router

Use the device icons to choose where the router belongs in a simple office example.

Place the router

Routers connect different IP networks. Select the position that joins the Office LAN to the Internet.

Office LANInternet
Laptophost

Knowledge check

Knowledge check: What is a host's default gateway normally?