Method and equipment for realizing modularized service quality
By utilizing the Class ID resources identifiable by the hardware switching chip in network devices, modular QoS processing is performed on the specified flows passing through the VSI virtual interface, solving the problem of insufficient ACL table resources and achieving efficient modular QoS policy application.
Patent Information
- Application Number
- CN202510899770.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-09-16
AI Technical Summary
When a network device learns a Layer 3 forwarding entry with a VSI interface as the outbound interface, it has insufficient ACL entry resources and cannot perform modular QoS processing on the specified traffic passing through the VSI interface.
By leveraging the Class ID resources in the Layer 3 interface table, a hardware resource recognized by the hardware switching chip, modular QoS processing is performed on designated flows passing through the virtual switching instance (VSI) interface. The specific steps include applying for a Class ID for the VSI interface, recording it in the hardware Layer 3 forwarding table, and configuring access control entries to implement flow classification and behavior processing.
This greatly reduces the ACL resources required to apply each modular QoS policy to a VSI virtual interface, avoiding the problem of being unable to perform modular QoS processing when ACL table resources are insufficient.
Smart Images

Figure CN120658630A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to communication technology, and more specifically to a method and device for implementing modular quality of service. Background Art
[0002] Modular QoS (Quality of Service) classifies traffic by defining flow characteristics that identify or match specific types of traffic, creates traffic behaviors by defining processing actions for the identified or matched traffic, associates the flow classification and traffic behavior to form a flow QoS policy, and finally applies the flow QoS policy to an inbound or outbound interface. If traffic passing through an inbound or outbound interface matches the flow classification rules of the modular QoS policy, the traffic is processed accordingly based on the traffic behavior specified in the QoS policy.
[0003] In data centers or cloud environments, different tenants use VSIs (Virtual Switch Instances) to achieve Layer 2 network isolation. To enable Layer 3 connectivity between VSIs or between a VSI and the external network, you typically configure a Layer 3 logical interface (VSI virtual interface) for each VSI. This interface acts as the VSI's Layer 3 gateway and implements Layer 3 forwarding.
[0004] But, the hardware chip of network equipment can't directly identify this overall object of three-layer logical interface, after the operating system of network equipment is configured a modular QoS strategy for a VSI virtual interface, when network equipment learns that VSI virtual interface is the three-layer forwarding table item of outgoing interface, need to set an ACL table item and realize modular QoS in hardware switching chip with the real next hop information (for example actual physical outgoing port or MAC encapsulation information) of this three-layer forwarding table item and flow characteristic parameter.But when the VSI virtual interface that network equipment learns is the three-layer forwarding table item of outgoing interface increases and ACL table item is under-resourced, then can't carry out modular QoS process to the designated flow through VSI virtual interface. Summary of the Invention
[0005] The purpose of this application is to provide a method and device for implementing modular quality of service, which implements modular QoS processing for a specified flow passing through a virtual switching instance VSI virtual interface through a single ACL table entry.
[0006] To achieve the above-mentioned purpose, the present application provides a method for realizing modular service quality, which includes applying a first outgoing flow quality of service QoS policy to a first virtual switching instance VSI virtual interface; in the VSI virtual interface binding software table, based on the first VSI virtual interface, not finding a bound classification identifier Class ID; applying for a first Class ID for the first VSI virtual interface from a Class ID resource pool; in the VSI virtual interface binding software table, recording the first Class ID bound to the first VSI virtual interface, and recording the applied policy count value of the first VSI virtual interface as 1; writing the first Class ID into each three-layer hardware forwarding table, in which the outgoing interface is the hardware three-layer forwarding table entry of the first VSI virtual interface; setting a first access control table entry; wherein the matching item includes at least the flow classification characteristic parameters of the first outgoing flow QoS policy and the first Class ID action item includes at least the flow behavior of the first outgoing flow QoS policy.
[0007] To achieve the above-mentioned purpose, the present application also provides a device for implementing modular service quality, which includes a processor, a memory, a switching chip and a network interface, the memory stores machine-executable instructions, and the processor allows the machine-executable instructions to execute a first outgoing flow quality of service QoS policy applied to a first virtual switching instance VSI virtual interface; in the VSI virtual interface binding software table, no bound classification identifier Class ID is found based on the first VSI virtual interface; a first Class ID is applied for the first VSI virtual interface from the Class ID resource pool; in the VSI virtual interface binding software table, the first Class ID bound to the first VSI virtual interface is recorded, and the applied policy count value of the first VSI virtual interface is recorded as 1; the first Class ID is written into the hardware three-layer forwarding table entry whose outgoing interface is the first VSI virtual interface in each three-layer hardware forwarding table; a first access control table entry is set; wherein the matching item at least includes the flow classification feature parameters of the first outgoing flow QoS policy and the first Class ID action item at least includes the flow behavior of the first outgoing flow QoS policy.
[0008] The beneficial effect of the present application is that, by utilizing the Class ID resources of the Layer 3 interface table entries (L3INTF, layer 3 Interface) of the hardware table entry resources that can be identified by the hardware switching chip, modular QoS processing is implemented for the specified flow passing through the virtual switching instance VSI virtual interface through a single ACL table entry, which greatly reduces the ACL resources required to apply each modular QoS policy to a VSI virtual interface, and further avoids the situation where modular QoS processing cannot be performed on the specified flow passing through the VSI virtual interface when the ACL table entry resources are insufficient. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] Figure 1 A flowchart of an embodiment of a method for implementing modular quality of service provided by this application;
[0010] Figures 2A-2C A schematic diagram of configuring an outbound modular service strategy provided in an embodiment of the present application;
[0011] Figure 3 Flowchart of an embodiment of a method for learning Layer 3 forwarding entries on a VSI virtual interface provided in an embodiment of the present application;
[0012] Figures 4A-4B A schematic diagram of an embodiment of deleting an outbound modular service strategy provided by this application;
[0013] Figure 5 This is a flowchart of an embodiment of a device for implementing modular quality of service provided by the present application. DETAILED DESCRIPTION
[0014] The present invention will be described in detail with reference to a plurality of examples shown in the accompanying drawings. In the following detailed description, a number of specific details are provided to provide a comprehensive understanding of the present invention. Known methods, steps, components, and circuits are not described in detail in the examples to avoid obscuring the understanding of the examples.
[0015] Among the terms used, the term "including" means including but not limited to; the term "containing" means including but not limited to; the terms "above," "within," and "below" are inclusive; the terms "greater than" and "less than" are exclusive. The term "based on" means based on at least a portion.
[0016] Figure 1 FIG2 is a flowchart of an embodiment of a method for implementing modular quality of service provided by the present application, which includes the following steps:
[0017] Step 101: Apply a first outbound flow quality of service (QoS) policy to a first virtual switching instance (VSI) virtual interface.
[0018] Step 102: In the VSI virtual interface binding software table, no bound Class ID is found based on the first VSI virtual interface.
[0019] Step 103: Apply for a first ClassID for the first VSI virtual interface from the ClassID resource pool.
[0020] Step 104: In the VSI virtual interface binding software table, record the first ClassID bound to the first VSI virtual interface and the applied policy count value of the first VSI virtual interface as 1;
[0021] Step 105: Write the first Class ID into the hardware Layer 3 forwarding entry whose outgoing interface is the first VSI virtual interface in each Layer 3 hardware forwarding table;
[0022] Step 106: Set a first access control table entry; wherein the matching item includes at least the flow classification characteristic parameters of the first outbound flow QoS policy and the first ClassID action item includes at least the flow behavior of the first outbound flow QoS policy.
[0023] Figure 1 The beneficial effect of the example shown is that, by utilizing the Class ID resources of the Layer 3 interface table entries (L3INTF, layer 3 Interface) of the hardware table entry resources that can be identified by the hardware switching chip, modular QoS processing is implemented for the specified flow passing through the virtual switching instance VSI virtual interface through a single ACL table entry, which greatly reduces the ACL resources required to apply each modular QoS policy to a VSI virtual interface, and further avoids the situation where modular QoS processing cannot be performed on the specified flow passing through the VSI virtual interface when the ACL table entry resources are insufficient.
[0024] Figures 2A-2C A schematic diagram of modifying the VSI interface binding software table for configuring the outbound modular service policy of the VSI virtual interface provided in an embodiment of the present application.
[0025] Figure 2A In each table entry of the VSI virtual interface software table 200 shown, the VSI virtual interface identifier corresponds to each VSI virtual interface configured with the applied outbound modular QoS policy, the classification identifier corresponds to the ClassID resource of the three-layer interface (L3INTF) table entry applied for each VSI virtual interface, and the number of applied QoS policies indicates the number of service flows (specified flows) corresponding to the VSI virtual interface as the outbound interface and to which the modular QoS policy is applied.
[0026] Figure 2B In the network device definition, the service flow flow 1 ( Figures 2A-2C(not shown) to classify the flow and define the flow behavior of creating flow1 ( Figures 2A-2C Not shown), associate the flow classification and flow behavior of flow1 to form a QoS policy for service flow flow1 ( Figures 2A-2C (not shown), when the QoS policy of the service flow flow 1 is applied to the outgoing direction of the VSI virtual interface 131, the bound classification identifier ClassID of the VSI virtual interface 131 is not found in the table 200.
[0027] The network device applies for Class ID 11 for VSI virtual interface 131 from the Class ID resource pool, records the Class ID bound to VSI virtual interface 131 in VSI virtual interface binding software table 200, and records the applied policy count value of VSI virtual interface 131 as 1. Figure 2B shown.
[0028] The network device writes ClassID11 into the hardware Layer 3 forwarding entry whose outgoing interface is VSI virtual interface 131 in each Layer 3 hardware forwarding table.
[0029] In network devices, the L3INTF entry in the Layer 3 interface table is used by switch chips or devices to manage and maintain all Layer 3 (IP)-capable interfaces. L3INTF entries can record both logical and physical Layer 3 interfaces. When a logical Layer 3 interface is created, a corresponding L3INTF entry is generated. This L3INTF entry includes fields such as the interface index, interface type, and class ID, which record Layer 3 interface attributes.
[0030] On network devices, a Layer 3 forwarding table refers to routing tables, ARP tables, ND tables, FIB tables, and other tables used to record Layer 3 forwarding of service flows. The network device polls each Layer 3 forwarding table and, if it finds a Layer 3 forwarding entry whose outgoing interface is VSI interface 131, it writes ClassID 11.
[0031] In the outbound ACL table, the network device sets an access control table entry for the outbound QoS policy of service flow flow1 on VSI virtual interface 131; the matching item includes at least the flow classification characteristic parameters of the above-mentioned service flow flow1 and Class ID11; the action item includes at least the flow behavior of the outbound QoS policy of service flow flow1.
[0032] Figure 2C In the network device definition, the identification service flow flow 2 ( Figures 2A-2C (not shown) to classify the flow and define the flow behavior of creating flow2 ( Figures 2A-2CNot shown), associate the flow classification and flow behavior of flow2 to form a QoS policy for service flow flow2 ( Figures 2A-2C Not shown), when the QoS policy of the service flow flow 2 is applied to the outgoing direction of the VSI virtual interface 131, the bound classification identifier Class ID11 of the VSI virtual interface 131 is found in table 200, and the applied policy count value of the VSI virtual interface 131 is modified to 2.
[0033] In the outbound ACL table, the network device sets an ACL table entry for the outbound QoS policy of service flow flow2 on VSI virtual interface 131; the matching item includes at least the flow classification characteristic parameters of service flow flow2 and Class ID11; the action item includes at least the flow behavior of the outbound QoS policy of service flow flow1.
[0034] In this application, the network device executes the Class ID resource pool when the hardware forwarding chip is initialized. The number of identifiers in the ClassID resource pool can be initialized based on the configuration information, or the number of identifiers in the ClassID resource pool can be initialized based on the length of the ClassID field of the L3INT table item in the hardware forwarding chip. For example, if the operating system of the network device obtains the CLASSID field length of the L3INT table item in the hardware forwarding chip as 32 bits, the maximum CLASSID recorded is 429496729, and the ClassID value of the CLASSID resource pool is set to 0-429496729. Each ClassID in the Class resource pool can be set based on an occupied or unoccupied flag. The network device applies for a ClassID with an unoccupied flag set from the resource pool. When the network device releases the ClassID, its occupied flag is modified to unoccupied.
[0035] In this way, in the downstream outbound direction, the network device finds that the outbound interface is VSI virtual interface 131 based on the data packet of business flow flow1; after finding a matching ACL table entry in the outbound ACL table based on the flow characteristic parameters of business flow flow1 and VSI virtual interface 131, it performs QoS processing on the business packet of business flow flow1 according to the flow behavior of the action item.
[0036] In the downstream outbound direction, the network device finds that the outbound interface is VSI virtual interface 131 based on the data packet of service flow flow2; after finding a matching ACL table entry in the outbound ACL table based on the flow characteristic parameters of service flow flow2 and VSI virtual interface 131, it performs QoS processing on the service packet of service flow flow2 according to the flow behavior of the action item.
[0037] Figures 2A-2CIn the embodiment, the network device sets an outbound ACL entry in the outbound ACL table for each of the service flows flow1 and flow2 sent through the VSI virtual interface 131 to implement modular QoS processing, thereby reducing the ACL resources occupied by applying the outbound QoS policy of the service flow to the VSI virtual interface.
[0038] Figure 3 Flowchart of an embodiment of a method for learning Layer 3 forwarding entries on a VSI virtual interface provided in an embodiment of the present application;
[0039] Step 301, learning software layer 3 forwarding table entries;
[0040] Network devices learn software Layer 3 forwarding entries based on configuration or protocol packets. For example, a network device's hardware switching chip sends received ARP packets to the CPU, where it learns software ARP entries.
[0041] This application does not limit the type or learning method of the three-layer forwarding table entries.
[0042] In this embodiment, ARP table entry learning is used as an example. The network device learns three ARP table entries. The network device identifies the virtual interface VSI 1000 of one of the ARP table entries.
[0043] Step 302 , determine whether the interface is a virtual interface. If so, execute step 303 ; if not, execute step 305 .
[0044] If the network device determines that the outgoing interface of the ARP software entry is a physical Layer 3 interface, step 305 is executed; if the network device determines that the outgoing interface of the ARP entry is a VSI virtual interface, step 303 is executed.
[0045] Step 303 , determining whether the outbound modular QoS policy has been configured, if so, executing step 304 ; if not, executing step 305 .
[0046] The network device identifies that the outbound interface of a learned ARP software entry is VSI interface 1000. However, the bound class ID is not found in VSI interface binding software table 200. Therefore, the network device determines that no outbound modular QoS policy is configured for VSI interface 1000.
[0047] The network device identifies that the outgoing interface of another learned ARP software entry is VSI virtual interface 131 and Class ID 11 is bound in VSI virtual interface binding software table 200 , and determines that VSI virtual interface 131 has been configured with the outgoing modular QoS policy.
[0048] Step 304: Write the ClassID bound to the VSI virtual interface into the software Layer 3 forwarding table.
[0049] The network device writes Class ID 11 bound to VSI interface 131 into the learned ARP software entry.
[0050] Step 305: Synchronize the software layer 3 forwarding table entries to the hardware layer 3 forwarding table entries.
[0051] The network device software ARP entries are written into the ARP forwarding table of the hardware switching chip. Therefore, the CLASSID is not written into the ARP entries for outbound interfaces that are not VSI interfaces, or for VSI interfaces that do not have a modular QoS policy configured for the outbound direction.
[0052] In the hardware forwarding chip of the network device, the ARP entry whose outbound interface is VSI virtual interface 131 is written with ClassID 11.
[0053] Figures 4A-4B A schematic diagram of an embodiment of deleting an outbound modular service strategy provided by this application;
[0054] Figure 4A In the example, the operating system of the network device deletes the outbound QoS policy of the service flow flow1 of the VSI virtual interface 131. The network device finds the bound ClassID11 based on the VSI virtual interface 131 in the VSI virtual interface binding software table 400, and subtracts the number of deleted outbound QoS policies by 1 from the applied policy count value of the VSI virtual interface 131. The operating system of the network device determines that the applied policy count value of the VSI virtual interface 131 in the VSI virtual interface binding software table 400 is not zero. The network device deletes the flow classification characteristic parameters with the matching item flow1 and the ACL table entry of ClassID11 in the downstream outbound ACL table ( Figure 4A not shown).
[0055] In another example, Figure 4B In the process, the network device's operating system deletes the outbound QoS policies for service flows flow1 and flow2 on VSI virtual interface 131. Based on VSI virtual interface 131, the network device searches for bound Class ID 11 in VSI virtual interface binding software table 400 and subtracts the number of deleted outbound QoS policies, 2, from the applied policy count for VSI virtual interface 131. The network device's operating system determines that the applied policy count for VSI virtual interface 131 in VSI virtual interface binding software table 400 is not zero. In the downstream outbound ACL table, the network device deletes the flow classification feature matching flow1 and the ACL entry for Class ID 11, and deletes the flow classification feature matching flow2 and the ACL entry for Class ID 11.
[0056] The network device polls each Layer 3 forwarding table and deletes Class ID 11 from each Layer 3 forwarding entry whose outgoing interface is VSI virtual interface 131.
[0057] The network device deletes ClassID11 of the L3INT table entry of VSI virtual interface 131, deletes VSI virtual interface 131, deletes all Class ID11 bound to VSI virtual interface 131 (for example, changes these values to 0), and the applied policy count value 0 in the VSI virtual interface binding software table.
[0058] The network device releases Class ID 11. This marks the Class ID 11 bit in the Class ID resource pool as unoccupied, and it can be subsequently assigned to outbound QoS policies for different service flows on other VSI interfaces.
[0059] Figure 5 A schematic diagram of a device for implementing fair forwarding of multicast data packets provided by the present application. The device 50 can be used in a multicast routing device; the device 50 includes a processor, a memory, a switching chip, and a network interface. The processor executes the following processing by running machine-executable instructions in the memory: applying a first outbound flow quality of service (QoS) policy to a first virtual switching instance (VSI) virtual interface; finding no bound classification identifier (ClassID) based on the first VSI virtual interface in the VSI virtual interface binding software table; applying for a first Class ID for the first VSI virtual interface from a Class ID resource pool; recording the first Class ID bound to the first VSI virtual interface in the VSI virtual interface binding software table, and recording the applied policy count value of the first VSI virtual interface as 1; writing the first Class ID into the hardware Layer 3 forwarding entry whose outbound interface is the first VSI virtual interface in each Layer 3 hardware forwarding table; writing the first Class ID into the Layer 3 interface table entry of the first VSI virtual interface; and setting a first access control table entry; wherein the matching item includes at least the flow classification characteristic parameters of the first outbound flow QoS policy, and the first Class ID action item includes at least the flow behavior of the first outbound flow QoS policy.
[0060] The processor further performs the following processing by running the machine executable instructions in the memory: applying the second outbound flow quality of service (QoS) policy to the first VSI virtual interface; searching for the bound first Class ID based on the first VSI virtual interface in the VSI virtual interface binding software table; adding 1 to the applied policy count value of the first VSI virtual interface in the VSI virtual interface binding software table; setting a second access control table entry; wherein the matching item at least includes the flow classification characteristic parameter of the second outbound flow QoS policy and the first Class ID action item at least includes the flow behavior of the second outbound flow QoS policy.
[0061] The processor also performs the following processing by running the machine executable instructions in the memory: determining that the outgoing interface of the learned software three-layer forwarding table entry is the first VSI virtual interface; finding the first Class ID based on the first VSI virtual interface in the VSI virtual interface binding software table; recording the first Class ID in the three-layer interface table entry of the newly learned three-layer forwarding table entry; and synchronizing the newly learned three-layer forwarding table entry into a hardware three-layer forwarding table entry.
[0062] The processor further executes the following processing by running the machine executable instructions in the memory: determining that the outgoing interface type of the learned new software Layer 3 forwarding table entry is not a VSI virtual interface; and synchronizing the new Layer 3 forwarding table entry into a hardware Layer 3 forwarding table entry.
[0063] The processor further performs the following processing by running the machine executable instructions in the memory: determining that the outgoing interface of the learned software three-layer forwarding table entry is the second VSI virtual interface; not finding the corresponding Class ID based on the second VSI virtual interface in the VSI virtual interface binding software table; and synchronizing the new three-layer forwarding table entry into a hardware three-layer forwarding table entry.
[0064] The processor further performs the following processing by running the machine executable instructions in the memory: deleting the first outbound flow QoS policy or the second outbound flow QoS policy of the first VSI virtual interface; searching for the bound first Class ID based on the first VSI virtual interface in the VSI virtual interface binding software table, subtracting the number of deleted outbound flow QoS policies from the applied policy count value of the first VSI virtual interface; determining that the applied policy count value of the first VSI virtual interface in the VSI virtual interface binding software table is not zero; and deleting the flow classification characteristic parameters that apply the deleted outbound flow QoS policy and the ACL table entry of the first Class ID.
[0065] The processor further performs the following processing by running machine-executable instructions in the memory: deleting a first outbound flow QoS policy and a second outbound flow QoS policy of the first VSI virtual interface; searching for a bound first Class ID based on the first VSI virtual interface in a VSI virtual interface binding software table, and subtracting the number of deleted outbound flow QoS policies from a count value of applied policies of the first VSI virtual interface; determining that the count value of applied policies of the first VSI virtual interface in the VSI virtual interface binding software table is zero; deleting a flow classification characteristic parameter and a first ACL table entry of the first Class ID that apply the first outbound flow QoS policy, and deleting a flow classification characteristic parameter and a second ACL table entry of the first Class ID that apply the second outbound flow QoS policy; deleting the first Class ID from a hardware Layer 3 forwarding table entry whose outbound interface is the first VSI virtual interface in each Layer 3 hardware forwarding table; deleting the first Class ID from a Layer 3 interface table entry of the first VSI virtual interface; deleting the first VSI virtual interface and its bound first Class ID and the count value of applied policies from the VSI virtual interface binding software table; and releasing the first Class ID.
[0066] The processor executes the machine executable instructions in the memory and, before applying the first outgoing flow quality of service (QoS) policy to the first virtual switching instance (VSI) virtual interface, further executes the following processing: initializing the Class ID resource pool.
[0067] The processor executes the processing of initializing the Class ID resource pool by running the machine executable instructions in the memory, including: obtaining the Class ID field length of the three-layer interface table item allocated by the hardware switching chip; calculating the maximum Class ID value based on the Class ID field length; calculating the number of Class IDs based on the maximum Class ID value; setting the Class ID resource pool according to the number of Class IDs; wherein each Class ID in the Class resource pool can be set based on an occupied or unoccupied flag bit.
[0068] In this application, a machine-readable memory can be any electronic, magnetic, optical, or other physical storage device that stores or contains information (e.g., executable instructions, data, etc.). For example, any machine-readable memory herein can be any type of random access memory (RAM), volatile memory, memory, flash memory, storage drive (e.g., hard drive), solid-state drive, any type of storage optical disk (e.g., CD-ROM, DVD, etc.), and similar devices, or a combination thereof. In addition, any machine-readable memory described herein can be a non-transitory machine-readable memory.
[0069] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for implementing modular quality of service, characterized in that: The method comprises, Applying the first outbound flow quality of service (QoS) policy to the first virtual switching instance (VSI) virtual interface; In the VSI virtual interface binding software table, no bound classification identifier ClassID is found based on the first VSI virtual interface; Applying a first ClassID for the first VSI virtual interface from a ClassID resource pool; In the VSI virtual interface binding software table, record the first ClassID bound to the first VSI virtual interface and set the applied policy count value of the first VSI virtual interface to 1. Writing the first Class ID into each Layer 3 hardware forwarding entry whose outgoing interface is the first VSI virtual interface; A first access control table entry is set; wherein the matching item includes at least the flow classification characteristic parameter of the first outbound flow QoS policy and the first ClassID action item includes at least the flow behavior of the first outbound flow QoS policy.
2. The method according to claim 1, characterized in that The method further comprises, Applying a second outbound traffic quality of service (QoS) policy to the first VSI virtual interface; In the VSI virtual interface binding software table, searching for the bound first ClassID based on the first VSI virtual interface; Incrementing the applied policy count value of the first VSI virtual interface in the VSI virtual interface binding software table by 1; A second access control table entry is set; wherein the matching item includes at least the flow classification characteristic parameter of the second outgoing flow QoS policy and the first ClassID action item includes at least the flow behavior of the second outgoing flow QoS policy.
3. The method according to claim 1, characterized in that The method further comprises, Determine that the outbound interface of the learned software Layer 3 forwarding entry is the first VSI virtual interface; In the VSI virtual interface binding software table, searching for the first ClassID based on the first VSI virtual interface; Recording the first ClassID in the Layer 3 interface table entry of the newly learned Layer 3 forwarding entry; The newly learned layer-3 forwarding table entry is synchronized into a hardware layer-3 forwarding table entry.
4. The method according to claim 1, wherein The method further comprises, Ensure that the outbound interface type of the newly learned software Layer 3 forwarding entry is not a VSI interface. The new layer 3 forwarding table entry is synchronized into a hardware layer 3 forwarding table entry.
5. The method according to claim 1, wherein The method further comprises, The outbound interface of the learned software Layer 3 forwarding entry is the second VSI virtual interface. In the VSI virtual interface binding software table, no corresponding ClassID is found based on the second VSI virtual interface; The new layer 3 forwarding table entry is synchronized into a hardware layer 3 forwarding table entry.
6. The method according to claim 1, characterized in that The method further comprises, Deleting the first outbound QoS policy or the second outbound QoS policy of the first VSI virtual interface; In the VSI virtual interface binding software table, based on the first VSI virtual interface, searching for the first Class ID that has been bound, and subtracting the number of deleted outbound QoS policies from the applied policy count value of the first VSI virtual interface; Determine in the software table that the VSI virtual interface is bound to that the applied policy count value of the first VSI virtual interface is not zero; The flow classification characteristic parameters of the deleted outbound flow QoS policy and the ACL table entry of the first Class ID are deleted.
7. The method according to claim 1, characterized in that The method further comprises, Delete the first outbound QoS policy and the second outbound QoS policy of the first VSI virtual interface; In the VSI virtual interface binding software table, based on the first VSI virtual interface, searching for the first Class ID that has been bound, and subtracting the number of deleted outbound QoS policies from the applied policy count value of the first VSI virtual interface; Determine that the applied policy count value of the first VSI virtual interface is zero in the software table for binding the VSI virtual interface; Deleting the flow classification characteristic parameters of the first outbound flow QoS policy and the first ACL entry of the first ClassID, and deleting the flow classification characteristic parameters of the second outbound flow QoS policy and the second ACL entry of the first ClassID; Deleting the first Class ID from each Layer 3 hardware forwarding table entry whose outgoing interface is the first VSI virtual interface; Deleting the first VSI virtual interface and the first ClassID bound to it and the applied policy count value from the VSI virtual interface binding software table; Release the first ClassID.
8. The method according to claim 1, characterized in that Before applying the first outgoing flow quality of service QoS policy to the first virtual switching instance VSI virtual interface, the method further includes: Initialize the ClassID resource pool.
9. The method according to claim 8, characterized in that Initializing the ClassID resource pool includes: Get the length of the ClassID field in the Layer 3 interface table entry assigned by the hardware switching chip; Calculate the maximum ClassID value based on the length of the ClassID field; Calculate the number of ClassIDs based on the maximum ClassID value; The ClassID resource pool is set according to the number of ClassIDs; wherein each ClassID in the Class resource pool can be set based on an occupied or unoccupied flag.
10. A device for implementing modular quality of service, characterized in that: The device includes a processor, a memory, a switching chip, and a network interface. The memory stores machine-executable instructions, and the processor executes any one of the methods of claims 1 to 9 by allowing the machine-executable instructions to execute.