You are on page 1of 31

Master Course

Advanced Computer Networks

Lecture 5 (Part -2)


Unicast Routing Protocols

Dr. Mahmoud Shuker Mahmoud


Chapter
Outline

5.5 Link State Routing


5.6 OSPF
5-5 LINK STATE ROUTING
The primary problem in distance vector that the algorithm
often took too long to converge after the network topology
changed (due to the count-to-infinity problem). Consequently,
it was replaced by a new algorithm, now called link state
routing.

Link state routing has a different philosophy from that of


distance vector routing. In link state routing, if each node in
the domain has the entire topology of the domain—the list of
nodes and links, how they are connected including the type,
cost (metric), and the condition of the links (up or down)—the
node can use the Dijkstra algorithm to build a routing table.
Link State Routing
The idea behind link state routing is simple and can be stated
as five parts. Each router must:
1) Discover its neighbors and learn their network addresses.
2) Measure the delay or cost to each of its neighbors.
3) Construct a packet telling to all it has just learned.
4) Send the packet to all other routers.
5) Compute the shortest path to every other router.

Compared to distance vector routing, link state routing requires


more memory and computation. Also, the computation time grows
faster, Nevertheless, in many practical situations, link state routing
works well because it does not suffer from slow convergence
problems.
Figure 5.13 Concept of Link state routing
Figure 5.14 Link state knowledge
Building Routing Tables
▪ Creation of the states of the links by each node,
called the link state packets (LSP)
▪ Dissemination of LSPs to every other routers,
called flooding
▪ Formation of a shortest path tree for each node
▪ Calculation of a routing table based on the
shortest path tree
Link-State Updates

Link-State Routing Process

Note: This process is the same for both OSPF for IPv4 and OSPF for IPv6.
Link-State Updates

Link and Link-State


The first step in the link-state
routing process is that each router
learns its own directly connected
networks.
Link-State Updates

Say Hello
The second step in the link-state
routing process is that each router
uses a Hello protocol to discover
any neighbors on its links.
When two link-state routers learn
that they are neighbors, they form
an adjacency.
If a router stops receiving Hello
packets from a neighbor, that
neighbor is considered
unreachable.
Link-State Updates

Building the Link-State Packet


The third step in the link-state
routing process is that each router
builds a link-state packet (LSP) that
contains the link-state information
about its links.
R1 LSP (in diagram) would contain:
◦ R1; Ethernet network 10.1.0.0/16;
Cost 2
◦ R1 -> R2; Serial point-to-point
network; 10.2.0.0/16; Cost 20
◦ R1 -> R3; Serial point-to-point
network; 10.3.0.0/16; Cost 5
◦ R1 -> R4; Serial point-to-point
network; 10.4.0.0/16; Cost 20
Link-State Updates

Flooding the LSP


The fourth step in the link-state
routing process is that each router
floods the LSP to all neighbors.
An LSP only needs to be sent:
◦ During initial startup of the routing
protocol process on that router (e.g.,
router restart)
◦ Whenever there is a change in the
topology (e.g., a link going down)

An LSP also includes sequence


numbers and aging information:
◦ used by each router to determine if it
has already received the LSP.
◦ used to determine if the LSP has
newer information.
Link-State Updates

Building the Link-State Database


The final step in the link-state routing process is that each router uses the database
to construct a complete map of the topology and computes the best path to each
destination network.
Link-State Updates

Building the SPF Tree


Each router uses the link-state
database and SPF algorithm to
construct the SPF tree.
◦ R1 identifies its directly connected
networks and costs.
◦ R1 adds any unknown networks and
associated costs.
◦ The SPF algorithm then calculates the
shortest paths to reach each individual
network resulting in the SPF tree shown in
the diagram.

Each router constructs its own


SPF tree independently from all
other routers.
Link-State Updates

Adding OSPF Routes to the


Routing Table
Using the shortest path
information determined by
the SPF algorithm, these best
paths are then added to the
routing table.
Directly connected routes and
static routes are also included
in the routing table.
Link-State Routing Protocol Benefits

Why Use Link-State Protocols?


Link-State Routing Protocol Benefits

Disadvantages of Link-State Protocols


Disadvantages of Link-State protocols:
◦ Memory Requirements - Link-state
protocols require additional
memory.
◦ Processing Requirements - Link-state
protocols can require more CPU
processing.
◦ Bandwidth Requirements - The
flooding of link-state packets can
adversely affect bandwidth.

Using multiple areas can reduce the size of the link-state databases. Multiple areas can
limit the amount of link-state information flooding and send LSPs only to those routers
that need them.
Figure 5.15 Forming shortest path three for router A in a graph
Figure 5.15 Continued
Example 5.6
Find the shortest path by using Dijkstra's Algorithm for the network below,
when router A is the source and the router F is the destination.
5-6 OSPF
The Open Shortest Path First (OSPF) protocol is an
intra-domain routing protocol based on link state
routing. Its domain is also an autonomous system.
Area in OSPF (1)
❑ A collection of networks with area ID
❑ Routers inside an area flood the area with routing
information
❑ Area border routers summarize the information about the
area and send it to other areas
❑ Backbone area and backbone routers
◦ All of the area inside an AS must be connected to the
backbone
Area in OSPF (2)
Virtual link
◦If, because of some problem, the
connectivity between a backbone and an
area is broken, a virtual link between
routers must be created by the
administration to allow continuity of the
functions of the backbone as the primary
area
Figure 5.16 Types of links
Figure 5.17 link types
Figure 5.18 Types of OSPF packet
Figure 5.19 OSPF Link state update packet
Hierarchical OSPF (Multi-area OSPF)

• Two-level hierarchy:
local area, backbone.
• Link-state
advertisements only in
area

• Each node has detailed area topology; only know direction (shortest path) to
nets in other areas.
• Area border routers: “summarize” distances to nets in own area, advertise to
other Area Border routers.
• Backbone routers: run OSPF routing limited to backbone.
• Boundary routers: connect to other AS’s.
Note

OSPF packets are encapsulated in


IP datagrams.

You might also like