Chapter 3
Routing Protocols
2.1
Chapter_3 Syllabus
Routing Algorithms: Types of routing algorithm,
Multicast Addressing
Unicast Routing Protocols: RIP, BGP and OSPF
Protocols
Multicast Routing Protocols: IGMP, MOSPF,
DVMRP and MBONE Protocols.
2.2
Routing Algorithms
2.3
Introduction
An internet is a network of networks which are connected by
routers
A packet is routed from source to destination in a optimum
pathway.
Optical Path is chosen by router depends on the metric:
Metric: a cost assigned for passing through a network
A router should choose the route with the smallest metric
2.4
Introduction . . .
• Routing Algorithm is
– Part of the network layer software.
– Responsible for deciding which output line an incoming
packet should be transmitted on.
• Properties of Routing Algorithm:
• Correctness
• Simplicity
• Robustness
• Stability
• Fairness
• Optimality
2.5
Functions of a Router
Why Routing?
• The router is responsible for the routing of
traffic between networks.
Functions of a Router
Routers are Computers
• Routers are specialized computers
containing the following required
components to operate:
– Central processing unit (CPU)
– Operating system (OS) - Routers use Cisco IOS
– Memory and storage (RAM, ROM, NVRAM,
Flash, hard drive)
• Routers utilize the following memory:
Functions of a Router
Routers Interconnect Networks
• Routers can connect multiple networks.
• Routers have multiple interfaces, each on a different IP network.
Functions of a Router
Routers Choose Best Paths
• Determine the best path to send packets
– Uses its routing table to determine path
• Forward packets toward their destination
– Forwards packet to interface indicated in
routing table.
– Encapsulates the packet and forwards out
toward destination.
• Routers use static routes and dynamic
routing protocols to learn about remote
networks and build their routing tables.
Switching Packets between Networks
Send a Packet
Switching Packets between Networks
Forward to the Next Hop
Switching Packets between Networks
Packet Routing
Switching Packets between Networks
Reach the Destination
Path Determination
Routing Decisions
The Routing Table
The Routing Table
Routing Table is a file stored in RAM that contains information about
Directly Connected Routes
Remote Routes
Network or Next hop Associations
Types of Routing Algorithms
• Two Categories
– Based on Routing Table Updating
– Based on Forwarding Principle
Other ways of Classification
– Proactive / Reactive
– Static / Dynamic
– Distance Vector RP / Link Status RP
– Intranetwork (Interior) RP / Internetwork (Exterior)
– (Adoptive) / (Non adaptive)
2.16
Types of Routing Protocols
Classifying Routing Protocols
Types of Routing Protocols
IGP and EGP Routing Protocols
Interior Gateway Protocols
(IGP) -
Used for routing within
an AS
Include RIP, EIGRP,
OSPF, and IS-IS
Exterior Gateway
Protocols (EGP) -
Used for routing
between AS
Official routing
protocol used by the
Internet
Based on Routing Table Updating . . .
Interior Routing
Routing inside an autonomous system.
An interior protocol handles intradomain routing.
Each AS can chose its own interior routing protocol
Examples: RIP, OSPF , EIGRP
Exterior Routing
Routing between autonomous systems
An exterior protocol handles inter- domain routing.
Examples: BGP
2.19
Based on Routing Table Updating . . .
Example. 1
Fig. Autonomous Systems
2.20
Based on Routing Table Updating . . .
RIP (Routing Information Protocol)
Treat each network as equals
Cost is calculated based on number of Hop Count
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 serviced required
For example, maximum throughput or minimum delay
Border Gateway Protocol (BGP)
The criterion is the policy, which can be set by the administrator
2.21
Based on Forwarding Principle
• As per forwarding principle / Delivery Models relate to the
Internet,
» Unicasting
» Multicasting
» Broadcasting.
2.22
Based on Forwarding Principle . . .
• Unicasting
– One source, one destination
– Widely used (web, p2p, streaming, many other
protocols)
Fig. Example Unicasting Systems
2.23
Based on Forwarding Principle . . .
• Multicasting
– One source, several (pre specified) destinations.
– Is a group communication where data communication
is addressed to a group of destination computers
Fig. Example Multicasting Systems
2.24
Based on Forwarding Principle . . .
Broadcasting
One source, all destinations .
Used to disseminate control information, perform service
discovery
Fig. Example Multicasting Systems
2.25
Multicast Addressing
• A multicast address is a logical identifier for a group of
hosts in a computer network
• Unicast address represents a single receiver where as
multicast address represents a group of receiver
• A packet that uses a multicast address as a destination
can reach all members of the group.
• Multicast addresses in both data link and network layers.
• Multicast addresses in the network layer - IPv4 protocol.
2.26
Multicast Addressing
• The multicast address space is divided into some smaller ranges
based on RFC 3171.
CIDR Range Assignment
224.0.0.0/24 224.0.0.0 -> 224.0.0.255 Local Network Control Block
224.0.1.0/24 224.0.1.0 -> 224.0.1.255 Internetwork Control Block
224.0.2.0 -> 224.0.255.255 AD HOC Block
224.1.0.0/16 224.1.0.0 -> 224.1.255.255 ST Multicast Group Block
224.2.0.0/16 224.2.0.0 -> 224.2.255.255 SDP/SAP Block
224.3.0.0 -> 231.255.255.255 Reserved
Source Specific Multicast
232.0.0.0/8 232.0.0.0 -> 224.255.255.255
(SSM)
233.0.0.0/8 233.0.0.0 -> 233.255.255.255 GLOP Block
234.0.0.0 -> 238.255.255.255 Reserved
239.0.0.0/8 239.0.0.0 -> 239.255.255.255 Administratively Scoped Block 2.27
Multicast Addressing . . .
• Types
• One to Many
• Many to Many
• Selecting Multicast Address
• The selection of address depends on the type of application.
• Let us discuss some cases.
– Limited Group
The administrator can use the AS number (x.y) and choose an
address between 239.x.y.0 and 239.x.y.255 (Administratively
Scoped Block) that is not used by any other group as the multicast
address for that particular group.
– Larger Group
» If the group is spread beyond an AS territory, the previous solution
does not work. The group needs to choose an address from the SSM
block (232.0.0.0/8). 2.28
Unicast Routing Algorithms
2.29
RIP:
Routing Information Protocol
2.30
RIP
RIP: Routing Information Protocol
Based on distance vector routing
Bellman-Ford algorithm - calculating the routing tables
Each router periodically shares its knowledge with its neighbors
Sharing knowledge about the entire AS
At the start, a router’s knowledge may be sparse
Sharing only with neighbors
Sends its knowledge only to neighbors
Sharing at regular intervals
2.31
2.32
RIP - Message Types
RIP uses two type of messages
Request and Response
Request
Sent by a router that has just come up or has some time-out
entries
Can ask specific entries or all entries
2.33
RIP - Message Types . . .
Response: Solicited or Unsolicited
A Solicited Response: Sent only in answer to a request
Contain information about the destination specified in the
corresponding request
An Unsolicited Response: Sent Periodically
Every 30s / 120s no reply – assumes failed / after 240 sec –
removes routing table entry on particular router
Contains information about the entire routing table
Also called Update Packet
2.34
RIP - Message Types . . .
Example 1
What is the periodic response sent by router R1?
Assume R1 knows about the whole autonomous system.
2.35
RIP - Message Types . . .
Solution
R1 can advertise three networks 144.2.7.0, 144.2.9.0, and
144.2.12.0.
The periodic response (update packet) is shown in below
2.36
RIP - Routing Table Updating
Initializing the Routing Table
When a router is added to a network
It initializes a routing table for itself using its
configuration file
The table contains only the directly attached networks
and the hop count (= 1)
Updating the Routing Table
Each routing table is updated upon receipt of RIP
Response message
2.37
Distance Vector Routing Tables
Initialization of Tables in Distance
Vector Routing
Updating in Distance Vector Routing
• In distance vector routing, each node shares its
routing table with its immediate neighbors
periodically and when there is a change.
RIP - Routing table Updating . . .
Add one hop to the hop count for each advertised destination
Using the RIP updating message algorithm shown below
Repeat the following steps for each advertised destination
If (destination not in the routing table)
Add the advertised information to the table
Else
If (next-hop field is the same)
Replace retry in the table with the advertised one
Else
If (advertised hop count smaller than one in the table)
Replace entry in the routing table
Return
2.41
RIP - Routing table Updating . . .
Fig. Example of Updating a Routing Table
2.42
RIP - Message Format
Command: 8-bit
The type of message:
request (1) or response (2)
Version: 8-bit
Define the RIP version
Family: 16-bit
Define the family of the protocol used
TCP/IP: value is 2
Address: 14 bytes
Defines the address of the destination network
14 bytes for this field to be applicable to any protocol
However, IP currently uses only 4 bytes, the rest are all 0s
Distance: 32-bit
2.43
The hop count from the advertising router to the destination network
RIP -- Timers
RIP uses three timers
Periodic timer
Expiration timer
Garbage collection timer
Periodic timer
Control the advertising of regular update message
Although protocol specifies 30s, the working model uses a random
number between 25 and 35s.
Prevent routers update simultaneously
2.44
RIP – Timers . . .
Expiration Timer
• Govern the validity of a route
• Set to 180s for a route when a router receives update
information for a route
• If a new update for the route is received, the timer is reset
• In normal operation, this occurs every 30 s
• If timer goes off, the route is considered expired
• The hop count of the route is set to 16, which means
destination is unreachable
2.45
RIP – Timers . . .
Garbage Collection Timer
When 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.
When the count reaches zero, the route is purged from the table
and allow neighbors to become aware of the invalidity of a
route prior to purging.
2.46
RIP – Timers . . .
Example 2
A routing table has 20 entries.
It does not receive information about five routes for 200
seconds.
How many timers are running at this time?
Solution
The timers are listed below:
Periodic timer: 1
Expiration timer: 20 - 5 = 15
Garbage collection timer: 5 2.47
RIP - Encapsulation
RIP message are encapsulated in UDP user datagram
The well-known port assigned to RIP in UDP is port 520
RIP - Problems
Slow Convergence
Instability
2.48
BGP:
Border Gateway Protocol
2.49
2.50
BGP
First appeared in 1989
An inter-autonomous system routing protocol
Based on the path vector routing method
Each entry in the routing table contains
The destination network
The next router
The path to reach the destination, usually defined as ordered list
of ASs
2.51
2.52
2.53
BGP
Network Next Router Path
NO1 R01 AS14, AS23, AS67
NO2 R05 AS22, AS67, AS05, AS89
NO3 RO6 AS67, AS89, AS09, AS34
NO4 R12 AS62, AS02, AS09
Example of a Path Vector Routing Table
2.54
2.55
BGP . . .
Autonomous boundary routers advertise the reachability of
networks in their own AS to neighbor autonomous boundary
routers
Each router receives a path vector message
Verify the advertised path is in agreement with its policy
If yes, update its routing table and modify the message
before sending it to the next router.
Add its AS number to the path and replacing the next
router entry with its own identification
2.56
BGP . . .
Example 3
R1 send a path vector message
Advertise the reachability of N1
R2 receives the message
Update it routing table
Send the message to R3 with adding its AS to the path and
inserting itself as the next router
2.57
2.58
BGP . . .
Path vector routing can solve
The instability of distance vector routing
The creation of loops
When a router receive a message, it checks to see if its AS is
in the path list or not
If yes, looping is involved and the message is ignored
2.59
BGP . . .
Policy Routing can be easily implemented through path vector
routing
Once a router receives a message, it can check the path.
If one of the AS listed in the path is against its policy,
It can ignore that path and that destination
Does not update its routing table with this path
Does not send this message to its neighbors
Thus, path vector routing are not based on the smallest hop count
or the minimum metric. Based on the policy imposed on the router
by the administrator
2.60
BGP - Packet Format
All BGP packets share the same common header
Header format
Marker: 16-bit
Reserved for authentication
Length: 2-bytes
Define the length of the total message, including the
header
Type: 1-byte
Define the type of the packet
2.61
BGP - Packet Format . . .
Fig. BGP Packet Header
2.62
BGP - Types of Messages
BGP uses four different types of messages
2.63
2.64
BGP - Types of Messages . . .
1. Open Message
Used to create a neighborhood relationship
A router running BGP opens a TCP connection with a neighbor
and sends an open message
If the neighbor accepts
It responses with a keepalive message
The relationship then has been established between the two
router
2.65
BGP - Types of Messages . . .
Fig. Open Message
2.66
BGP - Types of Messages . . .
2. Update Message
Used by a router to
Withdraw destination that have advertised previously
Announce a route to a new destination
Note, a router can withdraw several destinations in a single
update message
However, it can only advertise one new destination in a
single update message
2.67
BGP - Types of Messages . . .
Fig. Update Message
2.68
BGP - Types of Messages . . .
3. Keepalive Message
The BGP routers exchange keepalive message regularly
Tell each other that they are alive
Format
Consist of only the common header
Fig. Keepalive Message
2.69
BGP - Types of Messages . . .
4. Notification Message
Sent by a router
Whenever an error condition is detected
A router wants to close the connection
Fig. Notification Message 2.70
BGP - Sessions
o The exchange of routing information between two routers using BGP takes
place in a session.
o A session is a connection that is established between two BGP routers only
for the sake of exchanging routing information.
o To create a reliable environment, BGP uses the services of TCP.
o BGP sessions are sometimes referred to as semipermanent connections.
2.71
BGP – Sessions . . .
BGP can have two types of sessions.
• External BGP (E-BGP)
Used to exchange information between two speaker
nodes belonging to two different autonomous systems.
• Internal BGP (I-BGP)
Used to exchange routing information between two
routers inside an autonomous system.
Fig. Internal and External BGP sessions 2.72
BGP - Encapsulation
BGP message are encapsulated in TCP segments using the well-
known port 179.
No need for error control and flow control
Thus, when a TCP connection is opened
The exchange of update, keepalive, and notification message is
continued
Until a notification message of type cease is sent
2.73
2.74