Chapter 5
Chapter 5
What is a Router?
A router is a computer, just like any other computer including a PC, that has many of the same
hardware and software components that are found in other computers including: CPU, RAM,
ROM and Operating System. The main purpose of a router is to connect multiple networks and
forward packets destined for its own networks or other networks. When a router receives a
packet, it examines the destination IP address. If the packet does not belongs to any of the
router’s directly connected networks or learned networks, the router must forward (broadcast)
this packet to another routers or drop the packet. Each network that a router connects to typically
requires a separate interface. These interfaces are used to connect a combination of both local-
area networks (LAN) and wide-area networks (WAN). LANs are commonly Ethernet networks
that contain devices such as PCs, printers and servers (end devices). WANs are used to connect
networks over a large geographical area and are commonly used to connect a LAN to the internet
service provider’s (ISP) network.
The CPU of a router executes operating system instructions, such as: system initialization,
routing functions and network interface configuration data. The router’s RAM stores the
instructions and data needed to be executed by the CPU. It is volatile memory that loses its
content when the router is powered down or restarted. For this reason, the router also contains
permanent storage areas such as ROM, Flash, and NVRAM.
ROM is a form of permanent storage to store bootstrap instructions. The IOS (internetwork
operating system) is permanently stored in flash memory and copied into RAM during the boot
up process. NVRAM is non-volatile random access memory that does not lose its information
when power is turned off. It stores the start up configuration file.
1
4. Locating and loading the start up configuration file (startup mode) from NVRAM
Router Ports and Interfaces
Management Ports: are physical connectors used by the administrator to configure the router and
are not used for packet forwarding. The most common of the management ports are:
Console port: it must be used during initial configuration of router and local access to the
devices using a console cable.
Auxiliary port: is used to manage remote devices through modem.
Interface: refers to a physical connector on the router whose main purpose is to receive and
forward packets.
A router’s Ethernet interface usually uses an RJ-45 jack that supports unshielded twisted pair
(UTP) cabling. When a router is connected to a switch, a straight-through cable is used. When a
PC’s network interface card (NIC) is connected directly to a router’s Ethernet interface, a
crossover cable is used.
The following labeled figure shows the basic external components of a router:
2
5.1.1. Route and Routing Table
Routing
Routing is the process of transmitting packets from a network to another network. A router can
only forward packets to routes or subnets in its routing table.
A route is the information a router keeping about such as a network number, outgoing interface,
and metric and hop count between itself and the next router towards the destination within
internetworking.
Hop count – is a simple metric or algorithm that counts the number of routers a packet must
traverse through.
Metric – is different cases or algorithms that the routers choose to select the best path.
A router always has the routes to directly connected networks. For non-directly connected
networks, the router must learn and know how to get to there. Once a router has learned a route,
it places it in a repository for future use. This repository is known as a routing table. The routing
table of each router includes the network number, outgoing interface, and metric (hop count) to
all networks in the system. The router also uses its routing table to determine the best path to
forward the packet. When a mach is found, the router encapsulates the IP packet into the data
link frame of the outgoing or exit interface, and the packet is forwarded towards its correct
destination.
Routing protocols are used by routers: to figure out the network topology, find paths to all
networks in an internetwork, determine the best path to a network, and fill the routing tables with
the routing information.
Distance vector routing is broken down into two parts: distance and vector.
Distance is the measure of how far it is to reach the destination, or the metric/hop count to reach
the destination.
Vector or direction is the direction or the outgoing interface the packet must travel to reach that
destination. Distance vector protocols are known by rumor; i.e. a router will learn routes
(internetwork information) from its neighbors.
With distance-vector routing protocols, every router in a network advertises all its known routes
(complete routing table) to its neighboring routers. Finally, each router would have a complete
3
routing table to all the subnets in the network by combining the received routing updates with its
own routing table entries.
Below describes the operation of distance vector algorithms:
1. R1 advertises all its directly connected networks to its directly connected routers or
neighbors-R2 through all its interfaces.
2. R2 which received R1 routing updates would advertise all its directly connected networks
and the routes learned from R1 through all its interfaces (R1 and R3 would receive it).
3. R3 which received R2’s routing updates would advertise all its directly connected
networks to all its neighbors through all its interfaces.
4. Like this, routers send and receive periodic routing updates to and from their neighboring
routers.
Below shows the operation of distance vector protocols and routing tables of each router which
includes the network number, outgoing interface, and metric (hop count) to all networks before
and after convergence.
Convergence: is the condition by which routers exchange their routes through all their interfaces
and have complete routing table about neighboring routers within the internetworks. It is also the
speed and ability of routers to agree on the topology of the network after a change in that
4
topology. It occurs, when all routers’ routing tables are at a state of consistency or uniformity.
The network has converged when all routers have complete and accurate information about the
network topology.
Today almost all current routers and switches run IOS, the routing and switching software in the
devices.
5
5.3. Command Line Interface (CLI)
It is the text based user interface to a device for configuring, administering, and managing the
devices.
Below describes some basic IOS commands:
i. Enter user EXEC mode and move to privileged mode:
Router> enable
Router#
ii. Move into global configuration mode:
Router# config terminal
Router (config)#
iii. Name the router with the name you want-in our case say RT1:
Router (config)# hostname RT1
RT1 (config) #
iv. Enter interface configuration mode for fast Ethernet 0/0
RT1 (config) # interface fa0/0
RT1 (config-if)#
v. Set an interface address as 192.168.1.1/24
RT1 (config-if)# ip address 192.168.1.1 255.255.255.0
RT1 (config-if)#
vi. Activate an interface-up link using No shutdown command
RT1 (config-if)# no shutdown
vii. Save any configuration using do write command
RT1 (config-if)# do write
viii. Configure the DCE side of the link to clock bit at 64000bps:
RT1 (config-if)# clock rate 64000
ix. Exit from global configuration mode to privileged mode using end or exit command
RT1 (config-if)# exit
RT1 (config)# exit
RT1#
x. Display detailed information and statistics about all interfaces:
RT1# show interfaces
RT1#
xi. Display summary of all interfaces, including status of IP address assigned
6
RT1# show ip interface brief
RT1#
xii. Display the routing table-detail information (routes)
RT1# show ip route
RT1#
xiii. Display the current configuration in RAM:
RT1# show running-config
RT1#p-config
xiv. Display the configuration saved in NVRAM:
RT1# show startup-config
RT1#
xv. We can test the reconfiguration using the ping command to verify that we still have
proper connectivity throughout the network.
Note: Both RT2 serial interfaces are DCEs and need clock rate configuration.
7
8
5.4. Routing Configurations and Verifications
5.4.1. Static Routing Configuration
With this configuration option, we have to configure the router with networks not directly
connected (remote networks) to currently configured router using their last outgoing or exit
interface to reach currently configured router. Static route supports route summarization.
To configure static route with an exit interface specified, use the following syntax:
Exit-interface is the last outgoing interface for remote networks to reach currently configured
router
9
192.168.3.0
192.168.4.0
192.168.5.0
The last outgoing/exit interface for these networks to reach RT1 is the se0/0 (192.168.2.2) on
the RT2.
Below are the static routing configurations on RT1, RT2, and RT3
5.4.2.RIP Configuration
The main command when configuring RIP is the router rip at global configuration mode and
presses enter to type the command network then IP address
10
During RIP configuration, we have to configure each router with directly connected network
addresses (not a remote network addresses like static route configuration)
Example: To configure RIP on RT1
RT1 (config)# router rip
RT1 (config-router)# network 192.168.1.0
RT1 (config-router)# network 192.168.2.0
RT1 (config-router)# network 192.168.3.0
RT1 (config-router)# end
RT1#
Before configuring RIP, remove any pre configured static routes from the router.
Below are the RIP configurations on RT1, RT2, and RT3:
Multiple static routes can be summarized into a single static route if:
11
The following routers are configured using static routes.
In the above example RT3 has three static routes. All three routes are configured using the same
exit interface on RT2 (se0/1 or 192.168.4.1).
12
All the three routes can be summarized into a single route 192.168.0.0/22 or 192.168.0.0
255.255.252.0 But, how this /22 provides this subnet mask? 255.255.255.0 =
11111111.11111111.11111111.00000000. Then, when 2 digits are included in the unmatched
bits, 11111111.11111111.11111100.00000000 = 255.255.252.0
13