RIP (Distance Vector Routing Protocol) and OSPF

One, RIP

Dynamic routing is based on a certain routing protocol

1. Features of dynamic routing

1. Reduced management tasks
2. Occupy network belt frame

2. Overview of dynamic routing

The language used to exchange information between routers

3. Measure value

Metrics: number of hops, bandwidth, load, delay, reliability, cost

4. Convergence

The process of bringing all routing tables to a consistent state

5. Comparison of static routing and dynamic routing

Static routing and dynamic routing complement each other in the network

6. The difference between RIPv1v2

Rip1 is a classful routing protocol with fixed boundaries and cannot be divided into subnets. rip1 is updated through broadcast, and rip2 is multicast
rip1 automatic route summarization cannot be closed, rip2 supports automatic route summarization and can be closed manually. rip1 does not support discontinuous subnets, rip2 supports discontinuous subnets.

7. RIP configuration

[R1] rip1
[R1] version 2
[R1] undo summary
[R1] network


1. Overview of OSPF

OSPF (Open Shortest Path First) is an interior gateway protocol (Interior Gateway Protocol, IGP), which is used to make routing decisions in a single autonomous system (AS). It is an implementation of the link state routing protocol, which belongs to the interior gateway protocol (IGP), so it operates within the autonomous system. The famous Dijkstra algorithm is used to calculate the shortest path tree. OSPF supports load balancing and routing based on service types, as well as multiple routing forms, such as specific host routing and subnet routing.

2. Classification of agreements

1. According to the autonomous system, it is divided into
IGP: internal gateway routing protocol, a routing protocol running inside the AS, which mainly solves the problem of routing within the AS, and discovers and calculates routes.
Main protocols: RIP1/RIP2, OSPF, ISIS, EIGRP (Cisco Proprietary Protocol)
EGP: External gateway routing protocol, a routing protocol running between AS and AS, it solves the problem of routing between ASs.
Usually: BGP
2. Press Protocol type classification
Distance vector routing protocols: RIP1/2, BGP (Path Vector Protocol), EIGRP (Advanced Distance Vector Protocol
routers do not fully understand the topology of the entire network. It is a "legendary route", A sends routing information to B, and B adds The above metric value is sent to C again, and the entries in the routing table are heard.
3. Link state routing protocol: OSPF, ISIS
routers have a complete understanding of the entire network topology. It is a "route for sending messages", and A sends the information Put it in a letter and send it to B. B does not make any changes to it, copy it down, and put his information in another letter. The two letters are sent to C together, so that there is no change or loss of the information, and finally all The routers all receive the same bunch of letters, and this bunch of letters is LSDB. Then, each router uses the same SPF algorithm, takes itself as the root, calculates the SPF Tree (each plan that is about to reach the destination), and selects the most The best path is placed in the routing table.

3. The working process of OSPF

Establish adjacency relationship-link state database-shortest path tree-routing table

4. OSPF working area

In order to adapt to a large network, OSPF divides multiple areas within the AS. Each OSPF router only maintains the complete link state information of the area where it is located. The area ID can be expressed as a decimal number or as an IP
backbone area Area 0 (Responsible for the propagation of routing information between areas) Non-backbone area
Router ID (the IP address that uniquely identifies the router in the OSPF area)
Router ID selection rules
Select the IP address with the highest value on the router loopback interface.
If there is no loopback interface, select the IP address from the physical port The highest one
can also use the router-id command to specify the Router ID

5. How OSPF works

OSPF simply means that two adjacent routers become neighbors in the form of sending messages, and the neighbors send link state information to each other to form an adjacency relationship, and then each calculates the route according to the shortest path algorithm, and puts it in the OSPF routing table, OSPF routing It is added to the global routing table after comparing with other routes.
Hello packets:
discovering and maintaining neighbor relationships, electing DR and BDR
database description packet (DBD)
to send summary information to neighbors to synchronize the link state database
link state request packet (LSR) the
router receives new information and sends the DBD, Request more detailed information The
link state update package (LSU)
sends the complete information corresponding to the header information requested by the LSR to the neighbor.
The link status confirmation packet (LSAck)
confirms the
seven states of DBD/LSU after receiving the LSU message.
Down: initialization
init: receiving the first Hello packet
2-way: establishing a two-way session
Exstart: establishing a master-slave relationship
Exchange: Exchange summary Information
Loading: Loading detailed information
Area type of fully connected OSPF
-standard area
-stub area-
totally stubby area
-non-pure stubby area (NSSA)

Link State Announcement (LSA) Type
Type 1 router LSA is issued by routers in the area, describing the link status and cost of the router, and passed to the entire area.
Type 2 network LSA is issued by the DR in the area, describing changes in the area The information is transmitted to the
Type 3 network summary LSA ABR in the entire area , the summary link advertisement of other areas describes the route of a certain network segment in other areas, and the
Type 4 ASBR summary LSA ABR is transmitted between areas to advertise the ASBR. Information to determine the location of the ASBR, and it will not appear in the area where the ASBR belongs.
Type 5 AS external LSA ASBR sends out, used to advertise external routes, tell the routers of the same AS the path to the external AS, and flood the entire AS.
Type 7 NSSA external LAS The ASBR in the NSSA area is used to advertise the external routes connected to the area. Similar to Type 5, it is flooded only in the non-pure stub area, and will be converted by the ABR to the LSA5
stub area and complete. Peripheral area

Areas that meet the following conditions

Only one default route as an export zone
area can not pass through the area as a virtual links
Stub area where no autonomous system border router ASBR
is not the backbone area Area 0
peripheral area
not LSA4,5,7 notice
entirely peripheral area
default route in addition to a LSA3 In addition to the notification, there is no notification of LSA3, 4, 5, and 7. The function of the
tip and the complete tip
Reduce the LSA entries and routing entries in the area and
reduce the CPU and memory usage of the device

Guess you like