RIP protocol and OSPF protocol

Reference website: http://www.fx361.com/page/2018/0903/4182076.shtml

1. Classification of routing protocols

Each routing protocol has its own algorithm. When routing protocols share and transmit routing update information, they even converge because of different algorithms. Routing protocols can be divided into two categories based on algorithms: Distance Vector and Link State.

The distance vector protocol directly transmits the respective routing table information. The routers in the network get routing information from their neighbor routers, and send these routing information together with their own local routing information to other neighbors, so that they are passed on level by level to achieve synchronization across the entire network. Each router does not know the entire network topology, they only know the network conditions directly connected to them, and update their routes based on the routing information obtained from their neighbors.

The link state routing protocol does not pass routing items to neighbors, but advertises the status of some links to neighbors. Compared with the distance vector routing protocol, the link state protocol has an essential difference in the routing calculation method. Routers running this routing protocol do not simply learn routes from neighboring routers, but collect link state information of all routers, generate network topology based on the state information, and then each router calculates a route based on the topology.

2. Representative of distance vector protocol: RIP

Routing Information Protocol (RIP) for short is RIP, the most widely used distance vector protocol, which was developed by Xerox in the 1970s. The TCP/IP version of RIP is an improved version of the Xerox protocol.

1. How RIP works

The realization of RIP is based on the distance vector algorithm. Simply put, the calculation of the distance vector introduces the jump value as a metric value. When each route passes through the path, the number of hops in the path increases by 1. This means that the greater the number of hops, the more routers will pass through the path and the longer the relative path. RIP is to find the path with the smallest hop value between two destination routers through information exchange between routes.

2. Features of RIP

(1) Only exchange information with neighboring routers. The RIP protocol stipulates that non-adjacent routers do not exchange information.

(2) The information exchanged by the router is all the information currently known by the router, that is, its own routing table.

(3) Exchange routing information at regular intervals, and then the router updates the routing table according to the received routing information. When the network topology changes, the router also promptly advertises the routing information after the topology change to the neighboring routers.

3. Limitations of RIP

(1) Due to the limitation of the maximum number of hops, RIP is not suitable for larger networks. Because if the network is too large, the number of hops will exceed its limit and the path will be considered invalid, making the network unable to work normally.

(2) Since any network device can send routing update information, the reliability and security of RIP cannot be guaranteed.

(3) The algorithm used by RIP, the distance vector algorithm, only considers the size of the hop value in the path. However, in the actual environment, network delay and network reliability will become important indicators that affect network transmission quality. Therefore, the hop value cannot fully reflect the actual situation of the network, which may make the router appear sub-optimal in path selection.

(4) The update time of routing information is longer, and because the router sends all routing table information during the update, it takes up relatively more network resources, so RIP has higher requirements for network bandwidth, which will increase network overhead.

3. Representative of Link State Protocol: OSPF

The open shortest path first (Open Source Path First) protocol is a representative of link state routing protocols. It was developed in 1989 to overcome the shortcomings of RIP. Compared with RIP, OSPF applies to a larger network and a wider range. In addition, OSPF also got rid of the distance vector protocol algorithm, but based on the shortest path algorithm proposed by Dijkstra. At the same time, the protocol can also support hierarchical networks, which makes the application of OSPF more flexible and extensive. It should be noted here that OSPF is just the name of a protocol, it does not mean that other routing protocols are not the shortest path. In fact, the goal of all routing protocols used in autonomous systems is to find the shortest path.

1. How OSPF works

The concept of link state is introduced in OSPF. The so-called link state, because it contains the auxiliary ports in the link and other measurement information. Link-State Advertisement is widely used when updating the network topology information database of routers. The network topology database in the router is the collection and sorting of the link state announcements issued by all routers in the same area to form the topology structure diagram of the entire network. After the information collection process of the link state information base is completed, the router will generate a loop-free path graph according to the shortest path first algorithm. This figure describes the shortest path that takes each router itself as the starting point to reach all known destination routers, that is, the optimal path. This path graph is called the shortest path first tree.

2. Features of OSPF

(1) Send information to all routers in the autonomous system. This method is called flooding, which means that the router sends link state information to all neighboring routers through all output ports. And each router sends this information to all its neighboring routers again. In this way, eventually all routers in the entire area get a copy of this information.

(2) The information sent is the link status of all routers adjacent to this router, but this is only part of the information that the router knows. The so-called link state actually indicates which routers this router is connected to and the metric value of the link. OSPF uses this metric to indicate cost, distance, delay, bandwidth, and so on.

(3) Only when the link status changes, the router floods and sends information to other routers, not to RIP. Regardless of whether the network topology changes, it must periodically exchange routing table information.

3. Limitations of OSPF

(1) Compared with other network protocols, OSPF's working mode is more complicated, and it has higher requirements for network configuration and maintenance personnel, and requires relevant personnel to have better planning and design of the network in the early stage.

(2) OSPF's work is based on the shortest path first algorithm, which is more complicated and requires more CPU and memory resources. It has higher requirements for router performance and increases the cost of networking.

Fourth, the comparison and conclusion of the two routing protocols

In terms of complexity, RIP is relatively simple and easy to configure; OSPF is more complex and requires high configuration, and requires network planning and design. Due to the limitation of the number of hops, RIP is more suitable for smaller networks; while OSPF is more suitable for complex and hierarchical networks. RIP is based on the distance vector algorithm, while OSPF is based on the shortest path first algorithm. As far as the convergence time of the two is concerned, the update time of RIP is relatively longer. Because RIP update information needs to be transmitted in the network, its network bandwidth occupies a lot and periodically transmits routing information, which requires high bandwidth; while OSPF sends link state information, and update information is only transmitted between neighboring routers. In terms of working mode, RIP sends a complete routing table every 30 seconds. If the router does not send an updated routing table for more than 180 seconds, the router will be marked as invalid. After 120 seconds, the router will be marked as non-existent; while OSPF The Hello packet is sent every 10 seconds. If the Hello packet is not sent for more than 40 seconds, the router will be considered invalid and the routing database will be updated every 30 minutes.

In summary, RIP is mainly suitable for small and simple networks, which is good for maintenance; while OSPF is more suitable for applications in more complex large networks.

Guess you like

Origin blog.csdn.net/weixin_44763595/article/details/111284106