An IGP routing method and apparatus

By using the Bloom filter in the router to retrieve packet characteristic information and discard duplicate packets, the CPU resource occupation problem caused by flooding advertisements in the IGP routing protocol is solved, and more efficient packet processing is achieved.

CN112559162BActive Publication Date: 2025-06-20HUAWEI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN201910853389.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-09-10
Publication Date
2025-06-20
Estimated Expiration
2039-09-10

AI Technical Summary

Technical Problem

In the IGP routing protocol, when a router advertises link, interface and link status information through flooding, multiple copies of LSA or LSP packets may be received by the router, occupying limited CPU resources.

Method used

A Bloom filter is used to retrieve the characteristic information of the data packet. If the characteristic information already exists, the data packet is discarded to avoid being sent to the CPU for processing.

Benefits of technology

It effectively filters duplicate data packets, reduces the use of CPU resources, and improves the processing efficiency of the router.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112559162B_ABST
    Figure CN112559162B_ABST
Patent Text Reader

Abstract

The present invention discloses an IGP routing method and apparatus. The method includes: a first device receives a first data packet from a second device; the first device determines first feature information according to the first data packet; the first device retrieves whether the first feature information exists in a Bloom filter of the first device; when the first device retrieves the first feature information from the Bloom filter of the first device, the first device discards the first data packet. In this way, by judging whether the first device has received the first data packet according to the feature information of the data packet, the received data packets can be effectively filtered, and the discarded data packets do not need to be sent to the CPU for processing, which can save the resources of the CPU.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communications, and in particular, to an IGP routing method and apparatus. Background Art

[0002] Interior Gateway Protocols (IGPs) include Open Shortest Path First (OSPF) and Intermediate System to Intermediate System (IS-IS). Both OSPF and IS-IS advertise all links, interfaces, and link state information of routers through flooding. IGPs have a mechanism to synchronize the link state databases among various routers.

[0003] Each router sends Link State Advertisement (LSA) or Link State Protocol Data Unit (LSP) packets among its neighboring routers that have formed adjacency relationships, and uses flooding to advertise all links, interfaces, and link state information of the router. If OSPF is adopted, routers interact through LSAs. If IS-IS is adopted, routers interact through LSPs. Each router that receives an LSA or LSP from a neighboring router records these LSAs or LSPs in its link state database, and then sends its own local LSA / LSP to all other neighboring routers.

[0004] By flooding to advertise all links, interfaces, and link state information of routers, a router may receive multiple copies of an LSA or LSP. The valid contents of these LSAs or LSPs are the same, but all need to be sent to the Central Processing Unit (CPU) for processing. This occupies the limited CPU resources of the router. When there are many routers in the link, the number of LSAs or LSPs will be very large, and a large number of duplicate LSAs or LSPs will occupy the CPU resources. Summary of the Invention

[0005] The first aspect of the present invention provides an IGP routing method, which includes: a first device receives a first data packet from a second device; the first device determines first feature information according to the first data packet; the first device retrieves whether the first feature information exists in the Bloom filter of the first device; when the first device retrieves the first feature information from the Bloom filter of the first device, the first device discards the first data packet. In this way, it can be determined whether the first device has received the first data packet according to the feature information of the data packet, and the received data packets can be effectively filtered. The discarded data packets do not need to be sent to the CPU for processing, which can save the resources of the CPU.

[0006] Optionally, in combination with the first aspect, in the first possible implementation manner of the first aspect, the first feature information is calculated by the second device and carried in the first data packet. The first device determining the first feature information according to the first data packet includes: the first device extracts the first feature information from the first data packet. In this way, the computing pressure on the receiving party can be reduced.

[0007] Optionally, in combination with the first aspect, in the second possible implementation manner of the first aspect, the first device determining the first feature information according to the first data packet includes: the first device calculates the first feature information according to the first data packet. In this way, the sender can directly send the data packet without calculating the first feature information, which can reduce the computing pressure on the sender.

[0008] Optionally, in combination with any one of the first aspect to the second possible implementation manner of the first aspect, in the third possible implementation manner of the first aspect, the Bloom filter includes at least two feature information sets. The first device retrieving whether the first feature information exists in the Bloom filter of the first device includes: the first device determines a feature information set that stores the most feature information from at least two feature information sets; the first device retrieves whether the first feature information exists in the feature information set that stores the most feature information. The first device only needs to retrieve from the feature information set that stores the most feature information, which can reduce the retrieval pressure on the first device.

[0009] Optionally, in combination with the third possible implementation manner of the first aspect, in the fourth possible implementation manner of the first aspect, the Bloom filter includes N feature information sets, N is a positive integer greater than or equal to 2, the N feature information sets are numbered from 1 to N, the number of cycles of the preset processing period is T, and T is a positive integer. After the first device retrieves whether the first feature information exists in the Bloom filter of the first device, the method further includes: when the first device does not retrieve the first feature information from the Bloom filter of the first device and T is less than N, the first device writes the first feature information into the first T feature information sets among the N feature information sets.

[0010] Optionally, in combination with the fourth possible implementation manner of the first aspect, in the fifth possible implementation manner of the first aspect, the method further includes: when the first device fails to retrieve the first feature information from the Bloom filter of the first device and T is greater than or equal to N, the first device writes the first feature information into each of the N feature information sets.

[0011] Optionally, in combination with the fifth possible implementation manner of the first aspect, in the sixth possible implementation manner of the first aspect, after the first device retrieves whether there is the first feature information from the feature information set storing the most feature information, the method further includes: when T is greater than or equal to N, the first device clears the feature information in the feature information set storing the most feature information. Clearing only one feature information set storing the most feature information each time can reduce the occurrence of false positives while storing as many feature information as possible.

[0012] Optionally, in combination with the sixth possible implementation manner of the first aspect, in the seventh possible implementation manner of the first aspect, the Bloom filter includes two feature information sets. After the first device retrieves whether there is the first feature information from the Bloom filter of the first device, the method further includes: when the first device fails to retrieve the first feature information from the Bloom filter of the first device and T is equal to 1, the first device writes the first feature information into one of the two feature information sets.

[0013] Optionally, in combination with the seventh possible implementation manner of the first aspect, in the eighth possible implementation manner of the first aspect, the method further includes: when the first device fails to retrieve the first feature information from the Bloom filter of the first device and T is greater than or equal to 2, the first device writes the first feature information into each of the two feature information sets.

[0014] Optionally, in combination with the seventh possible implementation manner or the eighth possible implementation manner of the first aspect, in the ninth possible implementation manner of the first aspect, after the first device retrieves whether there is the first feature information from the feature information set storing the most feature information, the method further includes: when T is greater than or equal to 2, the first device clears the feature information in the feature information set storing the most feature information.

[0015] In a second aspect of the present invention, an IGP routing device is provided. The device includes: a receiving unit configured to receive a first data packet from a second device; a processing unit configured to determine first feature information according to the first data packet; the processing unit is further configured to retrieve whether the first feature information exists in a Bloom filter of the first device; the processing unit is further configured to discard the first data packet when the first feature information is retrieved from the Bloom filter of the first device. When the processing unit retrieves the first feature information from the Bloom filter of the first device, the processing unit can determine that the first data packet has been received, and thus can discard the first data packet. In this way, the received data packets can be effectively filtered, and the discarded data packets do not need to be sent to the CPU for processing, which can save CPU resources.

[0016] Optionally, in combination with the second aspect, in a first possible implementation manner of the second aspect, the first feature information is calculated by the second device and carried in the first data packet, and the processing unit is further configured to extract the first feature information from the first data packet.

[0017] Optionally, in combination with the second aspect, in a second possible implementation manner of the second aspect, the processing unit is further configured to calculate the first feature information according to the first data packet.

[0018] Optionally, in combination with any one of the second aspect to the second possible implementation manner of the second aspect, in a third possible implementation manner of the second aspect, the Bloom filter includes at least two feature information sets, and the processing unit is further configured to determine a feature information set with the most stored feature information from the at least two feature information sets; the processing unit is further configured to retrieve whether the first feature information exists in the feature information set with the most stored feature information.

[0019] Optionally, in combination with the third possible implementation manner of the second aspect, in a fourth possible implementation manner of the second aspect, the Bloom filter includes N feature information sets, N is a positive integer greater than or equal to 2, the N feature information sets are numbered from 1 to N, the number of cycles of a preset processing period is T, and T is a positive integer. The processing unit is further configured to write the first feature information into the first T feature information sets among the N feature information sets when the first device does not retrieve the first feature information from the Bloom filter of the first device and T is less than N.

[0020] Optionally, in combination with the fourth possible implementation manner of the second aspect, in a fifth possible implementation manner of the second aspect, the processing unit is further configured to write the first feature information into each of the N feature information sets when the first device does not retrieve the first feature information from the Bloom filter of the first device and T is greater than or equal to N.

[0021] Optionally, in combination with the fourth or fifth possible implementation manner of the second aspect, in the sixth possible implementation manner of the second aspect, the processing unit is further configured to clear the feature information in the one feature information set storing the most feature information when T is greater than or equal to N.

[0022] Optionally, in combination with the sixth possible implementation manner of the second aspect, in the seventh possible implementation manner of the second aspect, the Bloom filter includes two feature information sets, and the processing unit is further configured to write the first feature information into one of the two feature information sets when the first feature information is not retrieved from the Bloom filter of the first device and T is equal to 1.

[0023] Optionally, in combination with the seventh possible implementation manner of the second aspect, in the eighth possible implementation manner of the second aspect, the processing unit is further configured to write the first feature information into each of the two feature information sets when the first feature information is not retrieved from the Bloom filter of the first device and T is greater than or equal to 2.

[0024] Optionally, in combination with the seventh or eighth possible implementation manner of the second aspect, in the ninth possible implementation manner of the second aspect, the processing unit is further configured to clear the feature information in the one feature information set storing the most feature information when T is greater than or equal to 2.

[0025] The third aspect of the present invention provides a computer-readable storage medium, including a computer program, which when running on a computer, causes the computer to execute the IGP routing method described in any one of the possible implementation manners of the first aspect to the first aspect.

[0026] The fourth aspect of the present invention provides an IGP routing device, which includes: a processor, a memory, and a transceiver. The memory is used to store a computer program, and the processor is used to execute the computer instructions stored in the memory so that the device executes the IGP routing method described in any one of the possible implementation manners of the first aspect to the first aspect.

[0027] An embodiment of the present invention provides an IGP routing method and apparatus. The method includes: a first device receives a first data packet from a second device; the first device determines first feature information according to the first data packet; the first device retrieves whether the first feature information exists in the Bloom filter of the first device; when the first device retrieves the first feature information from the Bloom filter of the first device, the first device discards the first data packet. When the first feature information exists in the Bloom filter of the first device, the first device can determine that it has received the first data packet, and thus can discard the first data packet. In this way, by judging whether the first device has received the first data packet according to the feature information of the data packet, the received data packets can be effectively filtered, and the discarded data packets do not need to be sent to the CPU for processing, which can save CPU resources. Description of the Drawings

[0028] Figure 1 is a schematic diagram of an embodiment of an IGP routing method provided by an embodiment of the present application;

[0029] Figure 2 is a schematic diagram of a scenario where the first device retrieves the first feature information from the Bloom filter of the first device provided by an embodiment of the present application;

[0030] Figure 3 is a schematic diagram of a scenario where the first device does not retrieve the first feature information from the Bloom filter of the first device provided by an embodiment of the present application;

[0031] Figure 4 is a schematic diagram of a scenario of false positive provided by the present application;

[0032] Figure 5 is a schematic diagram of an embodiment of an IGP routing apparatus provided by the present application. Detailed Embodiments

[0033] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts shall fall within the protection scope of the present invention.

[0034] The term "and / or" appearing in the present application can be an association relationship describing associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in the present application generally represents an "or" relationship between the front and rear associated objects.

[0035] In the description, claims and the above-mentioned drawings of this application, terms such as "first", "second", etc. are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments described here can be implemented in an order other than that illustrated or described here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or modules does not necessarily have to be limited to those steps or modules clearly listed, but may include other steps or modules not clearly listed or inherent to these processes, methods, products or devices.

[0036] IGP includes OSPF and IS-IS. For OSPF, when a certain router receives an LSA, the router needs to confirm the LSA. Otherwise, this LSA will be added to the retransmission list and retransmitted every once in a while. Moreover, when routers synchronize their link state databases, they will put the information of the LSAs that the router does not have into the link state request list, send a link state request data packet to the neighbor routers of the router to request the LSAs that the router does not have, and then the router will obtain the LSAs that the router does not have from the link state update data packets sent by the neighbor routers, and add the LSAs that the router does not have to the local link state database.

[0037] For IS-IS, the designated router periodically sends complete sequence numbers protocol data units (CSNPs) in multicast mode. When a router receives a CSNP, it will compare the LSP summary in the protocol data unit (PDU) with the LSPs in its own database. If there is an LSP in the local link state database that does not exist in the CSNP, the router will send this LSP on the network in multicast mode; if there is an LSP in the CSNP that does not exist in the local link state database, the router will send a partial sequence numbers protocol data unit (PSNP) data packet in multicast mode, and the designated router will send a data packet containing the LSPs that do not exist in the local link state database of this router to this router.

[0038] OSPF and IS-IS advertise all link, interface, and status information of routers through flooding. Each router that receives an LSA or LSP from a neighbor router will record these LSAs or LSPs in its link state database and send its own local LSA / LSP to all other neighbor routers. In this way, a router may receive multiple copies of an LSA or LSP. Although the valid content of these LSAs or LSPs is the same, they all need to be sent to the CPU for processing. This occupies the limited CPU resources of the router. When there are many routers in the link, the number of LSAs or LSPs will be very large. A large number of duplicate LSAs or LSPs will occupy both the CPU processing power and the CPU bandwidth resources.

[0039] To address the above problems, on the premise of ensuring the correct interaction of routers, the CPU can select some necessary links in the link to interact with LSAs / LSPs. Before flooding and sending LSAs / LSPs, the CPU can judge the advertisement scope of the LSA / LSP and limit an LSA / LSP to flood only within one area. If multiple links belong to the same area, the LSA / LSP will only be sent on one link. However, although this solution determines flooding within one area, it still requires the CPU to judge and process, consuming the CPU processing power.

[0040] Embodiment 1 of this application provides a method for IGP routing. Please refer to Figure 1 , the method includes:

[0041] 101. The first device receives a first data packet from the second device.

[0042] The first device receives a first data packet from the second device. Both the first device and the second device are routers. If the first device and the second device communicate through OSPF, the first data packet is an LSA; if the first device and the second device communicate through IS-IS, the first data packet is an LSP.

[0043] 102. The first device determines first feature information according to the first data packet.

[0044] The first device determines first feature information according to the first data packet. The first feature information can be calculated by the second device and carried in the first data packet, or can be calculated by the first device according to the first data packet received from the second device.

[0045] The calculation method can be as follows: perform at least one hash calculation of the unique identifier of the first data packet using a Bloom filter to obtain at least one hash value, perform a modulo operation on the bits of the Bloom filter with the at least one hash value to obtain at least one eigenvalue. Then set the positions corresponding to the at least one eigenvalue on the bit-array to 1. Thus, the first feature information is obtained, and the first feature information can be the bit-array recording at least one eigenvalue. Exemplarily, the unique identifier of the first data packet can be subjected to 4 hash calculations using a Bloom filter to obtain 4 hash values, perform a modulo operation on the bits of the Bloom filter with the 4 hash values respectively to obtain 4 eigenvalues. Then set the positions corresponding to the 4 eigenvalues on the bit-array to 1. For example, the 4 eigenvalues are respectively: 1, 3, 7, 10. Then set the 1st, 3rd, 7th, and 10th positions of the bit-array to 1.

[0046] The unique identifier of the first data packet can be a checksum field but is not limited thereto. The checksum field is a 16-bit integer, and a data packet can be determined according to the checksum field.

[0047] In one implementation, before the second device sends the first data packet to the first device, the second device can obtain the first feature information according to the above calculation method, then carry the first feature information in the first data packet, and then the second device sends the data packet carrying the first feature information to the first device. After receiving the first data packet, the first device extracts the first feature information in the first data packet. The following are two examples of this implementation:

[0048] Example 1: If the first device and the second device communicate via OSPF, the second device can carry the first feature information in the LSA. Specifically, it can be: insert the first feature information between the IP header of the LSA and the OSPF data, but is not limited thereto. The position where the first feature information is inserted is not limited, but the inserted position is preset, and the first device extracts from the position where the second device inserts. After receiving the LSA carrying the first feature information, the first device extracts the first feature information from the corresponding position in the LSA. For example, it can be extracted between the IP header and the OSPF data.

[0049] Example 2: If the first device and the second device communicate via IS-IS, the second device can carry the first feature information in the LSP. Specifically, it can be to insert the first feature information between the link layer header and the IS-IS data, but not limited to this. The position where the first feature information is inserted into the LSP is not limited, but the inserted position is preset. The first device extracts the first feature information from the position where the second device inserts it. After the first device receives the LSP carrying the first feature information, it then extracts the first feature information from the corresponding position in the LSP. For example, it can be extracted between the IP header and the IS-IS data.

[0050] The above two examples are only two possible implementation manners and do not constitute a limitation to the present invention.

[0051] In another possible implementation manner, the first data packet sent by the second device to the first device does not carry the first feature information. After the first device receives the first data packet sent by the second device, it can calculate the first feature information according to the above calculation method.

[0052] 103. The first device retrieves from the Bloom filter of the first device whether there is the first feature information.

[0053] The first device retrieves from the Bloom filter of the first device whether there is the first feature information obtained in step 102. The Bloom filter includes at least two feature information sets for storing feature information. The first device retrieves from the Bloom filter of the first device whether there is the first feature information specifically as follows: The first device retrieves from the feature information set with the most stored feature information in the Bloom filter of the first device whether there is the first feature information. The retrieval process can be executed by a network processor (NP) or a CPU, which is not limited here.

[0054] It should be noted that in this solution, the processing period can be set in advance. The number of periods of this processing period is T, where T is a positive integer, and the duration of this processing period is not limited. For example, the number of periods of the first processing period is 1, the number of periods of the second processing period is 2... the number of periods of the Tth processing period is T. At least two feature information sets are set in this Bloom filter. The number of feature information sets is N, where N is a positive integer greater than or equal to 2. The N feature information sets are numbered from 1 to N. When T is 1, the first T feature information sets refer to the feature information set numbered 1. When T is greater than 1, the first T feature information sets refer to all the feature information sets numbered from 1 to T. Exemplarily, if 4 feature information sets are set, the 4 feature information sets are numbered from 1 to 4. When T is 1, the first T feature information sets refer to the feature information set numbered 1. When T is 3, the first T feature information sets refer to 3 feature information sets numbered from 1 to 3.

[0055] When the number of periods T is less than the number of feature information sets N, the first device writes the feature information to be written into the first T feature information sets among the N feature information sets. The feature information to be written is the feature information that does not exist in this Bloom filter. Exemplarily, if 3 feature information sets are set, the 3 feature information sets are numbered from 1 to 3. When the number of periods is 1, the feature information to be written is written into the feature information set numbered 1. When the number of periods is 2, the feature information to be written is written into the feature information set numbered 1 and the feature information set numbered 2.

[0056] When the number of periods T is greater than or equal to the number of feature information sets, the first device writes the feature information to be written into each of the N feature information sets. Exemplarily, if 3 feature information sets are set, when the number of periods is greater than or equal to 3, the feature information to be written is written once in each feature information set.

[0057] From this, it can be seen that among the N feature information sets, the feature information set with the most stored feature information must contain all the feature information contained in other feature information sets. Therefore, the first device retrieving whether the first feature information exists from a feature information set with the most stored feature information is equivalent to retrieving all the feature information sets in this Bloom filter once.

[0058] When the number of periods T is greater than or equal to N, at the end of each period, the first device clears the feature information stored in a feature information set with the most stored feature information.

[0059] Exemplarily, when there are 2 feature information sets set in the Bloom filter, when the first feature information is not retrieved from the Bloom filter of the first device and T is equal to 1, the first feature information is written into 1 of the 2 feature information sets; when the first feature information is not retrieved from the Bloom filter of the first device and T is greater than or equal to 2, the first feature information is written into each of the 2 feature information sets. When T is greater than or equal to 2, the feature information in the feature information set with the most stored feature information is cleared.

[0060] 104. The first device discards the first data packet.

[0061] If in step 103, the first device retrieves the existence of the first feature information from the Bloom filter of the first device, then the first device can determine that it has received the first data packet. As Figure 2 shown, the bits set to 1 in the first feature information and the corresponding bits in the feature information set with the most stored feature information in the Bloom filter are both set to 1. So in this case, the first device retrieves the existence of the first feature information from the Bloom filter of the first device. The first device discards the first data packet.

[0062] 105. The first device retains the first data packet.

[0063] If in step 104, the first device does not retrieve the first feature information from the Bloom filter of the first device, then the first device retains the first data packet and uploads it to the CPU for processing. As Figure 3 shown, there are bits set to 1 in the first feature information and the corresponding bits in the feature information set with the most stored feature information in the Bloom filter that are not set to 1. So in this case, the first device does not retrieve the first feature information from the Bloom filter of the first device. The first feature information needs to be written into the Bloom filter.

[0064] When the first device does not retrieve the first feature information from the Bloom filter of the first device and T is less than N, the first device writes the first feature information into the first T feature information sets among the N feature information sets; when the first device does not retrieve the first feature information from the Bloom filter of the first device and T is greater than or equal to N, the first device writes the feature information into each of the N feature information sets. Writing the first feature information into the feature information set of the Bloom filter can specifically be: setting the positions corresponding to the bits set to 1 in the first feature information to 1 in the feature information set.

[0065] It should be noted that, after receiving the data packet, the first device will write the feature information that is not retrieved in the Bloom filter into the Bloom filter. As more and more feature information is written, more and more bits in the feature information set of the Bloom filter will be set to 1. If the feature information set of the Bloom filter is not cleared in time, it is easy to cause the following error: Figure 4 Therefore, when the number of cycles T is greater than or equal to N, the feature information in a feature information set storing the most feature information is cleared.

[0066] Taking step 102 of the present application as an example, the method of obtaining the first characteristic information according to the first data packet may have a false positive problem, see Figure 4 . x and y are the characteristic information included in the characteristic information set in the Bloom filter, and z is the first characteristic information. However, in step 103, the first device will retrieve the first characteristic information included in the characteristic information set, so it will discard the first data packet. In fact, the first data packet has never reached the first device, that is, a false positive problem occurs. In this case, both OSPF and IS-IS have a link state database synchronization mechanism. If the first device does not retain the first data packet, it will request the first data packet from the neighboring router again.

[0067] However, because a clearing mechanism is set, the Bloom filter stores only N cycles of feature information at most. If the first device receives the first data packet N cycles ago, the first feature information corresponding to the first data packet has been cleared. The first device cannot retrieve the first feature information before the Bloom filter of the first device, so the first device will still retain the first data packet.

[0068] The first embodiment of the present invention provides an IGP routing method, when the first characteristic information exists in the bloom filter of the first device, the first device can determine that the first data packet has been received, and thus the first data packet can be discarded. In this way, by judging whether the first device has received the first data packet based on the characteristic information of the data packet, the received data packet can be effectively filtered, and the discarded data packet does not need to be sent to the CPU for processing, which can save CPU resources.

[0069] See also Figure 5 According to a second aspect of an embodiment of the present invention, an IGP routing device 20 is provided. The IGP routing device 20 includes:

[0070] The receiving unit 201 is configured to receive a first data packet from a second device. Please refer to step 101 of the first embodiment for understanding, which will not be described in detail here.

[0071] The processing unit 202 is configured to determine first feature information according to the first data packet. Refer to step 102 of Embodiment 1 for understanding, which will not be elaborated here.

[0072] The processing unit 202 is further configured to retrieve whether the first feature information exists in the Bloom filter of the first device. Refer to step 103 of Embodiment 1 for understanding, which will not be elaborated here.

[0073] The processing unit 202 is further configured to, when the first device retrieves the first feature information from the Bloom filter of the first device, discard the first data packet by the first device. Refer to step 104 of Embodiment 1 for understanding, which will not be elaborated here.

[0074] The processing unit 202 is further configured to extract the first feature information from the first data packet. Refer to step 102 of Embodiment 1 for understanding, which will not be elaborated here.

[0075] The processing unit 202 is further configured to calculate the first feature information according to the first data packet. Refer to step 102 of Embodiment 1 for understanding, which will not be elaborated here.

[0076] The processing unit 202 is further configured to determine, from at least two feature information sets, a feature information set that stores the most feature information. Refer to step 103 of Embodiment 1 for understanding, which will not be elaborated here.

[0077] The processing unit 202 is further configured to retrieve whether the first feature information exists in a feature information set that stores the most feature information. Refer to step 103 of Embodiment 1 for understanding, which will not be elaborated here.

[0078] The processing unit 202 is further configured to, when the first device does not retrieve the first feature information from the Bloom filter of the first device and T is less than N, write the first feature information into the first T feature information sets among the N feature information sets. Refer to step 105 of Embodiment 1 for understanding, which will not be elaborated here.

[0079] The processing unit 202 is further configured to, when the first device does not retrieve the first feature information from the Bloom filter of the first device and T is greater than or equal to N, write the first feature information into each of the N feature information sets. Refer to step 105 of Embodiment 1 for understanding, which will not be elaborated here.

[0080] The processing unit 202 is further configured to, when T is greater than or equal to N, clear the feature information in a feature information set that stores the most feature information. Refer to step 105 of Embodiment 1 for understanding, which will not be elaborated here.

[0081] The processing unit 202 is further configured to write the first feature information into one of the two feature information sets when the first feature information is not retrieved from the Bloom filter of the first device and T is equal to 1. For understanding, refer to step 103 of Embodiment 1, which will not be elaborated here.

[0082] The processing unit 202 is further configured to write the first feature information into each of the two feature information sets when the first feature information is not retrieved from the Bloom filter of the first device and T is greater than or equal to 2. For understanding, refer to step 103 of Embodiment 1, which will not be elaborated here.

[0083] The processing unit 202 is further configured to clear the feature information in the feature information set with the most stored feature information when T is greater than or equal to 2. For understanding, refer to step 103 of Embodiment 1, which will not be elaborated here.

[0084] The above has introduced in detail an IGP routing method and apparatus provided by an embodiment of the present invention. Specific examples are used herein to elaborate the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation of the present invention. Although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. An IGP routing method, characterized in that, The method includes: A first device receives a first data packet from a second device; The first device determines first feature information according to the first data packet; The first device retrieves whether the first feature information exists from a Bloom filter of the first device. The Bloom filter includes N sets of feature information, N is a positive integer greater than or equal to 2. The N sets of feature information are numbered from 1 to N. The number of cycles in a preset processing period is T, and T is a positive integer; When the first device retrieves the first feature information from the Bloom filter of the first device, the first device discards the first data packet; When the first device does not retrieve the first feature information from the Bloom filter of the first device and T is less than N, the first device writes the first feature information into the first T sets of feature information among the N sets of feature information.

2. The method according to claim 1, characterized in that, The first feature information is calculated by the second device and carried in the first data packet. The first device determines the first feature information according to the first data packet, including: The first device extracts the first feature information from the first data packet.

3. The method according to claim 1, characterized in that, The first device determines the first feature information according to the first data packet, including: The first device calculates the first feature information according to the first data packet.

4. The method according to any one of claims 1 to 3, characterized in that, The first device retrieves whether the first feature information exists from the Bloom filter of the first device, including: The first device determines a set of feature information with the most stored feature information from the N sets of feature information; The first device retrieves whether the first feature information exists from the set of feature information with the most stored feature information.

5. The method according to claim 1, characterized in that, The method further includes: When the first device does not retrieve the first feature information from the Bloom filter of the first device and T is greater than or equal to N, the first device writes the first feature information into each set of feature information among the N sets of feature information.

6. The method according to claim 1 or 5, characterized in that, After the first device retrieves whether the first feature information exists from the set of feature information with the most stored feature information, the method further includes: When T is greater than or equal to N, the first device clears the feature information in the set of feature information with the most stored feature information.

7. The method according to claim 6, characterized in that, The Bloom filter includes 2 sets of feature information. After the first device retrieves whether the first feature information exists from the Bloom filter of the first device, the method further includes: When the first device does not retrieve the first feature information from the Bloom filter of the first device and T is equal to 1, the first device writes the first feature information into 1 set of feature information among the 2 sets of feature information.

8. The method according to claim 7, characterized in that, The method further includes: When the first device does not retrieve the first feature information from the Bloom filter of the first device and T is greater than or equal to 2, the first device writes the first feature information into each set of feature information among the 2 sets of feature information.

9. The method according to claim 7 or 8, characterized in that, After the first device retrieves whether there is first feature information from the one feature information set that stores the most feature information, the method further includes: When T is greater than or equal to 2, the first device clears the feature information in the one feature information set that stores the most feature information.

10. An IGP routing device, characterized in that, The device includes: A receiving unit, configured to receive a first data packet from a second device; A processing unit, configured to determine first feature information according to the first data packet; The processing unit is further configured to retrieve whether there is the first feature information from a Bloom filter of the first device. The Bloom filter includes N feature information sets, N is a positive integer greater than or equal to 2, the N feature information sets are numbered from 1 to N, and the number of cycles of a preset processing period is T, and T is a positive integer; The processing unit is further configured to discard the first data packet when the processing unit retrieves the first feature information from the Bloom filter of the first device; The processing unit is further configured to write the first feature information into the first T feature information sets among the N feature information sets when the processing unit does not retrieve the first feature information from the Bloom filter of the first device and T is less than N.

11. The device according to claim 10, characterized in that,The first feature information is calculated by the second device and carried in the first data packet. The processing unit is further configured to extract the first feature information from the first data packet.

12. The device according to claim 10, wherein, The processing unit is further configured to calculate the first feature information according to the first data packet.

13. The device according to any one of claims 10 to 12, wherein, The processing unit is further configured to determine one feature information set that stores the most feature information from the N feature information sets; The processing unit is further configured to retrieve whether there is the first feature information from the one feature information set that stores the most feature information.

14. The device according to claim 10, wherein, The processing unit is further configured to write the first feature information into each of the N feature information sets when the processing unit does not retrieve the first feature information from the Bloom filter of the first device and T is greater than or equal to N.

15. The device according to claim 10 or 14, wherein, The processing unit is further configured to clear the feature information in the one feature information set that stores the most feature information when T is greater than or equal to N.

16. The device according to claim 15, wherein, The Bloom filter includes 2 feature information sets. The processing unit is further configured to write the first feature information into one of the 2 feature information sets when the first feature information is not retrieved from the Bloom filter of the first device and T is equal to 1.

17. The device according to claim 16, wherein, The processing unit is further configured to write the first feature information into each of the 2 feature information sets when the first feature information is not retrieved from the Bloom filter of the first device and T is greater than or equal to 2.

18. The device according to claim 16 or 17, wherein, The processing unit is further configured to clear the feature information in the one feature information set that stores the most feature information when T is greater than or equal to 2.

19. A computer-readable storage medium, comprising a computer program, which when running on a computer, causes the computer to execute the IGP routing method according to any one of claims 1 to 9.

20. An IGP routing device, the device comprising: A processor, a memory, and a transceiver, where the memory is used to store a computer program, and the processor is used to execute computer instructions stored in the memory so that the device executes the IGP routing method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Reliable transmission method based on SDN

    CN107347021A