A router separates the private network from the Internet. From it's routing table, a router can make decisions based on the destination IP address. Routing information can be stored either by using static entries or dynamic protocols. Imagine you want to send a message to a remote device. Packets arrive at the router, they are decapsulated, the destination IP address is checked with the routing table, the exit interface is chosen, the packet is encapsulated into the appropriate data link frame and forwarded through the exit interface. Multiple routers can exist from one end to another and each device have to process packets independently.
Routers have some main hardware components that we need to point out:
CPU - the main processing unit used to execute instructions
ROM - read only memory, used to store permanently the bootstrap and other read only information.
RAM - random access memory, used to store information needed by the CPU.
Flash - the location of Cisco IOS.
Interfaces - can be either Ethernet or Serial, these ports are used to interconnect networks.
Console port - used to establish a physical connection with the router.
Aux port - used to connect an external modem.
Upon start-up, a router does the following:
- It performs the POST or power on self test - a mechanism in which router's components are checked for faults
- The bootstrap is copied from ROM to RAM. Bootstrap is used to identify the routers operating system.
- The IOS is loaded from the Flash memory or a TFTP server.
- The start-up configuration file is loaded and executed. The start-up config file is usually stored in the NVRAM or a TFTP server. When the start-up file is located, it is loaded into RAM as the running configuration file. If the start-up config is not located, the user is prompted to make the initial router configuration.
To see information about the hardware components and more, type in the show version command:
As you already know, routers can have both Serial and Ethernet interfaces. You can see the router interfaces by typing show ip interfaces brief in the cli:
After the router has determined the exit interface using the path determination function, the router needs to encapsulate the packet into the data link frame of the outgoing interface.
The switching function is the process used by a router to accept a packet on one interface and forward it out another interface. A key responsibility of the switching function is to encapsulate packets in the appropriate data link frame type for the outgoing data link.
What does a router do with a packet received from one network and destined for another network? The router performs the following three major steps:
1. Decapsulates the Layer 3 packet by removing the Layer 2 frame header and trailer.
2. Examines the destination IP address of the IP packet to find the best path in the routing table.
3. Encapsulates Layer 3 packet into a new Layer 2 frame and forwards the frame out the exit interface.