Title: Open Shortest Path First OSPF
1Open Shortest Path First OSPF
2Limitations of RIP
- Limit of 15 hops
- Class based protocol
- Overhead over the links?
- Slow convergence
- Metric
- Protocol for flat networks
3The Response is OSPF
- Link state or SPF technology
- Developed by OSPF Working Group of IETF (not
proprietary) - Designed for TCP/IP Internet environment
- Documented in rfc 1583, rfc 2178
4OSPF Solutions
- No limitation on hop count
- Supports classless routing
- Routing updates sent only when only when there is
a change - Faster convergence then RIP
- Better load balancing
- Logical definition of areas
- Authentication and external routes tagging
5OSPF - Link State Protocol
- Link
- an interface on the router
- Link state
- description of the interface and the neighboring
routers - IP address, mask, type, routers connected to
- Link state database
- collection of link state advertisement for all
routers and networks
6How OSPF Works?
- Each router generates link-state advertisements
for its links - When no OSPF areas are configured, link-state
advertisements are flooded to all routers - It is crucial that all routers have identical
link state database - Shortest path three is calculated by all routers
and routing tables are derived
7Link State Advertisement (LSA)
- Generated periodically or in response to any
change - Contains
- source identification
- sequence number
- link state age
- list of neighbors
8A Simplified Link State Database Example
LS seq. num.
From To Link Cost A B a
1 2 A D c 1
2 B A a 1 2 B
C b 3 1 B E
e 2 2 C B b
3 1 C E f 1
1 D A c 1 2 D
E e 2 1 E B
d 2 2 E C d
2 1 E D e 2
1
c
Link State Announcement (LSA)
From A to B, Link 1, Cost 1, Ls seq. Num. 2
9In Case of a Link Failure
- A and B send the information to all other nodes
about state of link a and the connectivity is
reestablished.
- In the case when network is segmented the link
state database in both parts are different.
10Segmented Network
- If b breaks, A and D will not receive this LSA
and their database will be different than the one
of B, C and E.
- When e comes up the Ds has to become
synchronized. This process is called bringing up
adjacency.
11Bringing up Adjacency
- Synchronizing databases via comparison of
sequence numbers - Interesting records - the sequence numbers are
different or not present in database - Client-server relationship is established first
3
12The Flooding Protocol
- Used to securely deliver LSAs
- Every node sends the LSA on every link except the
one from where it received it - Very fast and very reliable, but wastes bandwidth
- Messages sent only when there is a change or
every 45 minutes - Each node compares the newly received LSA with
the entry in the data base. If it is newer the
database is updated
13Securing the Map Updates
- Flooding procedure includes hop-by-hop
acknowledgments - Database description packets are transmitted in a
secure fashion - Each link state record is protected by a timer
and is removed from the database if a refreshing
packet does not arrive in due time - All records are protected by checksum
- Messages can be authenticated, e. g. by passwords
14Authenticated Routing Updates
- Two possibilities are defined
- no authentication (configured by default)
- authentication
- simple password authentication
- message digest authentication
15More Routers on One Network
- N routers on the same network (broadcast or
non-broadcast) - N(N-2)/2 LSA will be needed to transmit
information about the same network - too much overhead
16Designated Router (DR)
- Selected among more routers on the same network
- selection based on the priority assigned by the
network administrator - for security reason backup designated router
(BDR) is also selected - All routers in the network become adjacent to DR
- exchange routing information with DR via
multicast - DR updates all the neighbors
17The Metrics in OSPF
- formula cost 108 /bandwidth in bps
56 Kbps serial link 1758 64 Kbps serial link
1562 T1 (1.544 Mbps seral link)
65 E1 (2.048 Mbps serial link) 48 4
Mbps token ring 25 Ethernet
10 16 Mbps token ring
6 FDDI
1
18External Routes
- One router to external word
- only advertise default route
- Several routers to outside world
- pick one that is closest
- pick one that carry data more efficiently
- Two types of metrics can be used
- type1 - the same as internal metrics
- type 2 - keeps the external costs
- External routes are added to the database as
gateway link state records
19Shortest Path Algorithm
- Places the router at the root of the tree
- In each iteration adds the router that is closest
to it (smallest cumulative metric of the path) - Finished when all routers are added and the
shortest path tree is generated
20Representation of routers and networks in a table
R1
R2
N3
R8
R3
R3
R4
R6
8
6
4
N7
From
R1 R2 R3 R4 N3 R1
0 R2 0 R3
0 R4
0 N3 1 1 1 1
From
From
R8 R8 N7 4
R3 R6 R3 6 R6 8
To
To
To
Broadcast or NBMA network
Stub network
Point-to-point network
21Example of an AS
N12
N13
N14
R1
R4
R5
R2
N2
R6
R3
N4
N12
N11
R7
N15
N8
R9
R11
R10
R5 and R7 are border routers
R8
R12
N10
N7
22 R1 R2 R3 R4 R5 R6 R7 R8 R9R10R11R12 N3 N6 N8
N9 R1
0 R2 0
R3 6 0 R4
8 0 R5
8 6 6 R6 8 7 5 R7
6 0 R8
0 R9
0 R10
7 0 0 R11
0 0 R12
0 N1
3 N2 3 N3 1 1 1 1 N4 2 N6
1 1 1 N7
4 N8 3 2 N9
1 1 1 N10
2 N11
3 N12 8 2 N13 8 N14
8 N15 9
The Resulting Directed Graph
Networks and routers are represented by
vertices. An edge of cost X connects Vertex A to
Vertex B if the intersection of Column A and Row
B is marked with the cost of the interface.
23Shortest Path Tree and Routing Table for R6
Dest. Next Hop Cost N1
R3 10 N2 R3
10 N3 R3 7 N4
R3 8 N6 R10
8 N7 R10 12 N8
R10 10 N9 R10 11
N10 R10 13 N11 R10
14 RT5 RT5 6 RT7
RT10 8
24Load Balancing by Multiple Path
equal or proportional cost multiple paths
R2
path 1
N1
N2
path 2
R3
R1
R4
25Hierarchical Structure
- Introduced to put a boundary on the explosion of
link-state updates - Every area is connected to the backbone area
Area 2
Area 1
Area 3
26Multiple Areas
IR
- Group of contiguous hosts and networks
- One LS database per area
- Backbone area (contiguous)
- Virtual links
- Inter-area routing
Area 3
Area 2
IR/BR
to other AS
area 0
ASBR
Area 4
Area 1
Virtual link
27OSPF Areas
- The border area is OSPF area 0
- all routers belonging to the same area have
identical database - SPF calculations are performed separately for
each area - LSA flooding is bounded by area
28Area Link State Database
- Link state database for every
- Area database is composed of
- router links advertisements
- network links advertisements
- summary links advertisements
- AS external advertisements
29Scaling OSPF
- Rule of thumb
- no more than 150 routers /area
- Reality
- no more than 500 routers/area
- Backbone area is an area
- always marked as area 0
- proper use of areas reduces bandwidth
- summarized routes
- instability is limited within the area
30Route Redistribution
RIP Domain
OSPF Domain
- the router redistributes RIP into OSPF and vice
versa
31Route Tagging
- Autonomous System B wants to
- propagate routes from A --gt D, but not propagate
from C --gt D - OSPF tags routes with AS input
- the information can be used when redistributing
routs
32OSPF - Advantages
- Fast convergence
- Load balancing
- Low bandwidth utilization
- Optimal path utilization
- Authenticated routing updates
- External routes
33OSPF Essential Configuration
- Enable OSPF routing
- router ospf ltprocess-idgt
- Define interfaces on which OSPF runs and define
the area ID for each interface. - network ltaddressgt ltmaskgt area ltarea-idgt
34The Link State Header
- LS age
- time since the LS record was first advertised
- options
- E - external links
- T - TOS (type 0 doesnt support any TOS
- LS type (router link, network link, summary link
(IP network, summary link, to a border router,
external link)
31
0
T
E
LS age options LS type
Link State ID
Advertising Router
LS sequence number
LS checksum length
35The Router Links
- summarizes all links that start from the router
- bits 6 and 7 of the first word indicate the type
of the router
36The Network Links
- advertised by designated routers
37The Summary Links
- advertised by area-border routers
- the network mask is followed by a set of metrics
38The External Links
- advertised by border routers
- required by EGPs
- E indicates that TOS is not comparable with that
of internal routes
network mask
E, TOS 0 TOS 0 metric
external route tag 0
E,TOS x 0 TOS x metric
external route tag x
- - -
- - -
- - -
E,TOS z 0 TOS z metric
external route tag z
39Protocols within OSPF
- Common header
- Hello protocol
- Exchange protocol
- Flooding protocol
40The Common Header
0
31
version (1) type (1)
packet length (2)
Router ID (4)
Area ID (4)
Checksum (2)
autype (2)
Authentication (4)
41The Hello Protocol
0
31
OSPF packet header, type 1 (hello)
Network mask
Hello interval
Options
Priority
Dead interval
Designated router
Backup designated router
Neighbour
- - - -
Neighbour
42The Exchange Protocol
- Uses database description packets
- Asymmetric protocol (master-slave)
- Master sends database description packets
- Slave sends the acknowledgments
43The Exchange Protocol 2
- Request records
- send in case when sequence number of the LS is
smaller - the other router will answer with a LS update
44The Flooding Protocol
- When a link changes state
- a router responsible for that link issues a new
version of the link state - the update is retransmitted in regular interval
until an acknowledgment is received
0
31
OSPF packet header, type 5 (ack)
Link State advertisements headers
- - - -
45Conclusions
- More complex than RIP
- the documentation is five times thicker
- the management needs more information
- the implementation needs more code
- Why design such complex procedure?
- routing is important
- requires less signalization messages
- compute better routes
46Conclusions
- OSPF is not a perfect protocol
- IETF keeps making it better
- O in OSPF stands for Open
- OSPF is not the only link state protocol
- IS-IS protocol is part of OSI routing framework
for CLNP - similar in design to OSPF
- uses different terminology