Method for generating routing table items in a distributed router, and distributed router
A distributed and router technology, applied in the field of communication, can solve the problem of packet loss in the failure recovery of the main router
Active Publication Date: 2014-01-15
BEIJING HUAWEI DIGITAL TECH
5 Cites 21 Cited by
AI-Extracted Technical Summary
Problems solved by technology
[0007] Embodiments of the present invention provide a method for generating routing entries in a distributed router and a di...
Abstract
The embodiment of the invention provides a method for generating routing table items in a distributed router. The method comprises receiving a routing update message including a routing prefix and a first next hop; obtaining a corresponding first routing table item including a second next hop, and adding the first next hop into the first routing table item to generate a second routing table item; starting a delete timer when the priority of the second next hop is lower than that of first next hop information, the duration of the delete timer being a preset time value; and deleting the second next hop in the second routing table item to generate a third routing table item when the time of the delete timer is up, and sending the third routing table item to a forwarding information table of an interface board. The embodiment of the invention also provides a distributed router. Through the technical scheme of the embodiment of the invention, during dual homing networking, packet loss can be effectively avoided when a fault of a main router recovers.
Application Domain
Data switching networks
Technology Topic
Distributed computingTimer +3
Image
Examples
- Experimental program(1)
Example Embodiment
[0024] In order to make the purposes, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments These are some embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0025] see figure 2 , an embodiment of the present invention provides a method for generating a routing table entry in a distributed router, where the distributed router includes a main control board and an interface board, including:
[0026] 202, receiving a routing update message including the routing prefix and the first next hop;
[0027] In a network, when a routing protocol session is established between routers, they will publish their own routing table entries to each other, and the routing table items are transmitted through routing update messages. For the Interior Gateway Protocol, the English abbreviation is IGP) or the Border Gateway Protocol (the English full name is Border Gateway Protocol, the English abbreviation is BGP).
[0028] 204. Obtain a corresponding first routing table entry in the routing table of the main control board according to the routing prefix, where the first routing table entry includes a second next hop, and add the first next hop to the routing table. generating a second routing table entry in the first routing table entry;
[0029] The routing table entries learned from other network devices in the distributed router are first stored in the routing table of the main control board. The routing table stores routing table entries. The routing table entries include the routing prefix and the next hop. For example, Say, for example, a routing entry with a destination address of 123.1.1.1 will store the routing prefix 123.1.1.1 and the next hop 234.1.1.1.
[0030]The routing table entry in the routing table is indexed by the routing prefix, and the routing prefix information in the received routing update message is used to find out whether there is a matching routing table entry in the routing table, and if a matching routing is found. When an entry is made, the second next hop is added to the found routing entry.
[0031] 206. When the priority of the second next hop is lower than the priority of the first next hop, start a deletion timer, and the duration of the deletion timer is a preset time value. After the deletion timer expires, delete the second next hop from the second routing table entry to generate a third routing table entry, and send the third routing table entry from the routing table to the interface board forwarding information table FIB;
[0032] Optionally, the preset time value is preset through the command line, and when the network administrator performs network planning, according to the number of routing table entries actually stored by the active router, it is estimated in advance that the active router learns the route during fault recovery. Table entries and the total time for sending these routing entries to the interface board FIB, the preset time value is defined according to the estimated total time, and the preset time value should be long enough to ensure that the Within a preset time value, the routing table entry learned by the active router after fault recovery has been sent to the FIB of the interface board. For example, for example, the total number of routing table entries stored by the active router before the failure is 100,000, and it is estimated that the time for the active router to learn the 100,000 routing table entries is about 10 seconds when it recovers from the failure. The time from the routing table entry to the interface board FIB is about 5 seconds, therefore, the preset time value can be set to 20 seconds.
[0033] Optionally, the preset time value may also be set according to different routing prefixes.
[0034] Optionally, a routing prefix set is preset, and the next hop of the routing prefix stored in the routing prefix set needs to be deleted by starting a deletion timer. Correspondingly, before starting the deletion timer, the method further includes: starting the deletion timer when it is determined that the routing prefix set includes the routing prefix of the second routing table entry.
[0035] Optionally, a next hop set is preset, and the next hop stored in the next hop set needs to be deleted by starting a deletion timer. Correspondingly, before starting the deletion timer, the method further includes: when it is determined that the second next hop is included in the next hop set, starting the deletion timer.
[0036] Through the above method, when the routing table entry is generated, it can avoid starting the deletion timer for the next hop of all routing table entries to delete the next hop, and reduce the occupation of the CPU resources of the distributed router. For example, the network When planning the network, the administrator will know which routing entries on the access router are learned from the remote public network through the active router. The routing prefix corresponding to the routing table entry learned by the public network is added to the prefix set. When receiving the routing update message, it is determined that the prefix set contains the routing prefix in the routing update message. Only by starting the timer, the second next hop of the routing table entry found on the main control board is delayed and deleted. Or, when network administrators are planning the network, they will know that after the active router recovers from a fault, the next hop of the routing table entry from the access router to the remote public network will be the active router, and the next hop will be the active router. The next hop of the router is added to the next hop set, and when the main control board finds the routing table entry, it is determined that the next hop set includes the second next hop of the routing table entry. The second next hop of the routing table entry is delayed and deleted by starting the timer.
[0037] Optionally, the routing update message may also include other next hops, for example, a third next hop. According to the routing rules of the routing protocol, the next hop with the same priority will be placed in one update message. Therefore, the priority of the third next hop and the first next hop are the same, correspondingly , after the first routing table entry is acquired in the routing table of the main control board, the third next hop and the first next hop are added to the first routing table entry together.
[0038] Optionally, the first routing table entry may also include other next hops, for example, may also include a fourth next hop. Since the priorities of the next hops in the routing table entry are the same, therefore, When the deletion timer expires, the fourth next hop and the second next hop in the second routing table entry are deleted together.
[0039] 208. Send the third routing table entry from the routing table to the forwarding information table FIB of the interface board.
[0040] Optionally, the interface board receives the third routing table entry sent by the main control board, and stores the third routing table entry in the FIB to form a FIB table entry.
[0041] In order to describe the embodiments of the present invention more clearly, examples are now given, for example, image 3 In the middle, router A is the active router, and router B is the backup router. When router A is working normally, the public network advertises a routing table entry with the prefix 123.1.1.1 to the access router, and the routing table entry 123.1.1.1 passes through router A and router B. Advertised to the access router, the access router will receive from router A the routing table entry 123.1.1.1 whose next hop is router A, and the access router will also receive from router B the routing table whose next hop is router B Item 123.1.1.1, because router A is the active router and has a higher priority than router B, when 123.1.1.1 is stored in the routing table of the access router, the next hop will be router A. Traffic destined for 123.1.1.1 on the public network will be sent from router A. When router A fails, the next hop of the routing table entry 123.1.1.1 will be switched to router B. At this time, the traffic from the access router to the public network destination 123.1.1.1 will be sent from router B. The preset time value is set to 30 seconds through the command line on the access router. When router A recovers from the failure, after router A establishes a routing protocol session with the public network and the access router, the public network will publish 123.1. The routing table entry of 1.1 is sent to router A. Router A will send a routing update message containing the prefix 123.1.1.1 and the next hop to router A to the access router. After receiving the routing update message, the access router will In the routing table of the board, a routing table entry with the prefix 123.1.1.1 and router B as the next hop is found, and router A is added as the next hop to the routing table entry 123.1.1.1, and a timer is started. The timer The duration is the preset time value of 30 seconds. The preset time value can be adjusted by commands, but it must be ensured that the prefix stored in router A within this preset time value is 123.1.1.1 The routing table entry has been sent to the interface board FIB of router A, when the timer expires, delete the next hop router B of the routing table entry 123.1.1.1 in the access router, including the next hop of router A. The routing table entry 123.1.1.1 is sent to the interface board FIB. At this time, the traffic from the access router to the public network with the address 123.1.1.1 will be sent from router A. Because the interface board of router A expires the timer The routing table entry with the prefix 123.1.1.1 has been saved before. Therefore, the traffic arriving at the destination address 123.1.1.1 will be normally forwarded to the public network without packet loss.
[0042] It can be seen that the embodiment of the present invention provides a method for generating a routing table entry in a distributed router. In a dual-homing network, when the main router recovers from a fault, the next hop with a low priority is deleted after a delay to ensure that the When traffic passes through the access router and reaches the active router, the interface board of the active router has saved the corresponding FIB entry, which can effectively avoid packet loss.
[0043] see Figure 5 , an embodiment of the present invention provides a distributed router, the distributed router includes a main control board 502 and an interface board 504, and the main control board includes:
[0044] a receiving unit 506, configured to receive a routing update message including the routing prefix and the first next hop;
[0045] The first generating unit 508 is configured to obtain a corresponding first routing table entry in the routing table of the main control board according to the routing prefix, where the first routing table entry includes a second next hop, and the first routing table entry includes the second next hop. adding the next hop to the first routing table entry to generate a second routing table entry;
[0046] The second generating unit 510 is configured to start a deletion timer when the priority of the second next hop is lower than the priority of the first next hop, and the duration of the deletion timer is preset time value, when the deletion timer expires, delete the second next hop from the second routing table entry to generate a third routing table entry;
[0047] The sending unit 512 is configured to send the third routing table entry from the routing table to the forwarding information table FIB of the interface board.
[0048] In a network, when a routing protocol session is established between routers, they will publish their own routing table entries to each other, and the routing table items are transmitted through routing update messages. For the Interior Gateway Protocol, the English abbreviation is IGP) or the Border Gateway Protocol (the English full name is Border Gateway Protocol, the English abbreviation is BGP).
[0049] The routing table entries learned from other network devices in the distributed router are first stored in the routing table of the main control board. The routing table stores routing table entries. The routing table entries include the routing prefix and the next hop. For example, Say, for example, a routing entry with a destination address of 123.1.1.1 will store the routing prefix 123.1.1.1 and the next hop 234.1.1.1.
[0050] The routing table entry in the routing table is indexed by the routing prefix, and the routing prefix information in the received routing update message is used to find out whether there is a matching routing table entry in the routing table, and if a matching routing is found. When an entry is made, the second next hop is added to the found routing entry.
[0051] Optionally, the main control board 502 further includes a first configuration unit, where the first configuration unit is configured to preset the preset time value through a command line. During network planning, the network administrator estimates the total time for the active router to learn routing entries and send these routing entries to the FIB of the interface board in advance according to the number of routing entries actually stored by the active router. The estimated total time is used to define the preset time value, and the preset time value should be long enough to ensure that within the preset time value, the active router learns after failure recovery. The routing table entry has been sent to the FIB of the interface board. For example, for example, the total number of routing table entries stored by the active router before the failure is 100,000, and it is estimated that the time for the active router to learn the 100,000 routing table entries is about 10 seconds when it recovers from the failure. The time from the routing table entry to the interface board FIB is about 5 seconds, therefore, the preset time value can be set to 20 seconds.
[0052] Optionally, the main control board 502 further includes a second configuration unit, and the second configuration unit is used to preset a routing prefix set;
[0053] Correspondingly, before the second generation unit 510 starts the deletion timer, it further includes:
[0054] When it is determined that the routing prefix set includes the routing prefix of the second routing table entry, the deletion timer is started. The next hop of the routing prefix stored in the routing prefix set needs to be deleted by starting the deletion timer.
[0055] Optionally, the main control board 502 further includes a third configuration unit, and the third configuration unit is used to preset a next hop set;
[0056]Correspondingly, before the second generating unit starts the deletion timer, it further includes:
[0057] When it is determined that the second next hop is included in the next hop set, the deletion timer is started. The next hop stored in the next hop set needs to be deleted by starting the deletion timer.
[0058] Through the above method, when the routing table entry is generated, it can avoid starting the deletion timer for the next hop of all routing table entries to delete the next hop, and reduce the occupation of the CPU resources of the distributed router. For example, the network When planning the network, the administrator will know which routing entries on the access router are learned from the remote public network through the active router. The routing prefix corresponding to the routing table entry learned by the public network is added to the prefix set. When receiving the routing update message, it is determined that the prefix set contains the routing prefix in the routing update message. Only by starting the timer, the second next hop of the routing table entry found on the main control board is delayed and deleted. Or, when network administrators are planning the network, they will know that after the active router recovers from a fault, the next hop of the routing table entry from the access router to the remote public network will be the active router, and the next hop will be the active router. The next hop of the router is added to the next hop set, and when the main control board finds the routing table entry, it is determined that the next hop set includes the second next hop of the routing table entry. The second next hop of the routing table entry is delayed and deleted by starting the timer.
[0059] Optionally, the routing update message may also include other next hops, for example, a third next hop. According to the routing rules of the routing protocol, the next hop with the same priority will be placed in one update message. Therefore, the priority of the third next hop and the first next hop are the same, correspondingly , after the first routing table entry is acquired in the routing table of the main control board, the third next hop and the first next hop are added to the first routing table entry together.
[0060] Optionally, the first routing table entry may also include other next hops, for example, may also include a fourth next hop. Since the priorities of the next hops in the routing table entry are the same, therefore, When the deletion timer expires, the fourth next hop and the second next hop in the second routing table entry are deleted together.
[0061] 108. Send the third routing table entry from the routing table to the forwarding information table FIB of the interface board.
[0062] Optionally, the interface board includes a processing unit, and the processing unit is configured to receive the third routing table entry sent by the main control board, and store the third routing table entry in the FIB , to form a FIB entry.
[0063] It can be seen that the embodiment of the present invention provides a distributed router. In a dual-homing network, when the main router recovers from a fault, the next hop with a low priority is deleted after a delay, so as to ensure that the traffic arrives after passing through the access router. When the router is the active router, the interface board of the active router has saved the corresponding FIB entries, which can effectively avoid packet loss.
[0064] Those of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by program instructions related to hardware, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the execution includes: The steps of the above method embodiments; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other media that can store program codes.
[0065] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, but not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that it can still be Modifications are made to the technical solutions described in the foregoing embodiments, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.
PUM


Description & Claims & Application Information
We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.