0% found this document useful (0 votes)
14 views62 pages

Lecture 6+7 DT

Uploaded by

kamilka.swiercz
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)
14 views62 pages

Lecture 6+7 DT

Uploaded by

kamilka.swiercz
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
You are on page 1/ 62

Institute of Telecommunications

Warsaw University of Technology


2024

Data Transmission
• Piotr Gajowniczek
• Andrzej Bąk
IP routing

principles & protocols


Types of dynamic routing protocols

• Distance vector protocols


❑ Routers periodically exchange routes (with metrics) with neighbors
• Routers do not have the knowledge about network topology, they only know
the cost of links to neighbors and neighbors’ routes
❑ Routers use the Bellman-Ford algorithm to actualize their routing tables
(selects the leased cost paths)
• After receiving update from the neighbor, router adds cost of the link to that
neighbor to every received route
• When router gets updated from all neighbors it chooses paths with leased
costs
• Link state protocols
❑ Routers periodically exchange network topology information (about links,
metrics, prefixes)
• Routers maintain topology database
❑ After receiving update from the neighbor, the router adds obtained links
(metrics and prefixes) to the topology database
❑ Finally, the router uses Dijkstra algorithms to calculate least-cost paths and
actualize its routing table
Routing in the Internet

• The Internet is organized as a set of independent Autonomous


Systems (AS)
❑ the AS is a part of the network (collection of routers, networks) under
single technical administration
❑ the AS appears to the outside world as having a coherent routing plan and
presents unique view on what destinations are reachable through it
• The AS can use many different routing protocols
❑ the routing protocols used inside the AS are called the Interior Routing
Protocols (IGP)
• A separate protocol is used to transfer information between ASs
❑ the routing protocol used between the ASs is called the Exterior Routing
Protocol (EGP)
IP routing

RIP protocol
Routing Information Protocol (RIP)

• RIP is an IGP protocol based on the Bellman-Ford algorithm (or


distance vector principle)
❑ Routers exchange „distances” to networks
• distance = the cost of path to destination network
• RIP versions
❑ RIPv1/RIPv2 – routing protocols for IPv4
❑ RIPng – routing protocol for IPv6
Routing Information Protocol (RIP)

• Simple and easy to implement


• RIP is developed for small networks and has limitations
❑ The longest path is limited to 15 hops
❑ Slow convergence time
❑ Counting to infinity for loop resolution
❑ Fixed (hop) metrics
• Metric doses not reflect link capacity
Distance vector protocols

• How to find the least cost path assuming,


that the node dose not know the network
topology? 3
❑ Let’s assume that the neighbors know the cost of 4
the least cost path from themselves to a given
target and that this knowledge is available to given 5
node
❑ Let’s further assume that the costs of the links 3
1
between the given node and the neighbors are 1 2
also known
❑ Then the node can locally calculate the least cost
path to a given target by adding the cost of the link 2
to given neighbor and the cost of the path from 5
3
that neighbor and finally selecting the neighbor,
that give the smallest cost
Distance vector protocols

• Bellman-Ford equation (dynamic programming):


• let
d(x,y) = cost of least-cost path from x to y
• then
d(x,y) = min {c(x,v) + d(v,y) }
v

cost from neighbor


v to destination y
cost to neighbor v

min taken over all neighbors v of x


Distance vector protocols

• How to find least cost paths in practice:


❑ initially each node x only records path costs to direct targets in D(x,y)
❑ then, from time-to-time, each node sends its known costs estimates to
direct neighbors (we call this data distance vector DV)
• when node receives new DV estimates from its neighbors, it
updates its own DV using B-F equation:
D(x,y) ← minv{c(x,v) + D(v,y)} for each node y ∊ N
• Under minor, natural conditions, the estimate D(x,y) converges to
the actual least cost d(x,y)
• Storing all neighbors DV is not necessary, B-F equation can be
executed iteratively for each received neighbor's DV
D(x,y) ← min{D(x,y) , c(x,v) + D(v,y)} for each node y ∊ N
New estimate of path Old estimate of path
cost from x to y cost from x to y
Distance vector protocols

• Routers advertise paths to the IP networks (not nodes)


• Initially routers know only directly connected networks
• The distance vectors are initialized with directly connected networks
❑ The cost of directly connected networks is the cost of its interface (e.g. 1)
• The information about directly connected networks are distributed to
the neighbors, then neighbors of neighbors etc.

net1 net1
Inicjalizacja
D(net1)=0 1 1
RT: net1, 1, direct
RT: net1, 0+1, direct a a
D(net1)=1
D(net1)=1
1 3

1
RT: net1, 2, via a b c RT: net1, 4, via a

5 4 2

1
d e
Distance vector protocols

• Routers advertise paths to the IP networks (not nodes)


• Initially routers know only directly connected networks
• The distance vectors are initialized with directly connected networks
❑ The cost of directly connected networks is the cost of its interface (e.g. 1)
• The information about directly connected networks are distributed to
the neighbors, then neighbors of neighbors etc.

net1
Inicjalizacja
1
RT: net1, 1, direct
a

1 3

1 D(net1)=4
RT: net1, 2, via a b c RT: net1, 4, via a
D(net1)=2
D(net1)=2 D(net1)=4
5 4 2
D(net1)=2
RT: net1, 7, via b 1 RT: net1, 6, via c
d e
Distance vector protocols

• Routers advertise paths to the IP networks (not nodes)


• Initially routers know only directly connected networks
• The distance vectors are initialized with directly connected networks
❑ The cost of directly connected networks is the cost of its interface (e.g. 1)
• The information about directly connected networks are distributed to
the neighbors, then neighbors of neighbors etc.

net1
Inicjalizacja
1
RT: net1, 1, direct
a

1 3

1 D(net1)=3
RT: net1, 2, via a b c RT: net1, 3, via b,

D(net1)=3
5 4 2

RT: net1, 7, via b 1 RT: net1, 5, via c


d e
Distance vector protocols

• Routers advertise paths to the IP networks (not nodes)


• Initially routers know only directly connected networks
• The distance vectors are initialized with directly connected networks
❑ The cost of directly connected networks is the cost of its interface (e.g. 1)
• The information about directly connected networks are distributed to
the neighbors, then neighbors of neighbors etc.

net1
Inicjalizacja
1
RT: net1, 1, direct
a

1 3

1
RT: net1, 2, via a b c RT: net1, 3, via b,

5 4 2

RT: net1, 6, via e 1


d e RT: net1, 5, via c
D(net1)=5
Building a routing table

Route r from router B


Add metric of incoming interface to r

Received
No route r Yes
known ?

Metric Router B =
No reachable Yes current next No
(<16)? Yes hop
Ignore route r
Metric
No Metric
r=current?
r>current?
Yes Smaller
Greater

Equal
(1) Add new entry for (1) Change metric (1) Reset timeout (1) Change metric
route r of route r for route r of route r
(2) Reset timeout (2) Reset timeout (2) Change next hop
(3) Set Change flag (3) Set Change flag for route r Ignore route r
(3) Reset timeout
(4) Set Change flag
Periodic updates

• RIP routers exchange information about known paths in periodic


fashion to refresh the routing entries
• Periodic exchange of routing information keeps the routing tables
up to date
❑ Each routing entry is associated with timer
❑ When the route entry is not refreshed within some time it is deleted
❑ The default update interval is 30 sec.
• The full routing information is sent neighbors

Full Full
Routing information Routing information

A B C
Handling network topology changes

• Deleted or invalid routes are handled by timeout mechanism


❑ When the directly connected network is detected to be lost, it is declared
as unreachable and excluded from routing updates
❑ Lost routes in remote nodes are handled by timing out the routing table
entries
• When the update for particular destination is not seen for some time, the
destination is declared to be unreachable and removed from routing table
• The default timeout is 180 seconds
• New routes or routes for which the cost has been changed
(without the change of next hop) can be handled by the periodic
updates
• Routes for which the path has changed resulting in increase of
the path cost are first timeout and than reinstalled by periodic
update
RIP convergence time

• Handling changes only by periodic updates and timeout


mechanism would result in very slow protocol convergence times
• RIP implements additional mechanisms that improve the
convergence time
❑ Route poisoning
❑ Split horizon w with poison reverse
❑ Triggered updates
• The above mechanisms are used together with periodic updates
Route poisoning

• When router detects route un-reachability it does not delete it


immediately from routing table
❑ Lost route is kept in routing table for some time i.e. garbage-collection
time
❑ The route metric is set to infinity (16)
❑ The route is advertised to neighbors with cost of infinity
• When router receives route with cost of infinity it changes its
metric to infinity (and starts the garbage-collection timer)
❑ The route is being included in routing updates until the garbage-collection
timer expires.
• Route poisoning slightly improves the protocol convergence time
❑ There is no need to wait for timeout to detect lost routes
❑ However periodic update is still slow
Resolving routing loops: counting to infinity

• (1) Router a advertises route net1 with cost 1


• (2) Router b installs route net1 with cost 1+1=2
and sets router a as next hop
• (3) Router a declares net1 as unreachable and net1, 1, direct (1)
(2)
sets its cost to infinity ignore
net1, 2, via a

• (4) Before a sends update, router b sends update net1 1


to net1 with cost 2 a
1
b
• (5) Router a installs again route net1 with cost 3
and sets router b as next hop (3) net1=16

• (6) Router a sends update to rutera b with cost 3 (5) net1, 3, via b
(4)
(7)
• (7) Router b sets cost of net1 to 4 etc. (6)
net1, 4, via a
• ……… net1, 5, via b
• (8) The loop is resolved when the metric for net1 net1, 6, via a
hits infinity
• The „counting to infinity” results from the fact
that router b advertises route net1 to router a net1, 15, via b
which was the source of the original route to (8)
net1, 16, -
net1 net1, 16, -

• Split horizon mechanism aims to resolve the


above problem
Split horizon

• A router never sends information about a route in the direction


from which the original information came
❑ If the next-hop is the same as neighbor address the update is not
forwarded to that neighbor
• Split horizon eliminates loops between directly connected routers
in most cases (but not all) 2

1 1 1
net1 x a b c
Link down RT: net1, 3, via a
RT: net1, 2 via x Update for net1 Split horizon:
1) Router a losses path to net1 from a send update
c <> next hop
it stops sending update for this route
Split horizon:
don’t send update Timeout for net1
2) Router b will not see an update for net1 a = next hop
Update for net1
from c
3) Router b deletes route to net1 after RT: net1, 4, via c
timeout RT: net1, 5, via b
Split horizon: Split horizon:
send update don’t send update
4) Router b will finally learn new route to a <> next hop c = next hop
net1 from router c
Split horizon with poison reverse

• The split horizon with poison reverse is used to reduce the chance
of forming routing loops.
• A router sends information about a route in the direction from
which the original information came with cost of infinity
• This mechanism breaks the loop between adjacent routers
immediately
Split horizon
apply
b b
Router X
fails
Split horizon Loop is formed
net1 x do not apply
net1 x (counting to infinity
occurs)

b
Split horizon a a
apply Split horizon with
poison reverse
net1 x immediately breaks
the loop
Router X
fails
a
Split horizon with poison reverse + route poisoning

• With split horizon and route poisoning the invalid routes can be
reinstalled without waiting for timeout
2

1 1 1
net1 x a b c
RT: net1, 3, via a
1) Router a losses path to net1 RT: net1, 2 via x Update for net1
it sends update for this route with cost 16 from a

(route poisoning)
Split horizon w. Split horizon w.
poison reverse: posion reverse
2) Router b deletes route to net1 send update send update
net 1 cost=16 net1 cost=3
a=next hop c <> next hop
3) Router b will finally learn new route to
net1 from router c and further send it to a net1 cost=16 Update for net1
from c

Split horizon w. RT: net1, 4, via c


posion reverse
send update
net1 cost=4
a <> next hop
Triggered updates

• Periodic updates leads to slow convergence time


• Triggered updates allow to send routing actualization
immediately after the change occurs (irrespectively if the change
was caused by update from another neighbor or occurred locally
on the router)
❑ Triggered update contains only changed routes
❑ The routes are selected based on the „Change Flag”
• Triggered update improves the convergence time
❑ All changes are immediately propagated over the network
• Whenever the update causes the change of some route (indicated by Change
Flag) the update is propagated to other neighbors etc.
❑ The update process stops when there is no change in any routing table in
the network
RIP timers

• Update timer - every 30 seconds the RIP process sends response


message to its neighbors
❑ to prevent message synchronization (especially on broadcast networks)
the timer must be independent of the system load or small offset +-5
seconds used
• Timeout timer – the timeout is initialized when the route is
established, the route timeout is 180 seconds
• Garbage-collection timer – after the route is declared to be
deleted it is kept in the routing table and included in the update
messages for 120 second
❑ if new update for the deleted route comes before the garbage timer
expires the route is updated and the timer is cancelled
RIP messages

• RIPv1/v2/ng messages are sent over UDP protocol


❑ RIPv1/v2 uses port number 520
❑ RIPng uses port number 521
• Two RIP message types are defined
❑ Request – used to request routing information from neighbor
❑ Response – used to send routing information to neighbor
• The response messages are sent by periodic and triggered
updates
• Router can also request routing information form neighbor using
RIP’s request message
❑ done on router boot up
IP routing

OSPF protocol
Open Shortest Path First

• OSPF is an IGP protocol based on the Dijkstra algorithm


• OSPF uses IP as its transport protocol
❑ OSPF is protocol number 89
• OSPF main characteristics
❑ Hierarchical routing - area definition
❑ Support for CIDR
• subnet and mask propagation
❑ No network topological limits
❑ Single dimensionless metrics - link cost (weight)
• links costs are usually set in proportion to the bandwidth
❑ Load balancing over equal cost paths (up to 6 paths)
❑ Security: all OSPF messages authenticated (to prevent malicious intrusion)
❑ Integrated uni- and multicast support:
• Multicast OSPF (MOSPF) uses same topology database as OSPF
Open Shortest Path First

• OSPF maintains a complete database of topology information


(LSDB)
❑ Routers have full knowledge of distant routers and how they interconnect
❑ Link State Advertisement (LSA) are used to transmit data required to build
the topological database
❑ Shortest Path First (SPF) algorithm (Dijkstra) is used to build an SPF tree
(and routing table),
❑ Updates are triggered by link-state topology changes

LSA SPF

source: Alcatel-Lucent
OSPF scalability

• In large networks the following issues may arise


❑ Frequent routing table recalculation
• in large network link state changes are inevitable
• the larger the network the more frequently a link in the network will go out of
service causing recalculation
• high CPU utilisation
❑ Large topology database
• more LSA data to store - larger LSDB
❑ Large routing tables
• each router has at least one entry in the routing table per each destination
• large memory requirements
❑ Significant routing traffic in the network
• link bandwidth is consumed by routing traffic
• less bandwidth available to data packets
Hierarchical OSPF (multiarea OSPF)

• In OSPF large network can be split into multiple areas


• Individual LSA updates are not propagated out of the area so the
change in one area does not incur routing table recalculation
outside of this area
❑ reduced routing traffic in the network – more bandwidth available to data
packets
❑ decreased router CPU utilization
❑ smaller LSDB
• OSPF areas allow to implement hierarchical routing
❑ the detailed routing information is kept within an area
❑ the route summarisation can be done for the routes that are sent out of
the area, with proper addressing even only one route can be propagated
out of the area (smaller routing tables)
• better convergence time
Hierarchical OSPF (multiarea OSPF)

area
border boundary router (ASBR)
routers backbone router
(ABR)

backbone

area 3

internal
area 1 routers

area 2

boundary router (ASBR)


LSDB

• Each router maintains LSDB (Link State Database) describing the


network topology
• Routers periodically send LSA (Link State Advertisement)
messages used to update the network topology
❑ LSA message are flooded over the network
❑ The flooding scope depends on the message type
❑ The received LSA messages are stored in LSDB (representing graph vertexes
and edges)
• The routers run Dijkstra algorithm to build the routing table
Router LSA (type 1)

• Generated by each router in the OSPF domain


• Flooded throughout a single area (the area of the originator)
• Identified by
❑ Link State ID = Router ID
• Describes the router's links
❑ Each link is identified by Link ID
❑ Types of links
• Point-to-point link : Link ID = Neighbor Router ID
• Link to transit network: Link ID = network address of the DR router
• Link to stub network: LinkID = network address of the interface
• Virtual link: Link ID = Neighbor Router ID
• In LSDB
❑ Router LSA represents vertex
❑ Each link is interpreted as pointer to another vertex
Router LSA example

R4# show ip ospf database router

OSPF Router with ID (4.4.4.4) (Process ID 1)

Router Link States (Area 1) Stub network Transit network


192.168.1.0/24 172.16.14.0/24
LS age: 321
Router ID = 1.1.1.1
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 1.1.1.1 R1
Advertising Router: 1.1.1.1 192.168.1.1 172.16.14.1
R2
LS Seq Number: 8000000B
Checksum: 0x966C DR
Length: 48
172.16.14.2
Area Border Router
Number of Links: 2
Router LSA
Link connected to: a Stub Network (Link State ID: 1.1.1.1)
(Link ID) Network/subnet number: 192.168.1.0
(Link Data) Network Mask: 255.255.255.0
Number of TOS metrics: 0
TOS 0 Metrics: 1 IP address of DR router interface
R4
Link connected to: a Transit Network
(Link ID) Designated Router address: 172.16.14.2
(Link Data) Router Interface address: 172.16.14.1
Number of TOS metrics: 0
TOS 0 Metrics: 10
Router LSA example

R4# show ip ospf database router

OSPF Router with ID (4.4.4.4) (Process ID 1)


Numbered p-p link
Router Link States (Area 1)

LS age: 321
Router ID = 1.1.1.1 Router ID = 2.2.2.2
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 1.1.1.1 R1 R2
Advertising Router: 1.1.1.1 192.168.2.1 192.168.2.2
LS Seq Number: 8000000B
Checksum: 0x966C Network
Length: 48
192.168.2.0/24
Area Border Router
Number of Links: 2
Router LSA
Link connected to: another Router (point-to-point) (Link State ID: 1.1.1.1)
(Link ID) Neighboring Router ID: 2.2.2.2
(Link Data) Router Interface address: 192.168.2.1
Number of TOS metrics: 0
TOS 0 Metrics: 64
R4
Link connected to: a Stub Network
(Link ID) Network/subnet number: 192.168.2.0
(Link Data) Network Mask: 255.255.255.0
Number of TOS metrics: 0
TOS 0 Metrics: 64

IP network address on P-P link


Router LSA example

R4# show ip ospf database router

OSPF Router with ID (4.4.4.4) (Process ID 1)

Router Link States (Area 1)

LS age: 321
Router ID = 1.1.1.1 Router ID = 2.2.2.2
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 1.1.1.1 R1 R2
Advertising Router: 1.1.1.1
LS Seq Number: 8000000B
Checksum: 0x966C
Unnumbered p-p link
Length: 36
Area Border Router
Number of Links: 1
Router LSA
Link connected to: another Router (point-to-point) (Link State ID: 1.1.1.1)
(Link ID) Neighboring Router ID: 2.2.2.2
(Link Data) Router Interface address: 0.0.0.10
Number of TOS metrics: 0
TOS 0 Metrics: 64
R4
MIB-II ifIndex of P-P link
Network LSA (type 2)

• Originated for broadcast and NBMA networks by the DR router


• Flooded throughout a single area (the area of the originator)
• Identified by
❑ Link State ID = network address of the DR router interface
• Contains Router IDs of all routers connected to the transit
network (including the DR router ID)
• In LSDB
❑ Network LSA represents vertex
❑ Each Router ID is interpreted as pointers to Router LSA(s)
Network LSA example
LAN network
R4# show ip ospf database network
172.16.14.0/24
OSPF Router with ID (4.4.4.4) (Process ID 1)
172.16.14.3
Net Link States (Area 0)

Routing Bit Set on this LSA in topology Base with MTID 0


R3
LS age: 170 Router ID
Options: (No TOS-capability, DC) = 3.3.3.3
LS Type: Network Router ID = 1.1.1.1
Links Link State ID: 172.16.14.2 (address of Designated Router)
Advertising Router: 2.2.2.2 Router ID
R1 = 2.2.2.2
LS Seq Number: 80000007
Checksum: 0x8FB6 172.16.14.1
Length: 36
Network Mask: /24
R2/DR
Attached Router: 2.2.2.2 172.16.14.2
Attached Router: 3.3.3.3
Attached Router: 1.1.1.1
Network LSA
(Link State ID: 172.16.14.2)

R4
Summary LSA (type 3)

• originated by area border routers


• flooded throughout single area
• Type 3 - describes a route to a destination outside the area (but
inside the AS)
❑ ABR router learns the destination addresses form Router LSA and Network
LSA of given area
❑ Link State ID = IP network address (IP network number)

Area 0 Area 1
LSA 3 LSA 3
with net2 with net1

ABR
net1 LSA 1/2 LSA 1/2 net2
with net1 with net2
Summary LSA type 3 example

R4# show ip ospf database summary Stub network Transit network


172.16.13.0/24 172.16.12.0/24
OSPF Router with ID (4.4.4.4) (Process ID 1)

Summary Net Link States (Area 1)


R5

LS age: 608
Options: (No TOS-capability, DC, Upward) Network LSA (transit network)
LS Type: Summary Links(Network) Router LSA (stub network)
Link State ID: 172.16.12.0 (summary Network Number)
Advertising Router: 1.1.1.1
LS Seq Number: 80000007
Checksum: 0xC567 Router ID = 1.1.1.1
Length: 28 Area ID 0
Network Mask: /24 R1/ABR Area ID 1
Metric: 64

LS age: 710
Options: (No TOS-capability, DC, Upward) Summary LSA 3
LS Type: Summary Links(Network) (Link State ID: 172.16.12.0)
Link State ID: 172.16.13.0 (summary Network Number) Summary LSA 3
Advertising Router: 1.1.1.1
LS Seq Number: 80000007
(Link State ID: 172.16.13.0)
Checksum: 0xA234
Length: 28
Network Mask: /24
Metric: 64 R4
….
Summary LSA (type 4)

• originated by area border routers


• flooded throughout single area
• Type 4 – informs about the presence of ASBR outside the area
❑ ABR learns the presence of ASBR from its Router LSA
❑ Link State ID = ASBR Router ID

Area 0 Area 1
LSA 4 LSA 4
with ASBR2 with ASBR1

ABR
ASBR1 LSA 1 LSA 1 ASBR2
from ASBR1 from ASBR2
Summary LSA type 4 example

R4# show ip ospf database asbr- summary


Router ID = 5.5.5.5
OSPF Router with ID (4.4.4.4) (Process ID 1)

Summary ASB Link States (Area 1)


ASBR

LS age: 608
Options: (No TOS-capability, DC, Upward) Router LSA
LS Type: Summary Links(AS Boundary Router) (Link State ID: 5.5.5.5, ASBR)
Link State ID: 5.5.5.5 (AS Boundary Router)
Advertising Router: 1.1.1.1
LS Seq Number: 80000007
Checksum: 0xC567 Router ID = 1.1.1.1
Length: 28 Area ID 0
Network Mask: /0 R1/ABR Area ID 1
Metric: 10

Summary LSA 4
(Link State ID: 5.5.5.5)

R4
External LSA (5)

• originated by AS boundary routers (ASBR)


• flooded throughout the AS (except stub area)
• describes a routes to a destination in another Autonomous
System or default route
• The location of advertising router (ASBR) is obtained from
Summary LSA type 4
• External route metric
❑ type 1 - sums the external metric with the cost of internal path to ASBR
❑ type 2 - only external metric is considered
External LSA (5) - example

R4# show ip ospf database external


Router ID = 5.5.5.5
OSPF Router with ID (4.4.4.4) (Process ID 1)

Type-5 AS External Link States


ASBR

LS age: 1434
Options: (No TOS-capability, DC, Upward) External LSA
LS Type: AS External Link (Link State ID: 172.80.1.0)
Link State ID: 172.80.1.0 (External Network Number)
Advertising Router: 5.5.5.5
LS Seq Number: 80000002
Checksum: 0x980 Router ID = 1.1.1.1
Length: 36 Area ID 0
Network Mask: /24 R1/ABR Area ID 1
Metric Type: 2 (Larger than any link state path)
Metric: 20
Forward Address: 0.0.0.0
External Route Tag: 0
External LSA
(Link State ID: 172.80.1.0)

R4
LSDB – building network topology graph

• Vertexes Network topology


❑ Router LSA - represents routers
R1 20
❑ Network LSA - represents transit links 10
(broadcast or NBMA networks) 0
• Directed Edges 10
0 T 0
❑ Router-to-router R2 20
20
• Obtained from point-to-point links in 5 R5
Router LSA 5
R6
• In LSDB represented as pointer between T 0
5
10
10
0
Router LSA(s) 5
5 R4 R7
❑ Router to transit link
R3
• Obtained from transit link in Router LSA
• In LSDB represented as pointer between
Router LSA and Network LSA Legend:

❑ Transit link to router R Router


• Obtained from Network LSA T Transit link
• In LSDB represented as pointer between
Network LSA and Router LSA
LSDB – building routing table

• Router runs Dijkstra algorithm SPF tree


to find SPF
10 R1 20
• Router adds information net 4

about IP subnets to the SPF net 1


0 T
tree R2
0

Subnets internal to the area 5 R5



net 5 R6
• Obtained from Router LSA (stub T
ABR1
10
ABR2
0 0
link) and Network LSA R4 R7
60 70
❑ Subnets external to the area R3 20
net 7 net 2 10 net 7
net 6 net 6
• Obtained from Summary LSA 3 net 3

and External LSA


❑ ASBR routers external to the Legend: Subnets internal to the area

area Router LSA


Stub link
Network LSA

• Obtained from the Summary Subnets external to the area


LSA 4 and External LAS 5 External LSA
Summary (3) LSA
&Summary (4) LSA
LSA flooding

• OSPF router sends LSA messages periodically every 30 minutes or


whenever there is a change in network topology (links state)
❑ LSA is generated with sequence number
❑ LSA is broadcast over the network (according to its scope)
❑ routers track the LSA sequence numbers to determine which LSA is newer
• Only newer LSA are propagated further

LSA (100)
R2 R4
LSA (100) ignore
LSA (100)
R1 LSA (100)
LSA (100) update

LSA (100) R3 R5
LSA (100)
LSA flooding (standard areas)

• R2 ABR (between area 0 i 10)


• R3 ASBR
LSA flooding (STUB area)

• R2 ABR (between area 0 i 10)


• All routers in the area must be configured with stub option
R1(config-router)# area 10 stub
• STUB area cannot contain ASBR routers
• Default route is used for external traffic (injected by ABR using
LSA 3)
• LSA 3 messages are used for inter-area traffic
LSA flooding (Totally STUB area)

• R2 ABR (between area 0 i 10)


• All routers in the area must be configured with stub option
R1(config-router)# area 10 stub no-summary
• Totally STUB area cannot contain ASBR routers
• No LSA messages exchange between areas
• Default route is used for external and inter-area traffic (injected
by ABR using LSA 3)
OSPF packets

• Hello packet – used to establish and maintain the adjacency


relationship
❑ Neighbor discovery
❑ DR/BDR routers election
• Database Description (DD) – used to exchange sequence
numbers of the LSA messages contained in the router LSDB
❑ LSDB synchronization
• Link State Request (LSR) – used to request a certain LSA from
neighbor LSDB
❑ LSDB synchronization
• Link State Update (LSU) – used to send LSA messages
❑ LSDB synchronization
❑ LSA flooding
• Link State Acknowledgement (LSAck) – used to acknowledge the
reception of Links State Update packet
Hello protocol

• Hello protocol is used for establishing neighbor relationship


(adjacency)
❑ On broadcast network it is used to elect Designated Router (DR) and
Backup Designated Router (BDR)
❑ All other routers establish adjacency with DR and BDR
• Hello protocol is used for keep alive procedure
❑ Hello packets are periodically sent out from each router interface with the
multicast IP address 224.0.0.5 (allOSPFRouters)
❑ typically, the hello packets are sent every 10 seconds
• Hello protocol is used to discover changes in the network
topology
❑ link failures/deletion
❑ link addition
Hello Protocol

• DR/BDR routers election


❑ via the exchange of hello packets router learns about its neighbours on the
network
❑ the router with the highest priority becomes DR router
❑ the router with the second priority in order becomes the BDR router
❑ the BDR router becomes active when the DR router goes out of service
• Each router on the network establishes adjacency with the DR
and BDR routers
• Only the DR router sends LSA messages for given network
❑ DR router represents the broadcast network to other routers
❑ this decreases the routing traffic
Hello Protocol

172.16.5.1/24 172.16.5.2/24

Down state A E0 E1 B Down state

Hello packet I am router ID 172.16.5.1 and I see no one


Init state
Router B
Neighbour list
172.16.5.1/24 int E1

I am router ID 172.16.5.2 and I see 172.16.5.1


Two way state
Hello packet
Router A Init state
Neighbour list
172.16.5.2/24 int E0
Two way state
I am router ID 172.16.5.1 and I see 172.16.5.2
Exchange Protocol

• Exchange protocol is used to


synchronise the neighbour exstart state
Router A Router B
routers LSDB databases
• Adjacent routers start to I=1, M=1, MS=1 SN=x
Content = Empty
exchange routing information
❑ the master-slave relationship is
I=1, M=1, MS=1 SN=y
established via initial DD packets Content = Empty
exchange
• It is used to synchronise the
sequence number used to provide I=0, M=1, MS=0 SN=y
reliable packet exchange Content = Empty

❑ the router with the higher Router ID


becomes the master B wins
(becomes Master)

exchange state
Exchange Protocol

• Adjacent routers exchange DD exchange state


Slave Master
packets to learn the LSA sequence I=0, M=1, MS=1 SN=y+1
numbers in the neighbour LSDB Content = LSA Headers

❑ the sequence number is increased by


master every time the new packet is I=0, M=1, MS=0 SN=y+1
Content = LSA Headers
send
• the slave always expect packet with
sequence number higher by one then I=0, M=1, MS=1 SN=y+2
the previous one Content = LSA Headers

• In this way master acknowledge packet


received from slave I=0, M=1, MS=0 SN=y+2
Content = LSA Headers
❑ the slave always sends DD packets with
the sequence number received from
last master DD packet I=0, M=0, MS=1 SN=y+3
Content = LSA Headers/Empty
• master always expects packets with the
same sequence number as sent to the
slave I=0, M=0, MS=0 SN=y+2
• In this way slave acknowledge packet Content = LSA Headers/Empty
received from master
Exchange Protocol

Slave exchange state Master

I=0, M=1, MS=0 SN=y+1


Content = LSA Headers Master’s packet is
lost

I=0, M=1, MS=1 SN=y+2


Content = LSA Headers

Timeout expires
Slave retransmits Duplicate is ignored
message with y+1 I=0, M=1, MS=0 SN=y+1
Content = LSA Headers (Master expects
packet with y+2)

I=0, M=1, MS=1 SN=y+2


Content = LSA Headers

Master retransmits
I=0, M=1, MS=0 SN=y+2 packet with y+2
Content = LSA Headers
Exchange Protocol

Slave exchange state Master

Slave’s packet is I=0, M=1, MS=1 SN=y+1


lost Content = LSA Headers

I=0, M=1, MS=0 SN=y+1


Content = LSA Headers Timeout expires
Master retransmits
message with y+1
I=0, M=1, MS=1 SN=y+1
Duplicate is ignored Content = LSA Headers
(Slave expects
packet with y+2)
I=0, M=1, MS=0 SN=y+1
Content = LSA Headers
Master retransmits
packet with y+1

if mismatch in sequence numbers is detected on the master or slave the whole


procedure is restarted
Exchange Protocol

• Each router compares the


received LSA sequence numbers Router A loading state Router B
with those it has, if some LSAs
are older it sends the LSR (Link LSR
State Request) packet for these
LSAs
• The other router responses with LSU

the LSU (Link State Update)


packet that contains full LSAs LSAck
information
• The router acks the LSU packet
• After the exchange protocol
reaches full state (no differences
in LSDB) each router pre-
computes its routing table entries full state
Routing table maintenance

• LSU packets are flooded to all routers in the OSPF area each time
there is a topology change on one of the links directly connected
to the router
• If there are no topology changes, the router will flood its LSAs
every 30 minutes.
❑ every LSA has a maximum age of 60 minutes.
❑ an OSPF router will age all LSAs in its link state database and will purge any
LSAs for which it has not received a refresh in the last 60 minutes.
• LSU packets are sent to
❑ multicast address 224.0.0.5 on point-to-point links
❑ multicast address 224.0.0.6 on broadcast networks when sending to
DR/DBR routers
❑ multicast address 224.0.0.5 on broadcast networks when sending by DR to
non-DR routers
• After router receives LSU it re-computes its routing table
OSPF metric

• OSPF metric for an interface is automatically calculated based on


the OSPF reference bandwidth which, by default, is 100 Mbps.
❑ the metric is calculated by dividing the reference bandwidth by the actual
bandwidth of the link
❑ example: 10 Mbps link -> metric = 10
❑ with default reference bandwidth the cost for links of capacity higher then
100 Mbps will be always 1
• Alternatively, the OSPF metric of an interface can be configured
manually
• The default metric of loopback interface is zero

You might also like