What Happens Inside a Router? – Ciscco Certifed Support Technici
Routers and switches are opaque boxes to most network operators and engineers. To better understand how these devices forward packets, and the relationship between the
physical interfaces, the routing table, and the applications (like routing protocols), it is useful to peek inside. Figure 3-12 illustrates.
Figure 3-12 Router Components
Figure 3-12 is a simplified version of the internal components of a router; as you gain experience in computer networking, you will probably want to do a deeper study on the components and operation of routers and switches.
The path of a packet through a router is simple:
1 The packet is received as a set of electrical or optical signals on the physical interface. These signals are decoded and copied into the router’s memory by the serial/deserializer (SerDes) and Phy chipset.
2. The packet is (sometimes) copied into an input queue. Some routers and switches do not have an input queue; they process packets directly as the physical interface is copying them into memory.
3. The forwarding engine (FE) processes the packet. FEs are also called switching engines, switching chipsets, and Ethernet chips.
A common name used for these processors is the application-specific integrated circuit (ASIC), because most FEs are also ASICs. There are many other kinds of ASICs than FEs, however.
4. The FE strips off the outer (physical header), finds the correct entry in the forwarding table (also called the forwarding information base, or FIB), builds a new physical layer header, and places the packet on the output queue.
5. The physical interface converts the packet from internal memory locations to electrical or optical signals for its journey to the next hop.
The forwarding table supplies the FE with the three pieces of information it needs to forward a packet:
• A destination interface (IP) address
• The interface this packet should be transmitted on
• The correct physical interface address to use when forwarding the packet
The forwarding table, in turn, is built by combining the various translation tables available in the router—tables relating the IP address of each next hop device (whether a host or another router) to a physical address. There normally is not a separate table, as shown here (for clarity), but rather the ARP and ND tables are consulted directly.
The routing table is built from information provided by routing protocols, static (manually configured) routes, and information about connected interfaces.
Routers versus Switches
While this chapter describes the function of routers and switches separately, the words router and switch are often used interchangeably in computer networking. To use the words absolutely properly:
• Routers should refer to devices that switch (or route) each packet based on the interface or IP destination address.
• Routers break up broadcast domains; two hosts connected to two different ports on a router are not on the same segment or broadcast domain.
• Switches should refer to devices that switch each packet based on the physical address.
• Switches do not break up broadcast domains; two hosts connected to two different ports on a switch are still on the same segment or broadcast domain.
A further major difference between routing and switching is IP packets have a time-to-live (TTL), while physical frames normally do not. Each time an IP packet is processed by a router, the TTL is reduced by 1; when the TTL reaches 0, the packet is discarded.
The confusion in naming these two devices stems from the early days of networks, when
• Routers processed or switched all packets in software. Because routers processed packets in software, their switching speed was limited by the general-purpose processor, which means routers could not switch packets very quickly.
• Switches processed or switched all packets in hardware.
Because switches processed packets in hardware, they could switch packets nearly as fast as their interface speeds.
When the first routers were designed with hardware-based switching router were designed and deployed, no one really wanted to call it a router because routers were slow. No one really wanted to call it a switch either because it routed packets based on the destination IP address rather than switching them.
A compromise developed: they were called Layer 3 switches.
Over time, however, the Layer 3 part of the Layer 3 switch was dropped, and now routers are called switches.
Calling both of these kinds of network devices a switch can cause confusion. Make certain that when you hear someone say the word switch, you understand which of the two kinds of devices they are discussing.
Note
One of the first routers, if not the first, with hardware-based forwarding was the Cisco 7000
with a Silicon Switching Engine (SSE).