Overview: OSPF basics
Goal: Visualize OSPF operation flow: How LSDB is synchronzied by exchaning Hello, DD, Request, Update.
Topology: Two hosts are connected to routers R1m R2 respectively. R1, R2 are connected by a serial link.
Step: 1) R1 send Hello to find its neighbors. R2 responds with a Hello. Neighbores are discovered.
2) Routers send DD (Data Description) to exchange link state database summaries with neighbors.
3) Router sends Request to get missing LSA from its neighbors Neighbor responds by sending Update.
4) When receiving Update, reculcaulate routes and update routing table.
Configure routre interfaces' IP addresses. Router's routing table show directly connected subnets.
E.g., R1's routing table has two entries: 192.168.1.1, 192.168.3.1. They are local subnets.
At this time, R1's routing table does not know the remote subnet 192.168.2.0.
【Note】 See Appendix for configuration command.
H1 ping H2 fails
H1 ping H2. When R1 receives ping, it looks up routing table for the ping's destination IP address 192.168.2.2 and fails. R1 drops ping.
To start OSPF, execute a few commands as shown in Router command line windows.
After OSPF is started on a router, it creates LSDB that contains one entry: this router's Router LSA.
Note: OSPF routers use LSA (Link State Advertisement）to describe its link state. LSDB stores all LSAs.
Note: A routerr uses Router LSA to describe its interface IP addresses.
【Note】 See Appendix for OSPF configuration command.
Hello: Discover neighbors
OSPF routers flood Hello to discover neighbors.
In this scenario, R1 floods Hello first. When R2 receives R1's Hello, it discovers a new neighbor R1 and floods Hello. R1 discovers a new neighbor R2 when it receives R2's Hello. Now R1 and R2 have discovered each other ass neighbors.
DD: Exchange LSDB's list
Neighbors use DD (Data Description) to exchange their LSDB catalogs. In this scenario, R1 sends DD to R2 first. It says: I have a Route LSA from R1. R2 also sends DD to R1: I have a Route LSA from R2.
Note: DD works like table fo content. It lists what LSDB has, but not details. By reading DD, the receiving router can determine what it is missing and them ask the sender to transmit required LSAs..
R1 Request, R2 Update
R1 has learned that R2 has a R2 Router LSA that it does not have. R1 sends a LS Request to R2.
When R2 receives this request, it sends an Update to transmit this LSA to R1.
R2 Request, R1 Update
R2 also sends request to R1. R1 replies an Update. Upon receiving Update, R2 adds R1 Router LSA to its LSDB, calculates its routes, and add a new entry (192.168.1.0, S1/0) to its routing tabe.
Note: OSPF works distributely. After routers have synchronized their LSDB, they use the same data (LSDB) to calculate shortest paths, and updates their routing tables independently.
Ack update : LSAs are received
In order to assure reliable transmission, when a router receives an Update, it sends an Ack to the Update sender. If the sender does not receivie Ack within a specific peried, it times out and retransmits Update.
Note: OSPF uses Update-Ack to implemnet relaible transmission. It does not use TCP.
H1 ping H2: succeeded.
Now H1 ping H2 again. This time, ping is forwarded by R1, R2 and reaches H2.
H2 sends echo to H1. Echo is forwarded by R2, R1 and arrives at H1 sucessfully.
Appendix: OSPF configuration
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#ip address 192.168.3.1 255.255.255.252
R1(config)#router ospf 1
R1(config-router)#network 192.168.1.0 0.0.0.255 area 0
R1(config-router)#network 192.168.3.0 0.0.0.3 area 0
Q1. What is OSPPF?
Answer: OSPF is a link state routing protocol. OSPF routers exchange their Link State Advertisement (OSPF LSA) to learn IP addresses of interfaces from all OSPF routers in the network. Each router saves its OSPF LSAs in its Link State Database (LSDB.) When routers have synchronized their LSDBs, they use the same set of LSAs to calculate shortest paths to reach destinations.
The most basic LSA is called Router LSA. Every router creates its own Router LSA to describe the IP addresses of its interfaces.
Roughly, OSPF routers are going through the following flow of events:
1) Routers discover their neighbors by flooding Hello packets.
2) Neighboring routers exchange DD to find out each others LSA catalog. Then each router sends Request packets to ask its neighbor to transmit LSAs it does not have. When receiving a Request, a router sends an Update that contains the requested LSAs.
3) When routers have the same LSDB, they are in Full Adjacency state. They can use their LSDB to calculate routes independently. The collection of routing tables from OSPF routers provides the shortest paths between any pair of destinations.
Q2. What is Router LSA?
Answer: Each OSPF router creates a Router LSA to describe its interfaces' IP addresses and floods its Router LSA to its neighbors. After a few rounds of flooding, all OSPF routers have the same set of Router LSAs in their LSDBs. Now routers can use the same LSDB to calculate routes and update routing tables.
Q3. How can a router use LSDB to calculate to routing paths?
Answer: From LSDB, a router learns the entire topology: the number of routers being connected. Router interfaces and their IP addresses, interface link costs (OSPF metric). With such detail information, routers are able to calculate routing paths to reach all destinations found in LSDB.
For example, in the OSPF basic simulation (see External links), R1's LSDB contains two Router LSAs:
- A Router LSA from R1. R1 has two links. Their IP addresses are 192.168.1.0/24,192.168.3.0/30.
- A Router LSA from R2. R2 has two links. Their IP addresses are 192.168.2.0/24,192.168.3.0/30.
From these LSA, R1 can calculate the routing path to reach remote destination 18.104.22.168.2 and adds an entry (192.168.2.0/24, S1/0) to its routing table.
|Single step forward|
|Backup one step|
|Read the next page|
|Read the last page|
|Don’t show me this message next time.|