Network Router Overview
Routers are physical devices that join multiple wired or wireless networks together. Technically, a wired or wireless router is a Layer 3 gateway, meaning that the wired/wireless router connects networks (as gateways do), and that the router operates at the network layer of the OSI model.
By maintaining configuration information in a piece of storage called the routing table, wired or wireless routers also have the ability to filter traffic, either incoming or outgoing, based on the IP addresses of senders and receivers.
Knowing why routers are useful
Although with a small network, you actually do not need routers, if your network is connected to the Internet, you will have at least one router. In addition to a router connecting you to the Internet, you may choose to have internal routers on a network for many reasons, such as the following:
To accommodate a second office that is connected to your network via a telephone company using either a private line or leased lines or over the Internet.
To increase security for systems on your network, which would include any systems where you want to restrict access such as your servers. These segments can have rules on their routers allowing only a certain range of IP addresses to connect to the segments.
To reduce the size of the broadcast domains on your network. If broadcast domains are too large, they can create problems with network performance because of excessive background traffic. Adding routers splits the broadcast into smaller segments. Broadcast domains are covered later in this chapter.
Knowing what routers do
The main purpose of a router is to pass data from one interface on the router to another interface. For many routers, their only job is to pass traffic, and over the years Cisco has perfected the process of moving this data as fast as possible over the router.
The router makes decisions about where that data needs to be based on a routing table, which you can think of as an address book.
You can use routers to divide a network into several different broadcast domains. For example, you can break a 1,000-device network into ten 100-device networks that pass data back and forth through one or more routers.
Although doing so increases network complexity, because each segment needs its own IP address subnet and default gateway (which is the router), this process reduces the effect of the broadcast traffic from 1,000 devices to 100 devices, which can increase overall throughput.
Switches operate at Layer 2 — the data link layer — in the OSI network model, filtering and passing data based on MAC addresses of the devices. Routers, on the other hand, operate at Layer 3 — the network layer — filtering and passing data based on the network protocol addresses, which these days typically means IP addresses.
Unlike switches, which automatically build address tables, routers rely on a routing table, which is a distinct part of the router’s firmware that records routing information such as network IDs and the next router or process in the packet.
Routing tables must be manually configured or dynamically configured using a routing protocol such as Routing Information Protocol (RIP), or Open Shortest Path First (OSPF). The routing table contains a list of network IDs that look like IP addresses, and for each destination address to which the router needs to send data, the router uses a logical AND operation.
This AND operation is performed against every entry in the routing table until it finds the entry that most closely represents the destination address. The closest routing entry to the destination IP address is the routing entry that is used.