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:
Because routers make decisions based on the Internet Protocol we can say that they are layer 3 devices.Routing tables are used to store information about the available network paths. You can see the routing information by typing show ip route:
As we can see in these iamge, there is only one directly connected network detected (check the above Codes). We can also have static or dynamic entries. Static (S) entries are configured by administrators and dynamic ones are added by dynamic routing protocols like RIP (R), EIGRP (D), OSPF (O) etc. We will talk later about dynamic routing protocols and static routes.
Based on what type of routing protocol you are using, routers make decisions on how to forward packets, by using different elements. A router can make decisions by comparing path costs, bandwidth, hop count etc. We will talk about how this information is interpreted when we will talk about routing protocols. Routers can provide load balancing when multiple equal routes exist from one point to another . Load balancing is a computer networking method to distribute workload across multiple computers or a computer cluster, network links, central processing units, disk drives, or other resources, to achieve optimal resource utilization, maximize throughput, minimize response time, and avoid overload from Wikipedia http://en.wikipedia.org/wiki/Load_balancing_(computing) . Routers also determine best path for packets to travel from source to destination and switching function. I've found this short article on http://ciscoeducation.blogspot.ro/2009/05/switching-function-after-router-has.html in which router switching function is described:Switching Function
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.
Have a nice day.