CN110233801B - Route updating method and device - Google Patents

Route updating method and device Download PDF

Info

Publication number
CN110233801B
CN110233801B CN201910467034.4A CN201910467034A CN110233801B CN 110233801 B CN110233801 B CN 110233801B CN 201910467034 A CN201910467034 A CN 201910467034A CN 110233801 B CN110233801 B CN 110233801B
Authority
CN
China
Prior art keywords
routing
next hop
hop information
original
class
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910467034.4A
Other languages
Chinese (zh)
Other versions
CN110233801A (en
Inventor
陈国鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Star Net Ruijie Networks Co Ltd
Original Assignee
Beijing Star Net Ruijie Networks Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Star Net Ruijie Networks Co Ltd filed Critical Beijing Star Net Ruijie Networks Co Ltd
Priority to CN201910467034.4A priority Critical patent/CN110233801B/en
Publication of CN110233801A publication Critical patent/CN110233801A/en
Application granted granted Critical
Publication of CN110233801B publication Critical patent/CN110233801B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/54Organization of routing tables

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a method and a device for updating a route, wherein the method comprises the following steps: acquiring a first original route to be added, which is sent by a routing protocol; searching first original next hop information in a routing class table; if the first routing prefix is found, adding the first routing prefix in a first routing class to which the first original next hop information belongs in a routing class table, and sending an addition notice carrying the first routing class and the first routing prefix to a forwarding platform application program of the network equipment; if the information is not found, a second routing class is newly established in the routing class table, the first routing prefix and the first original next hop information are stored in the second routing class, the first preferred next hop information corresponding to the first original next hop information is calculated and stored in the second routing class, and an adding notice carrying the second routing class, the first routing prefix and the first preferred next hop information is sent to a forwarding platform application program. The scheme can greatly reduce the storage space occupied by the routing class table, reduce the large consumption of the memory and reduce the time consumption.

Description

Route updating method and device
Technical Field
The present invention relates to the field of network technologies, and in particular, to a method and an apparatus for route update.
Background
The network is formed by connecting network devices, the route is the basis of the network devices, and the network can be communicated only if a proper route exists. In the network device, the route generation mode includes statically configuring the route and a routing protocol, and the commonly used routing protocol includes: intermediate System-to-Intermediate System (IS-IS), Open Shortest Path First (OSPF), Routing Information Protocol (RIP), Border Gateway Protocol (BGP), and so on.
The routing system of a network device typically includes a routing protocol, a routing platform application, and a forwarding platform application. The routing generated by the routing protocol is an original routing, the original routing comprises a routing prefix and original next hop information, the routing platform application program stores, compares and calculates the original routing to obtain preferred next hop information, the preferred next hop information and the routing prefix form a forwarding route, and then an adding notice of the forwarding route is sent to the forwarding platform application program for the use of forwarding messages.
The following illustrates the route update procedure, assuming that both outbound interfaces eth0and eth1 are active:
if receiving the original route 1 from the OSPF: the route prefix is 1.1.1.1./32, the original next hop information is 2.2.2 and eth0, the routing platform application stores the original route 1 in the routing table, then calculates whether the original route 1 is active, since the outbound interface eth0 is active, the original route 1 is active, preferably, the next hop information is also 2.2.2.2 and eth0, and stores the preferred next hop information, thereby obtaining the forwarding route 1: the route prefix is 1.1.1.1./32, the preferred next hop information is 2.2.2.2 and eth0, which can be noted as (1.1.1.1/32 → 2.2.2.2, eth0), and then sends an add advertisement to forward route 1 to the forwarding platform application.
If the original route 2 from the OSPF is received: the route prefix is 1.1.1.2/32, the original next hop information is 2.2.2.3 and eth1, the routing platform application stores the original route 2 in the routing table, then calculates whether the original route 2 is active, since the outbound interface eth1 is active, the original route 2 is active, the preferred next hop information is 2.2.2.3 and eth1, the preferred next hop information is stored, and the forwarding route 2 is obtained: the route prefix is 1.1.1.2/32, the preferred next hop information is 2.2.2.3 and eth1, which may be noted as (1.1.1.2/32 → 2.2.2.3, eth1), and then sends an add advertisement for forwarding route 2 to the forwarding platform application.
If the original route 3 from BGP is received: the routing prefix is 3.3.3.3/32, the original next hop information is 1.1.1.1, the routing platform application stores the original route 3 in the routing table, then calculates whether the original route 3 is active, since the original route 3 does not directly carry an outgoing interface, calculation is needed, an Internet Protocol (IP) address 1.1.1.1 of the original next hop information is taken out, the routing table is inquired for the original route matched with 1.1.1.1, the original route 1 can be matched with the original route 1, the original route 1 is active, the preferred next hop information 2.2.2.2 and eth0 of the original route 3 can be obtained according to the original route 1, and then the forwarding route 3 is obtained: the route prefix is 3.3.3.3/32, preferably the next hop information 2.2.2.2 and eth0, which may be noted as (3.3.3.3/32 → 2.2.2.2, eth0), and then sends an add advertisement for forwarding route 3 to the forwarding platform application.
If the original route 4 from BGP is received: the routing prefix is 4.4.4.4/32, the original next hop information is 1.1.1 and 1.1.1.2, the original route 4 is an equivalent route, the routing platform application program stores the original route 4 in the routing table, then calculates whether the original route 4 is active, since the original route 4 does not directly carry an interface, calculation is needed, the first IP address 1.1.1 of the original next hop information is taken out, the routing table searches for the original route matched with 1.1.1.1, and the original route 1 can be matched with the original route 1, and the original route 1 is active, and the first preferable next hop information 2.2.2.2 and eth0 of the original route 4 can be obtained according to the original route 1; and then, taking out the second IP address 1.1.1.2 of the original next hop information, looking up the original route matched with 1.1.1.2 in the routing table, finding that the original route 2 can be matched with the original route 2 and the original route 2 is active, and obtaining second preferred next hop information 2.2.2.3 and eth1 of the original route 4 according to the original route 2 to further obtain the forwarding route 4: the route prefix is 4.4.4.4/32, preferably next hop information 2.2.2.2 and eth0, and 2.2.2.3 and eth1, which may be noted as (4.4.4.4/32 → 2.2.2, eth0and 2.2.2.3, eth1), and then sends an add advertisement for the forwarding route 4 to the forwarding platform application.
To this end, the routing table in the network device after storing the original route is:
original route 1: 1.1.1.1/32 → 2.2.2.2eth 0;
original route 2: 1.1.1.2/32 → 2.2.2.3eth 1;
original route 3: 3.3.3.3/32 → 1.1.1.1;
original route 4: 4.4.4.4/32 → 1.1.1.1;
→1.1.1.2。
after the routing calculation is finished, the network device stores the calculated preferred next hop information in a routing table, where the routing table is as follows:
original route 1: 1.1.1.1/32 → 2.2.2.2eth 0;
original route 2: 1.1.1.2/32 → 2.2.2.3eth 1;
original route 3: 3.3.3.3/32 → 1.1.1.1 → 2.2.2.2eth 0;
original route 4: 4.4.4.4/32 → 1.1.1.1 → 2.2.2.2eth 0;
→1.1.1.2→2.2.2.3eth1。
in the route updating method, each original route is independently stored, the information of the preferred next hop is independently calculated, the information is independently announced when the forwarding route is added, and when the number of the original routes is large, the storage space occupied by the route table is very large; a large amount of memory consumption is caused when the information of the next hop is calculated and optimized, and the performance of the network equipment is influenced; the addition of the forwarding route is independently announced, so that the time consumption is increased, and the addition efficiency is influenced.
Disclosure of Invention
The embodiment of the invention provides a method and a device for updating a route, which are used for solving the problem that in the prior art, when the number of original routes is large, the storage space occupied by a route table is very large; a large amount of memory consumption is caused when the information of the next hop is calculated and optimized, and the performance of the network equipment is influenced; the adding of the forwarding route is independently announced, so that the time consumption is increased, and the adding efficiency is influenced.
According to an embodiment of the present invention, a method for updating a route is provided, which is applied to a routing platform application program of a network device, and includes:
acquiring a first original route to be added, which is sent by a routing protocol of the network equipment, wherein the first original route comprises a first route prefix and first original next hop information;
searching the first original next hop information in a pre-established routing class table, wherein each routing class of the routing class table comprises original routes with the same original next hop information and different routing prefixes;
if the first original next hop information is found in the routing class table, adding the first routing prefix in a first routing class to which the first original next hop information belongs in the routing class table, and sending an addition notice carrying the first routing class and the first routing prefix to a forwarding platform application program of the network device;
if the first original next hop information is not found in the routing class table, a second routing class is newly established in the routing class table, the first routing prefix and the first original next hop information are stored in the second routing class, first preferred next hop information corresponding to the first original next hop information is calculated and stored in the second routing class, and an addition notice carrying the second routing class, the first routing prefix and the first preferred next hop information is sent to the forwarding platform application program.
Optionally, the method further includes:
when the change of the network environment information is detected, second preferred next hop information associated with the network environment information and a third routing class to which the second preferred next hop information belongs are determined in the routing class table;
recalculating third preferred next hop information for the third routing class;
and updating the third routing class according to whether the third preferred next hop information exists or not, and notifying the updating result to the forwarding platform application program.
Specifically, updating the third routing class in the routing class table according to whether the third preferred next hop information exists, and notifying the update result to the forwarding platform application program, specifically includes:
determining whether the third preferred next hop information exists;
and if the third preferred next hop information does not exist, deleting the second preferred next hop information in the third route class, and sending a deletion notice carrying the third route class and the second preferred next hop information to the forwarding platform application program.
Optionally, the method further includes:
and if the third preferred next hop information exists, replacing the second preferred next hop information with the third preferred next hop information, and sending a replacement notice carrying the third routing class, the third preferred next hop information and the second preferred next hop information to the forwarding platform application program.
Optionally, the method further includes:
acquiring a second original route to be deleted, wherein the second original route comprises a second route prefix and second original next hop information;
looking up the second original next hop information in the routing class table;
if the second original next hop information is found in the routing class table, deleting the second routing prefix in a fourth routing class to which the second original next hop information belongs, and sending a deletion notice carrying the fourth routing class and the second routing prefix to the forwarding platform;
determining whether the number of routing prefixes included in the fourth routing class is zero;
and if the number of the routing prefixes included in the fourth routing class is determined to be zero, deleting the fourth routing class from the routing class table, and sending a deletion notice carrying the fourth routing class to the forwarding platform application program.
According to an embodiment of the present invention, there is also provided a routing update apparatus, applied in a routing platform application program of a network device, including:
an obtaining module, configured to obtain a first original route to be added, where the first original route is sent by a routing protocol of the network device and includes a first route prefix and first original next hop information;
a searching module, configured to search the first original next hop information in a pre-established routing class table, where each routing class in the routing class table includes an original route with the same original next hop information and a different routing prefix;
a processing module, configured to add the first routing prefix in a first routing class to which the first original next hop information belongs in the routing class table if the first original next hop information is found in the routing class table, and send an addition notification carrying the first routing class and the first routing prefix to a forwarding platform application of the network device; if the first original next hop information is not found in the routing class table, a second routing class is newly established in the routing class table, the first routing prefix and the first original next hop information are stored in the second routing class, first preferred next hop information corresponding to the first original next hop information is calculated and stored in the second routing class, and an addition notice carrying the second routing class, the first routing prefix and the first preferred next hop information is sent to the forwarding platform application program.
Optionally, the method further includes:
a determining module, configured to determine, in the routing class table, second preferred next hop information associated with the network environment information and a third routing class to which the second preferred next hop information belongs when a change in the network environment information is detected;
a calculating module, configured to recalculate third preferred next hop information of the third routing class;
and the updating module is used for updating the third route class according to whether the third preferred next hop information exists or not and informing the updating result to the forwarding platform application program.
Specifically, the update module is configured to update the third routing class in the routing class table according to whether the third preferred next hop information exists, and notify the forwarding platform application of an update result, and specifically configured to:
determining whether the third preferred next hop information exists;
and if the third preferred next hop information does not exist, deleting the second preferred next hop information in the third route class, and sending a deletion notice carrying the third route class and the second preferred next hop information to the forwarding platform application program.
Optionally, the update module is further configured to:
and if the third preferred next hop information exists, replacing the second preferred next hop information with the third preferred next hop information, and sending a replacement notice carrying the third routing class, the third preferred next hop information and the second preferred next hop information to the forwarding platform application program.
Optionally, the method further includes:
the obtaining module is further configured to obtain a second original route to be deleted, where the second original route includes a second route prefix and second original next hop information;
the searching module is further configured to search the second original next hop information in the routing class table;
the processing module is further configured to delete the second routing prefix in a fourth routing class to which the second original next hop information belongs if the second original next hop information is found in the routing class table, and send a deletion advertisement carrying the fourth routing class and the second routing prefix to the forwarding platform; determining whether the number of routing prefixes included in the fourth routing class is zero; and if the number of the routing prefixes included in the fourth routing class is determined to be zero, deleting the fourth routing class from the routing class table, and sending a deletion notice carrying the fourth routing class to the forwarding platform application program.
The invention has the following beneficial effects:
the embodiment of the invention provides a method and a device for updating a route, wherein a first original route to be added, which is sent by a routing protocol of network equipment, is obtained, and the first original route comprises a first route prefix and first original next hop information; searching the first original next hop information in a pre-established routing class table, wherein each routing class of the routing class table comprises original routes with the same original next hop information and different routing prefixes; if the first original next hop information is found in the routing class table, adding the first routing prefix in a first routing class to which the first original next hop information belongs in the routing class table, and sending an addition notice carrying the first routing class and the first routing prefix to a forwarding platform application program of the network device; if the first original next hop information is not found in the routing class table, a second routing class is newly established in the routing class table, the first routing prefix and the first original next hop information are stored in the second routing class, first preferred next hop information corresponding to the first original next hop information is calculated and stored in the second routing class, and an addition notice carrying the second routing class, the first routing prefix and the first preferred next hop information is sent to the forwarding platform application program. In the scheme, a routing class table is established, original routes with the same original next hop information and different routing prefixes are classified into a routing class, routing updating is carried out based on the routing class, storage, calculation and notification of the original routes are carried out based on the routing class, and when the number of the original routes is large, the original next hop information and the optimized next hop information are only stored once by one routing class, so that the situation that the same original next hop information and the optimized next hop information are stored for many times is avoided, and the storage space occupied by the routing class table can be greatly reduced; meanwhile, the optimized next hop information is only calculated once for a plurality of original routes with the same original next hop information and different route prefixes in one route class, so that the calculation times can be greatly saved, the large consumption of a memory is reduced, and the performance of network equipment is improved; when the forwarding platform application program is notified, only the related routing class and routing prefix or the preferred next hop information are notified, and the complete forwarding route does not need to be notified, so that the time consumption can be reduced, and the updating efficiency can be improved.
Drawings
Fig. 1 is a flowchart of a route updating method according to an embodiment of the present invention;
FIG. 2 is a flow chart of a preferred embodiment of the present invention;
fig. 3 is a schematic structural diagram of a route updating apparatus according to an embodiment of the present invention.
Detailed Description
Aiming at the problem that in the prior art, when the number of original routes is large, the storage space occupied by a routing table is very large; a large amount of memory consumption is caused when the information of the next hop is calculated and optimized, and the performance of the network equipment is influenced; the problem that adding forwarding routes is separately announced, time consumption is increased, and adding efficiency is affected is solved.
In current data center networks, a large number of original routes from BGP are generated, and there are multiple equivalent original next hop information for the original routes from BGP, and the original next hop information for each original route is largely duplicated. For example, there are 100 ten thousand original routes from BGP, each with 4 equivalent original next hop information, and the original next hop information for every 10 ten thousand original routes is identical, as follows:
1.1.1.1, 1.1.1.2, 1.1.1.3 and 1.1.1.4 of original routes which are identical in original next hop information;
the original next hop information of the original route 10 ten thousand-20 is 2.1.1.1, 2.1.1.2, 2.1.1.3 and 2.1.1.4;
the original next hop information of 20-30 ten thousand original routes is 3.1.1.1, 3.1.1.2, 3.1.1.3 and 3.1.1.4;
original next hop information of 30-40 ten thousand original routes is 4.1.1.1, 4.1.1.2, 4.1.1.3, 4.1.1.4;
original next hop information of 40-50 ten thousand original routes is 5.1.1.1, 5.1.1.2, 5.1.1.3, 5.1.1.4;
original next hop information of 50-60 ten thousand original routes is 6.1.1.1, 6.1.1.2, 6.1.1.3 and 6.1.1.4;
original next hop information of 60-70 ten thousand original routes is 7.1.1.1, 7.1.1.2, 7.1.1.3 and 7.1.1.4;
original routes 70-80 ten thousand have the same original next hop information, namely 8.1.1.1, 8.1.1.2, 8.1.1.3 and 8.1.1.4;
original routes 80-90 ten thousand have the same original next hop information, which is 9.1.1.1, 9.1.1.2, 9.1.1.3, 9.1.1.4;
the original routes are 10.1.1.1, 10.1.1.2, 10.1.1.3, 10.1.1.4, as are the original next hop information of 90-100 ten thousand.
According to the existing method, a routing platform application program needs to independently store, calculate and advertise each original route, and the method mainly has the following three problems:
1) storage problem
For the above 100 ten thousand original routes from BGP, each original route has 4 equivalent original next hop information, and if 4 original next hop information is calculated by the route and 4 preferred next hop information is obtained, the number of the final preferred next hop information needs to be saved: 100 ten thousand 4 x 1600 ten thousand, and the memory consumed by each preferred next hop information is B, then a total of 1600 ten thousand B (16 x B) megabytes are consumed;
2) computational performance problem
For the 100 ten thousand original routes from BGP, each original route has 4 equivalent original next hop information, and when performing route calculation, matching search needs to be performed in the routing table for each original next hop information, so that 400 ten thousand times of route calculation is required. Each route calculation involves a series of operations, the time consumption is t, and the total time consumption is 400 ten thousand t.
3) Announcing efficiency issues
When the network environment information changes to cause 100 ten thousand original routes from the BGP to change, assuming that the data volume of each advertisement is B bytes, then a short time is needed: a 100 ten thousand B-B megabyte advertisement occurs to the forwarding platform application.
It can be seen from the above 100 ten thousand original routes that there are many original next hop information of the original routes that are identical, and if the original next hop information is identical, the obtained preferred next hop information is also identical, based on which, a route class can be introduced, and the original routes having the identical original next hop information can be classified into one class, so long as one original route in the route class is calculated, other original routes in the route class can share the calculation result, so as to optimize the storage, calculation and notification of the original routes.
For 100 ten thousand original routes from BGP above, where the original next hop information is the same for every 10 ten thousand original routes, then the 100 ten thousand original routes may be divided into 10 route classes. The size of the routing table is then sharply reduced from 100 ten thousand original routes to a routing class table of 10 routing classes.
Based on the research of the inventor, an embodiment of the present invention provides a route updating method, which is applied in a routing platform application program of a network device, and a flow of the method of the present invention is shown in fig. 1, and the method includes the following steps:
s11: the method comprises the steps of obtaining a first original route to be added, which is sent by a routing protocol of network equipment, wherein the first original route comprises a first route prefix and first original next hop information.
A plurality of routing protocols are generally run on the network device, and after a routing protocol generates routes, the routes are sent to the routing platform for processing, where the routes may be defined as a first original route, and a route prefix and original next-hop information included in the first original route may be defined as a first route prefix and first original next-hop information.
S12: searching first original next hop information in a pre-established routing class table, and if the first original next hop information is searched in the routing class table, executing S13; if the first original next hop information is not found in the routing class table, S14 is executed.
A routing class table may be pre-established, and the original routes with the same original next hop information and different routing prefixes are set as a routing class. After receiving the first original route, the corresponding route class may be determined according to first original next hop information included in the first original route.
S13: and adding a first routing prefix in a first routing class to which the first original next hop information belongs in the routing class table, and sending an addition notice carrying the first routing class and the first routing prefix to a forwarding platform application program of the network equipment.
If the first original next hop information is found in the routing class table, it is described that the original route of the same routing class is stored before, that is, the routing class corresponding to the first original next hop information is established before, and the routing class may be defined as a first routing class, and the first routing prefix is directly added to the first routing class, and further needs to be synchronized to a forwarding platform application program of the network device, and an addition notification carrying the first routing class and the first routing prefix may be sent to the forwarding platform application program.
S14: and establishing a second routing class in the routing class table, storing a first routing prefix and first original next hop information in the second routing class, calculating first preferred next hop information corresponding to the first original next hop information, storing the first preferred next hop information in the second routing class, and sending an addition notice carrying the second routing class, the first routing prefix and the first preferred next hop information to a forwarding platform application program.
If the first original next hop information is not found in the routing class table, which indicates that the original route of the same routing class is not stored before, a new routing class needs to be established in the routing class table, which can be defined as a second routing class, then the first routing prefix and the first original next hop information are stored in the second routing class, the first preferred next hop information corresponding to the first original next hop information is calculated and stored in the second routing class, and then the first preferred next hop information and the first original next hop information are synchronized to the forwarding platform application program, and an addition notice carrying the second routing class, the first routing prefix and the first preferred next hop information can be sent to the forwarding platform application program.
In the scheme, a routing class table is established, original routes with the same original next hop information and different routing prefixes are classified into a routing class, routing updating is carried out based on the routing class, storage, calculation and notification of the original routes are carried out based on the routing class, and when the number of the original routes is large, the original next hop information and the optimized next hop information are only stored once by one routing class, so that the situation that the same original next hop information and the optimized next hop information are stored for many times is avoided, and the storage space occupied by the routing class table can be greatly reduced; meanwhile, the optimized next hop information is only calculated once for a plurality of original routes with the same original next hop information and different route prefixes in one route class, so that the calculation times can be greatly saved, the large consumption of a memory is reduced, and the performance of network equipment is improved; when the forwarding platform application program is notified, only the related routing class and routing prefix or the preferred next hop information are notified, and the complete forwarding route does not need to be notified, so that the time consumption can be reduced, and the updating efficiency can be improved.
Optionally, the environment information of the network device may be changed from time to time, for example, when a certain egress interface changes from an on state to an off state, the preferred next hop information associated with the egress interface changes, and at this time, the relevant routing class in the routing class table needs to be updated. A preferred embodiment is shown in fig. 2, further comprising:
s21: and when the change of the network environment information is detected, determining second preferred next hop information associated with the network environment information and a third routing class to which the second preferred next hop information belongs in the routing class table.
When the network environment information changes, the original next hop information is not affected, but the preferred next hop information is affected, so that the preferred next hop information associated with the network environment information and the routing class to which the preferred next hop information belongs can be determined in the routing class table, the preferred next hop information can be defined as second preferred next hop information, and the routing class can be defined as a third routing class.
S22: the third preferred next hop information for the third routing class is recalculated.
S23: and updating the third routing class according to the third preferred next hop information, and notifying the updating result to the forwarding platform application program.
The third preferred next hop information may or may not exist, and the third routing class may be updated according to the calculation result and simultaneously synchronized to the forwarding platform application program.
The specific process comprises the following steps: determining whether third preferred next hop information exists; if the third preferred next hop information does not exist, deleting the second preferred next hop information in the third route class, and sending a deletion notice carrying the third route class and the second preferred next hop information to the forwarding platform application program; and if the third preferred next hop information exists, replacing the second preferred next hop information with the third preferred next hop information, and sending a replacement notice carrying the third routing class, the third preferred next hop information and the second preferred next hop information to the forwarding platform application program. Since the third routing class may include a plurality of pieces of preferred next hop information, the replacement advertisement of the third preferred next hop information and the second preferred next hop information may be carried in the replacement advertisement, so that after receiving the replacement advertisement, the forwarding platform application may find the third routing class, find that the third routing class includes the second preferred next hop information, and since the third routing class is the replacement advertisement, may directly replace the second preferred next hop information with the third preferred next hop information.
Optionally, sometimes, the routing protocol of the network platform needs to delete the original route, and at this time, the routing class table needs to be updated, and the method further includes:
acquiring a second original route to be deleted, wherein the second original route comprises a second route prefix and second original next hop information;
searching second original next hop information in the routing class table;
if the second original next hop information is found in the routing class table, deleting the second routing prefix in a fourth routing class to which the second original next hop information belongs, and sending a deletion notice carrying the fourth routing class and the second routing prefix to the forwarding platform;
determining whether the number of the routing prefixes included in the fourth routing class is zero;
and if the number of the routing prefixes included in the fourth routing class is determined to be zero, deleting the fourth routing class from the routing class table, and sending a deletion notice carrying the fourth routing class to the forwarding platform application program.
The process of deleting the original route is similar to the process of adding the original route, a corresponding route class can be determined based on original next hop information of the original route, then a route prefix corresponding to the original route in the route class is deleted, so that the deletion of the original route can be realized, of course, after the route prefix is possibly deleted, the number of the route prefixes in the route class is zero, in order to save storage space, whether the number of the route prefixes included in the route class at the moment is zero or not can be judged, if the number is zero, the route class is empty, the route class does not need to be reserved, the route class can be directly deleted, and meanwhile, the forwarding platform application program is synchronously given.
The above route update method is described below with a specific embodiment.
After the network device is started, the routing platform application creates a routing class table for storing routing classes. Initially, the routing class table is empty.
The routing platform application then receives the first original route R1: the routing prefix is 1.1.1.1/32, the original next hop information is 2.2.2.2 and eth0, and the original next hop information of R1 is searched in a routing class table to see which routing class has the original next hop information of (2.2.2.2 and eth 0); at this time, the routing class table is empty, so that the routing class table is not searched; therefore, a routing class C needs to be newly created in the routing class table, and the original next hop information of the routing class C is (2.2.2.2, eth 0); then, the preferred next hop information for the computed routing class C is also (2.2.2.2, eth 0). Since R1 is the first member of the routing class C, it needs to be advertised to the forwarding platform application, and only needs to send an additional advertisement carrying the routing class C, the routing prefix 1.1.1/32, and the preferred next-hop information (2.2.2.2, eth 0).
The routing platform application then receives a second original route R2: the routing prefix is 1.1.1.2/32 and the original next hop information is (2.2.2.2 and eth 0). And searching in a routing class table according to the original next hop information of R2 to find a matching routing class C, and then adding the routing prefix of R2 into the routing class C to enable R2 to share the preferred next hop information of the routing class C. Since the R2 is not the first member of the routing class C, and the forwarding platform application already knows the relevant information of the routing class C, it is not necessary to notify all the information of the R2 to the forwarding platform application, and it is only necessary to send the additional notification carrying the routing prefixes of the routing class C and the R2, and since it is not necessary to notify the complete information of the R2, the notification amount is saved, and when the information amount of the R2 is large, the saving is more obvious.
Next, the routing platform application receives a third original route R3: routing prefix is 1.1.1.3/32, original next hop information is (1.1.1.2), matching is carried out in a routing class table according to the original next hop information of R3, and the original next hop information without a routing class is 1.1.1.2, so that matching fails, a routing class B needs to be newly established, and the original next hop information of the routing class B is 1.1.1.2; then the preferred next hop information for route class B is calculated and it is found that the original next hop information 1.1.1.2 matches to R2, whereas the preferred next hop information for route R2 is (2.2.2.2, eth0) and so the preferred next hop information for R3 is (2.2.2.2, eth 0). Since R3 is the first member of the routing class B, it needs to be advertised to the forwarding platform application, and only needs to send an additional advertisement carrying the routing class B, the routing prefix 1.1.1.3/32, and the preferred next-hop information (2.2.2.2, eth 0).
At this time, R1, R2, and R3 are divided into two routing classes C and B, and when the network environment information changes, only the routing classes C and B need to be updated and the updated result is notified to the forwarding platform application, and a single original route does not need to be calculated any more and does not need to be notified to the forwarding platform application one by one. For example, the egress interface eth0 is turned off, the affected routing class is searched for, and the routing class C is found to be the routing class C, so that the preferred next hop information of the routing class C is recalculated, the preferred next hop information of the routing class C is found not to be already active, the preferred next hop information of the routing class C can be deleted, and the preferred next hop information is synchronized to the forwarding platform application program, and a deletion notification carrying the routing class C and the preferred next hop information (2.2.2.2, eth0) is sent. In the existing method, the affected original route is searched, and the original route is found to be R1 and R2; then, the preferred next hop information for R1 is computed, and it is found that R1 has no active preferred next hop information, and then synchronized to the forwarding platform application. Then, the preferred next hop information for R2 is computed, and it is found that R2 has no active preferred next hop information, and then synchronized to the forwarding platform application. Compared with the method of the embodiment, the existing method comprises the following steps: the times of route calculation are 2 times, and the times of announcing and forwarding platform application programs are 2 times; it can be seen that the multiple of the optimization effect is the number of the routing class members, and when there are many routing class members, the optimization effect is more obvious.
Assuming that R3 needs to be deleted, only the route prefix of R3 included in route class B needs to be deleted. Since there is no member in route class B after R3 is deleted, route class B also needs to be deleted. And simultaneously synchronized to the forwarding platform application.
It should be noted that the above-mentioned addition announcement, deletion announcement, and replacement announcement may be in the original format, as long as they carry the relevant information therein.
Based on the same inventive concept, an embodiment of the present invention provides a routing update apparatus applied to a routing platform application program of a network device, where the apparatus has a structure as shown in fig. 3, and includes:
an obtaining module 31, configured to obtain a first original route to be added, where the first original route is sent by a routing protocol of a network device and includes a first route prefix and first original next hop information;
a searching module 32, configured to search for first original next hop information in a pre-established routing class table, where each routing class in the routing class table includes an original route with the same original next hop information and a different routing prefix;
the processing module 33 is configured to, if the first original next hop information is found in the routing class table, add a first routing prefix in a first routing class to which the first original next hop information belongs in the routing class table, and send an addition advertisement carrying the first routing class and the first routing prefix to a forwarding platform application of the network device; if the first original next hop information is not found in the routing class table, a second routing class is newly established in the routing class table, a first routing prefix and first original next hop information are stored in the second routing class, first preferred next hop information corresponding to the first original next hop information is calculated and stored in the second routing class, and an addition notice carrying the second routing class, the first routing prefix and the first preferred next hop information is sent to a forwarding platform application program.
In the scheme, a routing class table is established, original routes with the same original next hop information and different routing prefixes are classified into a routing class, routing updating is carried out based on the routing class, storage, calculation and notification of the original routes are carried out based on the routing class, and when the number of the original routes is large, the original next hop information and the optimized next hop information are only stored once by one routing class, so that the situation that the same original next hop information and the optimized next hop information are stored for many times is avoided, and the storage space occupied by the routing class table can be greatly reduced; meanwhile, the optimized next hop information is only calculated once for a plurality of original routes with the same original next hop information and different route prefixes in one route class, so that the calculation times can be greatly saved, the large consumption of a memory is reduced, and the performance of network equipment is improved; when the forwarding platform application program is notified, only the related routing class and routing prefix or the preferred next hop information are notified, and the complete forwarding route does not need to be notified, so that the time consumption can be reduced, and the updating efficiency can be improved.
Optionally, the method further includes:
the determining module is used for determining second preferred next hop information associated with the network environment information and a third routing class to which the second preferred next hop information belongs in the routing class table when the change of the network environment information is detected;
the calculation module is used for recalculating the third preferred next hop information of the third routing class;
and the updating module is used for updating the third routing class according to the third preferred next hop information and informing the updating result to the forwarding platform application program.
Specifically, the update module is configured to determine whether a third routing class exists in the updated routing class table according to the third preferred next hop information, and notify the update result to the forwarding platform application, and specifically configured to:
determining whether third preferred next hop information exists;
and if the third preferred next hop information does not exist, deleting the second preferred next hop information in the third route class, and sending a deletion notice carrying the third route class and the second preferred next hop information to the forwarding platform application program.
Optionally, the update module is further configured to:
and if the third preferred next hop information exists, replacing the second preferred next hop information with the third preferred next hop information, and sending a replacement notice carrying the third routing class, the third preferred next hop information and the second preferred next hop information to the forwarding platform application program.
Optionally, the method further includes:
the obtaining module 31 is further configured to obtain a second original route to be deleted, where the second original route includes a second route prefix and second original next hop information;
the searching module 32 is further configured to search the routing class table for second original next hop information;
the processing module 33 is further configured to delete the second routing prefix in a fourth routing class to which the second original next hop information belongs if the second original next hop information is found in the routing class table, and send a deletion advertisement carrying the fourth routing class and the second routing prefix to the forwarding platform; determining whether the number of the routing prefixes included in the fourth routing class is zero; and if the number of the routing prefixes included in the fourth routing class is determined to be zero, deleting the fourth routing class from the routing class table, and sending a deletion notice carrying the fourth routing class to the forwarding platform application program.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While alternative embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following appended claims be interpreted as including alternative embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made in the embodiments of the present invention without departing from the spirit or scope of the embodiments of the invention. Thus, if such modifications and variations of the embodiments of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to encompass such modifications and variations.

Claims (10)

1. A route updating method applied in a routing platform application program of a network device is characterized by comprising the following steps:
acquiring a first original route to be added, which is sent by a routing protocol of the network equipment, wherein the first original route comprises a first route prefix and first original next hop information;
searching the first original next hop information in a pre-established routing class table, wherein each routing class of the routing class table comprises original routes with the same original next hop information and different routing prefixes;
if the first original next hop information is found in the routing class table, adding the first routing prefix in a first routing class to which the first original next hop information belongs in the routing class table, and sending an addition notice carrying the first routing class and the first routing prefix to a forwarding platform application program of the network device;
if the first original next hop information is not found in the routing class table, a second routing class is newly established in the routing class table, the first routing prefix and the first original next hop information are stored in the second routing class, first preferred next hop information corresponding to the first original next hop information is calculated and stored in the second routing class, and an addition notice carrying the second routing class, the first routing prefix and the first preferred next hop information is sent to the forwarding platform application program.
2. The method of claim 1, further comprising:
when the change of the network environment information is detected, second preferred next hop information associated with the network environment information and a third routing class to which the second preferred next hop information belongs are determined in the routing class table;
recalculating third preferred next hop information for the third routing class;
and updating the third routing class according to whether the third preferred next hop information exists or not, and notifying the updating result to the forwarding platform application program.
3. The method according to claim 2, wherein updating the third routing class in the routing class table according to whether the third preferred next hop information exists, and notifying the forwarding platform application of an update result, specifically includes:
determining whether the third preferred next hop information exists;
and if the third preferred next hop information does not exist, deleting the second preferred next hop information in the third route class, and sending a deletion notice carrying the third route class and the second preferred next hop information to the forwarding platform application program.
4. The method of claim 3, further comprising:
and if the third preferred next hop information exists, replacing the second preferred next hop information with the third preferred next hop information, and sending a replacement notice carrying the third routing class, the third preferred next hop information and the second preferred next hop information to the forwarding platform application program.
5. The method of any of claims 1-4, further comprising:
acquiring a second original route to be deleted, wherein the second original route comprises a second route prefix and second original next hop information;
looking up the second original next hop information in the routing class table;
if the second original next hop information is found in the routing class table, deleting the second routing prefix in a fourth routing class to which the second original next hop information belongs, and sending a deletion notice carrying the fourth routing class and the second routing prefix to the forwarding platform application program;
determining whether the number of routing prefixes included in the fourth routing class is zero;
and if the number of the routing prefixes included in the fourth routing class is determined to be zero, deleting the fourth routing class from the routing class table, and sending a deletion notice carrying the fourth routing class to the forwarding platform application program.
6. A routing update apparatus applied in a routing platform application of a network device, comprising:
an obtaining module, configured to obtain a first original route to be added, where the first original route is sent by a routing protocol of the network device and includes a first route prefix and first original next hop information;
a searching module, configured to search the first original next hop information in a pre-established routing class table, where each routing class in the routing class table includes an original route with the same original next hop information and a different routing prefix;
a processing module, configured to add the first routing prefix in a first routing class to which the first original next hop information belongs in the routing class table if the first original next hop information is found in the routing class table, and send an addition notification carrying the first routing class and the first routing prefix to a forwarding platform application of the network device; if the first original next hop information is not found in the routing class table, a second routing class is newly established in the routing class table, the first routing prefix and the first original next hop information are stored in the second routing class, first preferred next hop information corresponding to the first original next hop information is calculated and stored in the second routing class, and an addition notice carrying the second routing class, the first routing prefix and the first preferred next hop information is sent to the forwarding platform application program.
7. The apparatus of claim 6, further comprising:
a determining module, configured to determine, in the routing class table, second preferred next hop information associated with the network environment information and a third routing class to which the second preferred next hop information belongs when a change in the network environment information is detected;
a calculating module, configured to recalculate third preferred next hop information of the third routing class;
and the updating module is used for updating the third route class according to whether the third preferred next hop information exists or not and informing the updating result to the forwarding platform application program.
8. The apparatus of claim 7, wherein the updating module is configured to update the third routing class in the routing class table according to whether the third preferred next hop information exists, and notify the forwarding platform application of an update result, and specifically is configured to:
determining whether the third preferred next hop information exists;
and if the third preferred next hop information does not exist, deleting the second preferred next hop information in the third route class, and sending a deletion notice carrying the third route class and the second preferred next hop information to the forwarding platform application program.
9. The apparatus of claim 8, wherein the update module is further configured to:
and if the third preferred next hop information exists, replacing the second preferred next hop information with the third preferred next hop information, and sending a replacement notice carrying the third routing class, the third preferred next hop information and the second preferred next hop information to the forwarding platform application program.
10. The apparatus of any of claims 6-9, further comprising:
the obtaining module is further configured to obtain a second original route to be deleted, where the second original route includes a second route prefix and second original next hop information;
the searching module is further configured to search the second original next hop information in the routing class table;
the processing module is further configured to delete the second routing prefix in a fourth routing class to which the second original next hop information belongs if the second original next hop information is found in the routing class table, and send a deletion advertisement carrying the fourth routing class and the second routing prefix to the forwarding platform application program; determining whether the number of routing prefixes included in the fourth routing class is zero; and if the number of the routing prefixes included in the fourth routing class is determined to be zero, deleting the fourth routing class from the routing class table, and sending a deletion notice carrying the fourth routing class to the forwarding platform application program.
CN201910467034.4A 2019-05-31 2019-05-31 Route updating method and device Active CN110233801B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910467034.4A CN110233801B (en) 2019-05-31 2019-05-31 Route updating method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910467034.4A CN110233801B (en) 2019-05-31 2019-05-31 Route updating method and device

Publications (2)

Publication Number Publication Date
CN110233801A CN110233801A (en) 2019-09-13
CN110233801B true CN110233801B (en) 2021-08-17

Family

ID=67858335

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910467034.4A Active CN110233801B (en) 2019-05-31 2019-05-31 Route updating method and device

Country Status (1)

Country Link
CN (1) CN110233801B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110971527B (en) * 2019-11-29 2020-10-16 新华三半导体技术有限公司 Routing information determination method and device
CN112187636B (en) * 2020-09-22 2022-08-16 锐捷网络股份有限公司 ECMP route storage method and device
CN112637057B (en) * 2020-12-30 2022-08-16 锐捷网络股份有限公司 Route management method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101076029A (en) * 2007-07-12 2007-11-21 中兴通讯股份有限公司 Method for updating boundary gate protocol recursion router
CN102035738A (en) * 2010-12-14 2011-04-27 中兴通讯股份有限公司 Method and device for acquiring routing information
CN102857414A (en) * 2012-08-20 2013-01-02 中兴通讯股份有限公司 Forwarding table writing method and device and message forwarding method and device
US9544234B1 (en) * 2012-08-06 2017-01-10 Google Inc. Hash based ECMP load balancing with non-power-of-2 port group sizes
CN107454652A (en) * 2016-05-31 2017-12-08 尚民 GSM based on wireless self-organization network

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101076029A (en) * 2007-07-12 2007-11-21 中兴通讯股份有限公司 Method for updating boundary gate protocol recursion router
CN102035738A (en) * 2010-12-14 2011-04-27 中兴通讯股份有限公司 Method and device for acquiring routing information
US9544234B1 (en) * 2012-08-06 2017-01-10 Google Inc. Hash based ECMP load balancing with non-power-of-2 port group sizes
CN102857414A (en) * 2012-08-20 2013-01-02 中兴通讯股份有限公司 Forwarding table writing method and device and message forwarding method and device
CN107454652A (en) * 2016-05-31 2017-12-08 尚民 GSM based on wireless self-organization network

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
《基于前缀扩展的快速路由查找算法》;刘亚林等;《计算机学报》;20040108;第24卷(第12期);全文 *

Also Published As

Publication number Publication date
CN110233801A (en) 2019-09-13

Similar Documents

Publication Publication Date Title
CN110233801B (en) Route updating method and device
JP5095823B2 (en) Transport control server, network system, and transport control method
US8817798B2 (en) Constraining topology size and recursively calculating routes in large networks
KR101457317B1 (en) Prioritization of routing information updates
CN102025552B (en) Backup method and backup device of link-state advertisement
EP3454510A1 (en) Message forwarding method and apparatus
US9319304B2 (en) Method of routing and a device for an autonomous system
CN100466623C (en) Route information update method and network equipment based on OSPF
US8516152B2 (en) Lookahead computation of routing information
EP3043515B1 (en) Method, controller, forwarding device, and network system for forwarding packets
EP3731471A1 (en) Method and device for segment identifier offset distribution
US20170111260A1 (en) Trill isis-based route calculation method and device
EP3059913B1 (en) Lsp data packet generating method and device
CN111953606B (en) Routing iteration loop detection method and device, electronic equipment and storage medium
US20190334814A1 (en) Path establishment method and device, and network node
CN102316029B (en) Fast rerouting method and routing equipment
CN109039908B (en) Recursive routing switching method, router, switch and electronic equipment
WO2016184022A1 (en) Ip accessibility information announcement method and routing determining method and device
CN107770069B (en) LSA (location-based advertisement) method and device
CN111464441A (en) Communication method and device
CN113810276A (en) Segment routing fault processing method and device, electronic equipment and storage medium
CN108881035B (en) Message forwarding method and device
CN110752991A (en) Method for selecting shortest path of dynamic route
EP3163812A1 (en) Method and apparatus for cross-layer path establishment
CN105763436A (en) Method of deleting link state advertisement and apparatus thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant