Got it

Adjacency establishing and LSAs exchanging in OSPF - Series of OSPF Episode 2

Latest reply: Dec 28, 2020 00:04:03 2003 12 6 0 0

Want to know more about OSPF? Please refer to [Series of OSPF] Episode 1 OSPF summary and concept


In this episode, we will introduce you guys to how the routers establish adjacency relationships and exchange LSAs. 

As we talked in the previous episode, OSPF can support 4 types of network, broadcast, NBMA, P2P, and P2MP. In broadcast and NBMA, DR and BDR will be elected to restrain the unnecessary multicast traffics. On the contrary, there is no need to elect DR or BDR.

In this episode, let's talk about how the OSPF works in broadcast and NBMA.
We use the following figure as an example. In this network topology environment, three routers, AR1 AR2 and AR3, are running OSPF with area 0.

topo

When OSPF is configured on the router, and network segments are announced into the OSPF area, the router will send hello packets immediately from the interfaces in which IP addresses match the announced network segment. Because at the beginning of OSPF started, DR and BDR haven't elected out. So the hello packet sender regards itself as DR and sends the hello packet to multicast address 224.0.0.5. 


hello

from the capture result, as we said, hello packets are sent to 224.0.0.5 with DR and BDR address 0.0.0.0 which means unknown DR and BDR.
Let's analyze this OSPF hello packet deeper. 

From the captured packet, we can see OSPF are packaged in IP packet, and use IP protocol number 89, TTL in the IP header is 1. In the OSPF payload, the hello packet follows after the OSPF header. Fields in the OSPF header are used as below: 


  • version: the version number of the OSPF, when version value is 2, means OSPFv2 is implemented, when version value is 3, OSPFv3 is implemented. By the way, OSPFv2 is used in the IPv4 network environment, OSPFv3 is used in the IPv6 environment. 

  • message type: the type of the OSPF packet. The value from 1 to 5 corresponding to the hello packet, DBD packet, LSR packet, LSU packet, and LSAck packet. 

  • packet length: the whole length of the OSPF packet in bytes, including the OSPF header. 

  • source OSPF router: RID(Router ID) of the sender. The maximum loopback interface's IP address is designated as the RID, if no loopback interface is configured, the maximum physical interface's IP address will be chosen. 

  • area ID: the area where the router interface that sent the packet is located to. 

  • packet checksum: the checksum result of the whole packet. 

  • auth type: authentication type. The value from 0 to 2 corresponding to no authentication, plain text authentication, and MD5 authentication. 

  • authentication: the value is based on the authentication type. when auth type is 0, when the value is null when auth type is 1, the value is password information, when auth type is 2, this field includes information about Key ID, MD5 authentication data length, and serial number. 


In the OSPF hello packet:

  • network mask: the mask number of the router interface that sent this packet. 

  • hello-interval: interval of the router send hello packet, the value is 10 by default. 

  • router priority: router's priority, a larger router priority makes the router become the DR or BDR, when router priority is 0, it means the router doesn't participate in the calculation of DR and BDR. 

  • router dead interval: when the router doesn't receive hello packets from the neighbor router out of the dead interval, it regards the neighbor router failure, and deletes the LSAs learned from the neighbor. Usually, the router dead interval is four times as hello interval, when we modify the hello interval, the dead interval will be modified automatically, on the contrary, when we modify the dead interval, the hello interval wouldn't change. When routers' hello interval and dead interval not match, the neighbor relationship establishing will fail. So except for the specific requirements, it's better not to modify the hello interval and dead interval. 

  • designated router: interface IP address of the DR 

  • backup designated router: interface IP address of the BDR 


when the router receives the hello packet, if it doesn't find its RID in the hello packet, it sets the neighbor router to the init state. The router will add its own RID into the OSPF hello packet when next sending the hello packet. If the router receives the hello packet with its own RID exist in it, it sets the neighbor router to the 2-way state.
hello2

  • active neighbor: RID of the router. router received hello packets from the router that the RID belongs to. 


2-way is the first stable state of OSPF. As we said, In a multi-access network, to restrain the unnecessary multicast traffics, DR and BDR are elected. Between two DRother routers, they will keep in 2-way state, and between DRother and DR or DRother and BDR, There will be further state transitions.

After 2-way state, between DR and DRother, they will spread DBD packet unicast to each other and migrate to ex-start state, begin to elect master and slave router through exchange DBD packet which doesn't carry LSAs.
since we have introduced the OSPF header before, here we introduce the DBD packet directly. 


first_DBD

  • interface MTU: RFC 2328 describes the interface MTU as The size in bytes of the largest IP datagram that can be sent out the associated interface, without fragmentation. This value is 0 by default on Huawei network equipments, if command ospf mtu-enable which disabled by default is enabled under interface view, this field will equal to the interface's MTU. 

  • I: when sending more than one DBd packet, and this is the first one, I field will be set to 1, or it will be set to 0. 

  • M: with more than one DBD packet sent, in the lastest DBD packet, the M field is set to 0, or it will be set to 1. 

  • MS: before routers exchange DBD packets, the master router, and slave router should be determined first. This field is used to mark the master router when it is set to 1. 


When the first DBD packet is spread out, both I, M, and MS field are set to 1. Since every router regards itself as the master before the master elected out, this will make the MS bit been set to 1. The first DBD packet carries no LSAs, it's used to negotiate the master and slave router, after that, more DBD packets that will carry LSAs will be spread out. So the I and M field also been set to 1. The election of the master router is dependent on the RID, the router with a larger RID will be elected as a master router.


When the router receives the DBD packet with the I field set to 0, it set the neighbor router to an ex-change state. In this DBD packet, LSA headers are carried, the receiver will store these LSA headers. When the last DBD packet received(by checking the M field in the DBD packet), the router will check if there are some LSAs that don't exist in its own LSDB.


DBD2

  • LSA header: A brief description of the LSA, it doesn't contain the detailed LSA information. 



If the router finds some LSA that doesn't exist in its own LSDB, it will set the neighbor router to a loading state and begin to send an LSR packet to request detailed associated LSAs.


In the next episode, we will introduce how the OSPF routers request the detailed associated LSAs and update its own LSDB.

OSPF routing protocol is a link-state routing protocol for Internet Protocol (IP) networks. The protocol uses the internal gateway protocol (IGP) of link state routing algorithm to work within a single autonomous system (AS). OSPFv2 protocol for IPv4 is defined in RFC 2328 [1], and RFC 5340 [2] defines OSPFv3 for IPv6.
View more
  • x
  • convention:

good examples
View more
  • x
  • convention:

victorDa
victorDa Created Dec 27, 2020 22:11:13 (0) (0)
 
easy explanations
View more
  • x
  • convention:

thanks .....
View more
  • x
  • convention:

Wow! Very helpful. Thanks.
View more
  • x
  • convention:

Very helpful
View more
  • x
  • convention:

thx
View more
  • x
  • convention:

EdimarG
EdimarG Created Jan 10, 2021 17:48:19 (0) (0)
 
Interesting post
View more
  • x
  • convention:

Very helpful content. Thank you
View more
  • x
  • convention:

EdimarG
EdimarG Created Jan 10, 2021 17:48:26 (0) (0)
 

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.