Routing forwarding method, device, equipment and storage medium of three-layer switch
By obtaining and judging the priority category of routing table entries in the Layer 3 switch, the forwarding route of the routing table entries is dynamically adjusted, which solves the forwarding performance problem when the number of routing table entries exceeds the capacity of the hardware routing table, and achieves more efficient network forwarding. .
Patent Information
- Application Number
- CN202211434717.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-16
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2042-11-16
AI Technical Summary
In a large network system, when the number of routing table entries exceeds the capacity of the hardware routing table, randomly determining the forwarding route of the routing table entries will affect the forwarding performance of the entire network.
By obtaining the target routing table entry and determining its priority category, it is judged whether the capacity of the hardware routing table is full. If it is full, it is judged whether the priority category is higher than the lowest priority category. If it is higher, the routing table of the lowest priority category is The entry is moved out and written into the software routing table, and the destination routing table entry is written into the hardware routing table to implement hardware routing forwarding of the destination routing table entry.
Dynamically adjust the forwarding routes of routing table entries to improve the hardware and software forwarding performance of the entire network, avoid packet loss, and improve forwarding efficiency.
Smart Images

Figure CN115842793B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of switches, and in particular to a routing forwarding method, device, equipment and storage medium for a three-layer switch. Background Art
[0002] The capacity of hardware routing table entries is limited. When the number of routing table entries in a large network system is greater than the capacity of hardware routing table entries, some IP packets corresponding to routing table entries can only be forwarded through software routing and cannot be forwarded through hardware routing. However, IP packets corresponding to different routing table entries have different requirements for forwarding efficiency. If the forwarding routes of routing table entries are determined randomly, the forwarding efficiency of the entire network will be affected.
[0003] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention
[0004] The main purpose of the present invention is to provide a routing forwarding method, device, equipment and storage medium for a three-layer switch, aiming to solve the technical problem in the prior art that when the number of routing table items in the network system is greater than the capacity of the hardware routing table, the forwarding route of the routing table items is randomly determined, which affects the forwarding efficiency of the entire network.
[0005] To achieve the above object, the present invention provides a routing forwarding method for a three-layer switch, the method comprising the following steps:
[0006] Obtaining a target routing table entry, and determining a priority category of the target routing table entry;
[0007] Determine whether the capacity of the hardware routing table is full;
[0008] After determining that the capacity of the hardware routing table is full, determining whether the priority category is higher than the lowest priority category in the hardware routing table;
[0009] When it is determined that the priority category is higher than the lowest priority category in the hardware routing table, the routing table entry corresponding to the lowest priority category is removed from the hardware routing table and written into the software routing table, and the target routing table entry is written into the hardware routing table to implement hardware routing forwarding of the IP data packet corresponding to the target routing table entry.
[0010] Optionally, after determining whether the capacity of the hardware routing table is full, the method further includes:
[0011] When it is determined that the capacity of the hardware routing table is not full, the target routing table entry is written into the hardware routing table.
[0012] Optionally, determining the priority category of the target routing table entry includes:
[0013] Collecting the QoS information of the IP data packet corresponding to the target routing table entry, and determining the Q value of the target routing table entry according to the QoS information;
[0014] Determine whether the Q value is greater than a preset value;
[0015] If so, it is determined that the target routing table entry is of a high priority category.
[0016] Optionally, determining the priority category of the target routing table entry includes:
[0017] Collecting the QoS information of the IP data packet corresponding to the target routing table entry, and determining the Q value of the target routing table entry according to the QoS information;
[0018] Determine whether the Q value is greater than a preset value;
[0019] If not, then collect the service type information of the IP data packet corresponding to the target routing table entry;
[0020] Determine whether the service type information is a video service or a voice service;
[0021] If so, it is determined that the target routing table entry is of a high priority category.
[0022] Optionally, collecting service type information of the IP data packet corresponding to the target routing table entry includes:
[0023] Collecting the service type information of the IP data packet corresponding to the target routing table entry by identifying the conventional TCP / UDP port number of the target routing table entry; or,
[0024] The service type information of the IP data packet corresponding to the target routing table item is collected by identifying the port number specified by the user.
[0025] Optionally, the priority category includes a high priority category and a low priority category; wherein,
[0026] Determining the priority category of the target routing table entry includes:
[0027] Collecting the QoS information of the IP data packet corresponding to the target routing table entry, and determining the Q value of the target routing table entry according to the QoS information;
[0028] Determine whether the Q value is greater than a preset value;
[0029] If not, then collect the service type information of the IP data packet corresponding to the target routing table entry;
[0030] Determine whether the service type information is a video service or a voice service;
[0031] If not, after determining that the service type information is a general IP service, the rate of the IP data packet corresponding to the target routing table entry is collected;
[0032] Determining whether the rate is greater than a preset rate;
[0033] If yes, determining that the routing table entry is of a high priority category;
[0034] If not, it is determined that the routing table entry is of a low priority category.
[0035] Optionally, the routing forwarding method of the three-layer switch further includes:
[0036] Setting a timer for each routing table entry in the hardware routing table;
[0037] Determine the rate of the IP data packets corresponding to each routing table entry according to the timer;
[0038] If the rate of the IP data packet corresponding to the routing table entry is always the predetermined value, the routing table entry is determined to be an invalid route;
[0039] After determining that the routing table entry is an invalid route, the routing table entry is deleted from the hardware routing table.
[0040] In addition, to achieve the above-mentioned purpose, the present invention also proposes a routing and forwarding device of a three-layer switch, wherein the routing and forwarding device of the three-layer switch comprises:
[0041] An acquisition module, used to acquire a target routing table entry and determine a priority category of the target routing table entry;
[0042] A judgment module, used to judge whether the capacity of the hardware routing table is full;
[0043] The determination module is further configured to determine whether the priority category is higher than the lowest priority category in the hardware routing table after determining that the capacity of the hardware routing table is full;
[0044] The forwarding module is used to remove the routing table item corresponding to the lowest priority category from the hardware routing table and write it into the software routing table when it is determined that the priority category is higher than the lowest priority category in the hardware routing table, and write the target routing table item into the hardware routing table to realize hardware routing forwarding of the IP data packet corresponding to the target routing table item.
[0045] In addition, to achieve the above-mentioned purpose, the present invention also proposes a routing forwarding device of a three-layer switch, wherein the routing forwarding device of the three-layer switch comprises: a memory, a processor, and a routing forwarding program of the three-layer switch stored in the memory and executable on the processor, wherein the routing forwarding program of the three-layer switch is configured to implement the steps of the routing forwarding method of the three-layer switch as described above.
[0046] In addition, to achieve the above objectives, the present invention also proposes a storage medium, on which a routing forwarding program of a three-layer switch is stored. When the routing forwarding program of the three-layer switch is executed by a processor, the steps of the routing forwarding method of the three-layer switch as described above are implemented.
[0047] The routing forwarding method of the three-layer switch proposed by the present invention obtains the target routing table item and determines the priority category of the target routing table item; determines whether the capacity of the hardware routing table is full; after determining that the capacity of the hardware routing table is full, determines whether the priority category is higher than the lowest priority category in the hardware routing table; when determining that the priority category is higher than the lowest priority category in the hardware routing table, removes the routing table item corresponding to the lowest priority category from the hardware routing table and writes it into the software routing table, and writes the target routing table item into the hardware routing table, so as to realize the hardware routing forwarding of the IP data packet corresponding to the target routing table item. Through the above method, when the capacity of the hardware routing table is not full, the routing table item is directly written into the hardware routing table, and when the hardware routing table is full, the writing position of the routing table item is determined according to the priority category of the routing table item, and the forwarding route of the routing table item can be dynamically adjusted according to the priority of the routing table item, thereby improving the forwarding efficiency of the hardware and software of the entire network. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 It is a structural diagram of a routing and forwarding device of a layer 3 switch in a hardware operating environment involved in an embodiment of the present invention;
[0049] Figure 2 A schematic diagram of a first embodiment of a routing and forwarding method for a layer 3 switch of the present invention;
[0050] Figure 3 A schematic diagram of a second embodiment of the routing and forwarding method of a layer 3 switch of the present invention;
[0051] Figure 4 This is a structural block diagram of the first embodiment of the routing and forwarding device of the three-layer switch of the present invention.
[0052] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0053] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0054] Reference Figure 1 , Figure 1 The present invention is a schematic diagram of the structure of a routing and forwarding device of a layer 3 switch in a hardware operating environment according to an embodiment of the present invention.
[0055] like Figure 1 As shown, the routing and forwarding device of the three-layer switch may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wireless-Fidelity, Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM) memory, or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0056] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the routing and forwarding device of the three-layer switch, and may include more or less components than those shown in the figure, or combine certain components, or arrange the components differently.
[0057] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and a routing and forwarding program of a three-layer switch.
[0058] exist Figure 1In the routing and forwarding device of the three-layer switch shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the routing and forwarding device of the three-layer switch of the present invention can be set in the routing and forwarding device of the three-layer switch, and the routing and forwarding device of the three-layer switch calls the routing and forwarding program of the three-layer switch stored in the memory 1005 through the processor 1001, and executes the routing and forwarding method of the three-layer switch provided in the embodiment of the present invention.
[0059] Based on the above hardware structure, an embodiment of the routing and forwarding method of the three-layer switch of the present invention is proposed.
[0060] Reference Figure 2 , Figure 2 The figure is a flow chart of a first embodiment of a routing and forwarding method for a three-layer switch of the present invention.
[0061] In this embodiment, the routing forwarding method of the three-layer switch includes the following steps:
[0062] Step S10: Acquire a target routing table entry, and determine a priority category of the target routing table entry.
[0063] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a mobile phone, a tablet computer, a personal computer, etc., or an electronic device capable of realizing the above functions or a routing and forwarding device of a three-layer switch. The following takes the routing and forwarding device of the three-layer switch as an example to illustrate this embodiment and the following embodiments.
[0064] In a specific implementation, the priority category of the routing table entry may be set to a high priority category and a low priority category, which is not limited in this embodiment.
[0065] In one embodiment, determining the priority category of the target routing entry includes:
[0066] Collecting the QoS information of the IP data packet corresponding to the target routing table entry, and determining the Q value of the target routing table entry according to the QoS information;
[0067] Determine whether the Q value is greater than a preset value;
[0068] If so, it is determined that the target routing table entry is of a high priority category.
[0069] It should be noted that the QoS information of the IP data packet can be recorded according to certain fields of the IP data packet. Preferably, the QoS information can be determined by the COS of the 802.1p protocol or by the DSCP of the IP header.
[0070] It should be noted that when the QoS information is determined by the COS of the 802.1p protocol, the specific method for determining the QoS information is as follows: Usually, VLAN frames are exchanged between Layer 2 devices. According to the IEEE 802.1Q definition, the PRI field (i.e., 802.1p priority), or CoS (Class of Service) field, in the VLAN frame header identifies the quality of service requirements. The 802.1Q header contains a 3-bit PRI field. The PRI field defines 8 service priority CoSs, which are 7, 6, 5, 4, 3, 2, 1, and 0 in descending order of priority. The QoS information of an IP data packet is the priority in the IP data packet determined by the COS of the 802.1p protocol.
[0071] It should be noted that when the QoS information is determined by the DSCP in the ip header, the specific method for determining the QoS information is as follows: the ToS field in the ip header of the ip data packet consists of 8 bits, of which the 3-bit DSCP field indicates the priority of the ip data packet. The priority of the ip data packet is divided into 8 categories, and the values are 7, 6, 5, 4, 3, 2, 1 and 0 in descending order of priority. The highest priority is 7 and the lowest priority is 0. The QoS information of the ip data packet is the priority determined in the ip data packet according to the DSCP in the ip header.
[0072] It can be understood that the QoS information corresponds to the Q value. When the QoS information is 4, the Q value is also 4.
[0073] In a specific implementation, the preset value can be set in advance according to actual conditions. Preferably, the preset value can be set to 3.
[0074] In this embodiment, by determining a preset value and then comparing the QoS information of the IP data packet with the preset value to judge the priority category of the routing table item corresponding to the IP data packet, the priority category of the routing table item corresponding to the IP data packet can be easily and quickly determined, and then the write location of the routing table item can be quickly determined.
[0075] In one embodiment, determining the priority category of the target routing entry includes:
[0076] Collecting the QoS information of the IP data packet corresponding to the target routing table entry, and determining the Q value of the target routing table entry according to the QoS information;
[0077] Determine whether the Q value is greater than a preset value;
[0078] If not, then collect the service type information of the IP data packet corresponding to the target routing table entry;
[0079] Determine whether the service type information is a video service or a voice service;
[0080] If so, it is determined that the target routing table entry is of a high priority category.
[0081] It should be noted that when the QoS information of an IP data packet is less than or equal to a preset value, the service type information corresponding to the IP data packet can be determined. When the service type information corresponding to the IP data packet is a video service or a voice service, the routing table entry corresponding to the IP data packet can still be classified as a high priority category.
[0082] In one embodiment, collecting the service type information of the IP data packet corresponding to the target routing table entry includes:
[0083] Collecting the service type information of the IP data packet corresponding to the target routing table entry by identifying the conventional TCP / UDP port number of the target routing table entry; or,
[0084] The service type information of the IP data packet corresponding to the target routing table item is collected by identifying the port number specified by the user.
[0085] In one embodiment, the priority categories include a high priority category and a low priority category; wherein,
[0086] Determining the priority category of the target routing table entry includes:
[0087] Collecting the QoS information of the IP data packet corresponding to the target routing table entry, and determining the Q value of the target routing table entry according to the QoS information;
[0088] Determine whether the Q value is greater than a preset value;
[0089] If not, then collect the service type information of the IP data packet corresponding to the target routing table entry;
[0090] Determine whether the service type information is a video service or a voice service;
[0091] If not, after determining that the service type information is a general IP service, the rate of the IP data packet corresponding to the target routing table entry is collected;
[0092] Determining whether the rate is greater than a preset rate;
[0093] If yes, determining that the routing table entry is of a high priority category;
[0094] If not, it is determined that the routing table entry is of a low priority category.
[0095] It should be noted that the preset rate is set in advance based on actual conditions.
[0096] It should be noted that when the IP data packet is a video service, the forwarding efficiency requirement is the highest, when the IP data packet is a general IP service, the forwarding efficiency requirement is the lowest, and when the IP data packet is a voice service, the forwarding efficiency requirement is between the video service and the general IP service.
[0097] It should be noted that when the QoS information of an IP data packet is less than or equal to a preset value, and the service type information corresponding to the IP data packet is not a video service or a voice service, the rate of the IP data packet can be determined. When the rate of the IP data packet is greater than the preset rate, the routing table entry corresponding to the IP data packet can be determined to be a high priority category. When the rate of the IP data packet is less than or equal to the preset rate, the routing table entry corresponding to the IP data packet can be determined to be a low priority category.
[0098] Step S20: Determine whether the capacity of the hardware routing table is full.
[0099] In one embodiment, after determining whether the capacity of the hardware routing table is full, the method further includes:
[0100] When it is determined that the capacity of the hardware routing table is not full, the target routing table entry is written into the hardware routing table.
[0101] It should be noted that the forwarding of IP data packets through the hardware routing table does not require CPU and software processing, so the forwarding efficiency of IP data packets through the hardware routing table is much higher than the forwarding efficiency of IP data packets through the software routing table.
[0102] It should be noted that when the capacity of the hardware routing table is not full, the target routing table entry can be directly written into the hardware routing table entry.
[0103] In this embodiment, the capacity of the hardware routing table is first determined. When it is determined that the capacity of the hardware routing table is not full, the target routing table entry can be directly written into the hardware routing table, and the IP data packet corresponding to the target routing table entry is forwarded through the hardware routing table. This can not only avoid the loss of IP data packets, but also effectively improve the forwarding efficiency of IP data packets.
[0104] Step S30: after determining that the capacity of the hardware routing table is full, determining whether the priority category is higher than the lowest priority category in the hardware routing table.
[0105] In a specific implementation, the priority categories of routing table items can be set to high priority categories and low priority categories. When the priority categories of all routing table items in the hardware routing table are high priority categories, the lowest priority category in the hardware routing table is the high priority category; when the priority categories of routing table items in the hardware routing table include both high priority categories and low priority categories, the lowest priority category in the hardware routing table is the low priority category.
[0106] Step S40: When it is determined that the priority category is higher than the lowest priority category in the hardware routing table, the routing table entry corresponding to the lowest priority category is removed from the hardware routing table and written into the software routing table, and the target routing table entry is written into the hardware routing table to implement hardware routing forwarding of the IP data packet corresponding to the target routing table entry.
[0107] It should be noted that the routing table entries in the hardware routing table are forwarded by the hardware routing, and the routing table entries in the software routing table are forwarded by the software routing.
[0108] This embodiment obtains the target routing table item and determines the priority category of the target routing table item; determines whether the capacity of the hardware routing table is full; after determining that the capacity of the hardware routing table is full, determines whether the priority category is higher than the lowest priority category in the hardware routing table; when determining that the priority category is higher than the lowest priority category in the hardware routing table, removes the routing table item corresponding to the lowest priority category from the hardware routing table and writes it into the software routing table, and writes the target routing table item into the hardware routing table, so as to realize the hardware routing forwarding of the IP data packet corresponding to the target routing table item. Through the above method, when the capacity of the hardware routing table is not full, the routing table item is directly written into the hardware routing table, and when the hardware routing table is full, the writing position of the routing table item is determined according to the priority category of the routing table item, and the forwarding route of the routing table item can be dynamically adjusted according to the priority of the routing table item, thereby improving the forwarding efficiency of the hardware and software of the entire network.
[0109] refer to Figure 3 , Figure 3 The figure is a flow chart of a second embodiment of a routing and forwarding method for a three-layer switch of the present invention.
[0110] Based on the first embodiment above, the routing and forwarding method of the layer 3 switch in this embodiment further includes:
[0111] Step S50: Setting a timer for each routing table entry in the hardware routing table.
[0112] Step S60: Determine the rate of the IP data packets corresponding to each routing table entry according to the timer.
[0113] It should be noted that whether the routing table entry is in the monitoring interval is determined based on the timer. After determining that the routing table entry is in the monitoring interval, the rate of the IP data packet corresponding to the routing table entry in the monitoring interval is determined.
[0114] In a specific implementation, after the routing table entry is written into the hardware routing table, the timer starts timing. Preferably, the monitoring interval can be set to 1 hour, and the non-monitoring interval can also be set to 1 hour. After the timer starts timing, the routing table entry first enters the monitoring interval and then enters the non-monitoring interval.
[0115] In a specific implementation, a monitoring interval can be set to monitor whether the rate of the IP data packet corresponding to the routing table item is always a predetermined value within the monitoring interval. Preferably, the monitoring interval can be set to 5 hours. When it is monitored within 5 hours that the rate of the IP data packet corresponding to the routing table item in the hardware routing table is always at a predetermined value, the routing table item is determined to be an invalid route.
[0116] Step S70: If the rate of the IP data packet corresponding to the routing table entry is always the predetermined value, the routing table entry is determined to be an invalid route.
[0117] It should be noted that the predetermined value is determined in advance.
[0118] In a specific implementation, the predetermined value is set to 0 in advance. If it is detected that the IP data packet corresponding to the routing table entry is 0, the routing table entry is determined to be an invalid route.
[0119] In a specific implementation, if the rate of the IP data packet corresponding to the routing table entry is always a predetermined value within the monitoring interval, the routing table entry is determined to be an invalid route.
[0120] Step S80: After determining that the routing table entry is an invalid route, the routing table entry is deleted from the hardware routing table.
[0121] It is understandable that failed routes need to be removed from the hardware routing table periodically.
[0122] In a specific implementation, a timer can also be set for each routing table item in the software routing table, and the invalid routes in the software routing table can be determined based on the rate of the IP data packets corresponding to each routing table item in the software routing table, and the invalid routes in the software routing table can be deleted from the software routing table to improve the forwarding efficiency of the software routing table.
[0123] This embodiment sets a timer for each routing table item in the hardware routing table; determines the rate of the IP data packet corresponding to each routing table item within a preset time according to the timer; if the rate of the IP data packet corresponding to the routing table item is always a predetermined value, the routing table item is determined to be an invalid route; after determining that the routing table item is an invalid route, the routing table item is deleted from the hardware routing table. Through the above method, it is possible to monitor and determine in real time whether the routing table item in the hardware routing table is invalid, and delete the routing table item after determining that the routing table item is an invalid route, so as to improve the forwarding efficiency of the network.
[0124] In addition, an embodiment of the present invention further proposes a storage medium on which a routing forwarding program of a three-layer switch is stored. When the routing forwarding program of the three-layer switch is executed by a processor, the steps of the routing forwarding method of the three-layer switch described above are implemented.
[0125] Reference Figure 4 , Figure 4 This is a structural block diagram of the first embodiment of the routing and forwarding device of the three-layer switch of the present invention.
[0126] like Figure 4 As shown, the routing and forwarding device of the three-layer switch proposed in the embodiment of the present invention includes:
[0127] The acquisition module 10 is used to acquire a target routing table entry and determine a priority category of the target routing table entry.
[0128] The determination module 20 is used to determine whether the capacity of the hardware routing table is full.
[0129] The determination module 20 is further configured to determine whether the priority category is higher than the lowest priority category in the hardware routing table after determining that the capacity of the hardware routing table is full.
[0130] The forwarding module 30 is used to remove the routing table entry corresponding to the lowest priority category from the hardware routing table and write it into the software routing table when it is determined that the priority category is higher than the lowest priority category in the hardware routing table, and write the target routing table entry into the hardware routing table to realize hardware routing forwarding of the IP data packet corresponding to the target routing table entry.
[0131] It should be understood that the above is only an example and does not constitute any limitation on the technical solution of the present invention. In specific applications, technicians in this field can make settings as needed, and the present invention does not limit this.
[0132] This embodiment obtains the target routing table item and determines the priority category of the target routing table item; determines whether the capacity of the hardware routing table is full; after determining that the capacity of the hardware routing table is full, determines whether the priority category is higher than the lowest priority category in the hardware routing table; when determining that the priority category is higher than the lowest priority category in the hardware routing table, removes the routing table item corresponding to the lowest priority category from the hardware routing table and writes it into the software routing table, and writes the target routing table item into the hardware routing table, so as to realize the hardware routing forwarding of the IP data packet corresponding to the target routing table item. Through the above method, when the capacity of the hardware routing table is not full, the routing table item is directly written into the hardware routing table, and when the hardware routing table is full, the writing position of the routing table item is determined according to the priority category of the routing table item, and the forwarding route of the routing table item can be dynamically adjusted according to the priority of the routing table item, thereby improving the forwarding efficiency of the hardware and software of the entire network.
[0133] In one embodiment, the acquisition module 10 is further used for:
[0134] When it is determined that the capacity of the hardware routing table is not full, the target routing table entry is written into the hardware routing table.
[0135] In one embodiment, the acquisition module 10 is further used for:
[0136] Collecting the QoS information of the IP data packet corresponding to the target routing table entry, and determining the Q value of the target routing table entry according to the QoS information;
[0137] Determine whether the Q value is greater than a preset value;
[0138] If so, it is determined that the target routing table entry is of a high priority category.
[0139] In one embodiment, the acquisition module 10 is further used for:
[0140] Collecting the QoS information of the IP data packet corresponding to the target routing table entry, and determining the Q value of the target routing table entry according to the QoS information;
[0141] Determine whether the Q value is greater than a preset value;
[0142] If not, then collect the service type information of the IP data packet corresponding to the target routing table entry;
[0143] Determine whether the service type information is a video service or a voice service;
[0144] If so, it is determined that the target routing table entry is of a high priority category.
[0145] In one embodiment, the acquisition module 10 is further used for:
[0146] Collecting the service type information of the IP data packet corresponding to the target routing table entry by identifying the conventional TCP / UDP port number of the target routing table entry; or,
[0147] The service type information of the IP data packet corresponding to the target routing table item is collected by identifying the port number specified by the user.
[0148] In one embodiment, the acquisition module 10 is further used for:
[0149] Collecting the QoS information of the IP data packet corresponding to the target routing table entry, and determining the Q value of the target routing table entry according to the QoS information;
[0150] Determine whether the Q value is greater than a preset value;
[0151] If not, then collect the service type information of the IP data packet corresponding to the target routing table entry;
[0152] Determine whether the service type information is a video service or a voice service;
[0153] If not, after determining that the service type information is a general IP service, the rate of the IP data packet corresponding to the target routing table entry is collected;
[0154] Determining whether the rate is greater than a preset rate;
[0155] If yes, determining that the routing table entry is of a high priority category;
[0156] If not, it is determined that the routing table entry is of a low priority category.
[0157] In one embodiment, the determination module 20 is further configured to:
[0158] Setting a timer for each routing table entry in the hardware routing table;
[0159] Determine the rate of the IP data packets corresponding to each routing table entry according to the timer;
[0160] If the rate of the IP data packet corresponding to the routing table entry is always the predetermined value, the routing table entry is determined to be an invalid route;
[0161] After determining that the routing table entry is an invalid route, the routing table entry is deleted from the hardware routing table.
[0162] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of the present invention. In practical applications, technicians in this field can select part or all of them according to actual needs to achieve the purpose of the present embodiment, and no limitation is made here.
[0163] In addition, for technical details not fully described in this embodiment, reference can be made to the routing and forwarding method of a layer-3 switch provided in any embodiment of the present invention, and will not be repeated here.
[0164] In addition, it should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0165] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0166] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory (ROM) / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0167] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A routing forwarding method for a three-layer switch, characterized in that: The routing forwarding method of the three-layer switch includes: Obtaining a target routing table entry, and determining a priority category of the target routing table entry; Determine whether the capacity of the hardware routing table is full; After determining that the capacity of the hardware routing table is full, determining whether the priority class is higher than the lowest priority class in the hardware routing table; When it is determined that the priority category is higher than the lowest priority category in the hardware routing table, the routing table entry corresponding to the lowest priority category is removed from the hardware routing table and written into the software routing table, and the target routing table entry is written into the hardware routing table to implement hardware routing forwarding of the IP data packet corresponding to the target routing table entry; The priority categories include a high priority category and a low priority category; wherein, Determining the priority category of the target routing table entry includes: Collecting the QoS information of the IP data packet corresponding to the target routing table entry, and determining the Q value of the target routing table entry according to the QoS information, wherein the QoS information is determined by the COS field of the 802.1p protocol; Determine whether the Q value is greater than a preset value; If not, then collect the service type information of the IP data packet corresponding to the target routing table entry; Determine whether the service type information is a video service or a voice service; If not, after determining that the service type information is a general IP service, the rate of the IP data packet corresponding to the target routing table entry is collected; Determining whether the rate is greater than a preset rate; If yes, determining that the routing table entry is of a high priority category; If not, determining that the routing table entry is of a low priority category; The routing forwarding method of the three-layer switch also includes: Setting a timer for each routing table entry in the hardware routing table; Determine the rate of the IP data packets corresponding to each routing table entry according to the timer; If the rate of the IP data packet corresponding to the routing table entry is always the predetermined value, the routing table entry is determined to be an invalid route; After determining that the routing table entry is an invalid route, the routing table entry is deleted from the hardware routing table.
2. The method according to claim 1, characterized in that After determining whether the capacity of the hardware routing table is full, the method further includes: When it is determined that the capacity of the hardware routing table is not full, the target routing table entry is written into the hardware routing table.
3. The method according to claim 1, characterized in that The determining the priority category of the target routing table entry includes: Collecting the QoS information of the IP data packet corresponding to the target routing table entry, and determining the Q value of the target routing table entry according to the QoS information; Determine whether the Q value is greater than a preset value; If so, it is determined that the target routing table entry is of a high priority category.
4. The method according to claim 1, characterized in that The determining the priority category of the target routing table entry includes: Collecting the QoS information of the IP data packet corresponding to the target routing table entry, and determining the Q value of the target routing table entry according to the QoS information; Determine whether the Q value is greater than a preset value; If not, then collect the service type information of the IP data packet corresponding to the target routing table entry; Determine whether the service type information is a video service or a voice service; If so, it is determined that the target routing table entry is of a high priority category.
5. The method according to claim 4, characterized in that Collecting the service type information of the IP data packet corresponding to the target routing table entry includes: Collecting the service type information of the IP data packet corresponding to the target routing table entry by identifying the conventional TCP / UDP port number of the target routing table entry; or, The service type information of the IP data packet corresponding to the target routing table item is collected by identifying the port number specified by the user.
6. A routing and forwarding device for a three-layer switch, characterized in that: The routing and forwarding device of the three-layer switch includes: An acquisition module, used to acquire a target routing table entry and determine a priority category of the target routing table entry; A judgment module, used to judge whether the capacity of the hardware routing table is full; The determination module is further configured to determine whether the priority category is higher than the lowest priority category in the hardware routing table after determining that the capacity of the hardware routing table is full; A forwarding module, configured to, when determining that the priority category is higher than the lowest priority category in the hardware routing table, remove the routing table item corresponding to the lowest priority category from the hardware routing table and write it into the software routing table, and write the target routing table item into the hardware routing table, so as to implement hardware routing forwarding of the IP data packet corresponding to the target routing table item; The priority categories include a high priority category and a low priority category; wherein, The acquisition module is further used for: Collecting the QoS information of the IP data packet corresponding to the target routing table entry, and determining the Q value of the target routing table entry according to the QoS information, wherein the QoS information is determined by the COS field of the 802.1p protocol; Determine whether the Q value is greater than a preset value; If not, then collect the service type information of the IP data packet corresponding to the target routing table entry; Determine whether the service type information is a video service or a voice service; If not, after determining that the service type information is a general IP service, the rate of the IP data packet corresponding to the target routing table entry is collected; Determining whether the rate is greater than a preset rate; If yes, determining that the routing table entry is of a high priority category; If not, determining that the routing table entry is of a low priority category; The forwarding module is further used for: Setting a timer for each routing table entry in the hardware routing table; Determine the rate of the IP data packets corresponding to each routing table entry according to the timer; If the rate of the IP data packet corresponding to the routing table entry is always the predetermined value, the routing table entry is determined to be an invalid route; After determining that the routing table entry is an invalid route, the routing table entry is deleted from the hardware routing table.
7. A routing and forwarding device for a three-layer switch, characterized in that: The device comprises: a memory, a processor, and a routing and forwarding program of a three-layer switch stored in the memory and executable on the processor, wherein the routing and forwarding program of the three-layer switch is configured to implement the steps of the routing and forwarding method of the three-layer switch as described in any one of claims 1 to 5.
8. A storage medium, characterized in that: The storage medium stores a routing and forwarding program of the three-layer switch, and when the routing and forwarding program of the three-layer switch is executed by the processor, the steps of the routing and forwarding method of the three-layer switch as claimed in any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Switch routing recording, searching and deleting method and switch
CN111917670A
Communication method and device, equipment and storage medium
CN114189908A
