Title: Module 12 Routing Protocols
1Module 12Routing Protocols
2- Textbook sections
- BF Chapter 13 Routing Protocols (RIP,OSPF,and
BGP) - Topics
- RIP
- OSPF
- Overview
- Link-state Database
- Graphical Representation
- Shortest-path Tree and Routing Table Calculation
- OSPF Packets for link-state Database Updates
- BGP
31. Routing Information Protocol (RIP)
- Use the Bellman-Ford algorithm to calculate
routing tables - RIP runs on top of UDP via well-known UDP port
number 520. - Initializing the routing table
- Updating the routing table
- RIP message format
- Remedies for instabilities
4Table A distance vector routing table
1. Routing Information Protocol (RIP)
Note Other information can include time since
last updated
51. Routing Information Protocol (RIP)
- Initializing the routing table
- When a router is added to a network, it
initializes a routing table for itself using its
configuration file - Destination field contains only the directly
attached networks - Hop count initialized to 1.
- The next hop field which identifies the next
router, is empty.
BF Figure Initial routing tables in a small
autonomous system
6BF Figure Final routing tables for the previous
figure
Note Hop count is the number of networks a
packet enters to reach its final destination.
71. Routing Information Protocol (RIP)
- Updating the routing table
- The routing table is updated upon receipt of a
RIP response message
81. Routing Information Protocol (RIP)
- Updating the routing table
- The routing table is updated upon receipt of a
RIP response message
RIP Updating Algorithm
9BF Figure Example of updating a routing table
101. RIP - RIP Message Format
- Command field
- Request
- When the value in command field is 1
- A request can ask about specific entries or all
entries (Figure 13.7) - Normally, requests are sent as broadcasts, from a
UDP source port of 520. - Response (Figure 13.8 Response message)
- Solicited response
- Response to a specific request
- It contains information about the destination
specified in the corresponding request - Unsolicited response
- Regular updates
- Triggered updates triggered by a metric change
111. RIP - RIP Message Format
- Unsolicited response
- Regular updates
- Sent periodically, every 30 seconds trigged by a
30 second timer - The 30-second timer is offset by addition of a
small random time each time its is set. (to
prevent any possible synchronization and
therefore overload on an internet if route
updates simultaneously) - Message contains the whole routing table
- Triggered updates triggered by a metric change
- Metric field
- This 32-bit field defines the hop count from the
advertising router to the destination network - Must contain a value between 1 and 15 inclusive,
specifying the current metric for the
destination, or the value of 16, which indicates
that the destination is not reachable - The maximum number of hops is limited to 15
because RIP is intended to use in a local area
environment. The metric value of 16 is reserved
to represent infinity. This small number helps
to combat the count-infinity problem.
121. RIP - RIP Message Format
BF Figure RIP message format
Family field Define the the protocol family
under which the network address should be
interpreted. For TCP/IP the value is 2.
131. RIP - RIP Message Format
BF Figure Request messages
141. RIP - RIP Message Format
BF Figure Response message
151. Routing Information Protocol (RIP)
- Remedies for instability
- Maximum metric value of 16
- Triggered update
- Split horizons
- Poison Reverse
162. OSPF - Overview
- Overview
- In 1991, the industry moved to establish an open
standard replacement for RIP. The result was
OSPF (Open Shortest Path First). - As the name implies, OSPF is an open standard
used to seek out shortest path routes just like
RIP - OSPF operate under the link-state concept, in
which each router keeps a link-state database, a
topological database, of all links in a network
and information on any delay it might be
experiencing. Link-state protocols build routing
tables based on a topology database. - This database is built from link state packets
that are passed between all the routers to
describe the state of a network. OSPF saves
control message overhead by issuing routing
updates only on an event-driven basis.
172. OSPF - Overview
- Highlights
- OSPF is a link-state routing protocol
- OSPF is designed to be run internal to a single
Autonomous System. Distributes routing
information between routers belongs to a single
Autonomous System (AS). - Each OSPF router maintains an identical database
describing the Autonomous systems topology - From this database, a routing table is calculated
by constructing a shortest path tree - Important features
- OSPF recalculates routes quickly in the face of
topological changes, utilizing a minimum of
routing protocol traffic (link-state updates) - An area routing capability is provided, enabling
an additional level of routing protection and a
reduction in routing protocol traffic. - Provides the authentication of routing updates
- Use IP multicast when sending/receiving the
updates
18Highlights of OSPF Protocol
Graphical representation
Link-state Database
OSPF packets
Link-state algorithm
routing table
Shortest-path tree
192. OSPF Link-state Database
- Link-state database
- A tabular representation of the topology of the
internet inside an area. It shows the
relationship between each router and its
neighbors including the metrics. - Highlights of Link-state database
- Each router maintain a database describing the
Autonomous Systems topology - Each participating router has an identical
database - Each individual piece of this database is a
participants local state (e.g. the routers
usable interfaces and reachable neighbors) - The router distributes its local state throughout
the AS by flooding - All routers run the exact same algorithm in
parallel. - From the link-state database, each router
constructs a tree of shortest path with itself as
a root.
20Example of link-state database (a tabular
representation)
212. OSPF Link-state Database
- Graphical representation
- Hierarchical routing
- One particular feature that makes OSPF more
complex than other routing protocols also makes
it more powerful - To achieve a hierarchy, OSPF allows an autonomous
system to be partitioned for routing purpose. - A manager can divide routers and networks in an
autonomous system into subsets that OSPF calls
areas. Each router is configured to know the
area boundary (i.e., exactly which other routers
are in its area). - When OSPF runs, routers within a given area
exchange link-state message periodically. - To exchange information with an area, OSPF allows
communication between areas. One router in each
area is configured to communicate with a router
in one or more other area(s). The two routers
summarize routing information they have learned
from other routers within their respective area,
and then exchange the summary.
222. OSPF Link-state Database
- Thus, instead of broadcasting to all router in
the autonomous system, OSPF limits link-state
broadcasts to routers within an area. As a
result of the hierarchy, OSPF can scale to handle
much larger internets than other routing
protocols.
232. OSPF Link-state Database
- Autonomous system (AS)
- The global Internet topology can be viewed as a
collection of Ass - An AS is loosely defined as a set of routers or
networks that are technically administered by a
single organization such as a corporate network,
a campus network, or an ISP network - Each AS can choose an interior routing protocol
to handle routing inside the AS. - Categories of AS
- AS number
242. OSPF Link-state Database
BF Figure Autonomous systems
252. OSPF Link-state Database
BF Figure Areas in an autonomous system
262. OSPF Link-state Database
OSPF Router Classification
272. OSPF - Graphical Representation
- Types of links
- Point-to-point link
- Transient link
- A network with several routers attached to it.
- The data can enter through any of the routers and
leave through any router. - While there is a metric from each node to the
designated router, there is no metric from the
designated router to any other node. (The reason
is that the designated router represents the
network. We can only assign a cost to a packet
that is passing through the network. We cannot
charge for this twice. - Stub link
- A network connected to only one router
- The data package enter the network through this
single router and leave the network through this
same router. - A special case of the transient network
- Link is only one-directional, from the router to
the network - Virtual Link
- When the link between two routers is broken, the
administration may create a virtual link between
them using a longer path that probably goes
through several routers.
282. OSPF - Graphical Representation
BF Figure point-to-point link
BF Figure 13-21 Stub Link
29BF Figure Transient link
302. OSPF - Graphical Representation
- Network types
- Point-to-point networks
- A network that joins a single pair of routers
- Example a 56kb serial line
- Broadcast networks
- Network supporting many (more than two) attached
routers, together with the capability to address
a single physical message to all of the attached
routers (broadcast) - Example An Ethernet
- Non-broadcast networks
- Network Supporting many (more than two) routers,
but having no broadcast capability. - OSPF runs in one of two modes over non-broadcast
networks - Non-broadcast multi-access(NBMA) mode which
simulates the operation of OSPF on a broadcast
network. - Point-to-multipoint mode which treats the
non-broadcast network as a collection of
point-to-point links.
312. OSPF - Graphical Representation
- OSPF Network topology
- OSPF requires a hierarchical network topology.
The network can be broken up into areas. - OSPF router classification
- Autonomous system boundary router (ASBR)
- Exchanges routing information with routers
belongs to other autonomous systems - Area border router (ABR)
- attaches to multiple areas and runs multiple
copies of the routing algorithm, on for each
attached area. - Internal router
- has all directly connected networks belongs to
the same area. It runs a single copy of the
routing algorithm - Backbone router
- has an interface to the backbone
322. OSPF - Graphical Representation
BF Figure Example of an internet
332. OSPF - Graphical Representation
BF Figure Graphical representation of an internet
Note metrics assigned to the designated node.
342. OSPF - Shortest-path Tree and Routing Table
Calculation
- Dijkstra algorithm
- To calculate its shortest-path tree and routing
table, each router applies the Dijkstra algorithm
to its link state database
352. OSPF OSPF Packets for link-state Database
Updates
- Operation
- OSPFs Hello protocol uses Hello packets to
discover and maintain neighbor relationships - The Database Description and Link State Request
packets are used in the forming of adjacencies. - OSPFs reliable update mechanism is implemented
by the Link State Update and Link State
Acknowledgement packets. - OSPF packet types
362. OSPF OSPF Packets for link-state Database
Updates
- OSPF common header
- All OSPF share the same common header
- Router ID Source router IP address (No
destination IP address is included in the common
header) - This field defines the area within which the
routing take place - Checksum It does not include authentication type
and authentication data field
0 8
16
31
Version Type
Packet Length
Router ID
Area ID
Checksum
Authentication Type
Authentication
Authentication
372.0 OSPF OSPF Packets for link-state Database
Updates
BF Figure Types of OSPF packets
Note Five different types of Link state
advertisements
382.0 OSPF OSPF Packets for link-state Database
Updates
- Hello protocol
- The Hello protocol establishes and maintains
neighbor relationships. Neighbor routers form
adjacencies - The Hello protocol is used to elect a designated
router (DR) on multiaccess networks. Refer to RFC
2328 Section 9.4 Electing the Designated router
for details. - Details
- Each router broadcasts a Hello packet
periodically onto its network. - When a router receives a Hello packet, it replies
with a Hello packet containing the router ID of
each neighbor it has seen. - When a router receives a Hello packet containing
its router ID in one of the neighbors fields, the
router is assured that communication to the
sender is bi-directional - Designated routers are elected in each
multiaccess network after neighbor discovery.
The election is based on the priority and ID
fields.
392.0 OSPF OSPF Packets for link-state Database
Updates
LG Figure 8.35 OSPF Hello packet format (Not
including OSPF common header)
Note Hello interval The normal period, in
seconds, between hello messages. Dead interval
Gives a time in seconds after which a
non-responding neighbor is considered
dead. Neighbor n Gives the IP addresses of all
neighbors from which the sender has recently
received hello messages Priority is used in
selecting designated routers. Designated router
and Backup designated Router Contains IP
addresses that give the senders view of the
designated router and backup designated router
for the network over which the message is sent
402.0 OSPF OSPF Packets for link-state Database
Updates
- Database description packet
- Packet contains link state header only
- The database description packet does not contain
completely database information it only gives an
outline, the title of each line in the database - Client/server relationship
- When two routers want to exchange database
description packet, one of them takes the role of
master and the other the role of slave. - Contents of the database can be divided into
several messages. - Example newly connected router
- After a router is connected to the system, it
sends hello packets to greet its neighbors - If this is the first time that the neighbors hear
from the router, they send a database description
packet - The newly connected router examines the outline
and finds out which lines of information it does
not have. - It then sends one or more link state request
packets to get full information about that
particular link.
412. OSPF OSPF Packets for link-state Database
Updates
BF Figure Database Description Message
Note I flag is set to 1 if the message is the
first message M flag is set to 1 if this message
is not the last message. M/S flag indicates
whether the message is sent by a master (M/S 1)
or by a slave (M/S 0). Message sequence number
is used to match a request with the response Link
state header See BF Figure 13-37 LSA header
422. OSPF OSPF Packets for link-state Database
Updates
- Link state request packet
- After exchanging database description messages
with a neighbor, a router may discover that part
of its link-state database are out of date. - To request the neighbor supply updated
information, the router sends a link state
request message.
BF Figure 13-35 Link state request packet
432. OSPF OSPF Packets for link-state Database
Updates
- Link state update packet
- Link state update packet is the heart of the OSPF
operation. It is used by a router to advertise
the state of its links - Link state advertisements (LSA)
- Five different types
- Router link LSA
- Network link LSA
- Summary link to network LSA
- Summary link to AS boundary router LSA
- External link LSA
- Have common LSA headers with different bodies
- Reliable flooding
442. OSPF - Reliable flooding
- OSPF uses reliable flooding to ensure that LSA
are updated correctly. - Suppose that a routers local state has changed,
so the router wishes to update its LSA. The
router then issues a link-state update packet
that invokes the reliable flooding procedure. - Upon receiving such a packet, a neighbor router
examines the LSAs in the update. The neighbor
installs each LSA in the update that is more
recent than those in its database and then sends
an LSA acknowledgement packet back to the router.
These packets consists of a list of LSA headers - The router also prepares a new link-state update
packet that contains the LSA and floods the
packet on all interfaces other than the one in
which the LSA arrived. - All routers eventually receive the update LSA.
- Each router retransmits an LSA that has been sent
to a neighbors periodically until receiving
corresponding acknowledgement from the neighbor.
45BF Figure Link state update packet
OSPF common header
46BF Figure LSA header
Link state age Number of seconds elapsed since
this message was first generated. E indicates
the area is a stub area T indicates that the
router can handle multiple types of service. Link
state type Defines LSA type. Link state ID An
IP address. The value of this field depends on
the type of link. Advertising router The
IP address of the router advertising this
message. Link state sequence number A number
assigned to each link state update message. Link
state checksum Fletchers checksum based on the
whole packet except for the age field. Length
Defines the length of the whole packet in bytes.
472.0 OSPF OSPF packets for link-state updates
48Figure 13-24
49BF Figure Router link
50BF Figure Network link
51BF Figure Summary link to network
52BF Figure Summary link to AS boundary router
53BF Figure External link
54BF Figure Router link LSA
Link ID Defined in BF Table 13.3 Link data
Defined in BF Table 13.3 Link type Defined in BF
Table 13.3 of TOS Defines the number of types
of service (TOS) announced for each link TOS
Defines the type of service Metric Define the
metric for the corresponding TOS E flag is set
to 1 if the advertising router is an autonomous
boundary router (ABR) (E stands for external) B
flag is set to 1 if the advertising router is an
area border router
55Table Link types, link identification, and link
data for router link LSA
56BF Figure Link state acknowledgement packet
572. OSPF
- Comparing OSPF with RIP (OSPF is an enhancement
over RIP)
583. BGP
- The Border Gateway Protocol version4 is the de
facto standard interAS (inter-autonomous system)
routing protocol in todays Internet. - Defined in
- RFC 1771 A Boarder Gateway Protocol 4 (BGP-4)
- RFC 1772 Application of the Border Gateway
Protocol in the Internet - RFC 1773 Experience with the BGP-4 protocol
- RFC 1774 BGP-4 Protocol Analysis
- BGP has been designed to allow many kinds of
routing policies to be enforced in the interAS
traffic. - Typical policies involve political, security, or
economic considerations
593. BGP
- BGP can be characterized as a path vector
protocol - Propagate path information, such as the sequence
of ASs on a route to a destination AS - Does not specify how a specific route to a
particular destination should be chosen among the
routes that have been advertised. - BGP provides the mechanism to distribute path
information among the interconnected AS, but
leaves the policy for making the actual route
selections up the network administrator. - Policies are manually configured into each BGP
router. They are not part of the protocol
itself. - BGP peers
- BGP uses TCP as its transport protocol rather
than defining its own - After a neighbor BGP session is established, it
remains open unless specifically closed or unless
there is a link failure. - When tow neighbor routers are exchanging BGP
session and route information, they are said to
be BGP peers. - The route information exchanged between peers
includes the network number/AS path pair and
other route attributes