Computer Networks – UNIT 3
Routing Protocols
RIP, OSPF, BGP
M.Subramaniam,. M.E., (Ph.D)
Asst. Prof – Dept of CSE,
M.N.M. Jain Engineering College,
Chennai – 600 097, INDIA
Routing Protocols
Metric
Cost assigned for passing through a
network
Routing Information Protocol (RIP)
Open Shortest Path First (OSPF)
Broader Gateway Protocol (BGP)
Routing Protocols
RIP
The cost of passing each network is the same (hop-count)
OSPF
Allows each router to have several routing tables based on the
required type of service.
Max Throughput.
Minimum Delay.
BGP
Criterion is policy set by administrator, which defines what path is
to be chosen.
Routing Table – tells optimum path for packet.
Static Table
Not Changed frequently.
Dynamic Table
Updated frequently when there is a change in the Internet.
Internet Routing
Internet today is large,
one routing protocol
cannot handle the task of
updating routing tables of
all the Routers.
Autonomous system (AS)
AS- Group of Network and Routers under the
authority of single administration.
Interior Routing -Routing within the AS.
Exterior Routing -Routing between the AS
Interior Routing Exterior Routing
Autonomous System Autonomous System
Routing Protocols
Routing Protocols
Interior Routing Exterior Routing
RIP OSPF BGP
Routing Information Protocol (RIP)
RIP – Simple protocol based on Distance
Vector Routing
Distance Vector Routing.
Three key elements how this algorithm
works
Sharing knowledge about the entire
autonomous system
Sharing only with neighbors.
Sharing at regular intervals (i.e. every 20s)
Routing table
Destination Hop count Next hop Others …..
163.5.0.0 7 172.6.23.4 …
197.5.13.0 5 176.3.6.17 …
189.45.0.0 4 200.5.1.6 …
. . . …
. . . …
. . . …
RIP – Updating Algorithm
1. Receive: a response RIP message
2. Add one hop to the hop count for each advertised destination
3. Repeat the following steps for each advertised destination
1. If (destination is not in the routing table)
1. Add the advertised information to the table
2. Else
1. If (next hop field is the same)
1. Replace entry in the table with the advertised one.
2. Else
1. If( advertised hop count smaller than one in the table)
1. Replace entry in the routing table
4. Return ()
Example of Updating a Routing table
RIP message from C RIP message from C after increment
Net 2 4 Net 2 5
Net 3 3 Net 3 4
Net 6 4 Net 6 5
Net 8 3 Net 8 4
Net 9 5 Net 9 6
Old Routing Table New Routing Table
Net 1 7 A Net 1 7 A
Net 2 2 C Net 2 5 C
Net 6 8 F Updating Algorithm Net 3 9 C
Net 8 4 E Net 6 5 C
Net 9 4 F Net 8 4 E
Net 9 4 F
Net 1: No news, do not change
Net 2: Same as next hop, replace
Net 3: A New router add
Net 6: Different next hop, new hop count smaller, replace
Net 6: Different next hop, new hop count the same, do not change
Net 6: Different next hop, new hop count larger, do not change
Contd..
Initializing the routing table
Router initializes using configuration file
Table contain directly attached network
and hop count which are initialized to 1
Updating the routing table
Routing table is updated upon receipt of
RIP message using RIP Updating algorithm
OSPF – Open Shortest Path First
Its domain is also (AS) autonomous system as RIP
To handle routing efficiently and in a timely manner
OSPF divides an autonomous system into Areas.
Areas
Collection of
Networks
Hosts
Routers
Areas – disintegrates to form sub-areas (They have the
same properties of area having all devices)
Metric
OSPF protocol allows administrator to
assign a cost called – Metric
Metric based on
Minimum delay
Maximum throughput
Etc
Note:
A router can have multiple routing tables.
Link State Routing
OSPF uses link state routing to update
routing tables.
Basic key elements of link state routings
Sharing the knowledge about the
neighborhood
Sharing with every other router.
Sharing whenever there is a change
Types of link
In OSPF terminology, a connection is
called “LINK”
Point-to-Point
Transient link
Stub
Virtual
LINK STATE ADVERTISEMENT’S
Link state advertisements
Summary link to AS boundary Router External link
Router link
Network link
Summary link to network
Router Link
A router link defines the links of a true router.
A true router uses this advertisement to announce
information about all of its links and what is at the
other side of the link (neighbors)
Network Link
The packet announces the existence of all the
routers connected to the network
Summary Link to Network
Router 1 – Area border router has two routing tables one from area1 and area 0
Router 1 – floods area 1 with information about how to reach a network located
to area 0
Similarly Router 2 – same as above instead (area 2 <-> area 0)
Summary Link to AS boundary Router
If router inside an area wants to send a packet outside the autonomous system it
should first know the router to an autonomous boundary router.
The summary link to AS boundary router provides this information.
The area border router flood their areas with this information.
External Link
External Link
A router inside the Autonomous system (AS) wants to
know which network are available outside the
autonomous system; the external link advertisement
provides this information.
The AS boundary router floods the autonomous
system with the cost of each network outside the
autonomous system using a routing table created by
a exterior routing protocol
Each advertisement announces one single network,
If there are more than one network separate
announcements are made.
Exterior Routing
BGP – Broader Gateway Protocol
Is an interior autonomous system routing protocol.
It is based on routing method called Path-vector-
Routing
Path-vector-Routing - Each entry in the routing table
contains the destination network, the next router and
the path to reach the destination.
The path is usually defined as an ordered list of
autonomous systems that a packet should travel
through to reach destination.
Path-vector-routing table
Network Next Router Path
N01 R01 AS14, AS23, AS67
N02 R05 AS22, AS67, AS05, AS89
N03 R06 AS67, AS89, AS09, AS34
N04 R12 AS62, AS02, AS09
Path-vector-packets