Method for detecting route item usage state, network device, medium and product
By adding a flow table entry containing route identity information, the association between the flow table and the route entry is established, solving the problem of detecting the usage status of the route entry, enabling the assessment of the importance of the route entry and risk warning, and improving the accuracy of network configuration.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CLOUD INTELLIGENCE ASSETS HOLDING (SINGAPORE) PTE LTD
- Filing Date
- 2024-11-27
- Publication Date
- 2026-05-29
AI Technical Summary
In existing technologies, network operators lack effective methods to detect the usage status of routing entries when configuring them, resulting in inaccurate configurations.
By adding flow table entries that describe route identity information, the association between flow tables and route entries is established. The route identity information recorded in the flow table is used to determine the target flow table, and the usage status of the target route entry is reflected based on the packet attribute information forwarded by the target flow table.
It enables accurate detection of the usage status of routing entries, assesses the importance of routing entries and the risk of modification, improves the packet forwarding efficiency of network devices, and provides a basis for configuration decisions by maintenance personnel.
Smart Images

Figure CN122120153A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of network communication technology, and in particular to a method, network device, medium, and product for detecting the usage status of routing entries. Background Technology
[0002] The messages generated by users when using different applications and cloud services can form a data stream, and the messages in the data stream can be transmitted from the source to the destination using routing entries in the routing table. The usage status of the routing entry can be used to measure the importance of the routing entry.
[0003] In practice, network operators often refer to the usage status of routing entries when configuring them. Therefore, how to detect the usage status of routing entries has become an urgent problem to be solved. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a method, network device, medium, and product for detecting the usage status of routing items, so as to realize the detection of the usage status of routing items.
[0005] In a first aspect, embodiments of the present invention provide a method for detecting the usage status of routing entries, comprising:
[0006] Retrieve the candidate flow table containing routing identity information;
[0007] In the candidate flow table, it is determined whether there is a target flow table that records the target route identity information, wherein the target route entry has the target route identity information, and the target packet is forwarded by the target flow table or the target route entry;
[0008] If the target flow table exists, the usage status of the target routing entry is determined based on the attribute information of the data flow to which the target packet belongs, as forwarded by the target flow table.
[0009] Secondly, embodiments of the present invention provide a network device, including: a message sending and receiving module and a statistics module;
[0010] The message sending and receiving module is used to obtain a candidate flow table that records routing identity information;
[0011] The detection module is used to determine whether there is a target flow table that records target route identity information in the candidate flow table, wherein the target route identity entry has the target route information, and the target packet is forwarded by the target flow table or the target route entry;
[0012] If the target flow table exists, the usage status of the target routing entry is determined based on the attribute information of the data flow to which the target packet belongs, as forwarded by the target flow table.
[0013] Thirdly, embodiments of the present invention provide a network device, including a processor and a memory. The memory stores one or more computer instructions, wherein the one or more computer instructions, when executed by the processor, implement the routing item usage status detection method described in the first aspect. The electronic device may also include a communication interface for communicating with other devices or communication networks.
[0014] Fourthly, embodiments of the present invention provide a non-transitory machine-readable storage medium storing executable code, wherein when the executable code is executed by a processor of an electronic device, the processor is able to at least implement the routing item usage status detection method as described in the first aspect.
[0015] Fifthly, embodiments of the present invention provide a computer program product, the computer program product including a computer program or instructions, which, when executed by a processor, causes the processor to implement the routing item usage status detection method as described in the first aspect above.
[0016] In practice, flow tables contain matching conditions and processing actions; routing tables contain routing entries, and both flow tables and routing tables can implement packet forwarding. Although flow tables do not directly contain routing entries, since flow tables and routing tables serve the same purpose, packets forwarded using flow tables can be considered packets forwarded using routing entries in routing tables. In other words, flow table entries are equivalent to routing entries in routing tables, and the forwarding status of packets by flow tables can be considered the usage status of routing entries.
[0017] Based on the above description, the routing entry usage status detection method, network device, medium and product provided in the embodiments of the present invention add a flow table entry describing routing identity information, namely routing identity information, to the flow table. The addition of this flow table entry can establish an association between flow tables and routing entries used for forwarding the same packets.
[0018] For a target routing entry whose usage status needs to be detected, the routing identity information recorded in the flow table is used. If the network device determines a target flow table that is associated with the target routing entry from the candidate flow tables, it can further determine the attribute information of the data flow to which the target packet forwarded by the target flow table belongs. This attribute information can reflect the forwarding status of the packet by the target flow table. Therefore, this attribute information can also reflect the usage status of the target routing entry. At this point, the usage status of the routing entry is detected.
[0019] In the above method, a new flow table entry describing route identity information is added to the flow table. This flow table entry is used to describe the association between the flow table and the route entry. For the target route entry to be detected, the network device can use this new flow table entry to determine the target flow table containing the target route entry, and then perform statistics on the packet forwarding of the target flow table to realize the detection of the usage status of the target route entry. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 A flowchart illustrating a method for detecting the usage status of a routing item, as provided in an embodiment of the present invention;
[0022] Figure 2 A schematic diagram illustrating a data volume statistics process for a data stream, provided as an embodiment of the present invention;
[0023] Figure 3 A flowchart of another method for detecting the usage status of routing entries provided in an embodiment of the present invention;
[0024] Figure 4 A schematic diagram of the structure of a network device provided in an embodiment of the present invention;
[0025] Figure 5 This is a schematic diagram of another network device provided in an embodiment of the present invention;
[0026] Figure 6 This is a schematic diagram of a device for detecting the usage status of routing entries, provided in an embodiment of the present invention.
[0027] Figure 7 This is a schematic diagram of the structure of another network device provided in an embodiment of the present invention. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0029] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to limit the invention. The singular forms “a,” “the,” and “the” used in the embodiments of this invention and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise. “Multiple” generally includes at least two, but does not exclude the inclusion of at least one.
[0030] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0031] Depending on the context, the words “if” or “suppose” as used here can be interpreted as “when” or “in response to determination” or “in response to identification.” Similarly, depending on the context, the phrases “if determination” or “if identification (of the condition or event of the statement)” can be interpreted as “when determination” or “in response to determination” or “when identification (of the condition or event of the statement)” or “in response to identification (of the condition or event of the statement).”
[0032] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this invention are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0033] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a product or system comprising a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a product or system. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the product or system that includes said element.
[0034] The following detailed description of some embodiments of the present invention, in conjunction with the accompanying drawings, is provided. Where there is no conflict between the embodiments, the following embodiments and features can be combined with each other. Furthermore, the timing of the steps in the following method embodiments is merely an example and not a strict limitation.
[0035] Figure 1This is a flowchart illustrating a method for detecting the usage status of routing entries according to an embodiment of the present invention. The method provided in this embodiment can be executed by a network device with packet forwarding capabilities; optionally, the network device can be a router, switch, etc. Figure 1 As shown, the method may include the following steps:
[0036] S101, obtain the alternative flow table that records routing identity information.
[0037] In the embodiments provided by this invention, the packets forwarded by the network device are streaming data packets, which can be sent using flow tables or routing tables. The number of flow tables can be the same as the number of data streams to which the packets forwarded by the network device belong, meaning there is a one-to-one correspondence between flow tables and data streams. For the established flow tables, these are data plane flow tables used for packet forwarding, not control plane flow tables. Optionally, a data plane flow table can include multiple flow table entries, and each entry can include matching conditions, actions, etc. The method for creating flow tables can be found in the descriptions of the relevant embodiments below.
[0038] For an established flow table, a network device can obtain all or part of it as a candidate flow table. In practice, flow tables and routing tables have the same function, both used for packet forwarding. If a device selects any flow table, such as flow table 1, and it and routing entry 1 in routing table 1 are used to forward the same packet, then the packet forwarded using flow table 1 can be considered as the packet forwarded using routing entry 1 in routing table 1. This also means that there is an association between flow table 1 and routing entry 1 in routing table 1.
[0039] In the various embodiments provided by this invention, the routing identity information of a routing entry in the routing table can be recorded as a flow table entry in the flow table. The addition of this flow table entry can establish the association between the flow table and the routing entry. Optionally, the routing identity information may include the identity identifier (ID) of the routing table to which the routing entry belongs and the identity identifier (ID) of the routing entry in the routing table.
[0040] S102, in the candidate flow table, determine whether there is a target flow table that records the target route identity information, wherein the target route entry has target route identity information, and the target packet is forwarded by the target flow table or the target route entry.
[0041] For any routing entry in the routing table that requires stateful inspection, such as a target routing entry, since the candidate flow tables record routing identity information reflecting the association between flow tables and routing entries, the network device can select the target flow table that records the target routing identity information of the target routing entry from the candidate flow tables. In other words, it can select the target flow table that is associated with the target routing entry. Furthermore, this associated target flow table and the target routing entry can forward the same packet, i.e., the target packet.
[0042] S103. If a target flow table exists, determine the usage status of the target routing entry based on the attribute information of the data flow to which the target packet forwarded by the target flow table belongs.
[0043] Finally, the network device can further determine the attribute information of the data flow to which the target packet belongs, which is forwarded by the target flow table. This attribute information reflects the forwarding status of the target packet by the target flow table. The network device can also use this attribute information to determine the usage status of the target routing entry. Optionally, the attribute information of the data flow to which the target packet belongs may include the type and number of data flows to which the target packet belongs.
[0044] As described in step S101, both the target flow table and the target routing entry can forward target packets. Packets forwarded using the target flow table are equivalent to packets forwarded using the target routing entry. Therefore, the packet forwarding status of the target flow table can be considered the usage status of the target routing entry. Thus, the network device can directly determine the usage status of the target routing entry by the type and quantity of the data flow to which the target packet belongs.
[0045] The types of data streams can be understood in conjunction with the following:
[0046] As described in the background section, users generate a data stream when using applications or cloud services. Furthermore, the type of data stream can vary depending on the application and cloud service. For example, data streams generated when a user uses a video application, conducts online meetings using an instant messaging application, or uses cloud gaming can be considered real-time data streams. Data streams generated by user interaction can be considered non-real-time data streams.
[0047] Optionally, in practice, since different data flows can be forwarded using the same routing entry, the target packet can belong to at least one data flow, and the data flow type can also be at least one. Referring back to the examples above, it's easy to understand that the more types of data flows there are, the wider the scope of use of the target routing entry, indicating a higher level of importance and value for that target routing entry, and a higher risk of modification. Therefore, the method provided in this embodiment can also be considered a method for evaluating the importance of routing entries.
[0048] In this embodiment, a new flow table entry for route identity information is added to the flow table. This entry reflects the association between flow tables and route entries that forward the same packets. Therefore, for a target route entry whose usage status needs to be detected, the network device can use the route identity information recorded in the flow table to determine whether a target flow table associated with the target route entry exists from the candidate flow tables. If such a target flow table exists, the attribute information of the data flow to which the target packet forwarded by that target flow table belongs can be further determined. This attribute information reflects the forwarding status of packets by the target flow table, and thus also reflects the usage status of the target route entry. This achieves the detection of the route entry's usage status.
[0049] In the above method, a new flow table entry describing route identity information is added to the flow table. This flow table entry is used to describe the association between the flow table and the route entry. For the target route entry to be detected, the network device can use this new flow table entry to determine the target flow table containing the target route entry, and then perform statistics on the packet forwarding of the target flow table to realize the detection of the usage status of the target route entry.
[0050] Figure 1 The illustrated embodiment mentions that the attribute information of the data stream to which the target packet belongs may include the number of data stream types. Optionally, after receiving the target packet, the network device can determine the type of data stream to which the target packet belongs based on the packet identity information of the target packet, and further count the number of data stream types. Optionally, the packet identity information may include the packet's 5-tuple information.
[0051] Optionally, since packets belonging to different data flows can be forwarded using the same routing entry in the same routing table, there can be at least one target flow table containing target route identity information. Target packets forwarded using the target flow table can belong to at least one data flow, and this at least one data flow can belong to at least one type.
[0052] In this embodiment, the network device can use the number of data stream types to which the target packet belongs to evaluate the importance of the routing entry.
[0053] In addition, optionally, the attribute information of the data stream to which the target packet belongs may also include the number of data streams to which the target packet belongs. Similar to the process described above, network devices can also determine the data stream to which the target packet belongs based on the packet identity information of the target packet, and further count the number of data streams. Furthermore, similar to the number of data stream types, a higher number of data streams indicates a wider range of application for the target routing entry, a higher level of importance and value for the target routing entry, and a higher risk of modification of the target routing entry.
[0054] In this embodiment, the network device can use the number of data streams to which the target packet belongs to evaluate the importance of the routing entry.
[0055] Optionally, the attribute information of the data flow to which the target packet belongs may also include the data volume of the data flow to which the target packet belongs. Specifically, this data volume may include the number of target packets and / or the total amount of data contained in the target packets. The number of target packets can also be considered as the packet forwarding volume of the target flow table.
[0056] In one scenario, when target packets belong to the same data flow, the target flow table is essentially a single flow table. The number of target packets and the total amount of data contained in each packet can be recorded as separate flow table entries. In this case, the network device can directly retrieve the number of target packets and / or the total amount of data contained in each packet from the target flow table.
[0057] In another scenario, when a target packet belongs to multiple data flows, and the number of target flow tables is the same as the number of data flows to which the target packet belongs, then for packets belonging to the same data flow within the target packet, the number of these packets and the total amount of data contained in these packets can be recorded as separate flow table entries in the corresponding flow table of that data flow. In this case, the network device can obtain the number of packets and the total amount of data for each data flow from the respective flow tables of the multiple data flows to which the target packet belongs, and sum them up to obtain the number of target packets and the total amount of data contained in the target packet. Furthermore, the more packets and the larger the total amount of data contained in the packets, the higher the frequency of use of the target routing entry, the higher its importance and value, and the higher the risk of modifying the target routing entry.
[0058] In the latter case, it can also be combined with Figure 2 Understand the summing process of network devices. For example... Figure 2 As shown, the target packet may include packet 1 belonging to data flow 1 and packet 2 belonging to data flow 1. The amount of data contained in packet 1 may be 3M, and the amount of data contained in packet 2 may be 5M. Then the network device can calculate that the total amount of data contained in the target packet is 8M.
[0059] In this embodiment, the network device can use the number of target packets and / or the total amount of data contained in the target packets to assess the importance of routing entries.
[0060] In summary, the flow table now includes a new entry for routing identity information, which describes the association between flow tables and routing entries. Therefore, for a target routing entry to be detected, the network device can determine the target flow table associated with it by utilizing this association recorded in the flow table. Subsequently, the network device can also statistically analyze at least one attribute of the data flow to which the target packet forwarded using that target flow table belongs. This attribute can directly serve as the usage status of the target routing entry. Furthermore, different attribute information can reflect the usage status of the target routing entry from different perspectives, such as usage scope and frequency.
[0061] Furthermore, although the destination flow table and the destination routing table are related, meaning they are both used to forward the same destination packets, they can forward packets under different circumstances.
[0062] Specifically, when no target flow table corresponding to a data flow has been created, packets belonging to that data flow can be forwarded using the target routing entry in the routing table. Once the target flow table corresponding to the data flow has been created and the network device receives a target packet, since the packet identity information is also recorded as a flow table entry, the network device can first compare the packet identity information of the target packet with the packet identity information recorded in the candidate flow tables. Through comparison, if it is determined that a target flow table containing the packet identity information of the target packet exists in the candidate flow tables, the network device can directly use that target flow table to forward the target packet without performing a routing table lookup, thus improving packet forwarding speed.
[0063] Optionally, the timing and method of creating the target flow table can be described in more detail below.
[0064] When a target packet generated by a user application or cloud service is transmitted to a network device, the network device can query the existing candidate flow table. If the candidate flow table does not record the packet identity information of the target packet, it indicates that the data flow to which the target packet belongs may be a new data flow. In this case, the network device can create a target flow table corresponding to the data flow to which the target packet belongs. The packet identity information and the target routing entry can be recorded as flow table entries in this target flow table. It is easy to understand that the network device can create flow tables corresponding to different data flows in the above manner, not limited to the target flow table. Furthermore, while creating the target flow table, the network device can also query the routing table and use the queried target routing entry to forward the target packet.
[0065] In this embodiment, when the network device receives a packet belonging to a new data flow, it creates a packet corresponding to that data flow and forwards the packet by querying the routing table.
[0066] As described in the above embodiments, the usage status of the target routing item detected in each embodiment can reflect the importance of the target routing item. Furthermore, the detected usage status can be visualized so that network operators can refer to the usage status of the routing item when configuring routes. Optionally, the usage status of the routing items obtained in the above embodiments can be directly displayed to network operators for their reference.
[0067] To provide a clearer reference for network operations and maintenance personnel when configuring routes, network devices may optionally perform the following actions: Figure 3 The example shown.
[0068] Figure 3 A flowchart illustrating another method for detecting the usage status of routing entries provided in an embodiment of the present invention. Figure 3 As shown, after step S103, the method may further include the following steps:
[0069] S201. Based on the usage status of the target routing entry, determine the level of the target routing entry. The level reflects the risk of modifying the routing entry.
[0070] S202 displays the level of the target routing entry.
[0071] After detecting the usage status of a target routing item according to the methods provided in the above embodiments, the network device can further determine the level of the target routing item based on the usage status and display this level. Similar to the usage status, the level of a target routing item can reflect its importance and the risk of modification. A higher level indicates a higher risk of modification.
[0072] Furthermore, as described in the above embodiments, the usage status of a target routing item can be represented by at least one piece of data, such as the type and number of data flows to which the target packet belongs, the number of data flows to which the target packet belongs, the amount of data in the data flows to which the target packet belongs, etc. However, compared to directly displaying data, the ranking can more clearly and explicitly reflect the importance of the target routing item.
[0073] Regarding the determination of the level of the target routing entry, optionally, when the usage status of the target routing entry includes the number of data flow types to which the target packet belongs, the network device can first determine the numerical range in which the number of types falls, and then determine the level corresponding to that numerical range. This level can then be used as the level of the target routing entry. For example, the numerical range [1,5] corresponds to level 1, the numerical range [6,10] corresponds to level 2, and the numerical range [11,15] corresponds to level 3. Then, when the number of data flow types to which the target packet belongs is 3, the network device can determine the level of the target routing entry as 1.
[0074] Optionally, when the usage status of the target routing entry includes the number of data streams to which the target packet belongs, similarly, the network device can first determine the numerical range in which the number of data streams falls, and then determine the level corresponding to that numerical range. This level can then be used as the level of the target routing entry.
[0075] Optionally, when the usage status of the target routing entry includes the data volume of the target packet, similarly, the network device can first determine the numerical range in which the data volume of the data stream falls, and then determine the level corresponding to that numerical range. This level can then be used as the level of the target routing entry.
[0076] In this embodiment, the network device can display the level of the target routing item to network operators to provide a reference for them when configuring routes. Optionally, the network device can also display the usage status and level of the target routing item to the network operators to provide them with information on the usage status of the target routing item at different granularities.
[0077] In practice, based on the usage status of the target routing entry, network operators can also modify the target routing entry. In this case, after step S202, the method may also include the following steps:
[0078] S203, In response to the modification operation of the target route entry, if the level of the target route entry is higher than the preset level, a risk warning message is displayed.
[0079] Network operations and maintenance personnel can also trigger modification operations on this target routing item. In response to the modification operation triggered by the network operations and maintenance personnel, the level of the target routing item is obtained. If the level of the target routing item is higher than the preset level, it indicates that the target routing item is of high importance, meaning it has a wide range of uses, high frequency of use, and high value. It also indicates that modifying the target routing item carries a high risk; that is, modifying it may cause packet forwarding delays, or even prevent users from using cloud services or applications. In this case, the network device can also display a risk warning message to the network operations and maintenance personnel in response to this modification operation, such as "This routing item is [value], please confirm whether to modify it." This risk warning message is used to prompt the network operations and maintenance personnel to carefully confirm whether to modify the target routing item after understanding its usage status and / or level.
[0080] Similarly, optionally, if any data describing the usage status of a target routing item exceeds a preset threshold, the network device can also display a risk warning message.
[0081] In this embodiment, when network operators modify important routing entries, the network device can display corresponding risk warning information to prompt the network operators to confirm the modification operation they triggered.
[0082] The above embodiments describe the process by which network devices detect the importance of routing items from a procedural perspective. The following section can also describe the working process of network devices from the perspective of their internal structure.
[0083] Optionally, the network devices mentioned in the embodiments of the present invention can be deployed in a cloud network or a physical network. When deployed in a cloud network, the network device can be a virtual network device in the cloud network, such as a virtual router (VR) or a virtual switch (VS). The network device can also be a physical network device in the cloud network, such as a physical router or switch. When deployed in a physical network, the network device can be a physical network device within the physical network.
[0084] Figure 4 This is a schematic diagram of the structure of a network device provided in an embodiment of the present invention. Figure 4 As shown, the network device may include a packet forwarding module and a detection module. Optionally, the above-mentioned modules in the network device can be implemented using threads.
[0085] The packet transceiver module can utilize flow tables or routing tables to forward received packets belonging to a specific data flow. Simultaneously, the packet transceiver module can also retrieve candidate flow tables containing routing identity information.
[0086] The detection module can determine whether a target flow table containing target route identity information exists in the candidate flow table. The target route entry corresponding to the target route identity information is associated with the target flow table; both are used to forward the target packet. Furthermore, if a target flow table exists in the candidate flow table, the detection module can also determine the usage status of the target route entry based on the attribute information of the data flow to which the target packet belongs.
[0087] Optionally, the detection module can statistically determine the attribute information of the data stream to which the target message belongs based on the message identity information of the target message. As described in the above method embodiments, the attribute information may include at least one of the following: the type and number of data streams to which the target message belongs, the number of data streams to which the target message belongs, and the data volume of the data stream to which the target message belongs. The specific statistical process of the detection module can be found in the above-mentioned related embodiments, and will not be repeated here.
[0088] Additionally, for details not described in this embodiment, please refer to [link to relevant documentation]. Figure 1 The relevant descriptions in the illustrated embodiments will not be repeated here.
[0089] In this embodiment, a new flow table entry for route identity information is added to the flow table. This entry reflects the association between flow tables and routing entries, and flow tables and routing entries with an association are used to forward the same packets. Therefore, for a target routing entry whose usage status needs to be detected, using the route identity information recorded in the flow table, if the network device determines a target flow table with an association with the target routing entry from the candidate flow tables, it can further determine the attribute information of the data flow to which the target packet forwarded by that target flow table belongs. This attribute information reflects the forwarding status of the packet by the target flow table; therefore, this attribute information can also reflect the usage status of the target routing entry, thus achieving the detection of the routing entry's usage status.
[0090] In the above method, a new flow table entry describing route identity information is added to the flow table. This flow table entry is used to describe the association between the flow table and the route entry. For the target route entry to be detected, the network device can use this new flow table entry to determine the target flow table containing the target route entry, and then perform statistics on the packet forwarding of the target flow table to realize the detection of the usage status of the target route entry.
[0091] Optionally, the detection module can further determine the level of the target routing item and display the usage status and / or level of the target routing item to network operations and maintenance personnel.
[0092] Optionally, when network maintenance personnel trigger a modification operation on a target routing item, if the target routing item's level is higher than a preset level, or if any data describing the target routing item's usage status exceeds a preset threshold, the network device can display a risk warning message to allow network maintenance personnel to carefully confirm whether routing modifications are necessary. (See also: [link to relevant content]). Figure 3 The relevant descriptions in the illustrated embodiments will not be repeated here.
[0093] Figure 5 This is a schematic diagram of another network device provided in an embodiment of the present invention. Figure 4 Based on the network device shown, such as Figure 5 As shown, network devices also include processors and shared memory.
[0094] In this network device, both the packet transceiver module and the detection module can operate using the computing resources provided by the processor core. The shared memory can store the candidate flow table created by the packet transceiver module.
[0095] Optionally, when the message transceiver module receives a target message, it can first obtain the message identity information of the target message and read the already created alternative flow table from shared memory. Then, in one scenario, if the alternative flow table contains a target flow table that records the message identity information of the target message, it indicates that the message transceiver module has previously forwarded other messages belonging to the same data flow as the target message. In this case, the message transceiver module can directly use this target flow table to forward the target message without querying the routing table, thereby improving message forwarding efficiency.
[0096] In another scenario, if none of the candidate flow tables record the packet identity information of the target packet, it indicates that the target packet belongs to a new data flow. In this case, the packet transceiver module can forward this target packet using the target route entry in the routing table. Simultaneously, the packet transceiver module can also create a target flow table corresponding to the data flow to which the target packet belongs, based on the packet identity information and the target route identity information, and write this target flow table into shared memory.
[0097] In this embodiment, the message sending and receiving module and the detection module read and write the flow table in the shared memory, so as to realize message forwarding and detect the usage status of routing entries at the same time.
[0098] The following will describe in detail one or more embodiments of the routing item usage status detection apparatus of the present invention. Those skilled in the art will understand that the apparatus can be configured using commercially available hardware components through the steps taught in this solution.
[0099] Figure 6This is a schematic diagram of a routing item usage status detection device provided in an embodiment of the present invention. It should be noted that the modules in this embodiment can be considered as included in... Figure 4 or Figure 5 The detection module in the network device shown. For example... Figure 6 As shown, the device may include:
[0100] The flow table determination module 11 is used to obtain candidate flow tables that record routing identity information.
[0101] In the candidate flow table, it is determined whether there is a target flow table that records the target route identity information, wherein the target route entry has the target route identity information, and the target packet is forwarded by the target route entry or the target flow table.
[0102] The detection module 12 is used to determine the usage status of the target routing entry based on the attribute information of the data flow to which the target packet belongs when the target flow table is forwarded, if the target flow table exists.
[0103] Optionally, the attribute information of the data stream to which the target message belongs includes the number of data streams to which the target message belongs.
[0104] The detection module 12 is used to determine the attribute information of the data stream to which the target message belongs based on the message identity information of the target message; and to determine the number of data streams to which the target message belongs as the usage status of the target routing entry.
[0105] Optionally, the attribute information of the data stream to which the target packet belongs includes the packet forwarding volume recorded in the target flow table.
[0106] The detection module 12 is used to obtain the packet forwarding volume recorded in the target flow table; and to determine the packet forwarding volume as the usage status of the target routing entry.
[0107] Optionally, the candidate flow table records message identity information.
[0108] The device also includes a forwarding module 13.
[0109] The flow table determination module 11 is used to obtain the message identity information of the target message in response to the receipt of the target message; and to determine whether there exists a target flow table that records the message identity information of the target message in the candidate flow table based on the message identity information recorded in the candidate flow table, wherein the target flow table records the target routing identity information.
[0110] The forwarding module 13 is used to forward the target packet using the target flow table if the target flow table exists in the candidate flow table.
[0111] Optionally, the device further includes a flow table creation module 14.
[0112] The forwarding module 13 is used to forward the target packet using the target routing entry in the routing table if the packet identity information of the target packet is not recorded in the alternative flow table.
[0113] The flow table creation module 14 is used to create the target flow table based on the packet identity information of the target packet and the target route identity information.
[0114] Optionally, the device further includes a display module 15, used to determine the level of the target routing item based on its usage status, the level reflecting the risk of modification of the routing item; and to display the level of the target routing item.
[0115] Optionally, the display module 15 is configured to respond to the modification operation of the target routing item, and if the level of the target routing item is higher than a preset level, display a risk warning message.
[0116] Figure 6 The device shown can perform Figures 1-3 For the methods shown in the embodiments, the parts not described in detail in this embodiment can be referred to the following: Figures 1-3 The relevant descriptions of the illustrated embodiments are provided below. For the execution process and technical effects of this technical solution, please refer to [link / reference]. Figures 1-3 The descriptions in the illustrated embodiments will not be repeated here.
[0117] In one possible design, the routing entry usage status detection methods provided in the above embodiments can be applied to a network device, such as... Figure 7 As shown, the network device may include a processor 21 and a memory 22. The memory 22 is used to store data that supports the network device in performing the above-described operations. Figures 1-3 The program for detecting the usage status of routing items provided in the illustrated embodiment is configured by processor 21 to execute the program stored in memory 22.
[0118] The program includes one or more computer instructions, wherein when the one or more computer instructions are executed by the processor 21, they can perform the following steps:
[0119] Retrieve the candidate flow table containing routing identity information;
[0120] In the candidate flow table, it is determined whether there is a target flow table that records the target route identity information, wherein the target route entry has the target route identity information, and the target packet is forwarded by the target flow table or the target route entry;
[0121] If the target flow table exists, the usage status of the target routing entry is determined based on the attribute information of the data flow to which the target packet belongs, as forwarded by the target flow table.
[0122] Optionally, the processor 21 is further configured to perform the aforementioned Figures 1-3 All or part of the steps in the illustrated embodiments.
[0123] The network device may also include a communication interface 23 for communicating with other devices or communication networks.
[0124] Furthermore, embodiments of the present invention provide a non-transitory machine-readable storage medium for storing computing unit instructions used in the aforementioned electronic device, which includes instructions for executing the above-mentioned... Figures 1-3 The procedure involved in the method for detecting the usage status of the routing entries shown.
[0125] In addition, embodiments of the present invention provide a computer program product. This computer program product includes a computer program or instructions. When the computer program or instructions are executed by a processor, the processor is enabled to perform the above-described functions. Figures 1-3 The steps or functions of the routing entry use status detection method are shown.
[0126] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for detecting the usage status of a routing item, characterized in that, include: Retrieve the candidate flow table containing routing identity information; In the candidate flow table, it is determined whether there is a target flow table that records the target route identity information, wherein the target route entry has the target route identity information, and the target packet is forwarded by the target flow table or the target route entry; If the target flow table exists, the usage status of the target routing entry is determined based on the attribute information of the data flow to which the target packet belongs, as forwarded by the target flow table.
2. The method according to claim 1, characterized in that, The attribute information of the data stream to which the target message belongs includes the number of data streams to which the target message belongs; Determining the usage status of the target routing entry based on the attribute information of the data stream to which the target message belongs includes: Based on the message identity information of the target message, determine the number of data streams to which the target message belongs; The number of data streams to which the target message belongs is determined as the usage status of the target routing entry.
3. The method according to claim 1, characterized in that, The attribute information of the data stream to which the target message belongs includes the message forwarding volume recorded in the target flow table; Determining the usage status of the target routing entry based on the attribute information of the data stream to which the target message belongs includes: Obtain the packet forwarding volume recorded in the target flow table; The packet forwarding volume is used to determine the usage status of the target routing entry.
4. The method according to claim 1, characterized in that, The candidate flow table records message identity information; The step of determining whether a target flow table containing target route identity information exists in the candidate flow table includes: In response to the receipt of the target message, obtain the message identity information of the target message; Based on the packet identity information recorded in the candidate flow table, determine whether there exists a target flow table that records the packet identity information of the target packet in the candidate flow table, wherein the target flow table records the target route identity information; The method further includes: If the target flow table exists in the candidate flow table, then the target flow table is used to forward the target packet.
5. The method according to claim 4, characterized in that, The method further includes: If the packet identity information of the target packet is not recorded in the alternative flow table, the target packet is forwarded using the target route entry in the routing table; The target flow table is created based on the message identity information of the target message and the target route identity information.
6. The method according to claim 1, characterized in that, The method further includes: Based on the usage status of the target routing entry, the level of the target routing entry is determined, and the level reflects the risk of modifying the routing entry; Display the rank of the target routing entry.
7. The method according to claim 6, characterized in that, The method further includes: In response to the modification operation of the target routing entry, if the level of the target routing entry is higher than the preset level, a risk warning message will be displayed.
8. A network device, characterized in that, include: Message sending and receiving module and detection module; The message sending and receiving module is used to obtain a candidate flow table that records routing identity information; The detection module is used to determine whether there is a target flow table that records target route identity information in the candidate flow table, wherein the target route identity entry has the target route information, and the target packet is forwarded by the target flow table or the target route entry; If the target flow table exists, the usage status of the target routing entry is determined based on the attribute information of the data flow to which the target packet belongs, as forwarded by the target flow table.
9. The device according to claim 8, characterized in that, The device also includes a processor; The message sending and receiving module and the detection module are used to run with the computing resources provided by the kernel in the processor.
10. The device according to claim 8, characterized in that, The attribute information of the data stream to which the target message belongs includes the number of data streams to which the target message belongs; The detection module is used to determine the data stream to which the target message belongs based on the message identity information of the target message; The number of data streams to which the target message belongs is determined as the usage status of the target routing entry.
11. The device according to claim 8, characterized in that, The attribute information of the data stream to which the target message belongs includes the message forwarding volume recorded in the target flow table; The detection module is used to obtain the packet forwarding volume recorded in the target flow table; The packet forwarding volume is used to determine the usage status of the target routing entry.
12. The device according to claim 8, characterized in that, The device further includes: shared memory; the message transceiver module is used to obtain the message identity information of the target message in response to the receipt of the target message; The candidate flow table is read from the shared memory, and the candidate flow table records message identity information; Based on the packet identity information recorded in the candidate flow table, determine whether there exists a target flow table that records the packet identity information of the target packet in the candidate flow table, wherein the target flow table records the target route identity information; If the target flow table exists in the candidate flow table, then the target flow table is used to forward the packet to be forwarded.
13. The device according to claim 12, characterized in that, The device also stores a routing table; The message sending and receiving module is used to forward the target message using the target route entry in the routing table if the message identity information of the target message is not recorded in the alternative flow table. The target flow table is created based on the message identity information of the target message and the target route identity information; Write the target flow table into the shared memory.
14. A network device, characterized in that, include: A memory and a processor; wherein the memory stores executable code, and when the executable code is executed by the processor, the processor performs a method for detecting the usage status of a routing item as described in any one of claims 1 to 7.
15. A non-transitory machine-readable storage medium, characterized in that, The non-transitory machine-readable storage medium stores executable code that, when executed by a processor of an electronic device, causes the processor to perform a method for detecting the usage status of a routing item as described in any one of claims 1 to 7.
16. A computer program product, characterized in that, The computer program product includes a computer program or instructions that enable the computer program or instructions to perform the steps in the method for detecting the usage status of routing items according to any one of claims 1 to 7.