OSPF protocol comprehensive networking experiment

One, OSPF overview

1. IGP (Interior Gateway Protocol), AS internal gateway routing protocol.
2. Link state dynamic routing protocol.
3. IP protocol number 89.
4. Sub-area. The area is composed of some network ranges. area 0 is the backbone area. The router link state database in the same area needs to be synchronized.
5. Use hello, Database Description, Link State Request, Link State Update, Link State Acknowledgment these 5 packets to discover and establish adjacency relationships, exchange LSA (Link State Advertisement), and synchronize link state databases.
6. Use 5 LSAs to describe the topology in the area, the routes of other areas in the AS, and the routes learned from the external AS in the AS: 1). Router links advertisements; 2). Network links advertisements; 3). Summary link advertisements; 4).ASBR-Summary link advertisements; 5).AS external link advertisements.
7. Use link state database to store LSA and use SPF (Shortest Path First) algorithm. Taking itself as the root, calculate the acyclic shortest path tree to the destination network.

2. Experimental topology diagram

Insert picture description here

Three, the experimental process

1. Set up a network topology diagram;
2. Configure the host's IP address, subnet mask and gateway;
3. Configure the router interface IP;
4. Configure the OSPF protocol on the router;
the OSPF protocol configuration of router R1 is as follows:

[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 12.0.0.0 255.255.255.0
[R1-ospf-1-area-0.0.0.0]network 23.0.0.1 255.255.255.0
[R1-ospf-1-area-0.0.0.0]network 23.0.0.0 255.255.255.0
[R1-ospf-1-area-0.0.0.0]q
[R1-ospf-1]area 3
[R1-ospf-1-area-0.0.0.3]network 2.0.0.0 255.255.255.0
[R1-ospf-1-area-0.0.0.3]network 10.0.0.0 255.255.255.0
[R1-ospf-1-area-0.0.0.3]quit
[R1]quit

The OSPF configuration of R2 and R3 is similar.
5. View routing table information.
Insert picture description here
6. Capture packets at GE0/0/1 of router R2

Fourth, the message interaction process

1. Discover
the HELLO message of R2 through the neighbors of the HELLO message: The HELLO message of
Insert picture description here
R3:
Insert picture description here
At this time, the router R3 receives the HELLO message of R2 and sends HELLO to R3. The hello data packet will maintain the two states of init and two-way. When the neighbor field in the hello packet of the other party does not contain itself, it is in the init state. When the neighbor field in the hello packet of the other party is found to contain itself, Then enter the two-way state, marking the establishment of the neighbor relationship, that is, you can send the database description data packet.

2.
After the 2way negotiation of the master-slave relationship of the DD message ends, it begins to enter the ExStart phase. First, R1 sends an empty DD message to R2, including its router ID, where (MS,I,M) = (1,1,1), declaring itself as the Master; R2 receives the DD message and compares its own The router ID and the router ID of R1 find that their router ID (2.2.2.2) is smaller than the router ID of R1 (3.3.3.3), so R1 is set as the Master and sends DD packets. At the end of ExStart, it is determined that R1 is the master and R2 is the slave, and both routers enter the Exchange state.
Insert picture description here
R3 sends a DD message for the first time and sets the Master to Yes.
Insert picture description here
At the same time, R2 sends a DD message for the first time, and also sets Master to Yes.
Insert picture description here
R3 sends a DD message for the second time and sets Master to Yes. R3 tells R2 that your RID is smaller than mine, so I should be Yes.
Insert picture description here
R2 sends a DD message for the second time and sets its Master to No.
3. DD packet exchange summary information
R3 unicast LSR request:
Insert picture description here
R2 reply confirmation message
Insert picture description here
4. LSA request, update, confirmation
Insert picture description here

Five, link status description

LSA type:
Insert picture description here

Six, neighbor state diagram

Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_44366125/article/details/105874158