Disclosure of Invention
In view of this, the present disclosure provides a method and an apparatus for limiting a tunnel speed to solve the problem in the prior art that the tunnel speed cannot be limited under the condition of iterative routing.
Specifically, the present disclosure is realized by the following technical solutions:
the present disclosure provides a method for limiting a tunnel speed, which is applied to a routing device of a TE tunnel start node, and the method includes:
acquiring queue number resources distributed to any TE tunnel on the routing equipment based on the speed limit;
searching an appointed LSP tunnel node of the TE tunnel iteration according to a pre-established corresponding relation of the LSP tunnel node of the TE tunnel iteration;
acquiring an output interface table entry corresponding to the specified LSP tunnel node;
and configuring the acquired queue number resource to an output interface table entry corresponding to the specified LSP tunnel node so that the specified LSP tunnel node limits the speed according to the queue number resource configured in the output interface table entry.
Based on the same conception, the invention also provides a device for limiting the speed of the tunnel, which is applied to the routing equipment of the initial node of the TE tunnel, and the device comprises:
a resource obtaining unit, configured to obtain a queue number resource allocated to any TE tunnel on the routing device based on the speed limit;
a node searching unit, which searches the specified LSP tunnel node of the TE tunnel iteration according to the pre-established corresponding relation of the LSP tunnel nodes of the TE tunnel iteration;
a table entry obtaining unit, configured to obtain an egress interface table entry corresponding to the specified LSP tunnel node;
and the resource configuration unit is used for respectively configuring the acquired queue number resources to the output interface table entry corresponding to the specified LSP tunnel node so that the specified LSP tunnel node limits the speed according to the queue number resources configured in the output interface table entry.
Based on the same concept, the present disclosure also provides a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements any step of the above method for limiting a tunnel speed.
Based on the same concept, the present disclosure also provides a computer device comprising a memory, a processor, a communication interface, and a communication bus; the memory, the processor and the communication interface are communicated with each other through the communication bus;
the memory is used for storing a computer program;
the processor is used for executing the computer program stored in the memory, and any step of the tunnel speed limiting method is realized when the processor executes the computer program.
Therefore, the method can obtain the output interface table entry corresponding to the corresponding designated LSP tunnel node after obtaining the queue number resource of any TE tunnel by pre-establishing the corresponding relation of the LSP tunnel nodes of the TE tunnel iteration, and then respectively issue the queue number resource to the output interface table entry corresponding to the designated LSP tunnel node, so that the designated LSP tunnel node carries out speed limitation according to the queue number resource in the output interface table entry, thereby realizing the effective utilization of bandwidth resources under the TE tunnel in the networking environment of the routing iteration and ensuring the effectiveness of the TM speed limitation function of the flow.
Detailed Description
Please refer to fig. 1, which is a schematic diagram illustrating a non-iterative routing forwarding table entry organization, wherein when an LR (Line Rate, speed limit) is configured below a TE tunnel, the TE applies for a queue number FLOWID resource, and the hardware speed limit of the tunnel is implemented based on the queue, that is, the forwarding traffic Rate entering the queue is limited by the size of the FLOWID resource.
In a specific implementation process, the FLOWID resource is issued to an OUTLIF table (output interface table) of the tunnel of the TE, and various attributes configured based on the output port are recorded in the OUTLIF table. The FIB (Forwarding Information Base) table of the Traffic is directly associated with the OUTLIF table of the TE, and obtains the value of the flow to perform TM (Traffic Management) speed limitation.
However, when an LSP (Label Switched Path) based on LDP (Label Distribution Protocol) iterates to a TE tunnel for packet forwarding, a networking structure is as shown in fig. 2-1, where TE tunnels carried on routing devices RT-1, RT-2, RT-3, RT-4, RT-5, and RT-6 are used for implementing VPN routing by the iterated LSP tunnel. The iterative routing forwarding table entry is shown in fig. 2-2, where the FIB table is directly associated with the OUTLIF table entry of the LSP for forwarding, and the LR cannot cause the TE tunnel of the MPLS to perform corresponding action processing, so that the LSP that actually performs forwarding cannot sense the FLOWID resource applied by the TE tunnel, and therefore the corresponding flag bit in the OUTLIF table of the LSP is invalid, and further cannot acquire queue information for limiting the speed, and therefore cannot meet the requirement of the service provider for setting the upper limit of the user bandwidth.
In order to solve the problems existing in the prior art, the present disclosure provides a method and a device for limiting speed of a tunnel, which can obtain an egress interface table entry corresponding to a specified LSP tunnel node after obtaining a queue number resource of any TE tunnel by creating a corresponding relationship of a TE tunnel iteration LSP tunnel node in advance, and then issue the queue number resource to the egress interface table entry corresponding to the specified LSP tunnel node, so that the specified LSP tunnel node limits speed according to the queue number resource in the egress interface table entry, thereby achieving effective utilization of bandwidth resources under the TE tunnel in a networking environment of route iteration and ensuring validity of a TM speed limit function of traffic.
Referring to fig. 3, a flowchart of a method for limiting a tunnel speed according to an exemplary embodiment of the present disclosure is shown, where the method is applied to a routing device of a TE tunnel start node, for example, an RT-1 device in fig. 2-1. The method comprises the following steps:
301, acquiring a queue number resource configured for any TE tunnel on the routing device based on the speed limit;
in this embodiment, when the LR speed limit is configured on the TE tunnel, the routing device located at the originating node of the TE tunnel may apply for a queue number (FLOWID) resource configured for the TE tunnel based on the LR. Because one routing device TE may carry multiple TE tunnels, the routing device may be triggered to acquire the queue number resource of each TE tunnel carried on the routing device at a limited speed, and because the processing methods of the queue number resource of each TE tunnel are the same, the routing device in this embodiment only takes the acquisition of the queue number resource of any TE tunnel as an example for explanation.
Step 302, according to the pre-established corresponding relationship of the LSP tunnel nodes of the TE tunnel iteration, finding the designated LSP tunnel nodes of the TE tunnel iteration;
as an embodiment, the routing device may obtain a tag value (e.g., token value) of the TE tunnel through an interface index of the TE tunnel; and then searching the designated LSP tunnel node corresponding to the label value in the LSP tunnel node corresponding relationship of the TE tunnel iteration according to the label value of the TE tunnel.
As an embodiment, when the routing device searches for a next-hop node of an LSP tunnel node, if the next-hop of the LSP tunnel node iterates to the TE tunnel, a correspondence between the TE tunnel and the LSP tunnel node may be created.
Specifically, a hash chain table with the tag value of the TE tunnel as an index may be constructed in advance, so that by constructing a hash chain table with the tag value of the TE tunnel as an index, the tag values of different TE tunnels are used for indexing the hash chain tables of different TE tunnels on the routing device; if the next hop of the LSP tunnel node is iterated to the TE tunnel, searching a hash chain table corresponding to the TE tunnel according to the label value of the TE tunnel; and then, creating a hash node corresponding to the LSP tunnel node in the hash chain table, and establishing a corresponding relation between the TE tunnel and the LSP tunnel node, wherein the corresponding relation comprises a mark value of the LSP tunnel node. The organization relationship between TE tunnels and iterated LSP tunnel nodes is shown in fig. 4, where the left side of the list is a plurality of TE tunnels carried on the routing device, such as TE1, TE2, and TE3 … … TEn, and the right side of the list is a head node of an LSP tunnel iterated by each TE tunnel, for example, when an LSP tunnel node iterated by a TE1 tunnel includes LSP11, LSP12, and LSP13, list entries corresponding to TE1 include LSP11, LSP12, and LSP13, and list entries of other TEs are the same, which is not described herein again.
Step 303, obtaining an output interface table entry corresponding to the specified LSP tunnel node;
as an embodiment, the routing device may obtain the label value of the specified LSP tunnel node, and search for an egress interface entry corresponding to the label value of the specified LSP tunnel node according to a correspondence between the label value of the LSP tunnel node and the egress interface entry that is stored in advance.
Andstep 304, respectively issuing the acquired queue number resources to the output interface table entry corresponding to the specified LSP tunnel node, so that the specified LSP tunnel node limits the speed according to the queue number resources in the output interface table entry.
In this embodiment, the routing device may configure the obtained queue number resource to an egress interface table entry corresponding to the specified LSP tunnel node, so that the specified LSP tunnel node performs speed limitation according to the queue number resource in the egress interface table entry, thereby implementing the speed limitation function of all LSPs iterated to the TE tunnel. Therefore, the method and the device can ensure the availability of the TM speed limit function of the traffic under the routing iterative networking.
In the prior art, because the forwarding layer can directly set an interface table according to the information issued by the LDP protocol, the iterated TE cannot sense the LDP information. Meanwhile, one TE tunnel may be iterated by multiple LSPs, and the TE cannot distinguish which LSP is iterated under the current networking environment. The method and the device can enable the LSP tunnel node to acquire the bandwidth resource configuration under the TE tunnel by storing the corresponding relation between the LSP tunnel node and the iterative TE tunnel and send the bandwidth resource configuration to the interface output table of the LSP tunnel node, thereby enabling the LSP to carry out queue speed limitation through the queue number.
Based on the same conception, the disclosure also provides a tunnel speed limiting device, which can be realized by software, or by hardware or a combination of the software and the hardware. Taking software implementation as an example, the tunnel speed limiting device disclosed by the invention is used as a logical device and is formed by reading a corresponding computer program instruction in a memory and then running the computer program instruction through a CPU of the device where the tunnel speed limiting device is located.
Referring to fig. 5, a tunnel speed limiting apparatus 500 according to an exemplary embodiment of the present disclosure is applied to a routing device of a TE tunnel start node, and the apparatus includes:
a resource obtaining unit 501, configured to obtain a queue number resource allocated to any TE tunnel on the routing device based on the speed limit;
a node searching unit 502, which searches for an assigned LSP tunnel node of the TE tunnel iteration according to a pre-created correspondence of LSP tunnel nodes of the TE tunnel iteration;
a table entry obtaining unit 503, configured to obtain an egress interface table entry corresponding to the specified LSP tunnel node;
a resource configuration unit 504, configured to configure the obtained queue number resources to the egress interface table entry corresponding to the specified LSP tunnel node, so that the specified LSP tunnel node performs speed limitation according to the queue number resources in the egress interface table entry.
As an embodiment, the node searching unit 502 is configured to obtain a tag value of the TE tunnel through an interface index of the TE tunnel; and searching the appointed LSP tunnel node of the TE tunnel iteration according to the label value of the TE tunnel in the corresponding relation of the LSP tunnel node of the TE tunnel iteration.
As an embodiment, the apparatus further comprises:
a relationship creating unit 505, configured to create a corresponding relationship between the TE tunnel and the LSP tunnel node if a next hop of the LSP tunnel node iterates to the TE tunnel.
As an embodiment, the relationship creating unit 505 is specifically configured to pre-construct a hash chain table using a tag value of the TE tunnel as an index; and if the next hop of the LSP tunnel node is iterated to the TE tunnel, searching a hash chain table corresponding to the TE tunnel according to the tag value of the TE tunnel, and creating a hash node corresponding to the LSP tunnel node in the hash chain table.
As an embodiment, the entry obtaining unit 503 is configured to obtain a label value of the specified LSP tunnel node; and searching an output interface table entry corresponding to the label value of the specified LSP tunnel node according to the corresponding relation between the label value of the prestored LSP tunnel node and the output interface table entry.
Based on the same concept, the present disclosure also provides a computer apparatus, as shown in fig. 6, including amemory 61, aprocessor 62, acommunication interface 63, and acommunication bus 64; wherein, thememory 61, theprocessor 62 and thecommunication interface 63 communicate with each other through thecommunication bus 64;
thememory 61 is used for storing computer programs;
theprocessor 62 is configured to execute the computer program stored in thememory 61, and when theprocessor 62 executes the computer program, any step of the method for limiting a tunnel speed provided by the embodiment of the present disclosure is implemented.
The present disclosure further provides a computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, any step of the method for limiting a tunnel speed provided by the embodiment of the present disclosure is implemented.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for embodiments of the computer device and the computer-readable storage medium, since they are substantially similar to the method embodiments, the description is relatively simple, and in relation to what is described in the partial description of the method embodiments.
In summary, the present disclosure may create a correspondence relationship between LSP tunnel nodes of a TE tunnel iteration in advance, after obtaining a queue number resource of any TE tunnel, obtain an egress interface table entry corresponding to a specified LSP tunnel node, and then configure the queue number resource to the egress interface table entry corresponding to the specified LSP tunnel node, so that the specified LSP tunnel node performs speed limitation according to the queue number resource in the egress interface table entry, thereby implementing effective utilization of bandwidth resources under the TE tunnel in a networking environment of a routing iteration, and ensuring effectiveness of a TM speed limitation function of traffic.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiment, since it basically corresponds to the method embodiment, reference may be made to the partial description of the method embodiment for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and should not be taken as limiting the scope of the present invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.