routing protocols part ii et4187/et5187 advanced telecommunication network
TRANSCRIPT
ROUTING PROTOCOLSPART II
ET4187/ET5187 Advanced Telecommunication Network
2Open Shortest Path First (OSPF)
3
RFC 2328 OSPF is a link state protocol OSPF provides a number of features not
found in distance vector protocols. Support for these features has made OSPF
a widely-deployed routing protocol in large networking environments.
In fact, RFC 1812 – Requirements for IPv4 Routers, lists OSPF as the only required dynamic routing protocol.
Link State Routing
Based on Dijkstra’ s Shortest-Path-First algorithm.
Each router starts by knowing: Prefixes of its attached networks. Links to its neighbors.
Each router advertises to the entire network (flooding): Prefixes of its directly connected networks. Active links to its neighbors.
Each router learns: A complete topology of the network (routers, links).
Each router computes shortest path to each destination.
In a stable situation, all routers have the same graph, and compute the same paths.
Link state routing: graphical illustration
a
b
c d
3 1
62
a
36
b
c
a’s view:
a
b
c
3 1b’s view: c d2
d’s view:
Collecting all views yield a global & complete view of the network!
Global view:
a
b
c d
1
6
c’s view:
2
Operation of a Link State Routing protocol
ReceivedLSAs
IP Routing Table
Dijkstra’s
Algorithm
Link State
Database
LSAs are flooded to other interfaces
Link State Routing: Properties
Each node requires complete topology information
Link state information must be flooded to all nodes
Guaranteed to converge
Distance Vector vs. Link State Routing
With distance vector routing, each node has information only about the next hop:
Node A: to reach F go to B Node B: to reach F go to D Node D: to reach F go to E Node E: go directly to F
Distance vector routing makespoor routing decisions if directions are not completelycorrect (e.g., because a node is down).
If parts of the directions incorrect, the routing may be incorrect until the routing algorithms has re-converged.
AA BB CC
DD EE FF
Distance Vector vs. Link State Routing
In link state routing, each node has a complete map of the topology
If a node fails, each node can calculate the new route
Difficulty: All nodes need to have a consistent view of the network
AA BB CC
DD EE FF
A B C
D E F
A B C
D E F
A B C
D E F
A B C
D E F
A B C
D E F
A B C
D E F
• Topology information is flooded within the routing domain
• Best end-to-end paths are computed locally at each router.
• Best end-to-end paths determine next-hops.
• Based on minimizing some notion of distance
• Works only if policy is shared and uniform
• Examples: OSPF, IS-IS
Distance Vector vs. Link State Routing
• Each router knows little about network topology
• Only best next-hops are chosen by each router for each destination network.
• Best end-to-end paths result from composition of all next-hop choices
• Does not require any notion of distance
• Does not require uniform policies at all routers
• Examples: RIP, BGP
Link State Vectoring
Dynamic Routing Protocols
Open Shortest Path First
12
OSPF terminology
OSPF areas OSPF networks are divided into a collection
of areas. An area consists of a logical grouping of
networks and routers. The area can coincide with geographic or
administrative boundaries. Each area is assigned a 32-bit area ID.
13
Subdividing the network provides the following benefits: Within an area, every router maintains an identical topology
database describing the routing devices and links within the area. These routers have no knowledge of topologies outside the area. They are only aware of routes to these external destinations. This reduces the size of the topology database maintained by each
router. Areas limit the potentially explosive growth in the number of
link state updates. Most LSAs are distributed only within an area.
Areas reduce the CPU processing required to maintain the topology database. The SPF algorithm is limited to managing changes within the area.
14
Backbone area and area 0 All OSPF networks contain at least one area, this
area is known as area 0 or the backbone area Additional areas can be created based on
network topology or other design requirements. In networks containing multiple areas, the
backbone physically connects to all other areas. OSPF expects all areas to announce routing
information directly into the backbone. The backbone then announces this information
into other areas
15
16
Intra-area, area border, and AS boundary routers Intra-area routers
This class of router is logically located entirely within an OSPF area. Intra-area routers maintain a topology database for their local area.
Area border routers (ABR) This class of router is logically connected to two or more areas. One area must be the backbone area. An ABR is used to interconnect areas. They maintain a separate topology database for each attached area. ABRs also execute separate instances of the SPF algorithm for each
area. AS boundary routers (ASBR)
It is located at the periphery of an OSPF internetwork. It functions as a gateway exchanging reachability between the OSPF
network and other routing environments ASBRs are responsible for announcing AS external link
advertisements through the AS. Each router is assigned a 32-bit router ID (RID).
The RID uniquely identifies the device. One popular implementation assigns the RID from the lowest-
numbered IP address configured on the router.
17
Physical network types Point-to-point: Point-to-point networks directly link two
routers. Multi-access: Multi-access networks support the
attachment of more than two routers. Broadcast networks: have the capability of simultaneously
directing a packet to all attached routers. This capability uses an address that is recognized by all devices. Ethernet and token-ring LANs are examples of OSPF broadcast
multi-access networks. Non-broadcast networks: do not have broadcasting
capabilities. Each packet must be specifically addressed to every router in
the network. X.25 and frame relay networks are examples of OSPF non-
broadcast multi-access networks. Point-to-multipoint: Point-to-multipoint networks are a
special case of multi-access, non-broadcast networks. In a point-to-multipoint network, a device is not required to
have a direct connection to every other device. This is known as a partially meshed environment.
18
Neighbor routers and adjacencies Routers that share a common network segment establish a neighbor
relationship on the segment. Routers must agree on the following information to become
neighbors: Area ID: The routers must belong to the same OSPF area. Authentication: If authentication is defined, the routers must specify the
same password. Hello and dead intervals: The routers must specify the same timer
intervals used in the Hello protocol. Stub area flag: The routers must agree that the area is configured as a
stub area. After two routers have become neighbors, an adjacency relationship
can be formed between the devices. Neighboring routers are considered adjacent when they have
synchronized their topology databases. This occurs through the exchange of link state information.
19
Designated and backup designated router The exchange of link state information between
neighbors can create significant quantities of network traffic.
To reduce the total bandwidth required to synchronize databases and advertise link state information, a router does not necessarily develop adjacencies with every neighboring device: Multi-access networks: Adjacencies are formed
between an individual router and the (backup) designated router.
Point-to-point networks: An adjacency is formed between both devices.
20
Designated and backup designated router (cont.) Each multi-access network elects a designated router (DR)
and backup designated router (BDR). The DR performs two key functions on the network segment:
It forms adjacencies with all routers on the multi-access network. This causes the DR to become the focal point for forwarding LSAs.
It generates network link advertisements listing each router connected to the multi-access network.
The BDR forms the same adjacencies as the designated router. It assumes DR functionality when the DR fails.
Each router is assigned an 8-bit priority, indicating its ability to be selected as the DR or BDR. A router priority of zero indicates that the router is not eligible to be
selected. The priority is configured on each interface in the router.
21
The relationship between neighbors. No adjacencies are formed between routers that
are not selected to be the DR or BDR.
22
Link state database The link state database is also called the
topology database. It contains the set of link state
advertisements describing the OSPF network and any external connections.
Each router within the area maintains an identical copy of the link state database.
23
Link state advertisements and flooding LSAs are exchanged between adjacent OSPF routers.
This is done to synchronize the link state database on each device.
When a router generates or modifies an LSA, it must communicate this change throughout the network.
The router starts this process by forwarding the LSA to each adjacent device.
Upon receipt of the LSA, these neighbors store the information in their link state database and communicate the LSA to their neighbors.
This store and forward activity continues until all devices receive the update.
This process is called reliable flooding.
24
Two steps taken to ensure this flooding doesn’t overloading the network with excessive quantities of LSA traffic: Each router stores the LSA for a period of time
If, during that time, a new copy of the LSA arrives, the router replaces the stored version.
However, if the new copy is outdated, it is discarded. To ensure reliability, each link state advertisement
must be acknowledged. Multiple acknowledgements can be grouped together into
a single acknowledgement packet. If an acknowledgement is not received, the original link
state update packet is retransmitted.
25
Five types of information contained in link state advertisements:
Router LSAs It describes the state of the router's interfaces (links)
within the area. Generated by every OSPF router. The advertisements are flooded throughout the area.
Network LSAs It lists the routers connected to a multi-access
network. Generated by the DR on a multi-access segment. The advertisements are flooded throughout the area.
26
Summary LSAs (Type-3 and Type-4) It generated by an ABR. Two types of summary link advertisements:
Type-3 summary LSAs describe routes to destinations in other areas within the OSPF network (inter-area destinations).
Type-4 summary LSAs describe routes to ASBRs. Summary LSAs are used to exchange reachability
information between areas. Normally, information is announced into the backbone
area. The backbone then injects this information into other
areas. AS external LSAs
It describes routes to destinations external to the OSPF network.
They are generated by an ASBR. The advertisements are flooded throughout all areas in
the OSPF network.
27
OSPF link state advertisements
Example Network
Router IDs can be selected independent of interface addresses, but usually chosen to be the smallest interface address
3
4 2
5
1
1
32
• Link costs are called Metric
• Metric is in the range [0 , 216]
• Metric can be asymmetric
10.1.1.0 / 24
.1 .2 .2
10.1.1.1
10.1.4.0 / 24
10.1.2.0 / 24
.1
.4
10.1.7.0 / 24
10.1
.6.0
/ 24
10.1
.3.0
/ 24
10.1.5.0/24
10.1
.8.0
/ 24
.3
.3 .5
.2
.3
.5
.5
.4
.4
.6
.6
10.1.1.2 10.1.4.4 10.1.7.6
10.1.2.3 10.1.5.5
Link State Advertisement (LSA)
The LSA of router 10.1.1.1 is as follows:
Link State ID: 10.1.1.1 = Router ID
Advertising Router: 10.1.1.1 = Router ID Number of links: 3 = 2 links plus router itself
Description of Link 1: Link ID = 10.1.1.2, Metric = 4 Description of Link 2: Link ID = 10.1.2.2, Metric = 3 Description of Link 3: Link ID = 10.1.1.1, Metric = 0
10.1.1.0 / 24
.1 .2 .2
10.1.1.1
10.1.4.0 / 24
10.1.2.0 / 24
.1
.4
10.1.7.0 / 24
10.1
.6.0
/ 24
10.1
.3.0
/ 24
10.1.5.0/24
10.1
.8.0
/ 24
.3
.3 .5
.2
.3
.5
.5
.4
.4
.6
.6
10.1.1.2 10.1.4.4 10.1.7.6
10.1.2.3 10.1.5.5
4
3 2
Network and Link State Database
Each router has a database which contains the LSAs from all other routers
LS Type Link StateID Adv. Router Checksum LS SeqNo LS Age
Router-LSA 10.1.1.1 10.1.1.1 0x9b47 0x80000006 0
Router-LSA 10.1.1.2 10.1.1.2 0x219e 0x80000007 1618
Router-LSA 10.1.2.3 10.1.2.3 0x6b53 0x80000003 1712
Router-LSA 10.1.4.4 10.1.4.4 0xe39a 0x8000003a 20
Router-LSA 10.1.5.5 10.1.5.5 0xd2a6 0x80000038 18
Router-LSA 10.1.7.6 10.1.7.6 0x05c3 0x80000005 1680
10.1.1.0 / 24
.1 .2 .2
10.1.1.1
10.1.4.0 / 24
10.1.2.0 / 24
.1
.4
10.1.7.0 / 24
10.1
.6.0
/ 24
10.1
.3.0
/ 24
10.1.5.0/24
10.1
.8.0
/ 24
.3
.3 .5
.2
.3
.5
.5
.4
.4
.6
.6
10.1.1.2 10.1.4.4 10.1.7.6
10.1.2.3 10.1.5.5
OSPF Packet Format
OSPF MessageIP header
Body of OSPF MessageOSPF MessageHeader
Message TypeSpecific Data
LSA LSALSA ...
LSAHeader
LSAData
...
Destination IP: neighbor’s IP address or 224.0.0.5 (ALLSPFRouters) or 224.0.0.6 (AllDRouters)
TTL: set to 1 (in most cases)
OSPF packets are not carried as UDP payload!OSPF has its own IP protocol number: 89
OSPF Packet Format
source router IP address
authentication
authentication
32 bits
version type message length
Area ID
checksum authentication type
Body of OSPF MessageOSPF MessageHeader
2: current version is OSPF V2
Message types:1: Hello (tests reachability)2: Database description3: Link Status request4: Link state update5: Link state acknowledgement
ID of the Area from which the packet originated
Standard IP checksum taken over entire packet
0: no authentication1: Cleartext password2: MD5 checksum(added to end packet)
Authentication passwd = 1: 64 cleartext password Authentication passwd = 2: 0x0000 (16 bits)
KeyID (8 bits) Length of MD5 checksum (8 bits) Nondecreasing sequence number (32 bits)
Prevents replay attacks
OSPF LSA Format
Link State ID
link sequence number
advertising router
Link Age Link Type
checksum length
Link ID
Link Data
Link Type Metric#TOS metrics
LSA
LSAHeader
LSAData
Link ID
Link Data
Link Type Metric#TOS metrics
LSA Header
Link 1
Link 2
Discovery of Neighbors
Routers multicasts OSPF Hello packets on all OSPF-enabled interfaces.
If two routers share a link, they can become neighbors, and establish an adjacency
After becoming a neighbor, routers exchange their link state databases
OSPF Hello
OSPF Hello: I heard 10.1.10.2
10.1.10.1 10.1.10.2
Scenario:Router 10.1.10.2 restarts
Neighbor discovery and database synchronization
OSPF Hello
OSPF Hello: I heard 10.1.10.2
Database Description: Sequence = X
10.1.10.1 10.1.10.2
Database Description: Sequence = X, 5 LSA headers = Router-LSA, 10.1.10.1, 0x80000006 Router-LSA, 10.1.10.2, 0x80000007 Router-LSA, 10.1.10.3, 0x80000003 Router-LSA, 10.1.10.4, 0x8000003a Router-LSA, 10.1.10.5, 0x80000038 Router-LSA, 10.1.10.6, 0x80000005
Database Description: Sequence = X+1, 1 LSA header= Router-LSA, 10.1.10.2, 0x80000005
Database Description: Sequence = X+1
Sends empty database description
Scenario:Router 10.1.10.2 restarts
Discovery of adjacency
Sends database description. (description only contains LSA headers)
Database description of 10.1.10.2
Acknowledges receipt of description
After neighbors are discovered the nodes exchange their databases
Regular LSA exchanges
10.1.10.2 explicitly requests each LSA from 10.1.10.1
10.1.10.1 sends requested LSAs
10.1.10.1 10.1.10.2
Link State Request packets, LSAs =
Router-LSA, 10.1.10.1,
Router-LSA, 10.1.10.2,
Router-LSA, 10.1.10.3,
Router-LSA, 10.1.10.4,
Router-LSA, 10.1.10.5,
Router-LSA, 10.1.10.6,
Link State Update Packet, LSAs =
Router-LSA, 10.1.10.1, 0x80000006
Router-LSA, 10.1.10.2, 0x80000007
Router-LSA, 10.1.10.3, 0x80000003
Router-LSA, 10.1.10.4, 0x8000003a
Router-LSA, 10.1.10.5, 0x80000038
Router-LSA, 10.1.10.6, 0x80000005
Dissemination of LSA-Update
A router sends and refloods LSA-Updates, whenever the topology or link cost changes. (If a received LSA does not contain new information, the router will not flood the packet)
Exception: Infrequently (every 30 minutes), a router will flood LSAs even if there are not new changes.
Acknowledgements of LSA-updates: explicit ACK, or implicit via reception of an LSA-Update
Question: If a new node comes up, it could build the database from regular LSA-Updates (rather than exchange of database description). What role do the database description packets play?