0% found this document useful (0 votes)
4 views

Chapter 2 - Routing Protocols (OSPF)

Uploaded by

mrksa8000
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)
4 views

Chapter 2 - Routing Protocols (OSPF)

Uploaded by

mrksa8000
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/ 48

Routing Protocols (Part I)

Interior Gateway Protocol (IGP): Open Shortest Path First Protocol (OSPF)

Computer Network II (NET461)


Topics
• Operation of OSPF • OSPF Neighbour State
• Router-ID • OSPF Packet Types
• Hello Packets • Building an Adjacency
• OSPF Network Types • OSPF Areas
• Designated Router and • OSPF Router Types
Backup Designated Router • Virtual Links
• OSPF Neighbours and
Adjacencies

Open Shortest Path First Protocol (Part I) 2


Operation of OSPF
• Step 1
– OSPF speaking routers send Hello packets out all OSPF-
enabled interfaces.
– If two routers sharing a common data link agree on
certain parameters specified in their respective Hello
packets, they will become neighbours.

Open Shortest Path First Protocol (Part I) 3


Operation of OSPF
• Step 2
– Adjacencies, which can be thought of a virtual point-to-point
links, are formed between some neighbours.
– The establishment of an adjacency is determined by the types
of routers exchanging Hellos and the type of network over
which the Hellos are exchanged.
– Type of routers: internal router, backbone router, area border
router, autonomous system border router
– Type of networks: point-to-point networks, broadcast
networks, virtual links etc.

Open Shortest Path First Protocol (Part I) 4


Operation of OSPF
• Step 3
– Each router sends link-state advertisements (LSAs) over
all adjacencies.
– Because of the varying types of link state information,
OSPF defines multiple LSA types.
– LSA types: LSA type 1 (router LSA), LSA type 2 (network
LSA), LSA type 3 (summary LSA) etc.

Open Shortest Path First Protocol (Part I) 5


Operation of OSPF
• Step 4
– Each router receiving an LSA from a neighbour, records
the LSA in its link-state database and sends a copy of the
LSA to all of its other neighbours (see link-state database
on next slide).
• Step 5
– By flooding LSAs throughout an area, all routers will build
identical link-state databases.

Open Shortest Path First Protocol (Part I) 6


Link State Database of R1
R1 Link States
Connected to 10.1.0.0/16; cost 2
Connected to R2 (10.2.0.0/16); cost 20
Connected to R3 (10.3.0.0/16); cost 5
Connected to R4 (10.4.0.0/16); cost 20

R2 Link States
Connected to 10.5.0.0/16; cost 2
Connected to R1 (10.2.0.0/16); cost 20
Connected to R5 (10.9.0.0/16); cost 10
R3 Link States
Connected to 10.6.0.0/16; cost 2
Connected to R1 (10.3.0.0/16); cost 5
Connected to R4 (10.7.0.0/16); cost 10
R4 Link States
Connected to 10.8.0.0/16; cost 2
Connected to R1 (10.4.0.0/16); cost 20
Connected to R3 (10.7.0.0/16); cost 10
Connected to R5 (10.10.0.0/16); cost 10
R5 Link States
Connected to 10.11.0.0/16; cost 2
Connected to R2 (10.9.0.0/16); cost 10
Connected to R3 (10.10.0.0/16); cost 10
Link State Database of R1
R1 Link States
Connected to 10.1.0.0/16; cost 2
Connected to R2 (10.2.0.0/16); cost 20
Connected to R3 (10.3.0.0/16); cost 5
Connected to R4 (10.4.0.0/16); cost 20

R2 Link States
Connected to 10.5.0.0/16; cost 2
Connected to R1 (10.2.0.0/16); cost 20
Connected to R5 (10.9.0.0/16); cost 10
R3 Link States
Connected to 10.6.0.0/16; cost 2
Connected to R1 (10.3.0.0/16); cost 5
Connected to R4 (10.7.0.0/16); cost 10
R4 Link States
Connected to 10.8.0.0/16; cost 2
Connected to R1 (10.4.0.0/16); cost 20
Connected to R3 (10.7.0.0/16); cost 10
5+10 Connected to R5 (10.10.0.0/16); cost 10
R5 Link States
20+10 Connected to 10.11.0.0/16; cost 2
Connected to R2 (10.9.0.0/16); cost 10
Connected to R3 (10.10.0.0/16); cost 10
Operation of OSPF
• Step 6
– When the databases are complete, each router uses the
SPF algorithm to calculate a loop-free shortest path to
every known destination, with itself as the root.
• Step 7
– Each router builds its router table based on SPF
computation.

Open Shortest Path First Protocol (Part I) 9


Router-ID
• Each router in OSPF must have a unique identifier. This
identifier is known as router-id.
• Router-id is in form of an IP address, but it is not an IP
address .
• Router-id is selected based on the following in order:
– Router-id manually configured using the router-id command.
– Numerically highest IP address on any of loopback interfaces of the
router.
– Numerically highest IP address on any of physical interfaces of the
router. It is not necessary that router interface is running OSPF.

Open Shortest Path First Protocol (Part I) 10


Router-ID
• Advantages of using loopback interfaces as router-id
– The loopback interface is more stable than any physical
interface. It is active when the router boots up, and it
only fails if the entire router fails or the port is shutdown.
– Network Engineers got control on choosing router-id.
Hence, they can assign predictable or recognizable
addresses as router-id.

Open Shortest Path First Protocol (Part I) 11


Router-ID
• The Cisco OSPF will continue to use a router-id
learned from a physical interface ever if the
interface subsequently fails or is deleted.
• The OSPF router begins a neighbour relationship by
advertising its router-id in Hello packets.

Open Shortest Path First Protocol (Part I) 12


Hello Packets
• Hello packet is the means by which neighbours are
discovered.
• It advertises several parameters on which two
routers must agree before they can become
neighbours.
• Hello packets act as keep alive between neighbours.

Open Shortest Path First Protocol (Part I) 13


Hello Packets
• OSPF speaking routers periodically send a Hello
packets out each OSPF-enabled interface every 2
seconds.
• This period is knows as the HelloInterval and is
configured on a per interface bases.
• Cisco uses a default HelloInterval of 10 seconds for
broadcast (e.g. LAN) networks and 30 seconds for
non-broadcast (e.g. Frame Relay).
Open Shortest Path First Protocol (Part I) 14
Hello Packets
• The value can be changed with the command ip ospf
hello-interval.
• If a router has not heard of Hello from a neighbour
within a period of time knows as the
RouterDeadInterval, it will declare the neighbour down.
• The Cisco default RouterDeadInterval is four times the
HelloInterval and can be changed with the command ip
ospf dead-interval.

Open Shortest Path First Protocol (Part I) 15


Hello Packets
• Each hello packet contains following information.
RouterDeadInterval of the originating
 Router-id of the originating router
interface.
 Area-id of the originating router
Router priority
interface
 Address mask of the originating
DR and BDR
interface
 Authentication type an authentication Five flag bits signifying optional
information for the originating interface. capabilities
 HelloInterval of the originating Router IDs of the originating
interface. router’s current OSPF neighbors.

Open Shortest Path First Protocol (Part I) 16


Hello Packets
• When a routers receives a Hello from a neighbour, it
verifies that the Area ID, Authentication, Network Mask,
HelloInterval, RouterDeadInterval, and Options values
match the values configured on the receiving interfaces.
• If they do not, the packet is dropped and no adjacency is
established.
• If everything matches, the Hello packet is declared valid.

Open Shortest Path First Protocol (Part I) 17


OSPF Network Types
• Point-to-point networks (OSPF over serial link)
• Broadcast Networks (Ethernet LAN)
• Non-Broadcast multi-access network (Frame Relay)
• Point-to-multipoint networks (special case of non-
broadcast multi-access network – Frame Relay)
• Virtual Links

Open Shortest Path First Protocol (Part I) 18


OSPF Network Types
• Transit
– Transit networks have two or more attached routers. They might
carry packets that are “just passing through” – packets that were
originated on and destined for a network other than the transit
network.
• Stub
– Stub networks have only a single attached router. Packets on stub
network always have either a source or a destination address
belonging to that network. That is, all packets were either
originated by a device on the network or are destined for a device
on the network.

Open Shortest Path First Protocol (Part I) 19


Designated Routers (DR) and Backup Designated Routers (BDR)

• Multi-access networks present two


problems for OSPF:
– The formation of an adjacency between
every attached router would create many
unnecessary LSAs.
– Flooding on the network itself would be
chaotic and excessive. A router would
flood an LSA to all its adjacent
neighbours, which in turn would flood it
to all their adjacent neighbours, creating
many copies of the same LSA on the
same network.

Open Shortest Path First Protocol (Part I) 20


Designated Routers (DR) and Backup Designated Routers (BDR)

• To prevent these problems, DR is


elected on multi-access networks.
The DR has following duties:
– To present the multi-access network and
its attached routers to the rest of the
OSPF area
– To manage the flooding process on the
multi-access network

Open Shortest Path First Protocol (Part I) 21


Designated Routers (DR) and Backup Designated Routers (BDR)

• Each router on the network forms an adjacency with the


DR.
– Router might be a DR on one of the its attached multi-access
networks, and it might not be the DR on another of its
attached multi-access networks. In other words, the DR is a
property of a router’s interface, not the entire router.
• All routers form adjacencies not only with the DR but
also with the BDR. The DR and BDR also become
adjacent with each other.
• If the DR fails, the BDR becomes the new DR.
Open Shortest Path First Protocol (Part I) 22
OSPF OSPF
Area 0 Area 10

Open Shortest Path First Protocol (Part I) 23


Election procedure of the DR and BDR
• When an OSPF routers becomes active and discovers its neighbours, it
checks for an active DR and BDR.
• If a DR and BDR exist, the router accepts them.
• If there is no BDR, an election is held in which the router with the highest
priority becomes the BDR.
• Default priority on Cisco routers is 1 while it ranges from 0 – 255. Network
Engineers can change this value by using command ip ospf priority.
• If more than one router has the same priority, the one with the numerically
highest Router ID wins.
• If there is no active DR, the BDR is promoted to the DR and new election is
held for the BDR.

Open Shortest Path First Protocol (Part I) 24


Election procedure of the DR and BDR
• Priority can influence an election, but will not
override an active DR or BDR.
• If a router with higher priority becomes active after
a DR and BDR have been elected, the new router
will not replace either of them.

Open Shortest Path First Protocol (Part I) 25


Election procedure of the DR and BDR
• After DR and BDR have been elected, the other routers
(known as DRothers) will establish adjacencies with the DR
and BDR only.
• All routers continue to multicast Hellos the AllSPFRouters
address 224.0.0.5 so that they can track neighbours, but
DRothers multicast update packets the AllDRothers address
224.0.0.6.
• Only the DR and BDR will listen to this address; in turn. The
DR will flood the updates to the DRothers on 224.0.0.5.

Open Shortest Path First Protocol (Part I) 26


OSPF Neighbors
• Two OSPF routers are neighbors if they are connected to the same
subnet and share a series of common configuration information:
Same Area ID Same Timers
Same Area Type Same Authentication
Same Subnet Mask -

• They see their own OSPF router-id in each other's Hello packet
• Two OSPF neighbors do not exchange any routing information - the
only packets they exchange is Hello packets. These Hello packets act
as keep alive between neighbors

Open Shortest Path First Protocol (Part I) 27


OSPF Adjacency
• Step 1: Neighbor discovery
• Step 2: Bidirectional Communication
– This communication is accomplished when two neighbors list each other’s
router-ids in their Hello packets
• Step 3: Database Synchronization
– Database Description, Link State Request, Link State Update, and Link
State Acknowledgement packets are exchanged to ensure that both
neighbors have identical information in their link-state databases. For the
purpose of this process, one neighbor will become the master and the
other will become the slave. As the name implies, master will control the
exchange of Database Description packets.
• Step 4: Full adjacency achieved
Open Shortest Path First Protocol (Part I) 28
OSPF Packet Types
• Before discussing OSPF packet types, it should be clear that Link
State Advertisement (LSA) is not a packet. It is a data structure
which keeps information about OSPF enabled interfaces. An OSPF
packet can deliver many LSAs simultaneously. For example, given
figure shows, Link State Update packet has many LSAs inside it.
• OSPF Packets Types are following
– Hello Packets
– Database Description (DD) Packets
– Link State Request Packet
– Link State Update Packet
– Link State Acknowledgement (LSAck) Packet

Open Shortest Path First Protocol (Part I) 29


Building an Adjacency
• Neighbours on point-to-point, point-to-multipoint, and virtual
link networks always become adjacent unless the parameters
of their Hellos don’t match.
• On broadcast and NBMA networks, the DR and BDR become
adjacent with all neighbours, but no adjacencies exist
between DRothers.
• The adjacency building process uses three OSPF packet types:
– Database Description (DD) packets
– Link State Request packets
– Link State Update packets

Open Shortest Path First Protocol (Part I) 30


Building an Adjacency
• Database Description packet carries a summary
description of each LSA in the originating router’s
link-state database.
• These descriptions are not the complete LSAs, but
merely their headers – enough information for the
receiving router to decide whether it has the latest
copy of the LSA in its own database.
Open Shortest Path First Protocol (Part I) 31
Building an Adjacency
• Three flag bits, in the DD packet, are used to
manage the adjacency building process:
– The I-bit, or initial bit, which when set indicates the first
DD packet sent.
– The M-bit, or More bit, when set indicates that this is not
the last DD packet to be sent.
– The MS-bit, or Master/Slave bit, which is set in the DD
packets originated by the master.

Open Shortest Path First Protocol (Part I) 32


Neighbour States
• Down
– Neighbour is considered down if no Hellos have been heard in the last
RouterDeadInterval.
• Init
– This state indicates that a Hello packet has been seen from the neighbour in the
last RouterDeadInterval, but 2-way communication has not been established.
• 2-Way
– This state indicates that the router has seen its own router id in the neighbour
field of the neighbour’s Hello packets, which means that a bidirectional
conversation has been established.
– The reception of a Database Description packet from a neighbour in the init state
also causes a transition to 2-way.

Open Shortest Path First Protocol (Part I) 33


Neighbour States
• ExStart
• In this state, the router and its neighbour establish a master/slave
relationship and determine the initial Database Description sequence
number in preparation for the exchange of Database Description
packets.
• The neighbour with the highest Router ID becomes the master.
• Exchange
• The router sends Database Description packets describing its entire
link-state database to neighbours that are in the Exchange state. The
router may also send Link State Request packets, requesting more
recent LSAs, to neighbours in this state.

Open Shortest Path First Protocol (Part I) 34


Neighbour States
• Loading
– The router sends Link State Request packets to
neighbours that are in the Loading state, requesting
more recent LSAs that have been discovered in the
Exchange state but have not yet been received.
• Full
– Neighbours in this state are fully adjacent, and the
adjacencies appear in Router LSAs and Network LSAs.

Open Shortest Path First Protocol (Part I) 35


Building an Adjacency:
Neighbor Discovery and Bidirectional Communication

DOWN
INIT
2-WAY
EXSTART
EXCHANGE
LOADING
FULL

Open Shortest Path First Protocol (Part I) 36


Building an Adjacency: Database Synchronization

DOWN
INIT
2-WAY
EXSTART
EXCHANGE
LOADING
FULL

Open Shortest Path First Protocol (Part I) 37


Building an Adjacency: Full Adjacency

DOWN
INIT
2-WAY
EXSTART
EXCHANGE
LOADING
FULL

Open Shortest Path First Protocol (Part I) 38


OSPF Areas
• An OSPF area is a logical grouping of OSPF routers and links
that effectively divide an OSPF domain into sub-domains.
• An OSPF router must share an identical link-state database
only with the other routers in its area, not with the entire
OSPF domain. The reduced size of the database reduces the
impact on a router’s memory.
• The smaller link-state databases mean fewer LSAs to process
and therefore less impact on the CPU.
• Because the link-state database must be maintained only
within an area most flooding is also limited to the area.

Open Shortest Path First Protocol (Part I) 39


OSPF Areas
• Areas are identified by 32-bit area ID.
• Three types of traffic may be defined in relation to
areas:
– Intra-area traffic consists of packets that are passed between
routers within a single area.
– Inter-area traffic consists of packets that are passed between
routers in different areas.
– External traffic consists of packets that are passed between a
router within the OSPF domain and a router within another
routing domain, for example, EIGRP.
Open Shortest Path First Protocol (Part I) 40
OSPF Areas: Backbone Area
• Area ID 0 (or 0.0.0.0) is reserved for
the backbone.
• The backbone is responsible for
summarizing the topologies of each
area to every other area.
• For this reason, all inter-area traffic
must pass through the backbone;
non-backbone areas cannot
exchange packets directly.
• OSPF area topologies are
exchanged in summarized form.
Open Shortest Path First Protocol (Part I) 41
OSPF Router Types
• Internal Routers are routers whose interfaces all belong to
the same area.
• Area Border Routers (ABRs) connect one or more areas to
the backbone and act as a gateway for inter-area traffic.
– An ABR always has at least one interface that belong to the
backbone, and must maintain a separate link-state database for
each of its connected areas.
– An ABR summarizes the topological information of its attached
areas into the backbone, which then propagates the summary
information.
Open Shortest Path First Protocol (Part I) 42
OSPF Router Types

Open Shortest Path First Protocol (Part I) 43


OSPF Router Types
• Backbone Routers are routers with at least one
interface attached to the backbone.
– Although this requirement means that ABRs are also
Backbone routers, figure given on previous slide shows
that not all backbone routers are ABRs.
– An internal router whose interfaces all belong to area 0 is
also a backbone router.

Open Shortest Path First Protocol (Part I) 44


OSPF Router Types
• Autonomous System Border Routers (ASBRs) are
gateways for external traffic, injecting routes into the
OSPF domain that were learned (redistributed) from
some other protocol, such as the BGP and EIGRP
processes shown in the figure given on previous slide.
• An ASBR can be located anywhere, within the OSPF
autonomous system except within stub areas; it may be
an Internal, Backbone, or ABR.
Open Shortest Path First Protocol (Part I) 45
Virtual Links
• A virtual link is a link to the backbone through a
non-backbone area.

Open Shortest Path First Protocol (Part I) 46


Virtual Links
• Virtual links are used for following purposes:
– To link an area to the backbone through a non-backbone area.
– To connect the two parts of a partitioned backbone through a
non-backbone area.

Open Shortest Path First Protocol (Part I) 47


Virtual Links
• The virtual link is a tunnel through which packets may
be routed on the optimal path from one endpoint to the
other.
• Several rules are associated with the configuration of
virtual links:
– Virtual links must be configured between two ABRs.
– The area through which the virtual link is configured, known
as the transit area, must have full routing information.
– The transit area cannot be a stub area.

Open Shortest Path First Protocol (Part I) 48

You might also like