0% found this document useful (0 votes)
12 views29 pages

Routing Lecture

The document discusses routing in networking, explaining the role of routers in determining the best paths for data transfer and the principles of routing. It outlines three main types of routing: static, default, and dynamic, detailing their functions, advantages, and disadvantages. Additionally, it covers specific protocols such as OSPF and RIP, emphasizing their mechanisms and applications in internet routing.

Uploaded by

lglegrand11
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views29 pages

Routing Lecture

The document discusses routing in networking, explaining the role of routers in determining the best paths for data transfer and the principles of routing. It outlines three main types of routing: static, default, and dynamic, detailing their functions, advantages, and disadvantages. Additionally, it covers specific protocols such as OSPF and RIP, emphasizing their mechanisms and applications in internet routing.

Uploaded by

lglegrand11
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

SSS 1

INSTRUCTOR: NGAKO

Chapter 2: ROUTING

Networking devices share data among themselves with the help of


a router. A router is a device that learns which paths are available
and which path is best to forward data . The mechanism through
which the router makes such a decision is known as routing in
other words, Routing is the process of moving a packet of data
from source to destination by selecting the best path.
PRINCIPLES OF ROUTING
-Every router makes its decision alone based on its own routing
table.
-One router having certain information on its routing table does
not mean that other routers have the same information.
-Routing information about a part from one network to another
does not provide routing information about the reverse or return
path.
A router uses information contained in the internet protocol
header to make various decisions; these decisions include:
➢ Path determination,
➢ Routing decisions and
➢ Load balancing.
PATH DETERMINATION: When a router receives an IP packet
through one of its interfaces, the router examines the packet
and its destination is added into the routing table. Metrics are
used to determine the optimal path to reach a destination IP
address through static and dynamic routing protocols. These
metrics are standard measurements that give a quantitative
value measured for the distance to a given network.
ROUTING DECISION:
The primary function of a router is to forward a packet to its
destination. The router achieves this by encapsulating the IP
packet with the appropriate data link frame type of the egress
port. This encapsulation happens after determined the exit
interface associated with the best path to forward the packet.
The path could either be; a direct path, a remote network
(when the destination IP address of the packet belongs to
another network) or a no route (when the destination address
is not in the network).
LOAD BALANCING:
A router can have two or more paths with equal metrics to a
destination. When this happens, the router will forward the
packet using both paths.
NB: A routing table is a set of rules, often viewed in a table
format that is used to determine where data packets traveling
over an internet protocol network will be directed.

TYPES OF ROUTING
Routing is of three main types:

1)Static routing:
Here, routes are manually added into the routing table . With
this type of routing, a cheaper router can be used. Static
routing adds security and does not require bandwidth usage
between routers. This is a method for small networks.
Examples of static routes we have; standard, default,
summary and floating static routes.
2)Default routing:
Here, the router is configured to send all packets toward a single
router. This type is typically used with a stub router i.e a router that
has only a single route to reach the other network. The only time a
router will use a default route is when a specific route does not exist.
3)Dynamic Routing:
This is the type of routing in which adjustment of the routes are
automatically made according to the current state of the route in the
routing table. Here, protocols are been used to discover network
destination and the route to reach it. It is also easy to configure and
more effective in selecting the best path. This is the most common
method and most complex method of routing.
IMPORTANCE OF ROUTING:
• Routing creates efficiency in network communication. Network
communication failures result in the long await times for website
pages to load for users.
• Routing helps to minimize network failure by managing data
traffic so that a network can use as much of its capacity as
possible without creating congestion.
Hence to conclude, the various types of routing have their
advantages and disadvantages it is up to the network administrator
to study the network in other to know which protocol they need to
apply.

Dynamic routing
Routing is a procedure of selecting the best path to make data transfer from source to destination. A
router exists in the network layer in the OSI as well as TCP/IP model. Some functions of a router are:

➢ Building an optimal path on a network to reach its destination.


➢ Taking routing decisions.
➢ Balancing load.

Types of Routing
There exist 3 main types of routing namely:

➢ Static routing
➢ Default routing
➢ Dynamic routing

Dynamic Routing
Dynamic routing is a technique of finding the best path for the data to travel over a network. In this
process a router can transmit data through various different routes and reach its destination on the basis
of conditions at that time of communication circuits.
Dynamic routers are smart enough to take the best path for data based on the condition of the present
scenario at that time of the network. In case one section fails in the network to transfer data forward
dynamic router will use its algorithm or protocols and it will re-route the previous network over another
network in real-time. And this amazing capability and functionality to change paths in real-time over the
network by sharing status among them is the key functionality of Dynamic Routing. OSPF (open shortest
path first) and RIP are some protocols used for dynamic routing.

Working of Dynamic Routing


First, A routing protocol (a protocol that states how the information is going to share between routers
and how are they going to communicate with each other to share/distribute information between nodes
on a network) must be installed in each router in the network to share information among each other.

Second, it is started manually to go to the first routing table of the router with router information, and
then after that it goes on automatically with the help of a dynamic routing algorithm and dynamically
forms the routing table for the rest of the routers in the network.

Third, then the routing information is exchanged among the routers so in case if the network goes down
or the router fails to work and share information with its connected routers then the routing table of
each router is modified correctly to that present condition so that it never fails to deliver information to
the destination.
Fourth, hosts are present to check or match the default gateway address to the IP addresses of the local
router.

PURPOSE

Dynamic protocols were introduced to:

➢ Explore every single path and choose the best path.


➢ Sharing of information about the network with each other router present in the network.
➢ Updating the path on its own and rerouting the best possible path.

Components

There are three main components that were used in dynamic routing:

➢ Data structure (to structure information)


➢ Algorithm (to construct or re-update path)
➢ The routing protocol (to share information about the network)

Advantages

➢ Beneficial in Performance as well as scalable networking with a high frequency of data on nodes.
➢ Makes fewer mistakes as it reroutes itself compared to other routing protocols.
➢ No need to be manually configured by the admin.
➢ Shares information about the network with each other makes them more reliable to work
efficiently.

Disadvantages

➢ Requires more heavy and reliable powerful hardware.


➢ Higher maintenance compared to static protocol

Open Shortest Path First (OSPF)

Open Shortest Path First (OSPF) is a link-state routing protocol that is used to find the best path between
the source and the destination router using its own Shortest Path First. OSPF is developed by Internet
Engineering Task Force (IETF) as one of the Interior Gateway Protocol (IGP), i.e. the protocol which aims
at moving the packet within a large autonomous system or routing domain. It is a network layer protocol
which works on protocol number 89 and uses AD value 110. OSPF uses multicast address [Link] for
normal communication and [Link] for update to designated router (DR)/Backup Designated Router
(BDR).

OSPF terms

Router Id: It is the highest active IP address present on the router. First, the highest loopback address is
considered. If no loopback is configured then the highest active IP address on the interface of the router
is considered.

Router priority: It is an 8-bit value assigned to a router operating OSPF, used to elect DR and BDR in a
broadcast network.

Designated Router (DR): It is elected to minimize the number of adjacencies formed. DR distributes the
LSAs to all the other routers. DR is elected in a broadcast network to which all the other routers share
their DBD. In a broadcast network, the router requests for an update to DR, and DR will respond to that
request with an update.

Backup Designated Router (BDR): BDR is a backup to DR in a broadcast network. When DR goes down,
BDR becomes DR and performs its functions.

DR and BDR elections take place in the broadcast network or multi-access network. Here are the criteria
for the election:

➢ Router having the highest router priority will be declared as DR.


➢ If there is a tie in router priority then the highest router Id be considered. First, the highest
loopback address is considered. If no loopback is configured then the highest active IP address
on the interface of the router is considered.
OSPF states: The device operating OSPF goes through certain states. These states are:

➢ Down: In this state, no hello packets have been received on the interface.

Note: The Downstate doesn’t mean that the interface is physically down. Here, it means that the OSPF
adjacency process has not started yet.

INIT: In this state, the hello packets have been received from the other router.

2WAY: In the 2WAY state, both the routers have received the hello packets from other routers.
Bidirectional connectivity has been established.

Note In between the 2WAY state and Exstart state, the DR and BDR election takes place.
Exstart: In this state, NULL DBD is exchanged. In this state, the master and slave elections take place. The
router having the higher router Id becomes the master while the other becomes the slave. This election
decides which router will send its DBD first (routers who have formed neighbour ship will take part in
this election).

Exchange: In this state, the actual DBDs are exchanged.

Loading: In this state, LSR, LSU, and LSA (Link State Acknowledgement) are exchanged.

Note When a router receives DBD from other router, it compares its own DBD with the other router
DBD. If the received DBD is more updated than its own DBD then the router will send LSR to the other
router stating what links are needed. The other router replies with the LSU containing the updates that
are needed. In return to this, the router replies with the Link State Acknowledgement.

Full: In this state, synchronization of all the information takes place. OSPF routing can begin only after
the Full state.

Routing Information Protocol (RIP)


Routing Information Protocol (RIP) is a dynamic routing protocol that uses hop count as a routing metric
to find the best path between the source and the destination network. It is a distance-vector routing
protocol that has an AD value of 120 and works on the Network layer of the OSI model. RIP uses port
number 520.

Hop Count
Hop count is the number of routers occurring in between the source and destination network. The path
with the lowest hop count is considered as the best route to reach a network and therefore placed in the
routing table. RIP prevents routing loops by limiting the number of hops allowed in a path from source
and destination. The maximum hop count allowed for RIP is 15 and a hop count of 16 is considered as
network unreachable.
Features of RIP
➢ Updates of the network are exchanged periodically.
➢ Updates (routing information) are always broadcast.
➢ Full routing tables are sent in updates.
➢ Routers always trust routing information received from neighbour routers. This is also known as
routing on rumours

RIP versions

There are three versions of routing information protocol RIP Version1, RIP Version2, and RIPng.

RIP v1 is known as Classful Routing Protocol because it doesn’t send information of subnet mask in its
routing update.

RIP v2 is known as Classless Routing Protocol because it sends information of subnet mask in its routing
update.

RIP v1 RIP v2 RIPng(next generation)

Sends update as broadcast Sends update as multicast Sends update as multicast

Broadcast at [Link] Multicast at [Link] Multicast at FF02::9 (RIPng can


only run on IPv6 networks)

Classful routing protocol Classless protocol updated Classless updates are sent
supports classful

RIP timers
Update timer: The default timing for routing information being exchanged by the routers operating RIP
is 30 seconds. Using an Update timer, the routers exchange their routing table periodically.

Invalid timer: If no update comes until 180 seconds, then the destination router considers it invalid. In
this scenario, the destination router mark hop counts as 16 for that router.

Hold down timer: This is the time for which the router waits for a neighbour router to respond. If the
router isn’t able to respond within a given time then it is declared dead. It is 180 seconds by default.

Flush time: It is the time after which the entry of the route will be flushed if it doesn’t respond within the
flush time. It is 60 seconds by default. This timer starts after the route has been declared invalid and
after 60 seconds i.e. time will be 180 + 60 = 240 seconds.

Note that all these times are adjustable.


INTERNET ROUTING
Internet routing is the process of transmitting and routing internet
protocol packets over the internet between two or more nodes. It is the
same as standard routing procedures but here in internet routing, it
incorporates packets routing techniques and processes on external
networks and it utilises internet protocol bases network but mainly for
those which are publicly accessible. It is a set of methods of internet
protocols used to route a packet through a network.

Principles of internet protocols


• Here, a router selects routes and forward packets. Upon receiving
the packet, a router selects a proper path, which may have one or
more hops, to send the packets to the next router according to the
destination address in the packet. The last router is responsible for
sending the packet to the destination host.
• Routers receives forward datagrams
• Also, it makes routing decisions to be based on the knowledge of
topology and conditions on internet
Types of internet routing protocols
There are several types of internet routing which are grouped into
protocols;
• Open Shortest Part First(OSPF): It is a link state routing protocol
that was developed for IP networks and is based on the shortest
path for packets as they pass through a set of connected
networks.
OSPF gathers link state information from available routers and
construct a topology map of network .It supports IPversion4 and
version6 using the SPF method.
• Intermediate System to Intermediate System (IS-IS): It is an
interior gateway protocol for a computer, group of physically
connected computers or similar devices on a network. Here, it chooses
the best route to distribute IP routing information throughout a single
autonomous system in an IP network.

• Routing Information Protocol(RIP):It is a vector internet protocol


which uses hop count(number of routers that are between the
source and the destination in a network).It allows 15 hops to
reach any network but here, if the packet does not reach the
destination in one of the hops count, then the destination is
considered unreachable. Some examples of RIP include; Routing
Information protocol version1 (RIPV1), Routing Information
protocol version2 (RIPV2) etc.
The RIP can have advantages and also some disadvantages. Some of
those advantages are as follows;
• Easy to configure
• It doesn’t requires an update
• It supports almost all routers
The main disadvantage of the RIP is that it is only based on hop
count so, if there is a better route available with better bandwidth
then it will not select that route.
• Border Gateway protocol (BGP): It is a standardized exterior
gateway internet routing protocol designed to exchange routing
and reachability information among autonomous systems on the
internet. It is classified as path vector routing protocol and
makes a routing decisions based paths where network policies are
configured by a network administrator. Also, it is used for routing
within autonomous systems called Interior Border Gateway
Protocol (IBGP) and External Border Gateway Protocol (EBGP)
when it runs different autonomous systems. The BGP maintains its
own master routing table called the Local Routing Information
base (LOC-RIB) which is separated from the main routing table of
the router, the physical storage and the structure of these
conceptual tables are decided by the implementer of the BGP
code.
• Enhanced Interior Gateway Routing Protocol (EIGPR): It is an
advanced distance – vector protocol that is used on a computer
network for automating routing decisions and configurations. It
enables routers to exchange information more efficient than
earlier networks. It is used on a router to share routes with other
routers within the same autonomous. It sends only incremental
updates which reduces the workload on the router and the
amount of data that needs to be transmitted.
Features of the EIGRP
• The ability to use different authentication passwords at
different times.
• Support for load balancing on parallel links between sites.
• Runs separate outing processes for internet protocols like IPV6,
IPX and Apple talks through the use of protocol dependent
modules.
• Sends topology changes, rather than sending the entire routing
table when a route is changed.
• Interior Gateway Routing Protocol (IGRP): It is a proprietary
distance vector routing protocol used to communicate routing
information within a host network. It was invented by Cisco.
This internet routing protocol manages the flow of routing
information within connected in the host network. It ensures
that every router has routing tables with the best available path.
It also avoids routing loops by updating itself with the changes
occurring over the network and by an error management. Cisco
crated IGRP in response to the limitations in RIP, which handles
a maximum hop count of 15 whereas IGRP supports a maximum
hop count of up to 255.
Routing

1
PROTOCOLS (RIP,OSPF, AND BGP)
Outline
oINTERIOR AND EXTERIOR ROUTING
oRIP
oOSPF
oBGP

Introduction
An internet is a combination of networks connectedby routers.
• How to pass a packet from source to destination ?
• nWhich of the available pathways is the optimum pathway ?
Depends on the metric:
Metric: a cost assigned for passing a packet through a network.
A router should choose the route with the smallest metric to send packets.
The metric assigned to each network depends on the type of protocol
• RIP (Routing Information Protocol)o Treat each network as equals,The cost of passing
through each network is the same: one hop count
• Open Shortest Path First (OSPF) Allow administrator to assign a cost for passing through
a network based on the type of services required for example, maximum throughput or
minimum delay.
• Border Gateway Protocol (BGP)
o The criterion is the policy, which can be set by the administrator.

types of routing

static routing is a process in which we have to manually add routes in a routing table
dynamic routing is a process in which routing protocols add routes in a routing table

default routing
this is a method where the router is configured to send all packets toward a single router(next
hop)
routing techniques

Routing table can be static or dynamic


An internet router needs dynamic routing tables
Dynamic routing table is achieved by the routing prococols.

Interior and Exterior Routing


o An internet can be so large that one routing protocol cannot handle the task of updating
routing table of all routersThus, an internet is divided into autonomoussystems (AS)
AS is a group of networks and routers under theauthority of a single administration.

Interior and Exterior Routing


• Interior routing
protocols like RIP and OSPF are used.
Routing is inside an autonomous system
Each AS can chose its own interior routing protocol
Examples: RIP and OSPF
• Exterior routing
Routing between autonomous systems
Only one exterior routing protocol is usually usedfor exterior routing
Examples: BGP
RIP
RIP: Routing Information Protocol is Based on distance vector routing;
Use the Bellman-Ford algorithm for calculating the routing tables information;
Distance Vector Routing
o Each router periodically shares its knowledge about the entire internet with its neighbors
Sharing knowledge about the entire AS
At the start, a router’s knowledge may be sparse but, how much it knows is unimportant, it
sendswhatever it has.
Sharing only with neighbors
Sends its knowledge only to neighbors
Sharing at regular intervals

RIP Updating Information


oRouting table is updated on receipt of a RIP response message

oReceipt: a response RIP message


oAdd one hop to the hop count for each advertised destination
oRepeat the following steps for each advertised destination
nIf (destination not in the routing table)
oAdd the advertised information to the table
nElse
oIf (next-hop field is the same)
nReplace retry in the table with the advertised one
oElse
nIf (advertised hop count smaller than one in the table)
oReplace entry in the routing table
oReturn
Initializing the Routing Table
oWhen a router is added to a network
nIt initializes a routing table for itself using its configuration file
nThe table contains only the directly attached networks and the hop count (= 1)
and after, the Routing Table will be updated upon
oEach routing table is updated upon receipt of RIP message using the RIP updating message
algorithm shown Above.

type of messages
Requests and Response
oRIP uses two type of messages
nRequest and response
oRequest is sent by a router that has just come up or has some time-out entries
oResponse: solicited or unsolicited
Response is sent only in answer to a request. It contains information about the destination
specified in the corresponding request.
nAn unsolicited response is sent periodically every 30s and contains information about the entire
routing table also called update packet
Timers in RIP
oRIP uses three timers
nPeriodic timer
nExpiration timer
nGarbage collection timer

Periodic Timer
oPeriodic timer control the advertising of regular update message although protocol specifies 30
s, the working model uses a random number between 25 and 35 s to prevent routers update
simultaneously
Expiration Timer
It govern the validity of a route, it set to 180 s for a route when a router receives update
information for a route
nIf a new update for the route is received, the timer is reset.
nIn normal operation, this occurs every 30 [Link] timer goes off, the route is considered expired
nThe hop count of the route is set to 16, which means destination is unreachable

Garbage Collection Timer


oWhen a route becomes invalid, the router does not immediately purge that route from its table. It
continues advertise the route with a metric value of 16
A garbage collection timer is set to 120 s for that route.
oWhen the count reaches zero, the route is purged from the table allowwing neighbors to become
aware of the invalidity of a route prior to purging.

Problems in RIP

oSlow Convergence
oInstability

Slow Convergence
oA change somewhere in the internet propagates very slowly through the rest of the
internet.
oFor example
nA change is Net1, R1 updates itself immediately
nR1->R2: an average of 15 s
nR2->R3: an average of 15 s
n…
nThus, R1-Rn: an average of 15 x n s
RIP Version 2
oNew fields
nRouting Tag: carries information such as the
autonomous system number
oEnable RIP to receive information from an exterior
routing table
nSubnet mask: carries the subnet mask (or prefix)
oRIP2 support classless addressing and CIDR
nNext-hop address: show the address of the next
Hop
Authentication
oProtect the message against unauthorized
advertisement
oThe first entry of the message is set aside for
authentication information
nFamily field = FFFF16

Multicasting
oVersion 1 of RIP uses broadcasting to send
RIP message to everyneighbor
nAll the router and the hosts receive the packets
oRIP version 2
nUses the multicast address [Link] to multicast
RIP message only to RIP routers in the network
PDF created
Encapsulation
oRIP message are encapsulated in UDP user
datagram
oThe well-known port assigned to RIP in UDP
is port 520
Introduction
oAn internet is a combination of networks connected
by routers
oHow to pass a packet from source to destination ?
nWhich of the available pathways is the optimum pathway ?
oDepends on the metric:
nMetric: a cost assigned for passing through a network
nA router should choose the route with the smallest metric

IN computer networking a routing table, or routing information base (RIB), is a data


table stored in a router or a network host that lists the routes to particular network destinations,
and in some cases, metrics (distances) associated with those routes. The routing table contains
information about the topology of the network immediately around it.

The construction of routing tables is the primary goal of routing protocols. Static routes are
entries made in a routing table by non-automatic means and which are fixed rather than being the
result of routing protocols and associated network topology discovery procedures.

Network destination Netmask Gateway Interface Metric


[Link] [Link] [Link] [Link] 10
[Link] [Link] [Link] [Link] 1
[Link] [Link] [Link] [Link] 10
[Link] [Link] [Link] [Link] 10
[Link] [Link] [Link] [Link] 10

• The columns Network destination and Netmask together describe the Network
identifier as mentioned earlier. For example, destination [Link] and netmask
[Link] can be written as [Link]/24.
• The Gateway column contains the same information as the Next hop, i.e. it points to the
gateway through which the network can be reached.
• The Interface indicates what locally available interface is responsible for reaching the
gateway. In this example, gateway [Link] (the internet router) can be reached
through the local network card with address [Link].
• Finally, the Metric indicates the associated cost of using the indicated route. This is
useful for determining the efficiency of a certain route from two points in a network. In
this example, it is more efficient to communicate with the computer itself through the use
of address [Link] (called “localhost”) than it would be through [Link] (the IP
address of the local network card).

Routing tables are generally not used directly for packet forwarding in modern router
architectures; instead, they are used to generate the information for a simpler forwarding
table. This forwarding table contains only the routes which are chosen by the routing
algorithm as preferred routes for packet forwarding. It is often in a compressed or pre-
compiled format that is optimized for hardware storage and lookup.

• This router architecture separates the control plane function of the routing table from the
forwarding plane function of the forwarding table.[3] This separation of control and
forwarding provides uninterrupted high-performance forwarding.

Uses of internet Routing


Internet routing enables a user to access and other data stored on a
remote web site. Internet routing Involves broadcasting or sending a
message from an internal network to an external network using
internet-based networks.
DIFFERENCES BETWEEN THE VARIOUS TYPES OF PROTOCOLS
• OSPF AND RIP
RIP only keeps track of the closest router for each destination address while OSPF keeps track of a
complete topological database of all connections in the local network.

The administrative distance of the RIP is 120 and it is a distance vector routing protocol whereas that of
the OSPF, it is a link state routing protocol an its administrative distance is 110.

RIP protocol allows only up to 15 hop count while the OSPF protocol does not have such restrictions or
has no limitations.

• EIGRP AND OSPF


The EIGRP can be implemented on any interface of any router while the OSPF can only be implemented
on ABR and ASBR and its route summary is not interface –based.

The EIGRP has a combination of bandwidth, reliability, load and delay whereas the OSPF uses an
interface bandwidth.

The EIGRP supports load balancing of unequal path metrics, while the OSPF only supports load balancing
equal metrics.

The EIGRP needs lower cpu and memory whereas the OSPF needs and requires high memory and cpu.

• BGP AND OSPF


The BGP excels with dynamic routing for large networks whereas the OSPF offers more efficient path
choice and convergence speed.

OSPF is an intra-domain routing protocol whereas BGP is the inter- domain routing protocol.

OSPF is very fast to occur whereas the BGP is very slow to occur.

OSPF prefers fastest path rather than shortest path while BGP prefers best path.

• RIP AND BGP


The main difference between the two is that RIP is an interior gateway protocol and it distribute routing
information within an autonomous system while the BGP is an exterior gateway protocol where the
router learned via the dynamic routing protocols are applied to the kernel routing table.

In RIP, the calculations are in terms of Bandwidth whereas that of the BGP are in terms of HOP count.

RIP is less intelligent protocol when compared to the BGP while the BGP is called a more intelligent
protocol as compared to the RIP.

RIP works for smaller organizations while BGP works for large organizations.

• RIP AND EIGRP


The RIP is basically used for smaller size organizations while the EIGRP is basically used for large size
organizations.

RIP works on Bellman Ford Algorithm(BFA) while the EIGRP works on DUAL (Diffusing Update Algorithm)
algorithm.

RIP is a standard dynamic routing protocol whereas the EIGRP is a Cisco standard routing protocol.

The RIP calculates the metric in terms of hop count while the EIGRP calculates the metric in terms of
bandwidth and delay.

The RIP is not a more intelligent dynamic routing protocol while the EIGRP is a more intelligent routing
protocol.

- The Routing Table –


Routing Table Basics
Routing is the process of selecting the best (shortest part)and sending of packet of information from one
network to another network. Thus, routes are usually based on the destination network, and not the
destination host (host routes can exist, but are used only in rare circumstances).

What is a routing table?


A Routing table is a set of rules, often viewed in table format, that is used to determine where data
packets traveling over an internet protocol (IP) network will be directed. All IP-enabled devices, including
routers and switches, use routing tables.

To route, routers build Routing Tables that contain the following:

• The destination network and subnet mask (Network identifier)


• The “next hop” router to get to the destination network

• Routing metrics and Administrative Distance(Routing protocol)

The routing table is concerned with two types of protocols:

• A routed protocol is a layer 3 protocol that applies logical addresses to devices and routes data
between networks. Examples would be IP and IPX.

• A routing protocolis a protocol that specifies how routers communicates with each other to
distribute information that enables them to select routes between nodes on a computer
network.

A routing protocol dynamically builds the network, the topology, and next hop information in
routing tables. Examples would be RIP, EIGRP, OSPF, etc.

To determine the best route to a destination, a router considers three

elements (in this order):

• Prefix-Length:

It specifies the number of bits in the IP address that are to be used as the subnet
mask(usually between 1-32) Prefix-length is the number of bits used to identify the
network, and is used to determine the most specific route.

• Metric (within a routing protocol):

It identifies the cost that’s associated with using that route. For example, the matric can
be valued in terms of link speed, hop count or time delay.

• Administrative Distance (between separate routing protocols):


It’s a value that routers use in order to select the best path when there are more than 1
routes to the same destination from two different routing protocol.

A longer prefix-length indicates a more specific route. For example, assume we are trying to reach a host
address of [Link]/24. If we had routes to the following networks in the routing table:

[Link]/24

[Link]/8

The router will do a bit-by-bit comparison to find the most specific route (i.e., longest matching prefix).
Since the [Link]/24 network is more specific, that route will be used, regardless of metric or
Administrative Distance.

Administrative Distance vs. Metric


A “metric” allows a router to choose the best path within a routing protocol. Metrics are usually selected
according to their magnitude or weight. The smaller the metric the higher its ranking.

Only routes with the best metric are added to the routing tableI.e, the metric with the smallest
magnitude. Thus, even if a particular routing protocol (for example, RIP) has four routes to the same
network, only the route with the best metric (hop-count in this example) would make it to the routing
table.

If multiple equal-metric routes exist to a particular network, most routing protocols will load-balance.

If your router is running multiple routing protocols, Administrative Distance is used to determine which
routing protocol to trust the most. Lowest administrative distance wins.

Again: if a router receives two RIP routes to the same network, it will use the routes’ metric to determine
which path to use. If the metric is identical for both routes, the router will load balance between both
paths.

If a router receives a RIP and an OSPF route to the same network, it will use Administrative Distance to
determine which routing path to choose.

The Administrative Distance of common routing protocols (remember, lowest wins):

Connected 0

Static 1

EIGRP Summary 5
External BGP 20

Internal EIGRP 90

IGRP 100

OSPF 110

IS-IS 115

RIP 120

External EIGRP 170

Internal BGP 200

Unknown 255

A route with an “unknown” Administrative Distance will never be inserted into the routing table.

Routes are labeled based on what protocol placed them in the table:

• C – Directly connected
• S – Static
• S* - Default route
• D - EIGRP
• R – RIP
• I – IGRP
• i – IS-IS
• O – OSPF
• B--BGP

Choosing the Best Route (Example)


Assume the following routes existed to the following host: [Link]/24
O [Link]/24 [110/58] via [Link], [Link], Serial3
R [Link]/24 [120/1] via [Link], [Link], Serial0
R [Link]/24 [120/5] via [Link], [Link], Serial1
S [Link]/16 [1/0] via [Link]

We have two RIP routes, an OSPF route, and a Static route to that destination. Which route will be
chosen by the router?

Remember the three criteria the router considers:

• Prefix-Length

• Metric

• Administrative Distance

The static route has the lowest administrative distance (1) of any of the routes; however, its prefix-length
is less specific. [Link]/24 is a more specific route than [Link]/16. Remember, prefix-length
is always considered first.

The second RIP route will not be inserted into the routing table, because it has a higher metric (5) than
the first RIP route (1). Thus, our routing table will actually look as follows:
O [Link]/24 [110/58] via [Link], [Link], Serial3
R [Link]/24 [120/1] via [Link], [Link], Serial0
S [Link]/16 [1/0] via [Link]

Thus, the true choice is between the OSPF route and the first RIP route. OSPF has the lowest
administrative distance, and thus that route will be preferred.

PLEASE NOTE
: Calculating the lowest metric route within a routing protocol occurs before administrative distance
chooses the route it “trusts” the most. This is why the order of the above “criteria” is prefix-length,
metric, and then administrative distance. However, the route with the lowest administrative distance is
always preferred, regardless of metric (assuming the prefix-length is equal). Thus, the metric is calc

You might also like