Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Dynamic routing protocol

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

Basic dynamic routing protocols

Overview of dynamic routin

Dynamic routing is a process in which routers in the network communicate with each other, transmit routing information, and update the routing table with the routing information received. It can adapt to the change of network structure in real time. If the routing update information indicates that the network has changed, the routing software recalculates the route and sends out a new routing update message. This information passes through each network, causing each router to restart its routing algorithm and update its routing table to dynamically reflect the change of network topology.

If the dynamic routing protocol is used, the routers will send their own routing information to the neighboring routers, and receive the routing information sent by the neighboring routers, save the routing information selectively and generate their own routing table.

Dynamic routing is suitable for networks with large scale and complex network topology. The characteristics of dynamic routing are as follows:

Reduced management tasks. Because the process of dynamic routing is completely completed by the router itself, the administrator only needs to make a simple configuration, and the tasks of route learning, route forwarding and route maintenance are all completed by dynamic routing. After dynamic routing is configured, when the network topology changes, there is no need to reconfigure, dynamic routing will understand these changes by itself, thus modifying the routing table.

Takes up the bandwidth of the network. Because dynamic routing learns about the network by communicating with other routers, each router has to tell other routers what they know about the network, and at the same time learn from other routers what they do not know about the network. in this way, it is inevitable to send packets, and these routing packets will occupy a certain amount of network traffic.

Dynamic routing protocol

Overview of dynamic routing protocols

Dynamic routing is based on a certain routing protocol (Routing Protocol). Routing protocols define some rules for routers to communicate with other routers. In other words, routing protocols specify how routers learn routing, what criteria are used to select routes and maintain routing information, and so on.

A dynamic routing protocol is like a language used to communicate information between routers, through which network connection information and status information can be shared between routers. Dynamic routing protocols are not limited to path selection and routing table updating. When there is a problem with the optimal path to the destination network, the dynamic routing protocol can choose the next optimal path to replace among the remaining available paths.

Each dynamic routing protocol has its own routing algorithm, which is a series of steps to solve the problem. A routing algorithm must have at least the following necessary steps:

Pass routing information to other routers.

Receive routing information from other routers.

According to the received routing information, the optimal path of each destination network is calculated, and the routing table is generated.

Respond in time according to the change of the network topology, adjust the route to generate a new routing table, and announce the topology change to other routing information in the form of routing information.

Measurement value

Different routing protocols use different metrics and sometimes multiple metrics.

Hop count: the hop count (Hop Count) metric can simply record the hop count of the router.

Bandwidth: the bandwidth (Bandwidth) metric will choose a high-bandwidth path over a low-bandwidth path.

Load: the load (Load) metric reflects the amount of traffic taking up the link along the way. The best path should be the path with the lowest load. Unlike hops and bandwidth, the load on the path changes, so the metric changes accordingly. It is important to note that if the metric changes too frequently, the route wobble (the optimal path changes frequently) may occur frequently. Route wobble will have a negative impact on the CPU of the router, the bandwidth of the data link and the stability of the whole network.

Delay: delay (Delay) is a measure of how long a packet takes to travel through a path. When using delay as a metric, the routing protocol will choose the path with the lowest delay as the optimal path.

Reliability: a Reliability measure is used to measure the likelihood that a link will fail under certain circumstances. Reliability can be variable or fixed. The number of link failures or the number of errors received during a specific time interval are examples of variable reliability metrics. The fixed reliability metric is based on the known quantity of a link determined by the administrator. The path with the highest reliability will be the first choice.

Cost: Cost is a general term used to describe the pros and cons of routing. Minimum cost (highest cost) or shortest (longest) simply refers to the routing protocol's view of the path based on its own specific metrics. The network administrator can define the Cost manually.

Convergent

A dynamic routing protocol must include a series of processes that are used by routers to advertise local directly connected networks to other routers, receive and process similar information from other routers, and relay information received from other routers. In addition, routing protocols need to define metrics that determine the optimal path. Another standard for routing protocols is that the reachable information in the routing tables of all routers on the Internet must be consistent. The process of bringing all routing tables to a consistent state is called Convergence. The sum of the time spent by all routers to achieve information sharing and to calculate the optimal path is the convergence time.

Static and dynamic routin

Through the learning of dynamic routing, it is felt that dynamic routing protocol is better than static routing protocol. Dynamic routing protocol is to automatically detect and update the routing table as the network topology changes. Static routing protocols are difficult to manage for large and medium-sized networks, but it is very convenient to configure static routes in small networks.

Static routing and dynamic routing have their own characteristics and practical scope, and static routing and dynamic routing complement each other in the network. Of all routes, static routes have the highest priority except directly connected routes. When a packet makes a path selection in the router, the router first looks for the static route, and if it finds it, it forwards the packet according to the corresponding static route, otherwise it looks for the dynamic route. When a static route conflicts with a dynamic route, the static route shall prevail.

Dynamic routing protocol classification

Common routing protocols can be divided into distance vector routing protocols and link-state routing protocols. Distance vector routing protocols choose routes according to the number of routers from the source network to the destination network, typical protocols such as RIP and IGRP. Link-state routing protocols take into account a variety of paths from the source network to the destination network to choose routes, typical protocols such as OSPF and IS-IS.

Distance vector routing protocol

The name of the distance vector comes from the fact that the route is advertised as a vector (distance, direction), where the distance is defined according to the metric and the direction is defined according to the next-hop router. For example, the expression "five hops away from destination An in the direction of next-hop router X" implies that each router learns the routing information they have observed from neighboring routers and then advertises the routing information it has observed. Because each router relies on neighboring routers for information, and neighboring routers learn routing from their neighboring routers, and so on, distance vector routing is sometimes thought of as "routing based on hearsay".

Link-state routing protocol

The information used by distance vector routing protocols can be compared to the information provided by road signs, while link-state routing protocols are like a road map. A link-state router is not easily deceived into making the wrong routing decision because it has a complete network diagram. The link state is different from the way distance vectors route according to rumors because link-state routers get first-hand information from peers. Each router generates some information about itself, its locally directly connected networks, and the state of these links. This information is transmitted from one router to another, and each router makes a backup of the information, but does not change the information. The ultimate goal is that each router has the same information about the Internet, and each router can independently calculate the optimal path.

How RIP routing Protocol works

Periodic updates (Periodic Updates): periodic updates mean that update information is sent every time period has elapsed. It should be noted that if the update information is sent too frequently, it may cause congestion, but if the update information is not sent frequently, the network convergence time may be unacceptably long.

Neighbor (Neighbors): from a router's point of view, a neighbor usually means a router that shares the same data link. The distance vector routing protocol sends update information to the neighbor router and relies on the neighbor to deliver the update information to its neighbors. Therefore, distance vector routing protocols are said to use hop-by-hop update.

Broadcast Update (Broadcast Update): how can a router find other routers when it is first activated on the network? How does it declare its existence? The easiest way is to send an update to the broadcast address (255.255.255.255 in the IP network). Neighboring routers that use the same router selection protocol will receive broadcast packets and act accordingly. Hosts and other devices that do not care about routing updates will drop the packet.

Full routing table update (Full Routing TableUpdate): most distance vector routing protocols use a very simple method to tell their neighbors everything they know by broadcasting its entire routing table. After receiving these updates, neighbors collect the information they need, and the rest is discarded.

The formation of routing table

When the router is configured with the IP address of the interface, and in the case of interface up, an entry for directly connected routes appears in the routing table of each router. If the router is configured with the RIP routing protocol, the routers will send their own routing table information to each other.

When a router receives routing information from a neighboring router, it compares it with an entry in its own routing table, and if it already has this routing information in the routing table, the router compares whether the newly received routing information takes precedence over the existing entry. If it takes precedence over an existing entry, the router replaces the original routing entry with new routing information. On the contrary, the router compares whether the routing information and the original entry come from the same source, and if it comes from the same source, it updates, otherwise it ignores the routing information.

Metrics and update time of RIP

The measure of RIP

The RIP routing protocol uses hop count as the only metric.

In RIP, the maximum number of hops is 15, and 16 hops are considered unreachable. Therefore, the RIP routing protocol is not suitable for large wide area networks.

Update time of RIP

RIP uses the UDP protocol and the port number is 520

After the router starts up, routing update messages are sent from each interface that starts the RIP protocol every 30 seconds on average.

Split horizon (Split Horizon)

After the network converges, the router is still sending out the entire routing table at intervals of 30 seconds.

Split horizon can prevent the occurrence of routing loops. the rule of split horizon is that routing information is learned from an interface and no longer sent out of that interface. Split horizon can not only prevent the generation of routing loops, but also reduce the link bandwidth resources occupied by routing update information.

Configuration and Verification of RIP routing Protocol

Configuration command

To configure the RIP routing protocol, start the RIP process on the router.

The command to start the RIP process is as follows:

Router (config) # router rip

Router (config-router) #

Then, to announce the primary network number of all interfaces on the router that initiate RIP, the command is as follows:

Router (config-router) # network network-number

Commands for verifying configuration

View routing tabl

Use the View routing Table command to see if the routing table has learned the correct route entries through the RIP protocol, as follows:

Router# show ip route

All the segments of the network can be seen in the routing table, indicating that the RIP is configured correctly. The route entry marked with C in front is a directly connected route, and marked R is the route learned through the RIP routing protocol. [120] after the segment number indicates administrative distance (priority) and metric (hop count).

Administrative distance is a measure of priority. When two routes reach the same network, the router will choose the route with smaller administrative distance to reach the destination network segment. Static routes have an administrative distance of 1, while the RIP protocol has an administrative distance of 120, so if you reach the same network segment and both static routes and RIP are configured, the router will choose the path that the static route points to to forward the data.

Priority of RIP: 120, priority of OSPF: 110

View the configuration of the routing protocol

Use the command to view the routing protocol configuration to view information about the RIP timer, the version used, the declared network segment, and so on. The command is as follows:

Router#show ip protocols

By default, RIP uses version 1 to send routing updates and can accept routing updates for both v1 and v2 versions.

RIP v1 and TIP v2

The RIP routing protocol contains two versions, RIP v1 and RIP v2. The main differences between version 1 and version 2 are as follows:

RIP v1 broadcast sends routing updates, broadcast address 255.255.255.255X RIP v2 Multicast sends routing updates, Multicast address 224.0.0.9

RIP v1 is a classful routing (Classful) protocol that does not carry a network mask when declaring routing information, while RIP v2 is a classless routing (Classless) protocol that carries a network mask when declaring routing information.

Another feature of classful routing protocols is automatic route summarization on border routers.

Configuration of RIP v2

To configure the RIP protocol, use the command for version v2 as follows:

Router (config) # router rip

Router (config-router) # version 2

RIP v2 does route summarization at the main network boundary by default, so route summarization needs to be turned off.

Router (config-router) # no auto-summary

Then announce the main network number.

Router (config-router) # network network-number

Verify RIP v1 and RIP v2

Experimental environment:

Connect to the network as shown in the topology diagram, where 10.1.1.0 and 10.1.2.0 are using the Loopback interface, respectively.

Requirements description:

It is required to configure RIP v1 and RIP v2 respectively, and verify that the network can communicate properly.

Specific steps:

Configure the interface address of the router to achieve router interworking

Configure the RIP v1 protocol, use show ip route to view the routing table, and verify that network communication is working properly by using the Loopback interface address of pingR1 or R3 on R2.

Configure RIP v2 protocol and use ping and showip route view commands to verify that network communication is normal.

RIP configuration

Experimental environment:

Connect the network according to the topology diagram shown in the figure, and realize the interconnection of the whole network within the company by configuring the router, the specific planning is as follows.

Interconnection address of R1 and R2: 192.168.0.0Universe address of R1 and R3 interconnection address: 192.168.1.0 Grammer 24heroR2 and R3 interconnection address: 192.168.2.0Cash 24gamma R3 and R4 interconnection address: 192.168.3.0 shock 24.

Use the Loopback interface of the router to simulate the Loopback0:192.168.40.0/24 of the Loopback0:192.168.20.0/24,R2 of the Loopback0:192.168.20.0/24,R2 of R1, the client host within the company.

Requirements description:

In order to avoid frequent configuration due to network segment changes, RIP router protocol is required.

Specific steps:

Configure the interface address of the router to achieve router interworking.

Configure RIP protocol to realize network interworking.

Use the show ip route command to view the routing table

Use the ping command to verify that the network and RIP protocols are working

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report