Social Icons

Friday, August 9, 2013

CCNP ROUTE: 8.OSPF packets and database exchange process - Exchange without a DR

Every router in an area, when OSPF stabilizes after topology changes occur, should have an identical LSDB for that area.

The OSPF packets are: HELLO, DBD, LSR, LSU, LSAck

HELLO: discover neighbors, check the conditions to become neighbors, monitor neighbor, brings neighborship to the 2-WAY state
DBD: exchange brief versions of each LSA, typically on initial topology exchange, so that a router knows a list of that neighbor’s known LSAs
LSR: lists the LSIDs of LSAs the sender of the LSR would like the receiver of the LSR to supply during database exchange
LSU: contains fully detailed LSAs, typically sent in response to an LSR message
LSAck: confirm receipt of an LSU message

The OSPF neighbor states are: Down, Attempt, Init, 2-WAY, Exstart, Exchange, Loading, Full

The most common case for which routers do not elect a DR occur on point-to-point topologies, such as true point-to-point serial links and point-to-point subinterfaces.

Routers discover each other by sending multicast Hellos (224.0.0.5 all-OSPF-routers) and then check each other’s parameters to make sure all items match.

OSPF neighborship criteria:
-Interfaces’ primary IP addresses must be in same subnet.
-Must be in same area.
-Hello/Dead timers must match.
-Unique RIDs.
-MTU must match.
-Must pass neighbor authentication (if configured).

After a router has both received a Hello and verified that all the required parameters agree, the router lists the other router’s RID in the Hello as being seen, as shown in the bottom two Hello messages in the figure.
When a router receives a Hello that lists its own RID as having been seen by the other router, the router can transition to 2-Way state.
When a router has reached the 2-Way state with a neighbor, the router then decides whether it should exchange its LSDB entries.
When no DR exists, the answer is always “yes.”

Consider the R1-R5 neighborship (point-to-point link, no DR):

R1#show ip ospf neighbor serial 0/2

Neighbor ID     Pri   State           Dead Time   Address         Interface
5.5.5.5           0   FULL/  -        00:00:39    192.168.0.18    Serial0/2

Enabling OSPF event debugging on R5 and shut/no shut R1's Serial0/0 connecting to R5's Serial0/2:

*Mar  1 01:23:06.495: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on Serial0/0 from FULL to DOWN, Neighbor Down: Interface down or detached
R5#debug ip ospf events 
OSPF events debugging is on
R5#
*Mar  1 01:23:26.467: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up
*Mar  1 01:23:26.483: OSPF: Interface Serial0/0 going Up
*Mar  1 01:23:26.487: OSPF: Send hello to 224.0.0.5 area 0 on Serial0/0 from 192.168.0.18
*Mar  1 01:23:26.499: OSPF: Rcv hello from 1.1.1.1 area 0 from Serial0/0 192.168.0.17
*Mar  1 01:23:26.503: OSPF: 2 Way Communication to 1.1.1.1 on Serial0/0, state 2WAY
*Mar  1 01:23:26.503: OSPF: Send DBD to 1.1.1.1 on Serial0/0 seq 0x175 opt 0x52 flag 0x7 len 32
*Mar  1 01:23:26.507: OSPF: Send immediate hello to nbr 1.1.1.1, src address 192.168.0.17, on Serial0/0
*Mar  1 01:23:26.507: OSPF: Send hello to 224.0.0.5 area 0 on Serial0/0 from 192.168.0.18
*Mar  1 01:23:26.511: OSPF: End of hello processing
*Mar  1 01:23:26.527: OSPF: Rcv DBD from 1.1.1.1 on Serial0/0 seq 0x7F4 opt 0x52 flag 0x7 len 32  mtu 1500 state EXSTART
*Mar  1 01:23:26.527: OSPF: First DBD and we are not SLAVE
*Mar  1 01:23:26.531: OSPF: Rcv DBD from 1.1.1.1 on Serial0/0 seq 0x175 opt 0x52 flag 0x2 len 352  mtu 1500 state EXSTART
*Mar  1 01:23:26.531: OSPF: NBR Negotiation Done. We are the MASTER
*Mar  1 01:23:26.535: OSPF: Send DBD to 1.1.1.1 on Serial0/0 seq 0x176 opt 0x52 flag 0x3 len 352
*Mar  1 01:23:26.615: OSPF: Rcv DBD from 1.1.1.1 on Serial0/0 seq 0x176 opt 0x52 flag 0x0 len 32  mtu 1500 state EXCHANGE
*Mar  1 01:23:26.619: OSPF: Send DBD to 1.1.1.1 on Serial0/0 seq 0x177 opt 0x52 flag 0x1 len 32
*Mar  1 01:23:26.619: OSPF: Send LS REQ to 1.1.1.1 length 12 LSA count 1
*Mar  1 01:23:26.623: OSPF: Rcv LS REQ from 1.1.1.1 on Serial0/0 length 36 LSA count 1
*Mar  1 01:23:26.623: OSPF: Send UPD to 192.168.0.17 on Serial0/0 length 28 LSA count 1
*Mar  1 01:23:26.623: OSPF: Rcv DBD from 1.1.1.1 on Serial0/0 seq 0x177 opt 0x52 flag 0x0 len 32  mtu 1500 state EXCHANGE
*Mar  1 01:23:26.623: OSPF: Exchange Done with 1.1.1.1 on Serial0/0
*Mar  1 01:23:26.627: OSPF: Rcv LS UPD from 1.1.1.1 on Serial0/0 length 136 LSA count 1
*Mar  1 01:23:26.627: OSPF: Synchronized with 1.1.1.1 on Serial0/0, state FULL
*Mar  1 01:23:26.627: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on Serial0/0 from LOADING to FULL, Loading Done

As seen above:
-hellos are sent to multicast address 224.0.0.5
-the process transitions from DOWN->2WAY->EXSTART->EXCHANGE->LOADING->FULL
-MASTER/SLAVE negotiated during EXSTART state
-OSPF packets are being exchanged: Hello, DBD, LSR (LS REQ), LSU (UPD)
-the MASTER sends the first LSR
-the acknowledgement of the LSU packet can be made either by an ACK packet or by sending the same LSA that was received back to the other router in an LSU message (implicit
acknowledgment)
-when all LSAs have been sent, received, and acknowledged, transition thneighborship to the FULL state (fully adjacent).

Note: During the Exstart state the routers are currently negotiating the DBD sequence numbers and master/slave logic used for DBD packets.
 After electing a master, the routers transition to the Exchange state. The master sends the LSR first and the slave responds with its known LSAs.

Note: LSAck packets can be seen with "debug ip ospf packet". They are Type 5 packets (Hello-1, DBD-2, LSR-3, LSU-4, LSAck-5):
R5#debug ip ospf packet 
OSPF packet debugging is on
*Mar  1 01:49:36.475: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up
R5#
*Mar  1 01:49:36.531: OSPF: rcv. v:2 t:1 l:48 rid:1.1.1.1
      aid:0.0.0.0 chk:DF92 aut:0 auk: from Serial0/0
*Mar  1 01:49:36.587: OSPF: rcv. v:2 t:2 l:32 rid:1.1.1.1
      aid:0.0.0.0 chk:94A1 aut:0 auk: from Serial0/0
*Mar  1 01:49:36.591: OSPF: rcv. v:2 t:2 l:352 rid:1.1.1.1
      aid:0.0.0.0 chk:D702 aut:0 auk: from Serial0/0
*Mar  1 01:49:36.599: OSPF: rcv. v:2 t:2 l:32 rid:1.1.1.1
      aid:0.0.0.0 chk:7E62 aut:0 auk: from Serial0/0
*Mar  1 01:49:36.599: OSPF: rcv. v:2 t:3 l:36 rid:1.1.1.1
      aid:0.0.0.0 chk:E7C1 aut:0 auk: from Serial0/0
*Mar  1 01:49:36.603: OSPF: rcv. v:2 t:4 l:136 rid:1.1.1.1
      aid:0.0.0.0 chk:2343 aut:0 auk: from Serial0/0
*Mar  1 01:49:37.095: OSPF: rcv. v:2 t:4 l:148 rid:1.1.1.1
      aid:0.0.0.0 chk:6AF4 aut:0 auk: from Serial0/0
*Mar  1 01:49:39.115: OSPF: rcv. v:2 t:5 l:64 rid:1.1.1.1
      aid:0.0.0.0 chk:21A aut:0 auk: from Serial0/0

No comments:

Post a Comment