WO2023236858A1 - Flow table rule management method, traffic management method and system, and storage medium - Google Patents

Flow table rule management method, traffic management method and system, and storage medium Download PDF

Info

Publication number
WO2023236858A1
WO2023236858A1 PCT/CN2023/097966 CN2023097966W WO2023236858A1 WO 2023236858 A1 WO2023236858 A1 WO 2023236858A1 CN 2023097966 W CN2023097966 W CN 2023097966W WO 2023236858 A1 WO2023236858 A1 WO 2023236858A1
Authority
WO
WIPO (PCT)
Prior art keywords
matching
network card
message
flow
flow table
Prior art date
Application number
PCT/CN2023/097966
Other languages
French (fr)
Chinese (zh)
Inventor
徐新海
唐新晨
谢红
王军
李春辉
王志达
曾德勋
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2023236858A1 publication Critical patent/WO2023236858A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/20Traffic policing

Definitions

  • This application relates to the field of communication technology, and in particular to a flow table rule management method, a traffic management method, a system and a storage medium.
  • VS virtual switch
  • OpenFlow open source flow
  • This application provides a flow table rule management method, a traffic management method, a system and a storage medium, which can realize the management of flow table rules and traffic on a smart network card.
  • the first aspect provides a management method for flow table rules.
  • the management method is executed by an intelligent network card.
  • the intelligent network card is used to connect to a VS.
  • the method includes: the intelligent network card manages access control list ACL flow matching rules, and ACL flow matching rules. Used for smart network cards to perform operation and maintenance function management on packets.
  • the AC flow matching rules are managed through the smart network card.
  • the operation and maintenance capability is enabled, there is no need to clear the existing flow table entries on the smart network card, and the first packet does not need to be sent to the VS for re-learning.
  • the received packets are matched through ACL flows. Just set the rules, so that the smart network card has highly maintainable and reliable operation and maintenance capabilities.
  • hardware can be used to perform counting and statistics. Compared with software implementation, the statistical results are more accurate.
  • the ACL flow matching rules include at least one of an inbound ACL flow matching rule and an outbound ACL flow matching rule.
  • the inbound ACL flow matching rules can be used to manage the operation and maintenance functions of the smart network card in the inbound direction.
  • the outbound ACL flow matching rules can be used to manage the operation and maintenance functions of the smart network card in the outbound direction.
  • the smart network card manages access control list ACL flow matching rules, including: the smart network card receives the first message sent by VS by calling the first application programming interface API, and the first message includes the first message of the smart network card. The port identification of the port; the smart network card creates the first port on the first port of the smart network card based on the first message. ACL flow matching rules. By carrying the port identifier in the first message, the smart network card can create an ACL flow matching rule on the corresponding port, thereby improving the accuracy of creating an ACL flow matching rule.
  • the first message further includes at least one of a flow table rule attribute, a flow table rule matching item, and a flow table rule action item; wherein the flow table rule attribute is used to indicate that the packet needs At least one of the matching group, the direction information of the first ACL flow matching rule, and the flow table type; the flow table rule matching items include matching Ethernet layer information, matching virtual LAN VLAN information, and matching Internet Protocol version 4 At least one of IPv4 information or matching Internet Protocol version 6 IPv6 information, matching virtual extended LAN VXLAN information, matching item end, and message tag; the flow table rule action items include flow table statistics, sampling forwarding and flow mirroring, At least one of the operations of setting internal tags, modifying specified fields, and refnum operations for the message.
  • the ACL flow matching rules created by the intelligent network card are made more accurate and comprehensive.
  • the method further includes: the smart network card sends a second message to the VS, the second message indicating creating the first ACL flow on the first port of the smart network card.
  • the result of matching rules Increases reliability by returning results to VS indicating the creation of ACL flow matching rules.
  • the smart network card manages access control list ACL flow matching rules.
  • the method includes: the smart network card receives the third message sent by the VS calling the second API, and based on the third The message deletes the second ACL flow matching rule on the smart network card.
  • the operation and maintenance capability is turned off or the ACL flow matching rules change, the delivered ACL flow matching rules will be deleted, and subsequent received packets will not be matched by the ACL flow matching rules, making the smart network card highly maintainable and reliable. operation and maintenance capabilities and greater flexibility.
  • the smart network card manages access control list ACL flow matching rules.
  • the method includes: the smart network card receives a fourth message sent by the VS calling a third API, and queries based on the fourth message. And return the statistical information of the smart network card. The query of statistical information is implemented through the fourth message, making the management of flow table rules more flexible.
  • the method further includes: the smart network card manages a hardware matching flow table, the hardware matching flow table is used by the smart network card to manage traffic, and the hardware matching flow table includes At least one of a hardware exact matching flow table and a hardware fuzzy matching flow table.
  • the smart network card manages a hardware matching flow table
  • the hardware matching flow table is used by the smart network card to manage traffic
  • the hardware matching flow table includes At least one of a hardware exact matching flow table and a hardware fuzzy matching flow table.
  • it can also manage hardware matching flow tables, making the management of flow table rules more comprehensive and more flexible.
  • the hardware fuzzy matching flow table is used to match a first message, and the first message is a message generated by a network element whose flow table entry satisfies the first threshold condition. ;
  • the hardware exact matching flow table is used to match the second message, and the second message is a message generated by a network element that meets the second threshold condition.
  • the hardware matching flow table managed by the smart network card includes the hardware fuzzy matching flow table and the hardware exact matching flow table, after the smart network card receives the packet, there is no need to compare the packet with the hardware fuzzy matching flow table and the hardware exact matching flow table respectively. Instead of matching, it first determines whether the packet is the first packet or the second packet, and then matches it with the hardware fuzzy matching flow table or the hardware exact matching flow table. In this way, traffic management is performed according to the type of packets, which improves management efficiency.
  • the method further includes: the smart network card manages a data plane hash table, and the data plane hash table is used by the smart network card to perform multi-path forwarding of multi-path forwarding messages.
  • Multipath forwarding is implemented through the data plane hash table.
  • ECMP equal-cost multi-path
  • the hardware matching flow table includes a hash matching action item, a redirection identifier matching action item, and a hash matching action item.
  • Work items and messages are uploaded to at least one of the VS software control plane matching action items; wherein the hash matching action item is used to instruct the execution of the query action of the data plane hash table, and the turn identification is used
  • the data plane hash table includes a hash value, a mask and the redirection identifier, and the mask corresponds to next hop information.
  • a flow table rule management method is provided.
  • the management method is executed by VS, which is used to connect to the smart network card.
  • the method includes: VS obtains the access control list ACL flow matching rule, and the ACL flow matching rule It is used for the smart network card to perform operation and maintenance function management on the packets; the VS instructs the smart network card to manage the ACL flow matching rules.
  • the ACL flow matching rules include at least one of inbound ACL flow matching rules and outbound ACL flow matching rules.
  • the VS instructs the smart network card to manage the ACL flow matching rules
  • the method includes: the VS calls a first application programming interface API to send a first message to the smart network card.
  • the first message includes a port identifier of the first port of the smart network card, and the first message is used by the smart network card to create a first ACL flow matching rule on the first port of the smart network card.
  • the first message further includes at least one of a flow table rule attribute, a flow table rule matching item, and a flow table rule action item; wherein the flow table rule attribute is used to indicate the report At least one of the group to be matched, whether the first ACL flow matching rule is an inbound ACL flow matching rule or an outgoing ACL flow matching rule, and a flow table type;
  • the flow table rule matching items include matching Ethernet layers information, matching virtual LAN VLAN information, matching Internet Protocol version 4 IPv4 information or matching Internet Protocol version 6 IPv6 information, matching virtual extended LAN VXLAN information, matching item end, and at least one of message tags;
  • the flow table Rule action items include at least one of flow table statistics, sampling forwarding and flow mirroring, setting internal tags for packets, modifying specified fields, and refnum operations.
  • the method further includes: the VS receiving a second message sent by the smart network card, the second message being used to indicate that the VS is created on the first port of the smart network card.
  • the result of the first ACL flow matching rule is the result of the first ACL flow matching rule.
  • the VS instructs the smart network card to manage the ACL flow matching rules.
  • the method includes: the VS calls a second API to send a third message to the smart network card.
  • the third message is used by the smart network card to delete the second ACL flow matching rule on the smart network card.
  • the VS instructs the smart network card to manage the ACL flow matching rules
  • the method includes: the VS calls a third API to send a fourth message to the smart network card, and the third Four messages are used for the smart network card to query and return the statistical information of the smart network card.
  • the method further includes: the VS obtains a hardware matching flow table.
  • the hardware matching flow table is used by the smart network card to manage traffic.
  • the hardware matching flow table includes hardware matching flow table. At least one of an exact matching flow table and a hardware fuzzy matching flow table; the VS instructs the smart network card to manage the hardware matching flow table.
  • the hardware fuzzy matching flow table is used to match a first message, and the first message is a message generated by a network element whose flow table entry satisfies the first threshold condition. ;
  • the hardware exact matching flow table is used to match the second message, and the second message is a message generated by a network element that meets the second threshold condition.
  • the method further includes: the VS obtains a data plane hash table, and the data plane hash table is used by the smart network card to perform multi-path forwarding of multi-path forwarding messages; The VS instructs the smart network card to manage the data plane hash table.
  • the hardware matching flow table includes at least one of a hash matching action item, a redirection identifier matching action item, and a message uploading matching action item to the VS software control plane; wherein, The hash matching action item is used to indicate the execution of the query action of the data plane hash table, and the redirection identity document (ID) is used to indicate the data plane hash table.
  • the data plane hash table The table includes a hash value, a mask and the redirection identifier, and the mask corresponds to next hop information.
  • a traffic management method includes: a smart network card receives a message, and matches the message with an access control list ACL flow matching rule created on the smart network card; based on the message Successfully matches the ACL flow matching rule, and the smart network card performs operation and maintenance function management on the packet according to the ACL flow matching rule.
  • the smart network card implements the management of the operation and maintenance function. There is no need to clear the existing forwarding flow table entries, and the received packets do not need to be sent to the VS for re-learning, and they can no longer be triggered by traffic. The received packets only need to be matched with ACL flow rules through the smart network card. Therefore, the smart network card has highly maintainable and reliable operation and maintenance capabilities.
  • operation and maintenance functions such as counting and statistics are implemented through smart network cards, that is, counting and statistics are implemented by hardware. Compared with software implementation, the statistical results are more accurate.
  • the ACL flow matching rules include inbound ACL flow matching rules and outgoing ACL flow matching rules; based on the successful matching of the packet and the ACL flow matching rule, the The intelligent network card performs operation and maintenance function management on the packet according to the ACL flow matching rule, including: based on the successful matching of the packet with the incoming ACL flow matching rule, the intelligent network card performs operation and maintenance function management on the incoming ACL flow matching rule based on the incoming ACL flow matching rule.
  • the ACL flow matching rules perform inbound operation and maintenance function management on the packets; the smart network card forwards the packets on Layer 2 and Layer 3 networks; the packets are successfully matched with the outbound ACL flow matching rules. , the smart network card performs outbound operation and maintenance function management on the packet according to the outbound ACL flow matching rules.
  • the method further includes: the smart network card matches the message with a hardware matching flow table, where the hardware matching flow table includes a hardware exact matching flow table and a hardware fuzzy matching flow table. At least one of: the smart network card performs traffic management on the packet according to the matching result between the packet and the hardware matching flow table.
  • the smart network card matches the message with a hardware matching flow table, including: based on the message being the first message, the smart network card matches the message with the The hardware fuzzy matching flow table is used for matching, and the first message is a message generated by a network element that generates a flow table entry that satisfies the first threshold condition; or based on the message being a second message, the intelligent The network card matches the packet with the hardware exact matching flow table, and the second packet is a packet generated by a network element that meets the second threshold condition.
  • the smart network card performs traffic management on the packet according to the matching result between the packet and the hardware matching flow table, including: based on the matching flow between the packet and the hardware.
  • the matching result of the table is that the packet successfully matches the hardware matching flow table, and the hardware matching flow table includes a upload action item, and the packet is uploaded to the VS; or, based on the report If the matching result between the packet and the hardware matching flow table is that the packet fails to match the hardware matching flow table, the packet is sent to the VS.
  • the message is a multi-path forwarding message
  • the method further includes: the smart network card matches the message with a data plane hash table; based on the message and The data plane hash table matches successfully, and the smart network card performs multi-path forwarding of the message.
  • the hardware matching flow table includes hash matching action items and turn identification matching Action item; wherein, the hash matching action item is used to indicate the execution of the query action of the data plane hash table, and the turn identification is used to indicate the data plane hash table, and the data plane hash table includes Hash value, mask and the redirection identifier, the mask corresponding to the next hop information;
  • the smart network card matches the message with the data plane hash table, including: the smart network card calculates a hash value corresponding to the message based on the hash matching action item, and calculates a hash value based on the hash value.
  • the smart network card calculates a hash value corresponding to the message based on the hash matching action item, and calculates a hash value based on the hash value.
  • the intelligent network card performs multi-path forwarding of the message, including: the intelligent network card performs multi-path forwarding of the message according to the next hop information corresponding to the mask in the data plane hash table.
  • the hardware matching flow table includes a hash matching action item, a redirection identification matching action item, and a packet uploading matching action item to the VS software control plane; wherein, the hash matching action item The item is used to indicate the execution of the query action of the data plane hash table, and the turn identification is used to indicate the data side hash table.
  • the data side hash table includes a hash value, a mask and the turn identification , the mask corresponds to the next hop information;
  • the smart network card matches the message with the data plane hash table, including: the smart network card calculates a hash value corresponding to the message based on the hash matching action item, and calculates a hash value based on the hash value. Obtain the mask corresponding to the message; search the data plane hash table based on the steering identifier matching action item; based on the hash value corresponding to the message and the mask in the data plane hash table Inconsistent, it is determined that the message and the data plane hash table fail to match;
  • the method further includes: the smart network card sending the message to the virtual switch VS.
  • a traffic management method includes: the virtual switch VS receives a message sent by the smart network card, and the message is matched by the smart network card with the hardware on the smart network card.
  • the flow table is successfully matched and the hardware matching flow table includes an upload action item, or the message is sent by the smart network card when the message matches the hardware flow on the smart network card.
  • the message is sent when the matching table fails, or the message is sent by the smart network card after the message fails to match the data plane hash table on the smart network card; the VS sends the message Match with the open source flow table on the VS, and perform traffic management on the packets based on the matching results.
  • a method for managing flow table rules is provided.
  • the method is executed by a smart network card.
  • the method includes: the smart network card manages a hardware matching flow table, and the hardware matching flow table is used by the smart network card to perform traffic management on traffic.
  • the hardware matching flow table includes at least one of a hardware exact matching flow table and a hardware fuzzy matching flow table.
  • the hardware fuzzy matching flow table is used to match a first message, and the first message is a message generated by a network element whose flow table entry satisfies the first threshold condition. ;
  • the hardware exact matching flow table is used to match the second message, and the second message is a message generated by a network element that meets the second threshold condition.
  • the method further includes: the smart network card manages a data plane hash table, and the data plane hash table is used by the smart network card to perform multi-path forwarding of multi-path forwarding messages.
  • the hardware matching flow table includes at least one of a hash matching action item, a redirection identifier matching action item, and a message uploading matching action item to the VS software control plane; wherein, The hash matching action item is used to indicate the execution of the query action of the data plane hash table, and the redirection flag is used to indicate the data plane hash table.
  • the data plane hash table includes a hash value, a mask and the redirection identifier, and the mask corresponds to next hop information.
  • a flow table rule management method is provided.
  • the method is executed by VS, which is used to connect to a smart network card.
  • the method includes: VS obtains a hardware matching flow table, and the hardware matching flow table is used for the smart network card.
  • the network card performs traffic management on traffic, and the hardware matching flow table includes at least one of a hardware exact matching flow table and a hardware fuzzy matching flow table; the VS instructs the smart network card to manage the hardware matching flow table.
  • the hardware fuzzy matching flow table is used to match a first message, and the first message is a message generated by a network element whose flow table entry satisfies the first threshold condition. ;
  • the hardware exact matching flow table is used to match the second message, and the second message is a message generated by a network element that meets the second threshold condition.
  • the method further includes: the VS obtains a data plane hash table, and the data plane hash table is used by the smart network card to perform multi-path forwarding of multi-path forwarding messages; The VS instructs the smart network card to manage the data plane hash table.
  • the hardware matching flow table includes at least one of a hash matching action item, a redirection identifier matching action item, and a message uploading matching action item to the VS software control plane; wherein, The hash matching action item is used to indicate the execution of the query action of the data plane hash table, and the steering ID is used to indicate the data plane hash table.
  • the data plane hash table includes a hash value, a mask and the redirection identifier, and the mask corresponds to next hop information.
  • a traffic management method includes: a smart network card obtains a message, and matches the message with a hardware matching flow table.
  • the hardware matching flow table includes a hardware exact matching flow table and a hardware fuzzy flow table. Match at least one of the flow tables; the smart network card performs traffic management on the packet according to the matching result between the packet and the hardware matching flow table.
  • the smart network card matches the message with a hardware matching flow table, including: based on the message being the first message, the smart network card matches the message with the The hardware fuzzy matching flow table is used for matching, and the first message is a message generated by a network element that generates a flow table entry that satisfies the first threshold condition; or based on the message being a second message, the intelligent The network card matches the packet with the hardware exact matching flow table, and the second packet is a packet generated by a network element that meets the second threshold condition.
  • the smart network card performs traffic management on the packet according to the matching result between the packet and the hardware matching flow table, including: based on the matching flow between the packet and the hardware.
  • the matching result of the table is that the packet successfully matches the hardware matching flow table, and the hardware matching flow table includes a upload action item, and the packet is uploaded to the VS; or, based on the report If the matching result between the packet and the hardware matching flow table is that the packet fails to match the hardware matching flow table, the packet is sent to the VS.
  • the message is a multi-path forwarding message
  • the method further includes: the smart network card matches the message with a data plane hash table; based on the message and The data plane hash table matches successfully, and the smart network card performs multi-path forwarding of the message.
  • the hardware matching flow table includes a hash matching action item and a turn identification matching action item; wherein the hash matching action item is used to indicate execution of a query of the data plane hash table Action, the redirection identifier is used to indicate the data plane hash table, the data plane hash table includes a hash value, a mask and the redirection identifier, and the mask corresponds to next hop information;
  • the smart network card matches the message with the data plane hash table, including: the smart network card calculates a hash value corresponding to the message based on the hash matching action item, and calculates a hash value based on the hash value.
  • the smart network card calculates a hash value corresponding to the message based on the hash matching action item, and calculates a hash value based on the hash value.
  • the intelligent network card performs multi-path forwarding of the message, including: the intelligent network card performs multi-path forwarding of the message according to the next hop information corresponding to the mask in the data plane hash table.
  • the hardware matching flow table includes a hash matching action item, a redirection identification matching action item, and a packet uploading matching action item to the VS software control plane; wherein, the hash matching action item The item is used to indicate the execution of the query action of the data plane hash table, and the turn identification is used to indicate the data side hash table.
  • the data side hash table includes a hash value, a mask and the turn identification , the mask corresponds to the next hop information;
  • the smart network card matches the message with the data plane hash table, including: the smart network card calculates a hash value corresponding to the message based on the hash matching action item, and calculates a hash value based on the hash value. Obtain the mask corresponding to the message; search the data plane hash table based on the steering identifier matching action item; based on the hash value corresponding to the message and the mask in the data plane hash table Inconsistent, it is determined that the message and the data plane hash table fail to match;
  • the method further includes: the smart network card sending the message to the virtual switch VS.
  • a traffic management method includes: VS receives a message sent by a smart network card, and the message is matched by the smart network card between the message and a hardware matching flow table on the smart network card. is sent when the matching is successful and the hardware matching flow table includes an upload action item, or the message is sent by the smart network card when the message matches the hardware matching flow table on the smart network card. Sent when the match fails, or the message is sent by the smart network card after the message fails to match the data plane hash table on the smart network card;
  • the VS matches the packet with the open source flow table on the VS, and performs traffic management on the packet according to the matching result.
  • a management device which device includes: a processor configured to implement management of flow table rules as in any one of the above-mentioned first aspect, second aspect, fifth aspect, or sixth aspect.
  • the method, or, is used to implement the traffic management method as described in any one of the third aspect, the fourth aspect, the seventh aspect, or the eighth aspect.
  • the device is a chip.
  • the device is a network device, and the type of the network device includes at least one of the following: a router, a switch, or a server.
  • a management system in a tenth aspect, includes a VS and a smart network card.
  • the smart network card is used to execute the management method of the flow table rules in any one of the above first and fifth aspects.
  • the VS is used to execute the above mentioned flow table rules.
  • the management method of flow table rules in either aspect 2 or aspect 6.
  • a management system in an eleventh aspect, includes a VS and a smart network card.
  • the smart network card is used to perform the traffic management method in any one of the above third and seventh aspects.
  • the VS is used to perform the above fourth aspect. Or any traffic management method in the eighth aspect.
  • a network device in a twelfth aspect, includes a processor.
  • the processor is coupled to a memory.
  • At least one program instruction or code is stored in the memory.
  • the at least one program instruction or code is loaded and executed by the processor.
  • the network device is allowed to implement the flow table rule management method in any one of the above-mentioned first aspect, second aspect, fifth aspect or sixth aspect, or to implement the above-mentioned third aspect, fourth aspect or seventh aspect or The traffic management method described in any one of the eighth aspects.
  • a computer-readable storage medium is provided. At least one instruction is stored in the storage medium, and the instruction is loaded and executed by a processor, so that the computer implements the above-mentioned first or second aspect or The management method of flow table rules in any one of the fifth or sixth aspects, or the traffic management method described in any one of the third or fourth aspect, the seventh or the eighth aspect, is implemented.
  • a computer program (product) is provided.
  • the computer program (product) includes a computer program.
  • the computer program When the computer program is run by a computer, it causes the computer to execute the above-mentioned first aspect or the second aspect or the fifth aspect.
  • a communication device which includes: a transceiver, a memory, and a processor.
  • the transceiver, the memory and the processor communicate with each other through an internal connection path, the memory is used to store instructions, and the processor is used to execute the instructions stored in the memory to control the transceiver to receive signals and control the transceiver to send signals.
  • the processor executes the instructions stored in the memory, the processor is caused to execute the flow table rule management method as in any one of the above-mentioned first aspect, second aspect, fifth aspect or sixth aspect, or, execute The traffic management method as described in any one of the above third aspect, fourth aspect, seventh aspect or eighth aspect.
  • processors there are one or more processors and one or more memories.
  • the memory may be integrated with the processor, or the memory may be provided separately from the processor.
  • the memory can be a non-transitory memory, such as a read-only memory (ROM), which can be integrated on the same chip as the processor, or can be set on different On the chip, this application does not limit the type of memory and the arrangement of the memory and the processor.
  • ROM read-only memory
  • a chip including a processor for calling and running instructions stored in the memory, so that the communication device installed with the chip executes the above-mentioned first aspect, second aspect, or fifth aspect. Or the management method of flow table rules in any one of the sixth aspect, or, perform the traffic management method as described in any one of the third or fourth aspect, the seventh aspect or the eighth aspect.
  • another chip including: an input interface, an output interface, a processor, and a memory.
  • the input interface, the output interface, the processor, and the memory are connected through an internal connection path.
  • the processor is used to execute tasks in the memory.
  • Code when the code is executed, the processor is configured to execute the management method of the flow table rules in any one of the above-mentioned first aspect or the second aspect or the fifth aspect or the sixth aspect, or to execute the above-mentioned third aspect or the third aspect.
  • Figure 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application.
  • Figure 2 is a schematic diagram of another implementation environment provided by the embodiment of the present application.
  • Figure 3 is a schematic diagram of another implementation environment provided by the embodiment of the present application.
  • Figure 4 is an interactive schematic diagram of a flow table rule management method provided by an embodiment of the present application.
  • Figure 5 is a flow chart of a traffic management method provided by an embodiment of the present application.
  • Figure 6 is a schematic diagram of a flow table rule management and traffic management process provided by an embodiment of the present application.
  • Figure 7 is an interactive schematic diagram of another flow table rule management method provided by an embodiment of the present application.
  • Figure 8 is an interactive schematic diagram of another flow table rule management method provided by an embodiment of the present application.
  • FIG. 9 is a flow chart of another traffic management method provided by an embodiment of the present application.
  • Figure 10 is a schematic diagram of another flow table rule management and traffic management process provided by the embodiment of the present application.
  • Figure 11 is a schematic diagram of another flow table rule management and traffic management process provided by the embodiment of the present application.
  • Figure 12 is an interactive schematic diagram of another flow table rule management method provided by an embodiment of the present application.
  • Figure 13 is an interactive schematic diagram of another traffic management method provided by an embodiment of the present application.
  • Figure 14 is a schematic diagram of another flow table rule management and traffic management process provided by the embodiment of the present application.
  • Figure 15 is an interactive schematic diagram of another flow table rule management method provided by an embodiment of the present application.
  • Figure 16 is a schematic structural diagram of a flow table rule management device provided by an embodiment of the present application.
  • Figure 17 is a schematic structural diagram of another flow table rule management device provided by an embodiment of the present application.
  • Figure 18 is a schematic structural diagram of a traffic management device provided by an embodiment of the present application.
  • FIG. 19 is a schematic structural diagram of another traffic management device provided by an embodiment of the present application.
  • Figure 20 is a schematic structural diagram of a network device provided by an embodiment of the present application.
  • Figure 21 is a schematic structural diagram of another network device provided by an embodiment of the present application.
  • Smart network cards are also called smart network adapters.
  • smart network cards In addition to completing the network transmission functions of standard network cards, smart network cards also provide built-in programmable and configurable hardware acceleration engines. Smart network cards can not only improve the performance of applications, but also significantly reduce the consumption of the central processing unit (CPU) in communication, thus providing more CPU resources for applications. Because of this, as network bandwidth increases, some traffic management operations of VS can be implemented by smart network cards.
  • CPU central processing unit
  • the embodiment of this application provides a flow table rule management method and a traffic management method, so that after the VS delivers the flow table rules to the smart network card, it can manage the flow table rules on the smart network card, and further based on the flow table rules Carry out traffic management.
  • the method provided by the embodiment of the present application can be applied in the implementation environment shown in Figure 1.
  • the implementation environment includes SDN controller, VS and intelligent network card.
  • the SDN controller is connected to the VS, and at least one smart network card is plugged into the VS (only one is used as an example in Figure 1 for illustration).
  • VS is a virtual switch that supports the OpenFlow protocol.
  • the OpenFlow protocol is a set of SDN control protocols. Different manufacturers use this standard to make switches and controllers compatible with each other, thereby facilitating the implementation of SDN.
  • VS can be an open source virtual switch (OVS).
  • OVS open source virtual switch
  • the SDN controller manages all flow tables, and the flow tables include one or more flow matching rules.
  • the SDN controller delivers an OpenFlow table to the VS, which contains at least one OpenFlow matching rule.
  • the VS can generate an ACL based on the OpenFlow table, that is, generate one or more ACL flow matching rules.
  • the OpenFlow table and ACL can be managed on VS, that is, OpenFlow matching rules and ACL flow matching rules can be managed.
  • the ACL includes but is not limited to at least one of an ingress ACL and an egress ACL.
  • the ACL flow matching rules generated by the VS include but are not limited to ingress ACL flow matching rules and egress ACL.
  • Inbound ACL flow matching rules are used to control access to packets in the inbound direction
  • outbound ACL flow matching rules are used to control access to packets in the outbound direction.
  • VS can also generate at least one of a fuzzy match flow (MegaFlow) table and an exact match flow (extract match cache, EMC) table based on the OpenFlow table.
  • a fuzzy match flow MegaFlow
  • EMC exact match cache
  • VS can manage OpenFlow tables, ACLs, fuzzy matching flow tables and exact matching flow tables on VS.
  • the fuzzy matching flow table includes at least one fuzzy flow matching rule
  • the exact matching flow table includes at least one precise flow matching rule
  • the ACL includes at least one ACL flow matching rule
  • the at least one ACL flow matching rule includes incoming At least one of ACL flow matching rules and outbound ACL flow matching rules.
  • DPDK data plane development kit
  • VS runs a data plane development kit (DPDK).
  • DPDK is a simple and complete open source framework that provides fast packet processing in data plane applications.
  • VS Connect with smart network cards through this open source framework.
  • Different smart network cards can be registered to the open source framework through the driver on the smart network card, thereby binding the VS to the smart network card. From this, VS can obtain relevant information about the smart network card, such as port information.
  • the open source framework includes multiple open source interfaces, namely application programming interface (API).
  • API application programming interface
  • FIG. 4 is an interaction diagram of the method for managing flow table rules.
  • the management method is implemented by the interaction between the VS and the smart network card. As shown in Figure 4, the method includes but is not limited to the following steps 401 to 403.
  • Step 401 VS obtains ACL flow matching rules, which are used by the smart network card to perform operation and maintenance function management on packets.
  • the SDN controller can deliver an OpenFlow table to the VS, and the VS can generate an ACL based on the OpenFlow table, that is, generate one or more ACL flow matching rules. Afterwards, VS can deliver the generated ACL flow matching rules to the smart network card.
  • the ACL flow matching rules include at least one of inbound ACL flow matching rules and outbound ACL flow matching rules. Any ACL flow matching rule is used by the smart network card to perform operation and maintenance function management of packets. If the ACL flow matching rule only includes inbound ACL flow matching rules, the incoming ACL flow matching rule can be used by the smart network card in the inbound direction. Operation and maintenance function management.
  • the outgoing ACL flow matching rules can be used for outbound O&M function management of the intelligent NIC. If the ACL flow matching rules include both inbound and outbound ACL flow matching rules, the smart NIC can be used to manage both the inbound and outbound O&M functions.
  • Step 402 VS instructs the intelligent network card to manage ACL flow matching rules.
  • VS After VS delivers the ACL flow matching rules to the smart network card, it can instruct the smart network card to manage the ACL flow matching rules, thereby delivering the ACL flow matching rules to the smart network card, so that the smart network card has operation and maintenance functions.
  • the VS instructs the smart network card to manage ACL flow matching rules, including but not limited to creating ACL flow matching rules, deleting ACL flow matching rules, and querying statistical information based on ACL flow matching rules and other operation and maintenance functions.
  • Step 403 The intelligent network card manages ACL flow matching rules.
  • the smart network card receives the ACL flow matching rules issued by the VS and manages the ACL flow matching rules according to the instructions of the VS.
  • the VS instructs the intelligent network card to manage ACL flow matching rules and the intelligent network card to manage ACL flow matching rules, including but not limited to the following situations.
  • VS instructs the smart network card to create an ACL flow matching rule.
  • the VS and the smart network card are connected through an open source framework, which includes multiple open source interfaces, that is, APIs, the VS can obtain the port information of the smart network card. Therefore, when VS instructs the smart network card to manage the ACL flow matching rules, VS can call the first API to send the first message to the smart network card.
  • the first message includes the port identifier of the first port of the smart network card.
  • the first message is used by the smart network card to Create the first ACL flow matching rule on the first port of the smart NIC.
  • the smart network card can create an ACL flow matching rule on the corresponding port, thereby improving the accuracy of creating an ACL flow matching rule.
  • the first API corresponds to the flow table entry creation function.
  • VS calls the first API, that is, it implements the call to the flow table entry creation function, and then uses the first API to encapsulate the first API.
  • message and sends the first message to the smart network card. Since the first message includes the port identifier of the first port of the smart network card, the smart network card can determine on which port to create the first ACL flow matching rule after receiving the first message.
  • the first message in addition to the port identifier of the first port of the smart network card, also includes at least one of flow table rule attributes, flow table rule matching items, and flow table rule action items.
  • the flow table rule attribute is used to indicate at least one of the group to which the packet needs to match, the direction information of the first ACL flow matching rule, and the flow table type
  • the flow table rule matching items include matching Ethernet layer information, matching Virtual local area network (VLAN) information, matching Internet protocol version 4 (IPv4) information or matching Internet protocol version 6 (IPv6) information, matching virtual extensible local area network, VXLAN) information, end of matching items, and at least one of packet tags
  • flow table rule action items include flow table statistics, sampling forwarding and flow mirroring, setting internal tags for packets, modifying specified fields, and refnum operations at least one of them.
  • the flow table entry creation function and the content and description of the first message may be as shown in Table 1 below.
  • the reserved field corresponds to the high two bits of the reserved bits
  • the flow table rule type is represented by the high two bits of the reserved bits.
  • the high two digits of the reserved parameter are 3, indicating that the flow table rule type created is an ACL flow matching rule.
  • the flow table rule matching items in the above Table 1 include but are not limited to the content shown in the following Table 2.
  • the flow table rule action items in Table 1 include but are not limited to the content shown in Table 3 below.
  • the smart NIC can specify the ACL flow matching rule. direction, such as ingress ACL flow matching rules or egress ACL flow matching rules.
  • the smart network card performs inbound ACL flow matching rules on the received packets, and then forwards them on the Layer 2 and Layer 3 networks, and then The process of executing outbound ACL flow matching rules.
  • the smart network card also supports grouping ACL flow matching rules.
  • ACL flow matching rules in the same port and the same direction can be matched and queried for each group.
  • different rule group numbers can be identified through the group parameter in Table 1.
  • the ACL flow matching rules in the method provided by the embodiments of this application can set a TAG mark for the packets when inbound, and the statistics of the packets can be realized by matching the TAG mark when going outbound.
  • the ACL flow matching rules support any combination of flow table rule matching items.
  • the method provided by the embodiments of the present application may not perform mask matching on certain bits of a certain flow table rule matching item, but each flow table rule matching item may be determined by masking whether it is a The flow table rule matches shown in Table 2 above.
  • ACL flow matching rules support any combination of the flow table rule action items in Table 3 above. For example, based on Table 3, you can use the reference 1 handle operation.
  • the method further includes: the smart network card sends a second message to the VS, and the second message indicates to create the first ACL flow matching rule on the first port of the smart network card. result.
  • the second message includes the port identification of the first port and the result of creating the first ACL flow matching rule.
  • the return value is 0.
  • the return value is a flow table entry object pointer. If the result of creating the first ACL flow matching rule is failure, the return value is a null pointer.
  • VS receives the second message sent by the smart network card. Since the second message is used to indicate the result of creating the first ACL flow matching rule on the first port of the smart network card, the VS can obtain the result of creating the first ACL flow matching rule on the first port of the smart network card based on the second message. . For example, if the second message includes the corresponding return value when the result of creating the first ACL flow matching rule is successful, then VS can determine that the smart network card successfully created the first ACL flow matching rule. If the second message includes error information, then VS It can be determined that the smart network card failed to create the first ACL flow matching rule. Increases reliability by returning results to VS indicating the creation of ACL flow matching rules.
  • VS instructs the smart network card to delete the ACL flow matching rule.
  • VS instructs the smart network card to manage the ACL flow matching rules, including: VS calls the second API to send a third message to the smart network card. The third message is used by the smart network card to delete the second ACL flow matching rule on the smart network card.
  • the embodiment of this application does not limit the second API.
  • VS can call the second API, and then encapsulate the third message through the second API, and send the third message to the smart network card.
  • the third message may include a port identifier of the second port of the smart network card to instruct the smart network card to delete the second ACL flow matching rule created on the second port.
  • the third message may also include flow information.
  • the flow information includes information such as ACL matching rule direction and ACL matching rule items, thereby instructing the smart network card to delete the data corresponding to the port identification through the third message.
  • ACL flow matching rules corresponding to the flow information on the port is information such as ACL matching rule direction and ACL matching rule items, thereby instructing the smart network card to delete the data corresponding to the port identification through the third message.
  • the first port in the embodiment of the present application can be the same as the second port, then the first ACL flow matching rule is the same as the second ACL flow matching rule. After the first ACL flow matching rule is created, the matching rule can be supported. First ACL Deletion of flow matching rules.
  • the first port may be different from the second port, and the second ACL flow matching rule is different from the second ACL flow matching rule.
  • This embodiment of the application does not determine whether the created and deleted ACL flow matching rules match the same ACL flow.
  • the rules are limited.
  • the second API corresponds to the flow table entry deletion function.
  • the content of the flow table entry deletion function can be shown in Table 4 below.
  • the smart network card manages the ACL flow matching rules, including: the smart network card receives the third message sent by VS by calling the second API, and deletes the second ACL flow matching rule on the smart network card based on the third message.
  • the smart network card can also return the result of deleting the second ACL flow matching rule to VS. For example, if the deletion is successful, a message with a value of 0 is returned to VS, so that VS determines the smart network card based on the return value.
  • the second ACL flow matching rule is successfully deleted.
  • the smart network card fails to delete the second ACL flow matching rule, an error message is returned. For example, the parameter of the error message defaults to a null value (null), so that VS determines that the smart network card has not successfully deleted the second ACL based on the returned error message.
  • Stream matching rules if the deletion is successful, the return value is a flow table entry object pointer. If the result of deleting the first ACL flow matching rule is failure, the return value is a null pointer.
  • VS instructs the smart network card to query statistical information.
  • VS instructs the smart network card to manage ACL flow matching rules, including: VS calls a third API to send a fourth message to the smart network card. Among them, the fourth message is used to query the smart network card and return the statistical information of the smart network card.
  • This application does not limit the third API.
  • VS needs to query the statistical information on the smart network card, it sends a fourth message to the smart network card by calling the third API.
  • the VS encapsulates the fourth message by calling the third API.
  • the fourth message includes the port identifier of the port on the smart network card, which is used for the smart network card to query and return statistical information on the port corresponding to the port identifier. For example, if the ACL flow matching rule includes a flow table statistics action item, then after the smart network card performs the flow table statistics action, the VS can query the statistical information on the smart network card through the fourth message.
  • the VS can also call the third API to send the fourth message to the smart network card to query the statistical information on the smart network card.
  • the query VS sends to ACL rule entries on the smart NIC.
  • VS calls the third API, that is, calls the open source query function.
  • the content of the query function can be as shown in Table 5 below.
  • the smart network card manages ACL flow matching rules, including: the smart network card receives the fourth message sent by VS by calling the third API, and queries and returns the statistical information of the smart network card based on the fourth message. Realizing statistical information through the fourth message Information query makes the management of flow table rules more flexible.
  • the smart network card can also return query results to VS. For example, if the query is successful, a message with a value of 0 is returned to VS, so that VS determines that the smart network card has successfully queried the flow table rule based on the return value. entry. For another example, if the smart network card query fails, error information is returned. For example, the parameter of the error message defaults to null, so that VS determines that the smart network card has not queried the entry of the flow table rule based on the returned error information. Or, if the query is successful, the return value is a flow table entry object pointer. If the query fails, the return value is a null pointer.
  • the method provided by the embodiment of this application does not require traffic triggering by issuing operation and maintenance rules to the smart network card.
  • operation and maintenance capability When the operation and maintenance capability is enabled, there is no need to clear the existing forwarding flow table entries on the smart network card, and the first packet does not need to be uploaded.
  • operation and maintenance functions such as counting and statistics are implemented through smart network cards, that is, counting and statistics are implemented by hardware. Compared with software implementation, the statistical results are more accurate.
  • an embodiment of the present application provides a traffic management method.
  • the traffic management method provided by the embodiment of the present application includes the following steps 501 and 502.
  • Step 501 The smart network card receives the message and matches the message with the ACL flow matching rule created on the smart network card.
  • the embodiments of this application do not limit the type of packets received by the smart network card.
  • the packets may be packets from audio and video applications, or may be packets from game applications, or may also be packets from instant messaging applications. Messages etc.
  • the embodiment of the present application does not limit the number of packets received by the smart network card. Each packet can be managed according to the traffic management method provided by the embodiment of the present application.
  • the ACL flow matching rules created on the smart network card include at least one of inbound ACL flow matching rules and outgoing ACL flow matching rules.
  • Any ACL flow matching rule is used by the smart network card to perform operation and maintenance function management of packets. . For example, if the ACL flow matching rule only includes the incoming ACL flow matching rule, the smart NIC will match the packet with the incoming ACL flow matching rule. If the ACL flow matching rule only includes the outbound ACL flow matching rule, the smart NIC matches the packet with the outgoing ACL flow matching rule. If the ACL flow matching rule includes both inbound and outbound ACL flow matching rules, the smart NIC will match the packet with the inbound ACL flow matching rule and the outbound ACL flow matching rule respectively.
  • the flow table rule matching items in the ACL flow matching rule may be as shown in Table 2 above.
  • the smart network card matches the packet with each flow table rule matching item in the ACL flow matching rule. If the packet matches any flow table rule matching item, the packet is considered to successfully match the ACL flow matching rule.
  • the flow table rule matching item ETH includes matching item parameters such as source MAC address, destination MAC address, and protocol type. .
  • the smart network card After receiving the message, the smart network card obtains the source MAC address, destination MAC address and protocol type of the message. If the source MAC address, destination MAC address and protocol type of the message match the flow table rule ETH in the ACL flow matching rule If the included source MAC address, destination MAC address, and protocol type match, it is determined that the packet successfully matches the ACL flow matching rules.
  • the report is determined to be The file failed to match the ACL flow matching rule.
  • Step 502 Based on the successful match between the packet and the ACL flow matching rule, the smart network card performs operation and maintenance function management on the packet according to the ACL flow matching rule.
  • the ACL flow matching rules include inbound ACL flow matching rules and outgoing ACL flow matching rules; based on the successful matching of the packet and the ACL flow matching rule, the smart network card processes the packet according to the ACL flow matching rule.
  • Carry out operation and maintenance function management including: based on successful matching between packets and inbound ACL flow matching rules, the smart network card performs inbound operation and maintenance function management on the packets based on the incoming ACL flow matching rules; the smart network card processes the packets Layer 2 and Layer 3 network forwarding; based on successful matching between the packet and the outbound ACL flow matching rules, the smart network card performs outbound operation and maintenance function management on the packets based on the outbound ACL flow matching rules.
  • the method provided by the embodiment of the present application is illustrated by taking the management of flow table rules and the traffic management process shown in Figure 6 as an example.
  • Figure 6 after VS generates inbound ACL flow matching rules and outbound ACL flow matching rules based on the OpenFlow table issued by the SDN controller, as shown by the dotted arrow in Figure 6, the inbound ACL flow matching rules and The outbound ACL flow matching rules are delivered to the smart network card, and the flow table rules are managed on the smart network card.
  • the management process of the flow table rules please refer to the management method of the flow table rules shown in Figure 4 above, and will not be described again here.
  • the smart network card after receiving the message, the smart network card first matches the message with the incoming ACL flow matching rules. If the match is successful, the smart network card processes the message according to the incoming ACL flow matching rules. Carry out inbound operation and maintenance function management, that is, execute the actions corresponding to the flow table rule action items, such as performing inbound flow table statistics, setting TAG marks for packets, etc. After executing the action corresponding to the action item of the flow table rule, the smart network card forwards the packet on the Layer 2 and Layer 3 network.
  • the packet Before the packet leaves the smart network card, the packet is matched based on the outbound ACL flow matching rules. If the match is successful, the smart network card performs outbound operation and maintenance function management on the packet based on the outbound ACL flow matching rules. For example, perform outbound flow table statistics on packets, and perform packet statistics based on the TAG set in the inbound direction.
  • the method provided by the embodiment of this application also includes: based on the failure of matching the packet with the inbound ACL flow matching rule or the outgoing ACL flow matching rule, there is no need to execute the flow table rule action item in the ACL flow matching rule, intelligent The network card forwards the packets directly to the second and third layer networks.
  • the ACL flow matching rules managed by the smart network card may also include only inbound ACL flow matching rules, or only outbound ACL flow matching rules.
  • the smart NIC only includes inbound ACL flow matching rules, or only outbound ACL flow matching rules.
  • the VS can deliver only incoming ACL flow matching rules to the smart NIC or only outbound ACL flow matching rules.
  • Smart NIC or the VS delivers the incoming ACL flow matching rules and outgoing ACL flow matching rules to the smart NIC, and then instructs the incoming ACL flow matching rules or the outgoing ACL flow matching rules to be deleted.
  • the process of deleting ACL flow matching rules please refer to the relevant instructions in the management method of flow table rules shown in Figure 4 above, and will not be described again here.
  • the smart NIC After receiving the packet, the smart NIC first matches the packet with the incoming ACL flow matching rules. If the match is successful, the smart network card performs inbound operation and maintenance function management on the packets based on the inbound ACL flow matching rules, that is, performs the actions corresponding to the action items of the flow table rules, such as performing inbound flow table statistics and updating packets. Set TAG tags, etc. After executing the action corresponding to the action item of the flow table rule, the smart network card forwards the packet on the Layer 2 and Layer 3 network.
  • the smart NIC After receiving the packet, the smart NIC first forwards the packet for reasons. Before the packet leaves the smart network card, the packet is matched with the outbound ACL flow matching rules. If the match is successful, the smart network card performs outbound operation and maintenance function management on the packet based on the outgoing ACL flow matching rules, that is, executes the flow table The action corresponding to the rule action item, such as performing outbound flow table statistics, etc. After executing the action corresponding to the action item of the flow table rule, the smart network card forwards the packet on the Layer 2 and Layer 3 network.
  • the intelligent network card when the operation and maintenance capability is enabled, implements the management of the operation and maintenance function. There is no need to clear the existing flow table entries on the intelligent network card, and the received messages do not need to be sent to the VS for processing. Re-learning does not require traffic triggering. You only need to deliver the ACL flow matching rules to the smart network card, and let the received packets pass through the smart network card for ACL flow rule matching. Therefore, the smart network card has highly maintainable and reliable operation. Dimensional ability. Furthermore, operation and maintenance functions such as counting and statistics are implemented through smart network cards, that is, counting and statistics are implemented by hardware. Compared with software implementation, the statistical results are more accurate.
  • FIG. 7 is an interaction diagram of the method for managing flow table rules.
  • the management method is implemented by the interaction between the VS and the smart network card. As shown in Figure 7, the method includes but is not limited to the following steps 701 to 703.
  • Step 701 VS obtains a hardware matching flow table, which is used by the smart network card to manage traffic.
  • the hardware matching flow table includes at least one of a hardware exact matching flow table and a hardware fuzzy matching flow table.
  • the SDN controller can deliver an OpenFlow table to the VS, and the VS can generate a hardware (hardware, hw) matching flow table based on the OpenFlow table.
  • the hardware matching flow table includes one or more pieces of hardware. Match flow rules.
  • VS can deliver the generated hardware matching flow table to the smart network card.
  • the hardware matching flow table includes at least one of a hardware exact matching flow table (hw EMC) and a hardware fuzzy matching flow table (hw MegaFlow).
  • the table capacity of the hardware exact matching flow table is larger than that of the hardware fuzzy matching flow table, but the table lookup efficiency of the hardware fuzzy matching flow table is higher than the table lookup efficiency of the hardware exact matching flow table.
  • the hardware fuzzy matching flow table includes entries for sending and processing specified types of packets.
  • the specified type of packets includes Internet Control Message Protocol (ICMP). /Dynamic Host Configuration Protocol (DHCP)/Address Resolution Protocol (ARP) messages, etc. This entry can be hit preferentially compared to other aggregate entries in the hardware fuzzy matching flow table.
  • ICMP Internet Control Message Protocol
  • DHCP Dynamic Host Configuration Protocol
  • ARP Address Resolution Protocol
  • the hardware fuzzy matching flow table in the embodiment of the present application is used to match the first packet, which is a packet generated by a network element whose flow table entry satisfies the first threshold condition; the hardware precise matching flow The table is used to match the second message, and the second message is a message generated by a network element that meets the second threshold condition.
  • the embodiments of the present application do not limit the first threshold condition and the second threshold condition.
  • the first threshold condition and the second threshold condition can be set based on experience or based on application scenarios.
  • the VS combines the flow table rule settings of the controller to generate oversized flow table entries, that is, the traffic generated by network elements that meet the first threshold condition is set as fuzzy matching.
  • the flow table is sent to the smart network card, and other scenarios are used to meet the second For network elements with threshold conditions, use the exact matching flow table and deliver it to the smart network card. That is to say, the second threshold condition may refer to a condition other than the first threshold condition, that is, the second message is any message other than the first message.
  • Step 702 VS instructs the intelligent network card to manage the hardware matching flow table.
  • VS After VS delivers the hardware matching flow table to the smart network card, it can instruct the smart network card to manage the hardware matching flow table, thereby delivering the hardware matching flow table to the smart network card, so that the smart network card has traffic management functions.
  • the VS instructs the smart network card to manage hardware matching flow tables including but not limited to managing at least one of a hardware exact matching flow table and a hardware fuzzy matching flow table.
  • Step 703 The smart network card manages the hardware matching flow table.
  • the smart network card receives the hardware matching flow table issued by VS and manages the hardware matching flow table according to the instructions of VS.
  • the VS instructs the intelligent network card to manage the hardware matching flow table and the intelligent network card to manage the hardware matching flow table, including but not limited to the following interactive process.
  • VS can obtain the port information of the smart network card. Therefore, when VS instructs the smart network card to manage the hardware matching flow table, VS can call the corresponding first API to send the fifth message to the smart network card.
  • the fifth message includes the port identification of the target port of the smart network card. The fifth message is used for the smart network card. Create a hardware matching flow table on the target port of the smart NIC.
  • the embodiment of the present application does not limit the first API.
  • the first API corresponds to the flow table entry creation function
  • VS calls the first API, that is, to implement the flow table entry creation function. Call, and then encapsulate the fifth message through the first API, and send the fifth message to the smart network card. Since the fifth message includes the port identification of the target port of the smart network card, the smart network card can determine on which port to create the hardware matching flow table after receiving the fifth message.
  • the flow table entry creation function and the content and description of the fifth message may be as shown in Table 6 below.
  • the reserved parameter corresponds to the high two bits of the reserved bits
  • the flow table rule type is represented by the high two bits of the reserved bits.
  • the high two bits of the reserved parameter are at least one of 0 and 1.
  • 0 means that the flow table rule type created is an exact routing and forwarding rule, that is, the hardware accurately matches the flow table.
  • 1 means that the created flow table rule type is a destination IP fuzzy matching rule, that is, a hardware fuzzy matching flow table.
  • the fifth message in addition to the port identification of the target port of the smart network card, also includes at least one of a flow table rule attribute, a flow table rule matching item, and a flow table rule action item.
  • the flow table rule attribute is used to indicate at least one of the group and flow table type that the packet needs to match;
  • the flow table rule matching items include but are not limited to the rule matching items shown in Table 2 and the ones shown in Table 7. Rule matches.
  • the rule matching items include matching Ethernet layer information, matching virtual local area network (VLAN) information, matching Internet Protocol version 4 (IPv4) information, or matching Internet Protocol version 6 ( At least one of internet protocol version 6 (IPv6) information, matching virtual extensible local area network (VXLAN) information, end of matching items, and packet tags; as shown in Table 7, the rule matching items include matching data surfaces. Hash (datapath_hash, dp_hash) value, matching redirection ID (recirc_id).
  • the flow table rule action items include but are not limited to the rule action items shown in Table 8 and the rule action items shown in Table 9; the rule action items shown in Table 8 include flow table statistics, forward to port, and pop-up (POP) VLAN , push (PUSH) VLAN, set VLAN ID, set VLAN priority, decapsulate vxlan header, encapsulate vxlan header, Vxlan header key value, time to live value (time to live, TTL) minus one, modify the source mac address , at least one of modifying the destination mac address, sampling forwarding and flow mirroring, ending the action (ACTION), setting an internal mark for the packet, modifying the specified field, refnum operation, and discarding the packet.
  • the rule action items shown in Table 9 include executing dp-hash actions, matching dp-hash secondary table recirc_id, and sending packets to the VS software control plane.
  • the method provided by the embodiment of the present application also includes steps 704 to 706.
  • Step 704 VS obtains the data plane hash table.
  • the data plane hash table is used by the intelligent network card to perform multi-path forwarding of multi-path forwarding packets.
  • the SDN controller can deliver an OpenFlow table to the VS, and the VS can generate a hardware matching flow table based on the OpenFlow table.
  • the hardware matching flow table includes one or more hardware matching flow rules.
  • VS can deliver the generated hardware matching flow table to the smart network card.
  • the hardware matching flow table includes at least one of a hardware exact matching flow table (hardware EMC, hw EMC) and a hardware fuzzy matching flow table (hw MegaFlow).
  • the hardware matching flow table includes at least one of a hash matching action item, a redirection identifier matching action item, and a packet uploading VS software control plane matching action item.
  • VS also delivers the data plane hash table (Datapath-Hash).
  • the hash matching action item is used to indicate the query action of the data plane hash table
  • the redirection ID is used to indicate the data plane hash table.
  • the data plane hash table includes a hash value, a mask, and a redirection identifier. The mask corresponds to Next hop information.
  • Step 705 VS manages the data plane hash table on the smart network card.
  • VS After VS delivers the hardware matching flow table to the smart network card, it can also deliver the data plane hash table to the smart network card and instruct the smart network card to manage the data plane hash table, thereby realizing the delivery of the hardware matching flow table to the smart network card. to save hardware Configure the entries in the flow table and offload the traffic to the smart network card, so that the smart network card has the traffic management function.
  • Step 706 The smart network card manages the data plane hash table.
  • the data plane hash table is used by the smart network card to perform multi-path forwarding of multi-path forwarding messages.
  • the smart network card receives the data plane hash table issued by VS and manages the data plane hash table according to the instructions of VS.
  • the VS instructs the smart network card to manage the data plane hash table and the smart network card to manage the data plane hash table, including but not limited to the following interaction process.
  • VS can obtain the port information of the smart network card. Therefore, when VS instructs the smart network card to manage the data plane hash table, VS can call the corresponding first API to send the sixth message to the smart network card. The sixth message is used by the smart network card to create the data plane hash table on the target port of the smart network card. .
  • the embodiment of the present application does not limit the first API.
  • the first API corresponds to the flow table entry creation function
  • VS calls the first API, that is, to implement the flow table entry creation function. Call, and then encapsulate the sixth message through the first API, and send the sixth message to the smart network card. Since the data plane hash table reuses the first API, the smart network card can determine on which port the data plane hash table is to be created after receiving the sixth message.
  • the flow table entry creation function and the content and description of the sixth message may be as shown in Table 11 below.
  • the reserved parameter corresponds to the high two bits of the reserved bits
  • the flow table rule type is represented by the high two bits of the reserved bits.
  • the high two bits of the reserved parameter are 2.
  • 2 means that the flow table rule type created is a data plane hash table, that is, DP-HASH.
  • DP-HASH related flow table entries are configured in OpenFlow
  • the next hop information is delivered to the DP-HASH table. This means that the DP-HASH function is enabled.
  • the hardware matches the entries in the flow table. If the action is DP_HASH, then It will be queried through the DP-HASH table, otherwise it will not be queried.
  • the entries in the hardware matching flow table need to support the two action fields DP HASH and RECIRC_ID, which include two rule action items: executing the dp-hash action and matching the dp-hash secondary table recirc_id, as shown in Table 12 below.
  • the data plane hash table can be shown in Table 13.
  • Figure 8 only takes the example of VS first delivering the hardware matching flow table, instructing the smart network card to manage the hardware matching flow table, and then delivering the data plane hash table, instructing the smart network card to manage the data plane hash table.
  • the VS can deliver a hardware matching flow table and a data plane hash table at the same time, instructing the smart network card to manage the hardware matching flow table and data plane hash table.
  • the data plane hash table is delivered first, and then the hardware matching flow table is delivered.
  • the embodiment of this application does not Limit the delivery and management order of the file matching flow table and data plane hash table.
  • the hardware matching flow table includes at least one of a hardware exact matching flow table and a hardware fuzzy matching flow table.
  • the forwarding performance of the hardware exact matching flow table is lower than that of the hardware fuzzy matching flow table.
  • choosing hardware fuzzy matching flow tables to deliver them to smart network cards can ensure the highest forwarding performance in major scenarios.
  • the network element delivers the hardware fuzzy matching flow table to the smart network card in a large traffic scenario, which reduces the number of flow tables generated by the hardware exact matching flow table.
  • the hardware fuzzy matching flow table itself does not have many entries. Therefore, when the OpenFlow configuration changes, significant Improved traffic stability and reduced traffic oscillation.
  • the method includes step 901 and step 902.
  • Step 901 The smart network card receives the packet and matches the packet with the hardware matching flow table.
  • the embodiments of this application do not limit the type of packets received by the smart network card.
  • the packets may be packets from audio and video applications, or may be packets from game applications, or may also be packets from instant messaging applications. Messages etc.
  • the embodiment of the present application does not limit the number of packets received by the smart network card. Each packet can be managed according to the traffic management method provided by the embodiment of the present application.
  • the hardware matching flow table created on the smart network card includes at least one of a hardware exact matching flow table and a hardware fuzzy matching flow table. For example, if the hardware matching flow table includes a hardware exact matching flow table, the smart NIC matches the packet with the flow matching rules in the hardware exact matching flow table. If the hardware matching flow table includes a hardware fuzzy matching flow table, the smart network card matches the packet with the flow matching rules in the hardware fuzzy matching flow table. If the hardware matching flow table includes a hardware exact matching flow table and a hardware fuzzy matching flow table, the smart network card will match the packet with the flow matching rules in the hardware exact matching flow table and the hardware fuzzy matching flow table respectively.
  • the flow table rule matching items in the hardware exact matching flow table and the hardware fuzzy matching flow table may be as shown in Table 2 and Table 7 above.
  • the smart network card matches the packet with each flow table rule match. If the packet matches any flow table rule match, the packet is considered to be successfully matched with the hardware matching flow table.
  • the hardware matching flow table includes the flow table rule matching items used to match VLAN information in Table 2 as an example for explanation.
  • the flow table rule matching items include parameter name, vlan tci value and inner protocol type.
  • the smart network card After receiving the message, the smart network card obtains the parameter name, vlan tci value and inner protocol type of the message. If the parameter name, vlan tci value and inner protocol type of the message match the hardware, the flow matching rules in the flow table include If the flow table rule matching items include the parameter name, vlan tci value, and inner protocol type, it is determined that the packet matches the hardware matching flow table successfully.
  • the packet fails to match the hardware matching flow table.
  • Step 902 The smart network card performs traffic management on the packet based on the matching result between the packet and the hardware matching flow table.
  • VS generates hardware precision based on the OpenFlow table issued by the SDN controller.
  • hw EMC matching flow
  • hw MegaFlow hardware fuzzy matching flow
  • Flow table rules are managed on the smart network card.
  • the management process of the flow table rules please refer to the management method of the flow table rules shown in Figure 7 above, and will not be described again here.
  • the smart network card after receiving the message, the smart network card first matches the message with the hardware fuzzy matching flow table. If the match is successful, the smart network card performs traffic management on the message based on the hardware fuzzy matching flow table. That is, the action corresponding to the flow table rule action item included in the flow matching rule in the hardware fuzzy matching flow table is executed. After executing the action corresponding to the action item of the flow table rule, the smart network card continues to transmit the packet.
  • the smart network card matches the packet with the hardware fuzzy matching flow table, if the packet does not match the hardware fuzzy matching flow table, the smart network card matches the packet with the hardware exact matching flow table. If the match is successful, the smart network card The network card performs traffic management on packets based on the hardware exact matching flow table, that is, it performs actions corresponding to the flow table rule action items included in the flow matching rules in the hardware exact matching flow table.
  • the smart network card performs traffic management on packets based on the matching results between the packets and the hardware matching flow table, including: based on the matching results between the packets and the hardware matching flow table, the smart network card If the match is successful, and the hardware matching flow table includes a upload action item, the packet will be uploaded to the VS; or, based on the matching result between the packet and the hardware matching flow table, the packet fails to match the hardware matching flow table, and the packet will be uploaded to the VS. Send VS.
  • the solid arrow pointing to VS from the hardware fuzzy matching flow table if the packet fails to match the hardware fuzzy matching flow table, or the packet hits the flow matching rule in the hardware fuzzy matching flow table, and the hit flow matching rule is Send action item, the smart network card sends the packet to VS.
  • the solid arrow pointing to VS from the hardware exact matching flow table if the packet fails to match the hardware exact matching flow table, or the packet hits the flow matching rule in the hardware exact matching flow table, and the hit flow matching rule is Send action item, the smart network card sends the packet to VS.
  • the failure of the above packet to match the hardware matching flow table means that the packet matches the hardware fuzzy matching flow table and the hardware exact matching flow table. All flow tables failed to match, that is, the packet neither hit the hardware fuzzy matching flow table nor the hardware exact matching flow table.
  • the hardware matching flow table managed by the smart network card may also include only a hardware exact matching flow table, or only a hardware fuzzy matching flow table.
  • the process of hardware matching flow tables please refer to the relevant description in the management method of flow table rules shown in Figure 7 above, and will not be described again here.
  • the smart network card matches the message with the hardware matching flow table, including: based on the message being the first message, the smart network card matches the message with the hardware fuzzy matching flow table, and the first message
  • the message is a message generated by a network element whose flow table entry satisfies the first threshold condition; or, based on the message being the second message, the smart network card matches the message with the hardware exact matching flow table, and the second message is Packets generated by network elements that meet the second threshold condition.
  • the hardware matching flow table managed by the smart network card includes the hardware fuzzy matching flow table and the hardware exact matching flow table
  • the smart network card receives the message, there is no need to compare the message with the hardware fuzzy matching flow table and the hardware exact matching flow table respectively.
  • the hardware exact matching flow table is used for matching, but it is first determined whether the packet is the first packet or the second packet, and then matched with the hardware fuzzy matching flow table or the hardware exact matching flow table. For example, if the packet received by the smart network card is the first packet, the packet can be matched with the hardware fuzzy matching flow table instead of matching with the hardware exact matching flow table. If the packet received by the smart network card is the second packet, the packet can be matched with the hardware exact matching flow table without matching with the hardware fuzzy matching flow table. In this way, traffic management is performed according to the type of packets, which improves management efficiency.
  • the message is a multi-path forwarded message.
  • the method also includes: the intelligent network card matches the message with the data plane hash table; based on the successful matching between the message and the data plane hash table, the intelligent network card The network card performs multi-path forwarding of packets.
  • the hardware matching flow table includes a hash matching action item and a turn identification matching action item; where the hash matching action item is used to indicate the query action of executing the data plane hash table, and the turn identification is used to indicate the data side hash table.
  • the data plane hash table includes hash value, mask and redirection identifier, and the mask corresponds to the next hop information;
  • the smart network card matches the message with the data plane hash table, including: the smart network card matches the action item based on the hash, calculates the hash value corresponding to the message, obtains the mask corresponding to the message based on the hash value, and matches based on the redirection identifier
  • the action item is to search the data plane hash table; based on the mask corresponding to the message being consistent with the mask in the data plane hash table, it is determined that the message and the data plane hash table are successfully matched;
  • the intelligent network card performs multi-path forwarding of packets, including: the intelligent network card performs multi-path forwarding of packets according to the next hop information corresponding to the mask in the data plane hash table.
  • the method provided by the embodiment of the present application is illustrated by taking the management of flow table rules and the traffic management process shown in Figure 11 as an example.
  • Figure 11 after VS generates the hardware exact matching flow (hw EMC) table, hardware fuzzy matching flow (hw MegaFlow) table and data plane hash table (DP Hash) based on the OpenFlow table issued by the SDN controller, as shown in Figure 11
  • hw EMC hardware exact matching flow
  • hw MegaFlow hardware fuzzy matching flow
  • DP Hash data plane hash table
  • the configuration of the hardware exact matching flow table, hardware fuzzy matching flow table and data plane hash table is delivered to the smart network card, and the flow table rules are managed on the smart network card.
  • the management process of the flow table rules please refer to the management method of the flow table rules shown in Figure 8 above, and will not be described again here.
  • the smart network card after receiving the message, the smart network card first matches the message with the hardware fuzzy matching flow table. If the match is successful, the smart network card performs traffic management on the message based on the hardware fuzzy matching flow table. That is, the action corresponding to the flow table rule action item included in the flow matching rule in the hardware fuzzy matching flow table is executed. After executing the action corresponding to the flow table rule action item, the intelligent network card matches the packet with the hardware exact matching flow table. If the match is successful, the intelligent network card performs traffic management on the packet according to the hardware exact matching flow table, that is, performs hardware exact matching. The action corresponding to the flow table rule action item included in the flow matching rule in the flow table.
  • the smart network card calculates the hash value corresponding to the message based on the hash matching action item, and obtains the mask corresponding to the message based on the hash value; matches the action item based on the redirection identifier, and searches the data plane hash table; based on the message corresponding
  • the mask is consistent with the mask in the data plane hash table, confirming that the packet matches the data plane hash table successfully. Therefore, the smart network card multipath forwards the packet according to the next hop information corresponding to the mask in the data plane hash table.
  • the flow matching rules included in the hardware matching flow table include the following two entries:
  • the smart network card calculates the hash value HASH of the message as: 01011101011.
  • the hash value is ANDed with the mask 0x11, and the result is 0x11.
  • the data plane hash table includes the following entries:
  • this result matches the fourth entry in the data plane hash table, so the next hop corresponding to the fourth entry can be Information performs multi-path forwarding of packets.
  • the hardware matching flow table includes a hash matching action item (that is, the dp-hash action is performed in Table 9 ), the steering ID matching action item (that is, the matching dp-hash secondary table recirc_id in Table 9) and the message uploading VS software control plane matching action item; among them, the hash matching action item is used to instruct the execution of data plane hashing
  • the redirection flag is used to indicate the data plane hash table.
  • the data side hash table includes the hash value, mask and redirection flag. The mask corresponds to the next hop information;
  • the smart network card matches the message with the data plane hash table, including: the smart network card matches the action item based on the hash, calculates the hash value corresponding to the message, obtains the mask corresponding to the message based on the hash value, and matches based on the redirection identifier Action item: Search the data plane hash table; based on the inconsistency between the hash value corresponding to the message and the mask in the data plane hash table, it is determined that the message fails to match the data plane hash table. In the case of matching failure, the method also includes: the smart network card sends the packet to the VS.
  • the virtual switch VS receives the packet sent by the intelligent network card.
  • the packet is successfully matched by the intelligent network card with the hardware matching flow table on the intelligent network card, and the hardware matching flow table includes the upload action item.
  • Sent either by the smart NIC after the packet fails to match the hardware matching flow table on the smart NIC, or by the smart NIC after the packet matches the data plane hash table on the smart NIC. Sent after failure.
  • the VS After receiving the packet sent by the smart network card, the VS matches the packet with the open source flow table on the VS, and performs traffic management on the packet based on the matching results.
  • the method provided by the embodiments of this application delivers the hardware matching flow table to the smart network card, which can be applied when the bandwidth increases, making traffic management more efficient.
  • the packet is selected to be matched with the corresponding hardware matching flow table to implement traffic management.
  • choosing hardware fuzzy matching flow tables to deliver them to smart network cards can ensure the highest forwarding performance in major scenarios.
  • the network element delivers the hardware fuzzy matching flow table to the smart network card, which reduces the number of flow tables generated by the hardware exact matching flow table and further improves the efficiency of traffic management. Since there are not many entries in the hardware fuzzy matching flow table itself, , when the OpenFlow configuration changes, it significantly improves the stability of the traffic and reduces the traffic oscillation.
  • the smart network card When the smart network card supports DP-HASH table processing, it can save the number of entries in the hardware matching flow table for ECMP scenarios.
  • the OpenFlow configuration changes, the stability and reliability of traffic management are significantly improved.
  • This embodiment of the present application provides a method for managing flow table rules. Refer to Figure 12. The method includes the following steps 1201 to 1203.
  • Step 1201 VS obtains ACL flow matching rules, hardware matching flow table and data plane hash table.
  • the embodiment of this application does not limit the order in which VS obtains the ACL flow matching rules, the hardware matching flow table and the data plane hash table.
  • the process of obtaining the ACL flow matching rules can refer to the relevant description of step 401 shown in Figure 4 to obtain the hardware matching.
  • For the flow table process please refer to the relevant description of step 701 shown in Figure 7.
  • For the process of obtaining the data plane hash table please refer to the relevant description of step 704 shown in Figure 8, which will not be described again here.
  • it can also manage hardware matching flow tables, making the management of flow table rules more comprehensive and more flexible.
  • Step 1202 VS instructs the smart network card to manage ACL flow matching rules, hardware matching flow tables, and data plane hash tables.
  • Step 1203 The smart network card manages ACL flow matching rules, hardware matching flow tables and data plane hash tables.
  • the embodiment of this application does not limit the order in which VS instructs the intelligent network card to manage ACL flow matching rules, the hardware matching flow table and the data plane hash table.
  • the process can refer to the relevant description of steps 402 and 403 shown in Figure 4.
  • the process of VS instructing the smart network card to manage the hardware matching flow table and the process of the smart network card managing the hardware matching flow table can refer to steps 702 and 703 shown in Figure 7.
  • the process of VS instructing the smart network card to manage the data plane hash table and the smart network card managing the data plane hash table can refer to the related descriptions of steps 705 and 706 shown in Figure 8, which will not be described again here.
  • the embodiment of the present application provides a traffic management method. See Figure 13.
  • the method includes the following steps 1301 to 1307.
  • Step 1301 The smart network card receives the packet and matches the packet with the inbound ACL flow matching rule created on the smart network card.
  • step 1301 For the implementation process of step 1301, reference can be made to step 501 shown in Figure 5 and the related description of Figure 6, which will not be described again here.
  • Step 1302 Based on the successful match between the packet and the ACL flow matching rule, the smart network card performs operation and maintenance function management on the packet according to the incoming ACL flow matching rule.
  • step 1302 For the implementation process of step 1302, reference can be made to step 502 shown in Figure 5 and the related description of Figure 6, which will not be described again here.
  • Step 1303 The smart network card matches the packet with a hardware matching flow table.
  • the hardware matching flow table includes at least one of a hardware exact matching flow table and a hardware fuzzy matching flow table.
  • step 1302 For the implementation process of step 1302, reference can be made to step 901 shown in Figure 9 and the related description of Figure 10, which will not be described again here.
  • Step 1304 The smart network card performs traffic management on the packet based on the matching result between the packet and the hardware matching flow table.
  • step 1304 For the implementation process of step 1304, reference can be made to step 902 shown in Figure 9 and the related description of Figure 10, which will not be described again here.
  • the message is a multi-path forwarding message, and the method further includes the following step 1305.
  • Step 1305 The smart network card matches the message with the data plane hash table; based on the successful match between the message and the data plane hash table, the smart network card performs multi-path forwarding of the message.
  • step 1305 For the implementation process of step 1305, reference can be made to the relevant description of the data plane hash table below step 902 shown in Figure 9 and the relevant description of Figure 11, which will not be described again here.
  • Step 1306 The smart network card matches the packet with the outbound ACL flow matching rule created on the smart network card.
  • step 1306 For the implementation process of step 1306, reference can be made to step 501 shown in Figure 5 and the related description of Figure 6, which will not be described again here.
  • Step 1307 Based on the successful match between the packet and the ACL flow matching rule, the smart network card performs operation and maintenance function management on the packet according to the outbound ACL flow matching rule.
  • step 1307 For the implementation process of step 1307, reference can be made to step 502 shown in Figure 5 and the related description of Figure 6, which will not be described again here.
  • the management process of flow table rules and the traffic management process shown in Figure 14 are taken as an example to illustrate the management method of flow table rules provided in Figure 12 and the traffic management method shown in Figure 13 in the embodiment of the present application. illustrate.
  • Figure 14 after VS generates the inbound ACL, that is, the inbound ACL flow matching rule, and the outbound ACL, that is, the outbound ACL flow matching rule, based on the OpenFlow table issued by the SDN controller, as indicated by the dotted arrows in Figure 14 Display, deliver the inbound ACL flow matching rules and outbound ACL flow matching rules to the smart NIC, and manage the flow table rules on the smart NIC.
  • the smart network card After the smart network card receives the message, as shown by the solid arrow in Figure 14, it first matches the message with the incoming ACL flow matching rules. If the match is successful, the smart network card processes the message according to the incoming ACL flow matching rules. Carry out inbound operation and maintenance function management, that is, execute the actions corresponding to the flow table rule action items, such as performing inbound flow table statistics, setting TAG marks for packets, etc. After executing the action corresponding to the flow table rule action item, the intelligent network card matches the packet with the hardware fuzzy matching flow table. If the match is successful, the intelligent network card performs traffic management on the packet according to the hardware fuzzy matching flow table, that is, performs hardware fuzzy matching. The action corresponding to the flow table rule action item included in the flow matching rule in the flow table.
  • the intelligent network card After executing the action corresponding to the flow table rule action item, the intelligent network card matches the packet with the hardware exact matching flow table. If the match is successful, the intelligent network card performs traffic management on the packet according to the hardware exact matching flow table, that is, performs hardware exact matching.
  • the smart network card calculates the hash value corresponding to the message based on the hash matching action item, and obtains the mask corresponding to the message based on the hash value; matches the action item based on the redirection identifier, and searches the data plane hash table; based on the message corresponding
  • the mask is consistent with the mask in the data plane hash table, confirming that the packet matches the data plane hash table successfully. Therefore, the smart network card multipath forwards the packet according to the next hop information corresponding to the mask in the data plane hash table.
  • the packet Before the packet leaves the smart network card, the packet is matched based on the outbound ACL flow matching rules. If the match is successful, the smart network card performs outbound operation and maintenance function management on the packet based on the outbound ACL flow matching rules. For example, perform outbound flow table statistics on packets, and perform packet statistics based on the TAG set in the inbound direction.
  • the method provided by the embodiment of this application also includes: based on the failure of the packet to match the incoming ACL flow matching rule, there is no need to execute the flow table rule action item in the incoming ACL flow matching rule, and the smart network card will Match with hardware fuzzy matching flow table.
  • the matching result based on the packet and the hardware fuzzy matching flow table is that the packet matches the hardware fuzzy matching flow table successfully, and the hardware fuzzy matching flow table includes a upload action item, and the packet is sent to the VS; or, based on the packet and the hardware fuzzy matching flow table, the packet is sent to the VS.
  • the matching result of the hardware fuzzy matching flow table is that the packet fails to match the hardware fuzzy matching flow table, and the packet is sent to the VS.
  • the packet will be message and Hardware exact match flow table for matching.
  • the matching result based on the packet and the hardware exact matching flow table is that the packet and the hardware exact matching flow table are successfully matched, and the hardware exact matching flow table includes a upload action item, and the packet is sent to the VS; or, based on the packet and the hardware exact matching flow table, the packet is sent to the VS.
  • the matching result of the hardware exact matching flow table is that the packet fails to match the hardware exact matching flow table, and the packet is sent to the VS.
  • the packet will be flown according to the hardware exact matching flow table.
  • the smart network card calculates the hash value corresponding to the message based on the hash matching action item, and obtains the mask corresponding to the message based on the hash value; matches the action item based on the redirection identifier, and searches the data plane hash table; based on the message The corresponding mask is consistent with the mask in the data plane hash table, confirming that the packet matches the data plane hash table successfully.
  • the smart network card multipath forwards the packet according to the next hop information corresponding to the mask in the data plane hash table. Finally, the packet is matched against the outbound ACL flow matching rules. If the match is successful, the smart network card performs outbound operation and maintenance function management on the packet based on the outbound ACL flow matching rules.
  • the embodiment of the present application also provides a method for managing flow table rules. Taking this method as an example of the interaction between the SDN controller and the VS, as shown in Figure 15, the method includes steps 1501 to 1503.
  • Step 1501 The SDN controller obtains policy routing based on the flow table aggregation mark.
  • the network element adds whether the virtual router (virtual router) where the port connected to the terminal side is located is north-south in the network element network sharing disk (NSD) description file. (Inbound and outbound data center (DC)) identifier. This identifier is used to indicate whether the port flow table is used in aggregation.
  • NSD network element network sharing disk
  • DC Inbound and outbound data center
  • the SDN controller adds policy routing for the north-south identifier in the virtual router to instruct Layer 3 packets to be forwarded to the GW by default.
  • the policy routing matching field includes a port identifier (port).
  • the policy routing matching field also includes at least one of vlan, source MAC (smac), destination MAC (dmac), and Ethertype (ethtype).
  • the policy routing matching field also includes an action.
  • the action is forwarding to the GW, for example, forwarding to the GW in a VXLAN encapsulation manner.
  • Step 1502 The SDN controller delivers the policy route to the VS and instructs the VS to manage the hardware fuzzy matching flow table based on the policy route.
  • Step 1503 VS receives the policy routing and generates a hardware fuzzy matching flow table based on the policy routing and the OpenFlow table.
  • VS can perform traffic management based on the hardware fuzzy matching flow table.
  • the VS can also deliver the generated hardware fuzzy matching flow table to the smart network card, instructing the smart network card to manage the hardware fuzzy matching flow table. That is to say, the management method of flow table rules shown in Figure 15 provided by the embodiment of the present application can be applied to the process of obtaining the hardware fuzzy matching flow table in step 701 shown in Figures 7, 8 and 13.
  • VS can also deliver the generated hardware fuzzy matching flow table to the smart network card.
  • the process of instructing the smart network card to manage the hardware fuzzy matching flow table can be referred to Figure 7, Figure 8 and Figure 13. Step 702 and subsequent processes will not be described again here.
  • FIG 16 is a schematic structural diagram of a flow table rule management device provided by an embodiment of the present application.
  • the device is applied to a smart network card.
  • the smart network card is used to connect to the VS.
  • the smart network card is the smart network card shown in Figure 4 above.
  • the flow table rule management device shown in Figure 16 can perform all or part of the operations performed by the smart network card. It should be understood that the device may include more additional modules than the modules shown or omit some of the modules shown therein, and the embodiments of the present application are not limited to this.
  • the device includes:
  • the management module 1601 is used to manage the access control list ACL flow matching rules.
  • the ACL flow matching rules are used for the operation and maintenance function management of the packets by the smart network card.
  • the ACL flow matching rules include at least one of an inbound ACL flow matching rule and an outbound ACL flow matching rule.
  • the management module 1601 is configured to receive the first message sent by the VS by calling the first application programming interface API.
  • the first message includes the port identification of the first port of the smart network card; based on the first message Create the first ACL flow matching rule on the first port of the smart NIC.
  • the first message also includes at least one of a flow table rule attribute, a flow table rule matching item, and a flow table rule action item; wherein the flow table rule attribute is used to indicate that the packet needs to match At least one of the group, the direction information of the first ACL flow matching rule, and the flow table type; the flow table rule matching items include matching Ethernet layer information, matching virtual LAN VLAN information, matching Internet Protocol version 4 IPv4 information, or matching Internet Protocol At least one of the sixth version of IPv6 information, matching virtual extended LAN VXLAN information, matching item end, and packet marking; flow table rule action items include flow table statistics, sampling forwarding and flow mirroring, setting internal tags for packets, and modifying Specifies at least one of field and refnum operations.
  • the flow table rule attribute is used to indicate that the packet needs to match At least one of the group, the direction information of the first ACL flow matching rule, and the flow table type
  • the flow table rule matching items include matching Ethernet layer information, matching virtual LAN VLAN information, matching Internet Protocol version 4 IPv4 information,
  • the device further includes: a sending module, configured to send a second message to the VS, where the second message indicates the result of creating the first ACL flow matching rule on the first port of the smart network card.
  • the management module 1601 is configured to receive the third message sent by the VS by calling the second API, and delete the second ACL flow matching rule on the smart network card based on the third message.
  • the management module 1601 is configured to receive a fourth message sent by the VS by calling a third API, and query and return statistical information of the smart network card based on the fourth message.
  • the management module 1601 is also used to manage the hardware matching flow table.
  • the hardware matching flow table is used by the smart network card to manage traffic.
  • the hardware matching flow table includes a hardware exact matching flow table and a hardware fuzzy matching. At least one of the flow tables.
  • the hardware fuzzy matching flow table is used to match the first packet, which is a packet generated by a network element whose flow table entry satisfies the first threshold condition; hardware exact matching The flow table is used to match the second packet, and the second packet is a packet generated by a network element that meets the second threshold condition.
  • the management module 1601 is also used to manage the data plane hash table.
  • the data plane hash table is used by the intelligent network card to perform multi-path forwarding of multi-path forwarding messages.
  • the hardware matching flow table includes at least one of a hash matching action item, a redirection identifier matching action item, and a packet upload VS software control plane matching action item; wherein, the hash matching action item It is used to instruct the execution of the query action of the data plane hash table.
  • the redirection flag is used to indicate the data side hash table.
  • the data plane hash table includes the hash value, mask and redirection flag. The mask corresponds to the next hop information.
  • Figure 17 is a schematic structural diagram of a flow table rule management device provided by an embodiment of the present application.
  • the device is applied to a VS.
  • the VS is used to connect to a smart network card.
  • the VS is as shown in Figure 4 or Figure 7 or Figure 8.
  • VS Based on the following multiple as shown in Figure 17 Module, the flow table rule management device shown in Figure 17 can perform all or part of the operations performed by the VS. It should be understood that the device may include more additional modules than the modules shown or omit some of the modules shown therein, and the embodiments of the present application are not limited to this.
  • the device includes:
  • the acquisition module 1701 is used to obtain the access control list ACL flow matching rules.
  • the ACL flow matching rules are used by the smart network card to perform operation and maintenance function management of the packets;
  • Instruction module 1702 is used to instruct the intelligent network card to manage ACL flow matching rules.
  • the ACL flow matching rules include at least one of an inbound ACL flow matching rule and an outbound ACL flow matching rule.
  • the instruction module 1702 is configured to call the first application programming interface API to send a first message to the smart network card.
  • the first message includes the port identification of the first port of the smart network card.
  • the first message is used to The smart NIC creates the first ACL flow matching rule on the first port of the smart NIC.
  • the first message also includes at least one of a flow table rule attribute, a flow table rule matching item, and a flow table rule action item; wherein the flow table rule attribute is used to indicate that the packet needs to match
  • the first ACL flow matching rule is at least one of the incoming ACL flow matching rule or the outgoing ACL flow matching rule, and the flow table type
  • the flow table rule matching items include matching Ethernet layer information, matching virtual LAN VLAN information, Matching Internet Protocol version 4 IPv4 information or matching Internet Protocol version 6 IPv6 information, matching virtual extended LAN VXLAN information, matching item end, and packet marking
  • the flow table rule action items include flow table statistics and sampling forwarding At least one of flow mirroring, setting internal tags for packets, modifying specified fields, and refnum operations.
  • the device further includes: a receiving module, configured to receive a second message sent by the smart network card, where the second message is used to instruct the creation of the first ACL flow matching rule on the first port of the smart network card. result.
  • the instruction module 1702 is configured to call a second API to send a third message to the smart network card, where the third message is used by the smart network card to delete the second ACL flow matching rule on the smart network card.
  • the instruction module 1702 is configured to call a third API to send a fourth message to the smart network card.
  • the fourth message is used for the smart network card to query and return statistical information of the smart network card.
  • the acquisition module 1701 is also used to obtain a hardware matching flow table.
  • the hardware matching flow table is used by the smart network card to manage traffic.
  • the hardware matching flow table includes a hardware exact matching flow table and a hardware fuzzy matching. At least one of the flow tables;
  • the instruction module 1702 is also used to instruct the smart network card to manage the hardware matching flow table.
  • the hardware fuzzy matching flow table is used to match the first packet, which is a packet generated by a network element whose flow table entry satisfies the first threshold condition; hardware exact matching The flow table is used to match the second packet, and the second packet is a packet generated by a network element that meets the second threshold condition.
  • the acquisition module 1701 is also used to obtain the data plane hash table, which is used by the smart network card to perform multi-path forwarding of multi-path forwarding messages; the instruction module 1702 is also used to obtain Instructs the smart NIC to manage the data plane hash table.
  • the hardware matching flow table includes at least one of a hash matching action item, a redirection identifier matching action item, and a packet upload VS software control plane matching action item; wherein, the hash matching action item It is used to indicate the query action of the data plane hash table.
  • the redirection ID is used to indicate the data plane hash table.
  • the data plane hash table includes the hash value, mask and redirection identifier. The mask corresponds to the next hop information.
  • FIG 18 is a schematic structural diagram of a traffic management device provided by an embodiment of the present application.
  • the device is applied to a smart network card.
  • the smart network card is used to connect to the VS.
  • the smart network card is the smart network card shown in Figure 5 or Figure 9 above.
  • the traffic management device shown in Figure 18 can perform all or part of the operations performed by the smart network card. It should be understood that the device may include more additional modules than the modules shown or omit some of the modules shown therein, and the embodiments of the present application are not limited to this.
  • the device includes:
  • the receiving module 1801 is used to receive the message and match the message with the access control list ACL flow matching rule created on the smart network card;
  • the management module 1802 is configured to perform operation and maintenance function management on the packets according to the ACL flow matching rules based on successful matching between the packets and the ACL flow matching rules.
  • the ACL flow matching rules include incoming ACL flow matching rules and outgoing ACL flow matching rules; the management module 1802 is configured to, based on successful matching of the packet with the incoming ACL flow matching rule, according to The inbound ACL flow matching rules perform inbound operation and maintenance function management on the packets; the packets are forwarded on Layer 2 and Layer 3 networks; based on successful matching between the packets and the outbound ACL flow matching rules, the packets are processed based on the outbound ACL flow matching rules.
  • the outbound operation and maintenance functions manage the packets.
  • the management module 1802 is also used to match the packet with a hardware matching flow table.
  • the hardware matching flow table includes at least one of a hardware exact matching flow table and a hardware fuzzy matching flow table; according to The matching results between the packets and the hardware matching flow table are used to perform traffic management on the packets.
  • the management module 1802 is configured to match the message with the hardware fuzzy matching flow table based on the message being the first message, and the first message being the generated flow table entry that satisfies the first threshold condition.
  • the management module 1802 is configured to, based on the matching result between the packet and the hardware matching flow table, that the packet matches the hardware matching flow table successfully, and the hardware matching flow table includes an upload action item, The packet is sent to the VS; or, based on the matching result between the packet and the hardware matching flow table, the packet fails to match the hardware matching flow table, and the packet is sent to the VS.
  • the message is a multi-path forwarding message
  • the management module 1802 is also used to match the message with the data plane hash table; based on the successful matching of the message with the data plane hash table, the Messages are forwarded through multipath.
  • the hardware matching flow table includes a hash matching action item and a turn identification matching action item; where the hash matching action item is used to indicate the query action of executing the data plane hash table, and the turn identification is used to Indicates the data plane hash table.
  • the data plane hash table includes hash value, mask and redirection identifier. The mask corresponds to the next hop information;
  • the management module 1802 is used to calculate the hash value corresponding to the message based on the hash matching action item, and obtain the mask corresponding to the message based on the hash value; match the action item based on the redirection identifier, and search the data plane hash table; based on the report
  • the mask corresponding to the message is consistent with the mask in the data plane hash table, confirming that the message and the data plane hash table are matched successfully;
  • the management module 1802 is used to multi-path forward packets according to the next hop information corresponding to the mask in the data plane hash table.
  • the hardware matching flow table includes a hash matching action item, a redirection identifier matching action item, and a message upload VS software control plane matching action item; where the hash matching action item is used to indicate execution data In the query action of the surface hash table, the redirection identifier is used to indicate the data-plane hash table.
  • the data-plane hash table includes the hash value, mask and redirection identifier. The mask corresponds to the next hop information;
  • the management module 1802 is used to match action items based on hash, calculate the hash value corresponding to the message, and obtain the hash value based on the hash value. Get the mask corresponding to the message; search the data-side hash table based on the steering identifier matching action item; determine the message and data-side hash based on the inconsistency between the hash value corresponding to the message and the mask in the data-side hash table Table matching failed;
  • the management module 1802 is also used to send packets to the virtual switch VS.
  • FIG 19 is a schematic structural diagram of a traffic management device provided by an embodiment of the present application.
  • the device is applied to a VS.
  • the VS is used to connect to a smart network card.
  • the VS is the VS shown in Figure 9 above.
  • the traffic management device shown in Figure 19 can perform all or part of the operations performed by the VS. It should be understood that the device may include more additional modules than the modules shown or omit some of the modules shown therein, and the embodiments of the present application are not limited to this.
  • the device includes:
  • the receiving module 1901 is used to receive the message sent by the smart network card.
  • the message is sent by the smart network card when the message successfully matches the hardware matching flow table on the smart network card, and the hardware matching flow table includes an upload action item.
  • the message is sent by the intelligent network card when the message fails to match the hardware matching flow table on the intelligent network card, or the message is sent by the intelligent network card when the message fails to match the data plane hash table on the intelligent network card. sent later;
  • the management module 1902 is used to match the packets with the open source flow table on the VS, and perform traffic management on the packets based on the matching results.
  • the management device may be a smart network card or a VS, and is used to execute the steps shown in Figures 4, 5, 7, 8, 9, 12, 13 and 15.
  • the management device includes: a processor, which is used to implement operations related to the smart network card or VS.
  • the device is a chip.
  • the device is a network device, and the type of the network device includes at least one of the following: a router, a switch, or a server.
  • the processor is a general central processing unit (CPU), a digital signal processor (DSP), a network processor (NP), a graphics processing unit (GPU) ), neural-network processing units (NPU), data processing unit (DPU), microprocessor or one or more integrated circuits used to implement the solution of the present application.
  • the processor 1001 includes an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof.
  • ASIC application-specific integrated circuit
  • PLD programmable logic device
  • PLD is, for example, a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a general array logic (GAL), or any combination thereof.
  • the processor may implement or execute various logical blocks, modules and circuits described in connection with the disclosure of the embodiments of this application.
  • the processor may also be a combination that implements computing functions, such as one or more microprocessor combinations, a DSP and a microprocessor combination, and so on.
  • Figure 20 shows a schematic structural diagram of a network device 2000 provided by an exemplary embodiment of the present application.
  • the network device 2000 shown in Figure 20 can be a smart network card or a VS, used to perform the methods shown in Figure 4, Figure 5, Figure 7, Figure 8, Figure 9, Figure 12, Figure 13 and Figure 15. operate.
  • the network device 2000 is, for example, a switch, a router, etc., and the network device 2000 can be implemented by a general bus architecture.
  • the network device 2000 includes at least one processor 2001, a memory 2003, and at least one communication interface 2004.
  • the processor 2001 is, for example, a CPU, DSP, NP, GPU, NPU, DPU, microprocessor, or one or more integrated circuits used to implement the solution of the present application.
  • processor 2001 includes an ASIC, PLD or other programmable logic components, transistor logic devices, hardware components, or any combination thereof.
  • the PLD is, for example, CPLD, FPGA, GAL or any combination thereof. It may implement or execute various logical blocks, modules and circuits described in connection with the disclosure of the embodiments of this application.
  • the processor may also be a combination that implements computing functions, such as one or more microprocessor combinations, a DSP and a microprocessor combination, and so on.
  • the network device 2000 also includes a bus.
  • Buses are used to transfer information between components of network device 2000.
  • the bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc.
  • PCI peripheral component interconnect
  • EISA extended industry standard architecture
  • the bus can be divided into address bus, data bus, control bus, etc. For ease of presentation, only one thick line is used in Figure 20, but it does not mean that there is only one bus or one type of bus.
  • the memory 2003 is, for example, a read-only memory (ROM) or other type of static storage device that can store static information and instructions, or a random access memory (random access memory, RAM) or a device that can store information and instructions.
  • ROM read-only memory
  • RAM random access memory
  • Other types of dynamic storage devices such as electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disk storage, optical discs Storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or can be used to carry or store desired program instructions in the form of instructions or data structures and can Any other media accessed by a computer, without limitation.
  • the memory 2003 exists independently, for example, and is connected to the processor 2001 through a bus.
  • the memory 2003 may also be integrated with the processor 2001.
  • the communication interface 2004 uses any device such as a transceiver to communicate with other devices or a communication network.
  • the communication network can be Ethernet, a radio access network (RAN) or a wireless local area network (WLAN), etc.
  • the communication interface 2004 may include a wired communication interface and may also include a wireless communication interface.
  • the communication interface 2004 may be an Ethernet (ethernet) interface, a fast ethernet (FE) interface, a gigabit ethernet (GE) interface, an asynchronous transfer mode (ATM) interface, a wireless LAN ( wireless local area networks, WLAN) interface, cellular network communication interface or a combination thereof.
  • the Ethernet interface can be an optical interface, an electrical interface, or a combination thereof.
  • the communication interface 2004 can be used for the network device 2000 to communicate with other devices.
  • the processor 2001 may include one or more CPUs, such as CPU0 and CPU1 as shown in FIG. 20 .
  • Each of these processors may be a single-CPU processor or a multi-CPU processor.
  • a processor here may refer to one or more devices, circuits, and/or processing cores for processing data (eg, computer program instructions).
  • the network device 2000 may include multiple processors, such as the processor 2001 and the processor 2005 shown in FIG. 20 .
  • processors can be a single-core processor (single-CPU) or a multi-core processor (multi-CPU).
  • a processor here may refer to one or more devices, circuits, and/or processing cores for processing data (such as computer program instructions).
  • the network device 2000 may also include an output device and an input device.
  • Output devices communicate with processor 2001 and can display information in a variety of ways.
  • the output device may be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, a projector, etc.
  • Input devices communicate with processor 2001 and can receive user input in a variety of ways.
  • the input device may be a mouse, keyboard, touch screen device, or Sensing equipment, etc.
  • the memory 2003 is used to store program instructions 2010 for executing the solution of the present application
  • the processor 2001 can execute the program instructions 2010 stored in the memory 2003. That is, the network device 2000 can implement the flow table rule management method or the traffic management method provided by the method embodiment through the processor 2001 and the program instructions 2010 in the memory 2003.
  • Program instructions 2010 may include one or more software modules.
  • the processor 2001 itself can also store program codes or instructions for executing the solution of the present application.
  • the network device 2000 in the embodiment of the present application may correspond to the VS in the method embodiments in Figure 4, Figure 5, Figure 7, Figure 8, Figure 9, Figure 12, Figure 13 and Figure 15.
  • the network The processor 2001 in the device 2000 reads the instructions in the memory 2003, so that the network device 2000 shown in Figure 21 can perform all or part of the operations performed by the VS.
  • the network device 2000 in the embodiment of the present application may correspond to the smart network card in the method embodiments in Figure 4, Figure 5, Figure 7, Figure 8, Figure 9, Figure 12, Figure 13 and Figure 15,
  • the processor 2001 in the network device 2000 reads the instructions in the memory 2003, so that the network device 2000 shown in Figure 21 can perform all or part of the operations performed by the smart network card.
  • the network device 2000 may also correspond to the device shown in FIGS. 16-19, and each functional module in the device is implemented using the software of the network device 2000.
  • the functional modules included in the device are generated by the processor 2001 of the network device 2000 after reading the program instructions 2010 stored in the memory 2003.
  • each step of the method shown in Figure 4, Figure 5, Figure 7, Figure 8, Figure 9, Figure 12, Figure 13 and Figure 15 is implemented in the form of integrated logic circuits or software of hardware in the processor of the network device 2000
  • the instruction is completed.
  • the steps of the methods disclosed in conjunction with the embodiments of the present application can be directly implemented by a hardware processor for execution, or can be executed by a combination of hardware and software modules in the processor.
  • the software module can be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other mature storage media in this field.
  • the storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware. To avoid repetition, the details will not be described here.
  • Figure 21 shows a schematic structural diagram of a network device 2100 provided by another exemplary embodiment of the present application.
  • the network device 2100 shown in Figure 21 can be a smart network card or a VS, used to perform the methods shown in Figure 4, Figure 5, Figure 7, Figure 8, Figure 9, Figure 12, Figure 13 and Figure 15. operate.
  • the network device 2100 is, for example, a switch, a router, etc., and the network device 2100 can be implemented by a general bus architecture.
  • the network device 2100 includes: a main control board 2110 and an interface board 2130.
  • the main control board is also called the main processing unit (MPU) or route processor card.
  • the main control board 2110 is used to control and manage various components in the network device 2100, including route calculation and device management. , equipment maintenance, protocol processing functions.
  • the main control board 2110 includes: a central processing unit 2111 and a memory 2112.
  • the interface board 2130 is also called a line processing unit (LPU), line card or service board.
  • the interface board 2130 is used to provide various service interfaces and implement data packet forwarding.
  • Business interfaces include but are not limited to Ethernet interfaces, POS (packet over SONET/SDH) interfaces, etc.
  • Ethernet interfaces are, for example, flexible Ethernet business interfaces (flexible ethernet clients, FlexE Clients).
  • the interface board 2130 includes: a central processor 2131, a network processor 2132, a forwarding entry memory 2134, and a physical interface card (physical interface card, PIC) 2133.
  • the central processor 2131 on the interface board 2130 is used to control and manage the interface board 2130 and communicate with the central processor 2111 on the main control board 2110 .
  • the network processor 2132 is used to implement packet forwarding processing.
  • the network processor 2132 may be in the form of a forwarding chip.
  • the forwarding chip may be a network processor (NP).
  • the forwarding chip may be implemented by an application-specific integrated circuit (ASIC) or a field programmable gate array (FPGA).
  • ASIC application-specific integrated circuit
  • FPGA field programmable gate array
  • the network processor 2132 is configured to forward the received message based on the forwarding table stored in the forwarding table memory 2134, and if the destination address of the message is the address of the message processing device 2100, then upload the message to CPU (such as central processing unit 2131) processes; if the destination address of the message is not the address of the message processing device 2100, the next hop and outgoing interface corresponding to the destination address are found from the forwarding table according to the destination address, and the destination address is The packet is forwarded to the outbound interface corresponding to the destination address.
  • the processing of uplink packets may include: processing of the packet incoming interface, forwarding table search; and the processing of downlink packets may include: forwarding table search, etc.
  • the central processing unit can also perform the function of the forwarding chip, such as implementing software forwarding based on a general-purpose CPU, so that there is no need for a forwarding chip in the interface board.
  • the physical interface card 2133 is used to implement the docking function of the physical layer.
  • the original traffic enters the interface board 2130 through this, and the processed packets are sent out from the physical interface card 2133.
  • the physical interface card 2133 is also called a daughter card and can be installed on the interface board 2130. It is responsible for converting photoelectric signals into messages and checking the validity of the messages before forwarding them to the network processor 2132 for processing.
  • the central processor 2131 can also perform the functions of the network processor 2132, such as implementing software forwarding based on a general-purpose CPU, so that the network processor 2132 is not required in the physical interface card 2133.
  • the network device 2100 includes multiple interface boards.
  • the network device 2100 also includes an interface board 2140.
  • the interface board 2140 includes: a central processor 2141, a network processor 2142, a forwarding entry memory 2144, and a physical interface card 2143.
  • the functions and implementation methods of each component in the interface board 2140 are the same as or similar to those of the interface board 2130 and will not be described again here.
  • the network device 2100 also includes a switching fabric board 2120.
  • the switching fabric unit 2120 may also be called a switching fabric unit (switch fabric unit, SFU).
  • SFU switching fabric unit
  • the switching network board 2120 is used to complete data exchange between the interface boards.
  • the interface board 2130 and the interface board 2140 can communicate through the switching network board 2120.
  • the main control board 2110 is coupled with the interface board.
  • the main control board 2110, the interface board 2130, the interface board 2140, and the switching network board 2120 are connected to the system backplane through a system bus to achieve intercommunication.
  • an inter-process communication protocol (IPC) channel is established between the main control board 2110 and the interface board 2130 and the interface board 2140.
  • the main control board 2110 and the interface board 2130 and the interface board 2140 communicate through IPC channels.
  • network device 2100 includes a control plane and a forwarding plane.
  • the control plane includes a main control board 2110 and a central processor 2111.
  • the forwarding plane includes various components that perform forwarding, such as forwarding entry memory 2134, physical interface card 2133, and network processing.
  • the control plane executes functions such as router, generates forwarding tables, processes signaling and protocol messages, configures and maintains the status of network devices.
  • the control plane sends the generated forwarding tables to the forwarding plane.
  • the network processor 2132 is based on the control
  • the forwarding table delivered above looks up the table and forwards the packets received by the physical interface card 2133.
  • the forwarding table delivered by the control plane may be stored in the forwarding table item storage 2134. In some embodiments, the control plane and forwarding plane may be completely separated and not on the same network device.
  • main control boards there may be one or more main control boards, and when there are multiple main control boards, they can include the main main control board and the backup main control board.
  • network equipment can have at least one switching network board, which enables data exchange between multiple interface boards through the switching network board, providing large-capacity data exchange and processing capabilities. Therefore, the data access and processing capabilities of the distributed architecture message processing equipment are greater than those of the centralized architecture.
  • Document processing equipment the network device can also be in the form of only one board, that is, there is no switching network board. The functions of the interface board and the main control board are integrated on this board. In this case, the central processor and the main control board on the interface board The central processor on the board can be combined into one central processor on this board to perform the superimposed functions of the two.
  • This form of network equipment has low data exchange and processing capabilities (for example, low-end switches or routers) and other network equipment).
  • the specific architecture used depends on the specific networking deployment scenario and is not limited here.
  • this embodiment of the present application also provides a management system, which includes: a VS and a smart network card.
  • a management system which includes: a VS and a smart network card.
  • the management system is obtained based on the network devices shown in Figures 20 and 21.
  • the VS is the network device 2000 shown in Figure 20 or the network device 2100 shown in Figure 21
  • the smart network card is the network device 2000 shown in Figure 20 or the network device 2100 shown in Figure 21.
  • the methods performed by the VS and the smart network card please refer to the relevant descriptions of the embodiments shown in the methods shown in the above-mentioned Figures 4, 5, 7, 8, 9, 12, 13 and 15, which are not included here. Let’s elaborate further.
  • An embodiment of the present application also provides a communication device, which includes: a transceiver, a memory, and a processor.
  • the transceiver, the memory and the processor communicate with each other through an internal connection path, the memory is used to store instructions, and the processor is used to execute the instructions stored in the memory to control the transceiver to receive signals and control the transceiver to send signals.
  • the processor executes the instructions stored in the memory, the processor is caused to execute the required execution of the smart network card or VS in Figure 4, Figure 5, Figure 7, Figure 8, Figure 9, Figure 12, Figure 13 and Figure 15 Methods.
  • processor may be a CPU, or other general-purpose processor, DSP, ASIC, FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • a general-purpose processor can be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor that supports advanced RISC machines (ARM) architecture.
  • ARM advanced RISC machines
  • the above-mentioned memory may include a read-only memory and a random access memory, and provide instructions and data to the processor.
  • Memory may also include non-volatile random access memory.
  • the memory may also store device type information.
  • the memory may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory.
  • non-volatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (erasable PROM, EPROM), electrically removable memory. Erase electrically programmable read-only memory (EPROM, EEPROM) or flash memory.
  • Volatile memory can be random access memory (RAM), which is used as an external cache. By way of illustration, but not limitation, many forms of RAM are available.
  • static random access memory static random access memory
  • dynamic random access memory dynamic random access memory
  • DRAM dynamic random access memory
  • SDRAM synchronous dynamic random access memory
  • double data rate synchronous dynamic random access Memory double data rate SDRAM, DDR SDRAM
  • enhanced synchronous dynamic random access memory enhanced SDRAM, ESDRAM
  • synchronous link dynamic random access memory direct rambus RAM, DR RAM
  • Embodiments of the present application also provide a computer-readable storage medium. At least one instruction is stored in the storage medium. The instruction is loaded and executed by the processor to implement the above Figures 4, 5, 7, 8, 9, and 12. The method described in any one of Figure 13 and Figure 15.
  • Embodiments of the present application also provide a computer program (product).
  • the computer program When the computer program is executed by a computer, it can cause the processor or computer to execute each step and/or process of the corresponding method in the above method embodiment.
  • Embodiments of the present application also provide a chip, including a processor, configured to call from a memory and run instructions stored in the memory, so that the communication device installed with the chip executes as shown in Figures 4, 5, and 7 above. , the method described in any one of Figure 8, Figure 9, Figure 12, Figure 13 and Figure 15.
  • An embodiment of the present application also provides another chip, including: an input interface, an output interface, a processor, and a memory.
  • the input interface, the output interface, the processor, and the memory are connected through an internal connection path, and the The processor is used to execute the code in the memory.
  • the processor is used to execute the steps shown in Figure 4, Figure 5, Figure 7, Figure 8, Figure 9, Figure 12, Figure 13 and Figure 15. any of the methods described.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another, e.g., the computer instructions may be transferred from a website, computer, server, or data center Transmission to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.) means.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains one or more available media integrated.
  • the available media may be magnetic media (such as floppy disks, hard disks, magnetic tapes), optical media (such as DVDs), or semiconductor media (such as solid state disks), etc.
  • the program can be stored in a computer-readable storage medium.
  • the storage medium can be read-only memory, magnetic disk or optical disk, etc.
  • the computer program product includes one or more computer program instructions.
  • methods of embodiments of the present application may be described in the context of machine-executable instructions, such as included in a program module executing in a device on a target's real or virtual processor.
  • program modules include routines, programs, libraries, objects, classes, components, data structures, etc., which perform specific tasks or implement specific abstract data structures.
  • the functionality of program modules may be combined or split between the described program modules.
  • Machine-executable instructions for program modules can execute locally or on a distributed device. In a distributed device, program modules can be located in both local and remote storage media.
  • Computer program codes for implementing the methods of embodiments of the present application may be written in one or more programming languages. These computer program codes may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when executed by the computer or other programmable data processing device, the program code causes the flowcharts and/or block diagrams to be displayed. The functions/operations specified in are implemented.
  • the program code may execute entirely on the computer, partly on the computer, as a stand-alone software package, partly on the computer and partly on a remote computer or entirely on the remote computer or server.
  • the computer program code or related data may be carried by any appropriate carrier, so that the device, device or processor can perform the various processes and operations described above.
  • Examples of carriers include signals, computer-readable media, and the like.
  • Examples of signals may include electrical, optical, radio, acoustic, or other forms of propagated signals, such as carrier waves, infrared signals, and the like.
  • the disclosed systems, devices and methods can be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the modules is only a logical function division. In actual implementation, there may be other division methods.
  • multiple modules or components may be combined or may be Integrated into another system, or some features can be ignored, or not implemented.
  • the coupling or direct coupling or communication connection between each other shown or discussed may be indirect coupling or communication connection through some interfaces, devices or modules, or may be electrical, mechanical or other forms of connection.
  • the modules described as separate components may or may not be physically separated.
  • the components shown as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed to multiple network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments of the present application.
  • each functional module in each embodiment of the present application can be integrated into one processing module, or each module can exist physically alone, or two or more modules can be integrated into one module.
  • the above integrated modules can be implemented in the form of hardware or software function modules.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program for or in connection with an instruction execution system, apparatus, or device.
  • Computer-readable storage media may be machine-readable signal media or machine-readable storage media.
  • Computer-readable storage media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or devices, or any suitable combination thereof.
  • Computer readable storage media include an electrical connection with one or more wires, portable computer disks, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory Memory (EPROM or flash memory), optical storage device, magnetic storage device, or any suitable combination thereof.
  • RAM random access memory
  • ROM read only memory
  • EPROM or flash memory erasable programmable read only memory Memory
  • optical storage device magnetic storage device, or any suitable combination thereof.
  • the size of the sequence number of each process does not mean the order of execution.
  • the execution order of each process should be determined by its function and internal logic, and should not be determined by the execution order of the embodiments of the present application.
  • the implementation process constitutes no limitation.
  • multiple target objects means two or more target audience.
  • determining B based on A does not mean determining B only based on A, and B can also be determined based on A and/or other information.
  • references throughout this specification to "one embodiment,” “an embodiment,” and “a possible implementation” mean that specific features, structures, or characteristics related to the embodiment or implementation are included herein. In at least one embodiment of the application. Therefore, “in one embodiment” or “in an embodiment” or “a possible implementation” appearing in various places throughout this specification do not necessarily refer to the same embodiment. Furthermore, the particular features, structures or characteristics may be combined in any suitable manner in one or more embodiments.
  • the information including but not limited to user equipment information, user personal information, etc.
  • data including but not limited to data used for analysis, stored data, displayed data, etc.
  • signals involved in this application All are authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
  • the location information of each of the multiple target objects involved in this application is obtained with full authorization.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present application relates to the technical field of communications, and provides a flow table rule management method, a traffic management method and system, and a storage medium. The method comprises: a VS acquires an access control list (ACL) flow matching rule; the VS instructs an intelligent network card to manage the ACL flow matching rule; and the intelligent network card manages the ACL flow matching rule, the ACL flow matching rule being used by the intelligent network card to perform operation and maintenance function management on a packets. The ACL flow matching rule is managed by means of the intelligent network card, so that during enabling of an operation and maintenance capability, existing flow table entries on the intelligent network card do not need to be cleared, the first packet does not need to be sent to the VS for re-learning, and there is only a need to subject the received packet to the ACL flow matching rule, so as to enable the intelligent network card to have a highly maintainable and reliable operation and maintenance capability. Furthermore, an operation and maintenance function is implemented by means of the intelligent network card, so that counting statistics and the like can be implemented by hardware, and compared with software implementation, the statistical result is more accurate.

Description

流表规则的管理方法、流量管理方法、系统及存储介质Flow table rule management method, traffic management method, system and storage medium
本申请要求于2022年06月06日提交的申请号为202210632725.7、发明名称为“一种数据转发的方法、系统及装置”的中国专利申请的优先权,本申请要求于2022年06月21日提交的申请号为202210709643.8、发明名称为“流表规则的管理方法、流量管理方法、系统及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application with application number 202210632725.7 and the invention title "A method, system and device for data forwarding" submitted on June 6, 2022. This application claims priority on June 21, 2022 The submitted application number is 202210709643.8 and the invention title is "Flow table rule management method, traffic management method, system and storage medium", the priority of the Chinese patent application, the entire content of which is incorporated into this application by reference.
技术领域Technical field
本申请涉及通信技术领域,特别涉及流表规则的管理方法、流量管理方法、系统及存储介质。This application relates to the field of communication technology, and in particular to a flow table rule management method, a traffic management method, a system and a storage medium.
背景技术Background technique
随着软件定义网络(software defined network,SDN)和网络功能虚拟化(network functions virtualization,NFV)技术的不断发展,各种数据面开源方案应运而生,虚拟交换机(virtual switch,VS)便是其中的一种。VS通过开源流(OpenFlow)协议管理交换机流表(flow table),能够使控制器软件通过网络访问一个交换机的数据路径,从而实现针对流量的运维功能、控制和转发等管理操作。With the continuous development of software defined network (SDN) and network functions virtualization (NFV) technologies, various data plane open source solutions have emerged, and virtual switch (VS) is one of them. kind of. VS manages the switch flow table through the open source flow (OpenFlow) protocol, which enables the controller software to access the data path of a switch through the network, thereby realizing management operations such as operation and maintenance functions, control and forwarding of traffic.
由于网络带宽的增加,VS的一些流量管理操作可由智能网卡实现。因此,有必要对智能网卡上的流表规则进行管理,以使智能网卡可基于流表规则进行流量管理。Due to the increase in network bandwidth, some traffic management operations of VS can be implemented by smart network cards. Therefore, it is necessary to manage the flow table rules on the smart network card so that the smart network card can manage traffic based on the flow table rules.
发明内容Contents of the invention
本申请提供了一种流表规则的管理方法、流量管理方法、系统及存储介质,能够实现在智能网卡上进行流表规则以及流量的管理。This application provides a flow table rule management method, a traffic management method, a system and a storage medium, which can realize the management of flow table rules and traffic on a smart network card.
第一方面,提供了一种流表规则的管理方法,该管理方法由智能网卡执行,智能网卡用于与VS连接,该方法包括:智能网卡管理访问控制列表ACL流匹配规则,ACL流匹配规则用于智能网卡对报文进行运维功能管理。The first aspect provides a management method for flow table rules. The management method is executed by an intelligent network card. The intelligent network card is used to connect to a VS. The method includes: the intelligent network card manages access control list ACL flow matching rules, and ACL flow matching rules. Used for smart network cards to perform operation and maintenance function management on packets.
通过智能网卡管理AC流匹配规则,当使能运维能力时,无需将智能网卡上已有的流表条目清除,首包也不用上送VS进行重新学习,将接收的报文经过ACL流匹配规则即可,使智能网卡具备高可维可靠的运维能力。再有,通过智能网卡实现运维功能,可实现由硬件进行计数统计等,相比于软件实现,统计结果更加准确。The AC flow matching rules are managed through the smart network card. When the operation and maintenance capability is enabled, there is no need to clear the existing flow table entries on the smart network card, and the first packet does not need to be sent to the VS for re-learning. The received packets are matched through ACL flows. Just set the rules, so that the smart network card has highly maintainable and reliable operation and maintenance capabilities. Furthermore, by implementing operation and maintenance functions through smart network cards, hardware can be used to perform counting and statistics. Compared with software implementation, the statistical results are more accurate.
在一种可能的实现方式中,ACL流匹配规则包括入向的ACL流匹配规则和出向的ACL流匹配规则中的至少一种。入向的ACL流匹配规则可用于智能网卡在入向进行运维功能管理,出向的ACL流匹配规则可用于智能网卡在出向进行运维功能管理,通过不同方向的ACL流匹配规则,可使得智能网卡管理的更加精确和全面。In a possible implementation manner, the ACL flow matching rules include at least one of an inbound ACL flow matching rule and an outbound ACL flow matching rule. The inbound ACL flow matching rules can be used to manage the operation and maintenance functions of the smart network card in the inbound direction. The outbound ACL flow matching rules can be used to manage the operation and maintenance functions of the smart network card in the outbound direction. Through the ACL flow matching rules in different directions, intelligent network cards can be made intelligent. Network card management is more accurate and comprehensive.
在一种可能的实现方式中,智能网卡管理访问控制列表ACL流匹配规则,包括:智能网卡接收VS调用第一应用程序编程接口API发送的第一消息,该第一消息包括智能网卡的第一端口的端口标识;智能网卡基于第一消息在智能网卡的第一端口上创建第一 ACL流匹配规则。通过在第一消息中携带端口标识,使得智能网卡能够在对应的端口上创建ACL流匹配规则,提高创建ACL流匹配规则的准确性。In a possible implementation, the smart network card manages access control list ACL flow matching rules, including: the smart network card receives the first message sent by VS by calling the first application programming interface API, and the first message includes the first message of the smart network card. The port identification of the port; the smart network card creates the first port on the first port of the smart network card based on the first message. ACL flow matching rules. By carrying the port identifier in the first message, the smart network card can create an ACL flow matching rule on the corresponding port, thereby improving the accuracy of creating an ACL flow matching rule.
在一种可能的实现方式中,第一消息还包括流表规则属性、流表规则匹配项和流表规则动作项中的至少一种;其中,所述流表规则属性用于指示报文需匹配的组、所述第一ACL流匹配规则的方向信息、流表类型中的至少一种;所述流表规则匹配项包括匹配以太层信息、匹配虚拟局域网VLAN信息、匹配网际协议第四版IPv4信息或匹配网际协议第六版IPv6信息、匹配虚拟扩展局域网VXLAN信息、匹配项结束、报文标记中的至少一种;所述流表规则动作项包括流表统计、采样转发和流镜像、为报文设置内标记、修改指定字段和引用句柄操作中的至少一种。通过在第一消息中携带流表规则属性、流表规则匹配项和流表规则动作项中的至少一种信息,使得智能网卡创建的ACL流匹配规则更加的准确和全面。In a possible implementation, the first message further includes at least one of a flow table rule attribute, a flow table rule matching item, and a flow table rule action item; wherein the flow table rule attribute is used to indicate that the packet needs At least one of the matching group, the direction information of the first ACL flow matching rule, and the flow table type; the flow table rule matching items include matching Ethernet layer information, matching virtual LAN VLAN information, and matching Internet Protocol version 4 At least one of IPv4 information or matching Internet Protocol version 6 IPv6 information, matching virtual extended LAN VXLAN information, matching item end, and message tag; the flow table rule action items include flow table statistics, sampling forwarding and flow mirroring, At least one of the operations of setting internal tags, modifying specified fields, and refnum operations for the message. By carrying in the first message at least one type of information among flow table rule attributes, flow table rule matching items and flow table rule action items, the ACL flow matching rules created by the intelligent network card are made more accurate and comprehensive.
在一种可能的实现方式中,该方法还包括:智能网卡向所述VS发送第二消息,所述第二消息指示在所述智能网卡的所述第一端口上创建所述第一ACL流匹配规则的结果。通过向VS返回用于指示创建ACL流匹配规则的结果,增加可靠性。In a possible implementation, the method further includes: the smart network card sends a second message to the VS, the second message indicating creating the first ACL flow on the first port of the smart network card. The result of matching rules. Increases reliability by returning results to VS indicating the creation of ACL flow matching rules.
在一种可能的实现方式中,所述智能网卡管理访问控制列表ACL流匹配规则,所述方法包括:所述智能网卡接收所述VS调用第二API发送的第三消息,基于所述第三消息在所述智能网卡上删除第二ACL流匹配规则。当运维能力关闭或者ACL流匹配规则发生变化时,将下发的ACL流匹配规则进行删除,后续收到的报文不经过ACL流匹配规则的匹配即可,使智能网卡具备高可维可靠的运维能力,且灵活性更高。In a possible implementation, the smart network card manages access control list ACL flow matching rules. The method includes: the smart network card receives the third message sent by the VS calling the second API, and based on the third The message deletes the second ACL flow matching rule on the smart network card. When the operation and maintenance capability is turned off or the ACL flow matching rules change, the delivered ACL flow matching rules will be deleted, and subsequent received packets will not be matched by the ACL flow matching rules, making the smart network card highly maintainable and reliable. operation and maintenance capabilities and greater flexibility.
在一种可能的实现方式中,所述智能网卡管理访问控制列表ACL流匹配规则,所述方法包括:智能网卡接收所述VS调用第三API发送的第四消息,基于所述第四消息查询并返回所述智能网卡的统计信息。通过第四消息实现统计信息的查询,使得流表规则的管理更加灵活。In a possible implementation, the smart network card manages access control list ACL flow matching rules. The method includes: the smart network card receives a fourth message sent by the VS calling a third API, and queries based on the fourth message. And return the statistical information of the smart network card. The query of statistical information is implemented through the fourth message, making the management of flow table rules more flexible.
在一种可能的实现方式中,所述方法还包括:所述智能网卡管理硬件匹配流表,所述硬件匹配流表用于所述智能网卡对流量进行流量管理,所述硬件匹配流表包括硬件精确匹配流表和硬件模糊匹配流表中的至少一种。除了管理ACL流匹配规则,还可以管理硬件匹配流表,使得流表规则的管理更加全面,且灵活性更高。In a possible implementation, the method further includes: the smart network card manages a hardware matching flow table, the hardware matching flow table is used by the smart network card to manage traffic, and the hardware matching flow table includes At least one of a hardware exact matching flow table and a hardware fuzzy matching flow table. In addition to managing ACL flow matching rules, it can also manage hardware matching flow tables, making the management of flow table rules more comprehensive and more flexible.
在一种可能的实现方式中,所述硬件模糊匹配流表用于与第一报文进行匹配,所述第一报文为生成流表条目满足第一阈值条件的网元所产生的报文;所述硬件精确匹配流表用于与第二报文进行匹配,所述第二报文为满足第二阈值条件的网元所产生的报文。对于智能网卡管理的硬件匹配流表包括硬件模糊匹配流表和硬件精确匹配流表的情况,智能网卡接收到报文后,无需将报文分别与硬件模糊匹配流表和硬件精确匹配流表进行匹配,而是先判断报文为第一报文还是第二报文,然后再与硬件模糊匹配流表或硬件精确匹配流表进行匹配。如此,根据报文的类型来进行流量管理,提高了管理效率。In a possible implementation, the hardware fuzzy matching flow table is used to match a first message, and the first message is a message generated by a network element whose flow table entry satisfies the first threshold condition. ; The hardware exact matching flow table is used to match the second message, and the second message is a message generated by a network element that meets the second threshold condition. For the case where the hardware matching flow table managed by the smart network card includes the hardware fuzzy matching flow table and the hardware exact matching flow table, after the smart network card receives the packet, there is no need to compare the packet with the hardware fuzzy matching flow table and the hardware exact matching flow table respectively. Instead of matching, it first determines whether the packet is the first packet or the second packet, and then matches it with the hardware fuzzy matching flow table or the hardware exact matching flow table. In this way, traffic management is performed according to the type of packets, which improves management efficiency.
在一种可能的实现方式中,该方法还包括:所述智能网卡管理数据面哈希表,所述数据面哈希表用于所述智能网卡对多路径转发报文进行多路径转发。通过数据面哈希表实现多路径转发,针对等价多路径(equal-cost multi-path,ECMP)场景,可节省硬件匹配流表中的条目的数量,当OpenFlow配置发生变化时,显著提升了流量管理的稳定性和可靠性。In a possible implementation manner, the method further includes: the smart network card manages a data plane hash table, and the data plane hash table is used by the smart network card to perform multi-path forwarding of multi-path forwarding messages. Multipath forwarding is implemented through the data plane hash table. For equal-cost multi-path (ECMP) scenarios, the number of entries in the hardware matching flow table can be saved. When the OpenFlow configuration changes, the performance is significantly improved. Stability and reliability of traffic management.
在一种可能的实现方式中,所述硬件匹配流表中包括哈希匹配动作项、转向标识匹配动 作项和报文上送所述VS软件控制面匹配动作项的至少一种;其中,所述哈希匹配动作项用于指示执行所述数据面哈希表的查询动作,所述转向标识用于指示所述数据面哈希表,所述数据面哈希表包括哈希值、掩码和所述转向标识,所述掩码对应下一跳信息。In a possible implementation, the hardware matching flow table includes a hash matching action item, a redirection identifier matching action item, and a hash matching action item. Work items and messages are uploaded to at least one of the VS software control plane matching action items; wherein the hash matching action item is used to instruct the execution of the query action of the data plane hash table, and the turn identification is used To indicate the data plane hash table, the data plane hash table includes a hash value, a mask and the redirection identifier, and the mask corresponds to next hop information.
第二方面,提供了一种流表规则的管理方法,该管理方法由VS执行,VS用于与智能网卡连接,该方法包括:VS获取访问控制列表ACL流匹配规则,所述ACL流匹配规则用于所述智能网卡对报文进行运维功能管理;VS指示智能网卡管理所述ACL流匹配规则。In the second aspect, a flow table rule management method is provided. The management method is executed by VS, which is used to connect to the smart network card. The method includes: VS obtains the access control list ACL flow matching rule, and the ACL flow matching rule It is used for the smart network card to perform operation and maintenance function management on the packets; the VS instructs the smart network card to manage the ACL flow matching rules.
在一种可能的实现方式中,所述ACL流匹配规则包括入向的ACL流匹配规则和出向的ACL流匹配规则中的至少一种。In a possible implementation manner, the ACL flow matching rules include at least one of inbound ACL flow matching rules and outbound ACL flow matching rules.
在一种可能的实现方式中,所述VS指示所述智能网卡管理所述ACL流匹配规则,所述方法包括:所述VS调用第一应用程序编程接口API向所述智能网卡发送第一消息,所述第一消息包括所述智能网卡的第一端口的端口标识,所述第一消息用于所述智能网卡在所述智能网卡的第一端口上创建第一ACL流匹配规则。In a possible implementation, the VS instructs the smart network card to manage the ACL flow matching rules, and the method includes: the VS calls a first application programming interface API to send a first message to the smart network card. , the first message includes a port identifier of the first port of the smart network card, and the first message is used by the smart network card to create a first ACL flow matching rule on the first port of the smart network card.
在一种可能的实现方式中,所述第一消息还包括流表规则属性、流表规则匹配项和流表规则动作项中的至少一种;其中,所述流表规则属性用于指示报文需匹配的组、所述第一ACL流匹配规则为入向的ACL流匹配规则还是出向的ACL流匹配规则、流表类型中的至少一种;所述流表规则匹配项包括匹配以太层信息、匹配虚拟局域网VLAN信息、匹配网际协议第四版IPv4信息或匹配网际协议第六版IPv6信息、匹配虚拟扩展局域网VXLAN信息、匹配项结束、报文标记中的至少一种;所述流表规则动作项包括流表统计、采样转发和流镜像、为报文设置内标记、修改指定字段和引用句柄操作中的至少一种。In a possible implementation, the first message further includes at least one of a flow table rule attribute, a flow table rule matching item, and a flow table rule action item; wherein the flow table rule attribute is used to indicate the report At least one of the group to be matched, whether the first ACL flow matching rule is an inbound ACL flow matching rule or an outgoing ACL flow matching rule, and a flow table type; the flow table rule matching items include matching Ethernet layers information, matching virtual LAN VLAN information, matching Internet Protocol version 4 IPv4 information or matching Internet Protocol version 6 IPv6 information, matching virtual extended LAN VXLAN information, matching item end, and at least one of message tags; the flow table Rule action items include at least one of flow table statistics, sampling forwarding and flow mirroring, setting internal tags for packets, modifying specified fields, and refnum operations.
在一种可能的实现方式中,所述方法还包括:所述VS接收所述智能网卡发送的第二消息,所述第二消息用于指示在所述智能网卡的所述第一端口上创建所述第一ACL流匹配规则的结果。In a possible implementation, the method further includes: the VS receiving a second message sent by the smart network card, the second message being used to indicate that the VS is created on the first port of the smart network card. The result of the first ACL flow matching rule.
在一种可能的实现方式中,所述VS指示所述智能网卡管理所述ACL流匹配规则,所述方法包括:所述VS调用第二API向所述智能网卡发送第三消息,所述第三消息用于所述智能网卡在所述智能网卡上删除第二ACL流匹配规则。In a possible implementation, the VS instructs the smart network card to manage the ACL flow matching rules. The method includes: the VS calls a second API to send a third message to the smart network card. The third message is used by the smart network card to delete the second ACL flow matching rule on the smart network card.
在一种可能的实现方式中,所述VS指示所述智能网卡管理所述ACL流匹配规则,所述方法包括:所述VS调用第三API向所述智能网卡发送第四消息,所述第四消息用于所述智能网卡查询并返回所述智能网卡的统计信息。In a possible implementation, the VS instructs the smart network card to manage the ACL flow matching rules, and the method includes: the VS calls a third API to send a fourth message to the smart network card, and the third Four messages are used for the smart network card to query and return the statistical information of the smart network card.
在一种可能的实现方式中,所述方法还包括:所述VS获取硬件匹配流表,所述硬件匹配流表用于所述智能网卡对流量进行流量管理,所述硬件匹配流表包括硬件精确匹配流表和硬件模糊匹配流表中的至少一种;所述VS指示所述智能网卡管理所述硬件匹配流表。In a possible implementation, the method further includes: the VS obtains a hardware matching flow table. The hardware matching flow table is used by the smart network card to manage traffic. The hardware matching flow table includes hardware matching flow table. At least one of an exact matching flow table and a hardware fuzzy matching flow table; the VS instructs the smart network card to manage the hardware matching flow table.
在一种可能的实现方式中,所述硬件模糊匹配流表用于与第一报文进行匹配,所述第一报文为生成流表条目满足第一阈值条件的网元所产生的报文;所述硬件精确匹配流表用于与第二报文进行匹配,所述第二报文为满足第二阈值条件的网元所产生的报文。In a possible implementation, the hardware fuzzy matching flow table is used to match a first message, and the first message is a message generated by a network element whose flow table entry satisfies the first threshold condition. ; The hardware exact matching flow table is used to match the second message, and the second message is a message generated by a network element that meets the second threshold condition.
在一种可能的实现方式中,所述方法还包括:所述VS获取数据面哈希表,所述数据面哈希表用于所述智能网卡对多路径转发报文进行多路径转发;所述VS指示所述智能网卡管理所述数据面哈希表。 In a possible implementation, the method further includes: the VS obtains a data plane hash table, and the data plane hash table is used by the smart network card to perform multi-path forwarding of multi-path forwarding messages; The VS instructs the smart network card to manage the data plane hash table.
在一种可能的实现方式中,所述硬件匹配流表中包括哈希匹配动作项、转向标识匹配动作项和报文上送所述VS软件控制面匹配动作项的至少一种;其中,所述哈希匹配动作项用于指示执行所述数据面哈希表的查询动作,所述转向身份标识号(identity document,ID)用于指示所述数据面哈希表,所述数据面哈希表包括哈希值、掩码和所述转向标识,所述掩码对应下一跳信息。In a possible implementation, the hardware matching flow table includes at least one of a hash matching action item, a redirection identifier matching action item, and a message uploading matching action item to the VS software control plane; wherein, The hash matching action item is used to indicate the execution of the query action of the data plane hash table, and the redirection identity document (ID) is used to indicate the data plane hash table. The data plane hash table The table includes a hash value, a mask and the redirection identifier, and the mask corresponds to next hop information.
第三方面,提供了一种流量管理方法,该方法包括:智能网卡接收报文,将所述报文与所述智能网卡上创建的访问控制列表ACL流匹配规则进行匹配;基于所述报文与所述ACL流匹配规则匹配成功,所述智能网卡根据所述ACL流匹配规则对所述报文进行运维功能管理。当使能运维能力时,由智能网卡实现运维功能的管理,无需将现有转发流表条目清除,接收到的报文也不用上送VS进行重新学习,也可以不再由流量触发,只需将接收到的报文经过智能网卡进行ACL流规则匹配即可,因此,使智能网卡具备高可维可靠的运维能力。再有,通过智能网卡实现计数统计等运维功能,也即由硬件实现计数统计等,相比于软件实现,统计结果更加准确。In a third aspect, a traffic management method is provided, which method includes: a smart network card receives a message, and matches the message with an access control list ACL flow matching rule created on the smart network card; based on the message Successfully matches the ACL flow matching rule, and the smart network card performs operation and maintenance function management on the packet according to the ACL flow matching rule. When the operation and maintenance capability is enabled, the smart network card implements the management of the operation and maintenance function. There is no need to clear the existing forwarding flow table entries, and the received packets do not need to be sent to the VS for re-learning, and they can no longer be triggered by traffic. The received packets only need to be matched with ACL flow rules through the smart network card. Therefore, the smart network card has highly maintainable and reliable operation and maintenance capabilities. Furthermore, operation and maintenance functions such as counting and statistics are implemented through smart network cards, that is, counting and statistics are implemented by hardware. Compared with software implementation, the statistical results are more accurate.
在一种可能的实现方式中,所述ACL流匹配规则包括入向的ACL流匹配规则和出向的ACL流匹配规则;所述基于所述报文与所述ACL流匹配规则匹配成功,所述智能网卡根据所述ACL流匹配规则对所述报文进行运维功能管理,包括:基于所述报文与所述入向的ACL流匹配规则匹配成功,所述智能网卡根据所述入向的ACL流匹配规则对所述报文进行入向的运维功能管理;所述智能网卡将所述报文进行二三层网络转发;基于所述报文与所述出向的ACL流匹配规则匹配成功,所述智能网卡根据所述出向的ACL流匹配规则对所述报文进行出向的运维功能管理。In a possible implementation, the ACL flow matching rules include inbound ACL flow matching rules and outgoing ACL flow matching rules; based on the successful matching of the packet and the ACL flow matching rule, the The intelligent network card performs operation and maintenance function management on the packet according to the ACL flow matching rule, including: based on the successful matching of the packet with the incoming ACL flow matching rule, the intelligent network card performs operation and maintenance function management on the incoming ACL flow matching rule based on the incoming ACL flow matching rule. The ACL flow matching rules perform inbound operation and maintenance function management on the packets; the smart network card forwards the packets on Layer 2 and Layer 3 networks; the packets are successfully matched with the outbound ACL flow matching rules. , the smart network card performs outbound operation and maintenance function management on the packet according to the outbound ACL flow matching rules.
在一种可能的实现方式中,所述方法还包括:所述智能网卡将所述报文与硬件匹配流表进行匹配,所述硬件匹配流表包括硬件精确匹配流表和硬件模糊匹配流表中的至少一种;所述智能网卡根据所述报文与所述硬件匹配流表的匹配结果对所述报文进行流量管理。In a possible implementation, the method further includes: the smart network card matches the message with a hardware matching flow table, where the hardware matching flow table includes a hardware exact matching flow table and a hardware fuzzy matching flow table. At least one of: the smart network card performs traffic management on the packet according to the matching result between the packet and the hardware matching flow table.
在一种可能的实现方式中,所述智能网卡将所述报文与硬件匹配流表进行匹配,包括:基于所述报文为第一报文,所述智能网卡将所述报文与所述硬件模糊匹配流表进行匹配,所述第一报文为生成流表条目满足第一阈值条件的网元所产生的报文;或,基于所述报文为第二报文,所述智能网卡将所述报文与所述硬件精确匹配流表进行匹配,所述第二报文为满足第二阈值条件的网元所产生的报文。In a possible implementation, the smart network card matches the message with a hardware matching flow table, including: based on the message being the first message, the smart network card matches the message with the The hardware fuzzy matching flow table is used for matching, and the first message is a message generated by a network element that generates a flow table entry that satisfies the first threshold condition; or based on the message being a second message, the intelligent The network card matches the packet with the hardware exact matching flow table, and the second packet is a packet generated by a network element that meets the second threshold condition.
在一种可能的实现方式中,所述智能网卡根据所述报文与所述硬件匹配流表的匹配结果对所述报文进行流量管理,包括:基于所述报文与所述硬件匹配流表的匹配结果为所述报文与所述硬件匹配流表匹配成功,且所述硬件匹配流表中包括上送动作项,将所述报文上送所述VS;或者,基于所述报文与所述硬件匹配流表的匹配结果为所述报文与所述硬件匹配流表匹配失败,将所述报文上送所述VS。In a possible implementation, the smart network card performs traffic management on the packet according to the matching result between the packet and the hardware matching flow table, including: based on the matching flow between the packet and the hardware. The matching result of the table is that the packet successfully matches the hardware matching flow table, and the hardware matching flow table includes a upload action item, and the packet is uploaded to the VS; or, based on the report If the matching result between the packet and the hardware matching flow table is that the packet fails to match the hardware matching flow table, the packet is sent to the VS.
在一种可能的实现方式中,所述报文为多路径转发报文,所述方法还包括:所述智能网卡将所述报文与数据面哈希表进行匹配;基于所述报文与所述数据面哈希表匹配成功,所述智能网卡对所述报文进行多路径转发。In a possible implementation, the message is a multi-path forwarding message, and the method further includes: the smart network card matches the message with a data plane hash table; based on the message and The data plane hash table matches successfully, and the smart network card performs multi-path forwarding of the message.
在一种可能的实现方式中,所述硬件匹配流表包括哈希匹配动作项和转向标识匹配 动作项;其中,所述哈希匹配动作项用于指示执行所述数据面哈希表的查询动作,所述转向标识用于指示所述数据面哈希表,所述数据面哈希表包括哈希值、掩码和所述转向标识,所述掩码对应下一跳信息;In a possible implementation, the hardware matching flow table includes hash matching action items and turn identification matching Action item; wherein, the hash matching action item is used to indicate the execution of the query action of the data plane hash table, and the turn identification is used to indicate the data plane hash table, and the data plane hash table includes Hash value, mask and the redirection identifier, the mask corresponding to the next hop information;
所述智能网卡将所述报文与数据面哈希表进行匹配,包括:所述智能网卡基于所述哈希匹配动作项,计算所述报文对应的哈希值,基于所述哈希值获取所述报文对应的掩码;基于所述转向标识匹配动作项,查找所述数据面哈希表;基于所述报文对应的掩码与所述数据面哈希表中的掩码一致,确定所述报文与所述数据面哈希表匹配成功;The smart network card matches the message with the data plane hash table, including: the smart network card calculates a hash value corresponding to the message based on the hash matching action item, and calculates a hash value based on the hash value. Obtain the mask corresponding to the message; search the data plane hash table based on the steering identifier matching action item; based on the mask corresponding to the message is consistent with the mask in the data plane hash table , confirming that the message matches the data plane hash table successfully;
所述智能网卡对所述报文进行多路径转发,包括:所述智能网卡按照所述数据面哈希表中所述掩码对应的下一跳信息对所述报文进行多路径转发。The intelligent network card performs multi-path forwarding of the message, including: the intelligent network card performs multi-path forwarding of the message according to the next hop information corresponding to the mask in the data plane hash table.
在一种可能的实现方式中,所述硬件匹配流表包括哈希匹配动作项、转向标识匹配动作项和报文上送所述VS软件控制面匹配动作项;其中,所述哈希匹配动作项用于指示执行所述数据面哈希表的查询动作,所述转向标识用于指示所述数据面哈希表,所述数据面哈希表包括哈希值、掩码和所述转向标识,所述掩码对应下一跳信息;In a possible implementation, the hardware matching flow table includes a hash matching action item, a redirection identification matching action item, and a packet uploading matching action item to the VS software control plane; wherein, the hash matching action item The item is used to indicate the execution of the query action of the data plane hash table, and the turn identification is used to indicate the data side hash table. The data side hash table includes a hash value, a mask and the turn identification , the mask corresponds to the next hop information;
所述智能网卡将所述报文与数据面哈希表进行匹配,包括:所述智能网卡基于所述哈希匹配动作项,计算所述报文对应的哈希值,基于所述哈希值获取所述报文对应的掩码;基于所述转向标识匹配动作项,查找所述数据面哈希表;基于所述报文对应的哈希值与所述数据面哈希表中的掩码不一致,确定所述报文与所述数据面哈希表匹配失败;The smart network card matches the message with the data plane hash table, including: the smart network card calculates a hash value corresponding to the message based on the hash matching action item, and calculates a hash value based on the hash value. Obtain the mask corresponding to the message; search the data plane hash table based on the steering identifier matching action item; based on the hash value corresponding to the message and the mask in the data plane hash table Inconsistent, it is determined that the message and the data plane hash table fail to match;
所述方法还包括:所述智能网卡将所述报文上送虚拟交换机VS。The method further includes: the smart network card sending the message to the virtual switch VS.
第四方面,提供了一种流量管理方法,该方法包括:虚拟交换机VS接收智能网卡发送的报文,所述报文由所述智能网卡在所述报文与所述智能网卡上的硬件匹配流表的匹配成功,且所述硬件匹配流表中包括上送动作项的情况下发送,或者,所述报文由所述智能网卡在所述报文与所述智能网卡上的硬件匹配流表的匹配失败的情况下发送,或者,所述报文由所述智能网卡在所述报文与所述智能网卡上的数据面哈希表匹配失败后发送;所述VS将所述报文与所述VS上的开源流表进行匹配,根据匹配结果对所述报文进行流量管理。In a fourth aspect, a traffic management method is provided. The method includes: the virtual switch VS receives a message sent by the smart network card, and the message is matched by the smart network card with the hardware on the smart network card. The flow table is successfully matched and the hardware matching flow table includes an upload action item, or the message is sent by the smart network card when the message matches the hardware flow on the smart network card. The message is sent when the matching table fails, or the message is sent by the smart network card after the message fails to match the data plane hash table on the smart network card; the VS sends the message Match with the open source flow table on the VS, and perform traffic management on the packets based on the matching results.
第五方面,提供了一种流表规则的管理方法,该方法由智能网卡执行,方法包括:智能网卡管理硬件匹配流表,所述硬件匹配流表用于所述智能网卡对流量进行流量管理,所述硬件匹配流表包括硬件精确匹配流表和硬件模糊匹配流表中的至少一种。In a fifth aspect, a method for managing flow table rules is provided. The method is executed by a smart network card. The method includes: the smart network card manages a hardware matching flow table, and the hardware matching flow table is used by the smart network card to perform traffic management on traffic. , the hardware matching flow table includes at least one of a hardware exact matching flow table and a hardware fuzzy matching flow table.
在一种可能的实现方式中,所述硬件模糊匹配流表用于与第一报文进行匹配,所述第一报文为生成流表条目满足第一阈值条件的网元所产生的报文;所述硬件精确匹配流表用于与第二报文进行匹配,所述第二报文为满足第二阈值条件的网元所产生的报文。In a possible implementation, the hardware fuzzy matching flow table is used to match a first message, and the first message is a message generated by a network element whose flow table entry satisfies the first threshold condition. ; The hardware exact matching flow table is used to match the second message, and the second message is a message generated by a network element that meets the second threshold condition.
在一种可能的实现方式中,所述方法还包括:所述智能网卡管理数据面哈希表,所述数据面哈希表用于所述智能网卡对多路径转发报文进行多路径转发。In a possible implementation manner, the method further includes: the smart network card manages a data plane hash table, and the data plane hash table is used by the smart network card to perform multi-path forwarding of multi-path forwarding messages.
在一种可能的实现方式中,所述硬件匹配流表中包括哈希匹配动作项、转向标识匹配动作项和报文上送所述VS软件控制面匹配动作项的至少一种;其中,所述哈希匹配动作项用于指示执行所述数据面哈希表的查询动作,所述转向标识用于指示所述数据面哈希表,所述数据面哈希表包括哈希值、掩码和所述转向标识,所述掩码对应下一跳信息。 In a possible implementation, the hardware matching flow table includes at least one of a hash matching action item, a redirection identifier matching action item, and a message uploading matching action item to the VS software control plane; wherein, The hash matching action item is used to indicate the execution of the query action of the data plane hash table, and the redirection flag is used to indicate the data plane hash table. The data plane hash table includes a hash value, a mask and the redirection identifier, and the mask corresponds to next hop information.
第六方面,提供了一种流表规则的管理方法,该方法由VS执行,VS用于与智能网卡连接,方法包括:VS获取硬件匹配流表,所述硬件匹配流表用于所述智能网卡对流量进行流量管理,所述硬件匹配流表包括硬件精确匹配流表和硬件模糊匹配流表中的至少一种;所述VS指示所述智能网卡管理所述硬件匹配流表。In the sixth aspect, a flow table rule management method is provided. The method is executed by VS, which is used to connect to a smart network card. The method includes: VS obtains a hardware matching flow table, and the hardware matching flow table is used for the smart network card. The network card performs traffic management on traffic, and the hardware matching flow table includes at least one of a hardware exact matching flow table and a hardware fuzzy matching flow table; the VS instructs the smart network card to manage the hardware matching flow table.
在一种可能的实现方式中,所述硬件模糊匹配流表用于与第一报文进行匹配,所述第一报文为生成流表条目满足第一阈值条件的网元所产生的报文;所述硬件精确匹配流表用于与第二报文进行匹配,所述第二报文为满足第二阈值条件的网元所产生的报文。In a possible implementation, the hardware fuzzy matching flow table is used to match a first message, and the first message is a message generated by a network element whose flow table entry satisfies the first threshold condition. ; The hardware exact matching flow table is used to match the second message, and the second message is a message generated by a network element that meets the second threshold condition.
在一种可能的实现方式中,所述方法还包括:所述VS获取数据面哈希表,所述数据面哈希表用于所述智能网卡对多路径转发报文进行多路径转发;所述VS指示所述智能网卡管理所述数据面哈希表。In a possible implementation, the method further includes: the VS obtains a data plane hash table, and the data plane hash table is used by the smart network card to perform multi-path forwarding of multi-path forwarding messages; The VS instructs the smart network card to manage the data plane hash table.
在一种可能的实现方式中,所述硬件匹配流表中包括哈希匹配动作项、转向标识匹配动作项和报文上送所述VS软件控制面匹配动作项的至少一种;其中,所述哈希匹配动作项用于指示执行所述数据面哈希表的查询动作,所述转向ID用于指示所述数据面哈希表,所述数据面哈希表包括哈希值、掩码和所述转向标识,所述掩码对应下一跳信息。In a possible implementation, the hardware matching flow table includes at least one of a hash matching action item, a redirection identifier matching action item, and a message uploading matching action item to the VS software control plane; wherein, The hash matching action item is used to indicate the execution of the query action of the data plane hash table, and the steering ID is used to indicate the data plane hash table. The data plane hash table includes a hash value, a mask and the redirection identifier, and the mask corresponds to next hop information.
第七方面,提供了一种流量管理方法,该方法包括:智能网卡获取报文,将所述报文与硬件匹配流表进行匹配,所述硬件匹配流表包括硬件精确匹配流表和硬件模糊匹配流表中的至少一种;所述智能网卡根据所述报文与所述硬件匹配流表的匹配结果对所述报文进行流量管理。In a seventh aspect, a traffic management method is provided. The method includes: a smart network card obtains a message, and matches the message with a hardware matching flow table. The hardware matching flow table includes a hardware exact matching flow table and a hardware fuzzy flow table. Match at least one of the flow tables; the smart network card performs traffic management on the packet according to the matching result between the packet and the hardware matching flow table.
在一种可能的实现方式中,所述智能网卡将所述报文与硬件匹配流表进行匹配,包括:基于所述报文为第一报文,所述智能网卡将所述报文与所述硬件模糊匹配流表进行匹配,所述第一报文为生成流表条目满足第一阈值条件的网元所产生的报文;或,基于所述报文为第二报文,所述智能网卡将所述报文与所述硬件精确匹配流表进行匹配,所述第二报文为满足第二阈值条件的网元所产生的报文。In a possible implementation, the smart network card matches the message with a hardware matching flow table, including: based on the message being the first message, the smart network card matches the message with the The hardware fuzzy matching flow table is used for matching, and the first message is a message generated by a network element that generates a flow table entry that satisfies the first threshold condition; or based on the message being a second message, the intelligent The network card matches the packet with the hardware exact matching flow table, and the second packet is a packet generated by a network element that meets the second threshold condition.
在一种可能的实现方式中,所述智能网卡根据所述报文与所述硬件匹配流表的匹配结果对所述报文进行流量管理,包括:基于所述报文与所述硬件匹配流表的匹配结果为所述报文与所述硬件匹配流表匹配成功,且所述硬件匹配流表中包括上送动作项,将所述报文上送所述VS;或者,基于所述报文与所述硬件匹配流表的匹配结果为所述报文与所述硬件匹配流表匹配失败,将所述报文上送所述VS。In a possible implementation, the smart network card performs traffic management on the packet according to the matching result between the packet and the hardware matching flow table, including: based on the matching flow between the packet and the hardware. The matching result of the table is that the packet successfully matches the hardware matching flow table, and the hardware matching flow table includes a upload action item, and the packet is uploaded to the VS; or, based on the report If the matching result between the packet and the hardware matching flow table is that the packet fails to match the hardware matching flow table, the packet is sent to the VS.
在一种可能的实现方式中,所述报文为多路径转发报文,所述方法还包括:所述智能网卡将所述报文与数据面哈希表进行匹配;基于所述报文与所述数据面哈希表匹配成功,所述智能网卡对所述报文进行多路径转发。In a possible implementation, the message is a multi-path forwarding message, and the method further includes: the smart network card matches the message with a data plane hash table; based on the message and The data plane hash table matches successfully, and the smart network card performs multi-path forwarding of the message.
在一种可能的实现方式中,所述硬件匹配流表包括哈希匹配动作项和转向标识匹配动作项;其中,所述哈希匹配动作项用于指示执行所述数据面哈希表的查询动作,所述转向标识用于指示所述数据面哈希表,所述数据面哈希表包括哈希值、掩码和所述转向标识,所述掩码对应下一跳信息;In a possible implementation, the hardware matching flow table includes a hash matching action item and a turn identification matching action item; wherein the hash matching action item is used to indicate execution of a query of the data plane hash table Action, the redirection identifier is used to indicate the data plane hash table, the data plane hash table includes a hash value, a mask and the redirection identifier, and the mask corresponds to next hop information;
所述智能网卡将所述报文与数据面哈希表进行匹配,包括:所述智能网卡基于所述哈希匹配动作项,计算所述报文对应的哈希值,基于所述哈希值获取所述报文对应的掩码;基于所述转向标识匹配动作项,查找所述数据面哈希表;基于所述报文对应的掩码与所述数据面哈希表中的掩码一致,确定所述报文与所述数据面哈希表匹配成功; The smart network card matches the message with the data plane hash table, including: the smart network card calculates a hash value corresponding to the message based on the hash matching action item, and calculates a hash value based on the hash value. Obtain the mask corresponding to the message; search the data plane hash table based on the steering identifier matching action item; based on the mask corresponding to the message is consistent with the mask in the data plane hash table , confirming that the message matches the data plane hash table successfully;
所述智能网卡对所述报文进行多路径转发,包括:所述智能网卡按照所述数据面哈希表中所述掩码对应的下一跳信息对所述报文进行多路径转发。The intelligent network card performs multi-path forwarding of the message, including: the intelligent network card performs multi-path forwarding of the message according to the next hop information corresponding to the mask in the data plane hash table.
在一种可能的实现方式中,所述硬件匹配流表包括哈希匹配动作项、转向标识匹配动作项和报文上送所述VS软件控制面匹配动作项;其中,所述哈希匹配动作项用于指示执行所述数据面哈希表的查询动作,所述转向标识用于指示所述数据面哈希表,所述数据面哈希表包括哈希值、掩码和所述转向标识,所述掩码对应下一跳信息;In a possible implementation, the hardware matching flow table includes a hash matching action item, a redirection identification matching action item, and a packet uploading matching action item to the VS software control plane; wherein, the hash matching action item The item is used to indicate the execution of the query action of the data plane hash table, and the turn identification is used to indicate the data side hash table. The data side hash table includes a hash value, a mask and the turn identification , the mask corresponds to the next hop information;
所述智能网卡将所述报文与数据面哈希表进行匹配,包括:所述智能网卡基于所述哈希匹配动作项,计算所述报文对应的哈希值,基于所述哈希值获取所述报文对应的掩码;基于所述转向标识匹配动作项,查找所述数据面哈希表;基于所述报文对应的哈希值与所述数据面哈希表中的掩码不一致,确定所述报文与所述数据面哈希表匹配失败;The smart network card matches the message with the data plane hash table, including: the smart network card calculates a hash value corresponding to the message based on the hash matching action item, and calculates a hash value based on the hash value. Obtain the mask corresponding to the message; search the data plane hash table based on the steering identifier matching action item; based on the hash value corresponding to the message and the mask in the data plane hash table Inconsistent, it is determined that the message and the data plane hash table fail to match;
所述方法还包括:所述智能网卡将所述报文上送虚拟交换机VS。The method further includes: the smart network card sending the message to the virtual switch VS.
第八方面,提供了一种流量管理方法,该方法包括:VS接收智能网卡发送的报文,所述报文由所述智能网卡在所述报文与所述智能网卡上的硬件匹配流表的匹配成功,且所述硬件匹配流表中包括上送动作项的情况下发送,或者,所述报文由所述智能网卡在所述报文与所述智能网卡上的硬件匹配流表的匹配失败的情况下发送,或者,所述报文由所述智能网卡在所述报文与所述智能网卡上的数据面哈希表匹配失败后发送;In an eighth aspect, a traffic management method is provided. The method includes: VS receives a message sent by a smart network card, and the message is matched by the smart network card between the message and a hardware matching flow table on the smart network card. is sent when the matching is successful and the hardware matching flow table includes an upload action item, or the message is sent by the smart network card when the message matches the hardware matching flow table on the smart network card. Sent when the match fails, or the message is sent by the smart network card after the message fails to match the data plane hash table on the smart network card;
所述VS将所述报文与所述VS上的开源流表进行匹配,根据匹配结果对所述报文进行流量管理。The VS matches the packet with the open source flow table on the VS, and performs traffic management on the packet according to the matching result.
第九方面,提供了一种管理装置,该装置包括:处理器,所述处理器用于实现如上述第一方面或第二方面或第五方面或第六方面中任一的流表规则的管理方法,或者,用于实现如上述第三方面或第四方面或第七方面或第八方面任一所述的流量管理方法。In a ninth aspect, a management device is provided, which device includes: a processor configured to implement management of flow table rules as in any one of the above-mentioned first aspect, second aspect, fifth aspect, or sixth aspect. The method, or, is used to implement the traffic management method as described in any one of the third aspect, the fourth aspect, the seventh aspect, or the eighth aspect.
在一种可能的实现方式中,所述装置为芯片。In a possible implementation, the device is a chip.
在一种可能的实现方式中,所述装置为网络设备,所述网络设备的类型包括以下至少一项:路由器、交换机或服务器。In a possible implementation, the device is a network device, and the type of the network device includes at least one of the following: a router, a switch, or a server.
第十方面,提供了一种管理系统,该管理系统包括VS和智能网卡,智能网卡用于执行上述第一方面、第五方面中任一的流表规则的管理方法,VS用于执行上述第二方面或第六方面中任一的流表规则的管理方法。In a tenth aspect, a management system is provided. The management system includes a VS and a smart network card. The smart network card is used to execute the management method of the flow table rules in any one of the above first and fifth aspects. The VS is used to execute the above mentioned flow table rules. The management method of flow table rules in either aspect 2 or aspect 6.
第十一方面,提供了一种管理系统,该管理系统包括VS和智能网卡,智能网卡用于执行上述第三方面、第七方面中任一的流量管理方法,VS用于执行上述第四方面或第八方面中任一的流量管理方法。In an eleventh aspect, a management system is provided. The management system includes a VS and a smart network card. The smart network card is used to perform the traffic management method in any one of the above third and seventh aspects. The VS is used to perform the above fourth aspect. Or any traffic management method in the eighth aspect.
第十二方面,提供了一种网络设备,该网络设备包括处理器,处理器与存储器耦合,存储器中存储有至少一条程序指令或代码,至少一条程序指令或代码由处理器加载并执行,以使该网络设备实现如上述第一方面或第二方面或第五方面或第六方面中任一的流表规则的管理方法,或者,实现如上述第三方面或第四方面或第七方面或第八方面任一所述的流量管理方法。In a twelfth aspect, a network device is provided. The network device includes a processor. The processor is coupled to a memory. At least one program instruction or code is stored in the memory. The at least one program instruction or code is loaded and executed by the processor. The network device is allowed to implement the flow table rule management method in any one of the above-mentioned first aspect, second aspect, fifth aspect or sixth aspect, or to implement the above-mentioned third aspect, fourth aspect or seventh aspect or The traffic management method described in any one of the eighth aspects.
第十三方面,提供了一种计算机可读存储介质,所述存储介质中存储有至少一条指令,所述指令由处理器加载并执行,以使计算机实现如上述第一方面或第二方面或第五方面或第六方面中任一的流表规则的管理方法,或者,实现如上述第三方面或第四方面或第七方面或第八方面任一所述的流量管理方法。 In a thirteenth aspect, a computer-readable storage medium is provided. At least one instruction is stored in the storage medium, and the instruction is loaded and executed by a processor, so that the computer implements the above-mentioned first or second aspect or The management method of flow table rules in any one of the fifth or sixth aspects, or the traffic management method described in any one of the third or fourth aspect, the seventh or the eighth aspect, is implemented.
第十四方面,提供了一种计算机程序(产品),该计算机程序(产品)包括计算机程序,当该计算机程序被计算机运行时,使得该计算机执行如上述第一方面或第二方面或第五方面或第六方面中任一的流表规则的管理方法,或者,执行如上述第三方面或第四方面或第七方面或第八方面任一所述的流量管理方法。In a fourteenth aspect, a computer program (product) is provided. The computer program (product) includes a computer program. When the computer program is run by a computer, it causes the computer to execute the above-mentioned first aspect or the second aspect or the fifth aspect. The method for managing flow table rules in any one of the aspects or the sixth aspect, or executing the traffic management method as described in any one of the above-mentioned third aspect, fourth aspect, seventh aspect or eighth aspect.
第十五方面,提供了一种通信装置,该装置包括:收发器、存储器和处理器。其中,该收发器、该存储器和该处理器通过内部连接通路互相通信,该存储器用于存储指令,该处理器用于执行该存储器存储的指令,以控制收发器接收信号,并控制收发器发送信号,并且当该处理器执行该存储器存储的指令时,使得该处理器执行如上述第一方面或第二方面或第五方面或第六方面中任一的流表规则的管理方法,或者,执行如上述第三方面或第四方面或第七方面或第八方面任一所述的流量管理方法。In a fifteenth aspect, a communication device is provided, which includes: a transceiver, a memory, and a processor. Wherein, the transceiver, the memory and the processor communicate with each other through an internal connection path, the memory is used to store instructions, and the processor is used to execute the instructions stored in the memory to control the transceiver to receive signals and control the transceiver to send signals. , and when the processor executes the instructions stored in the memory, the processor is caused to execute the flow table rule management method as in any one of the above-mentioned first aspect, second aspect, fifth aspect or sixth aspect, or, execute The traffic management method as described in any one of the above third aspect, fourth aspect, seventh aspect or eighth aspect.
在一种可能的实现方式中,处理器为一个或多个,存储器为一个或多个。In a possible implementation, there are one or more processors and one or more memories.
在一种可能的实现方式中,存储器可以与处理器集成在一起,或者存储器与处理器分离设置。In a possible implementation, the memory may be integrated with the processor, or the memory may be provided separately from the processor.
在具体实现过程中,存储器可以为非瞬时性(non-transitory)存储器,例如,只读存储器(read only memory,ROM),其可以与处理器集成在同一块芯片上,也可以分别设置在不同的芯片上,本申请对存储器的类型以及存储器与处理器的设置方式不做限定。In the specific implementation process, the memory can be a non-transitory memory, such as a read-only memory (ROM), which can be integrated on the same chip as the processor, or can be set on different On the chip, this application does not limit the type of memory and the arrangement of the memory and the processor.
第十六方面,提供了一种芯片,包括处理器,用于从存储器中调用并运行存储器中存储的指令,使得安装有芯片的通信设备执行如上述第一方面或第二方面或第五方面或第六方面中任一的流表规则的管理方法,或者,执行如上述第三方面或第四方面或第七方面或第八方面任一所述的流量管理方法。In a sixteenth aspect, a chip is provided, including a processor for calling and running instructions stored in the memory, so that the communication device installed with the chip executes the above-mentioned first aspect, second aspect, or fifth aspect. Or the management method of flow table rules in any one of the sixth aspect, or, perform the traffic management method as described in any one of the third or fourth aspect, the seventh aspect or the eighth aspect.
第十七方面,提供了另一种芯片,包括:输入接口、输出接口、处理器和存储器,输入接口、输出接口、处理器以及存储器之间通过内部连接通路相连,处理器用于执行存储器中的代码,当代码被执行时,处理器用于执行如上述第一方面或第二方面或第五方面或第六方面中任一的流表规则的管理方法,或者,执行如上述第三方面或第四方面或第七方面或第八方面任一所述的流量管理方法。In a seventeenth aspect, another chip is provided, including: an input interface, an output interface, a processor, and a memory. The input interface, the output interface, the processor, and the memory are connected through an internal connection path. The processor is used to execute tasks in the memory. Code, when the code is executed, the processor is configured to execute the management method of the flow table rules in any one of the above-mentioned first aspect or the second aspect or the fifth aspect or the sixth aspect, or to execute the above-mentioned third aspect or the third aspect. The traffic management method described in any one of the fourth aspect, the seventh aspect, or the eighth aspect.
应当理解的是,本申请的第二方面至第十七方面技术方案及对应的可能的实施方式所取得的有益效果可以参见上述对第一方面及其对应的可能的实施方式的技术效果,此处不再赘述。It should be understood that the beneficial effects achieved by the technical solutions of the second to seventeenth aspects of the present application and the corresponding possible implementations can be referred to the above-mentioned technical effects of the first aspect and the corresponding possible implementations. No further details will be given.
附图说明Description of the drawings
图1为本申请实施例提供的一种实施环境示意图;Figure 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application;
图2为本申请实施例提供的另一种实施环境示意图;Figure 2 is a schematic diagram of another implementation environment provided by the embodiment of the present application;
图3为本申请实施例提供的另一种实施环境示意图;Figure 3 is a schematic diagram of another implementation environment provided by the embodiment of the present application;
图4为本申请实施例提供的一种流表规则的管理方法的交互示意图;Figure 4 is an interactive schematic diagram of a flow table rule management method provided by an embodiment of the present application;
图5为本申请实施例提供的一种流量管理方法流程图;Figure 5 is a flow chart of a traffic management method provided by an embodiment of the present application;
图6为本申请实施例提供的一种流表规则的管理及流量管理过程示意图;Figure 6 is a schematic diagram of a flow table rule management and traffic management process provided by an embodiment of the present application;
图7为本申请实施例提供的另一种流表规则的管理方法的交互示意图;Figure 7 is an interactive schematic diagram of another flow table rule management method provided by an embodiment of the present application;
图8为本申请实施例提供的另一种流表规则的管理方法的交互示意图;Figure 8 is an interactive schematic diagram of another flow table rule management method provided by an embodiment of the present application;
图9为本申请实施例提供的另一种流量管理方法流程图; Figure 9 is a flow chart of another traffic management method provided by an embodiment of the present application;
图10为本申请实施例提供的另一种流表规则的管理及流量管理过程示意图;Figure 10 is a schematic diagram of another flow table rule management and traffic management process provided by the embodiment of the present application;
图11为本申请实施例提供的另一种流表规则的管理及流量管理过程示意图;Figure 11 is a schematic diagram of another flow table rule management and traffic management process provided by the embodiment of the present application;
图12为本申请实施例提供的另一种流表规则的管理方法的交互示意图;Figure 12 is an interactive schematic diagram of another flow table rule management method provided by an embodiment of the present application;
图13为本申请实施例提供的另一种流量管理方法的交互示意图;Figure 13 is an interactive schematic diagram of another traffic management method provided by an embodiment of the present application;
图14为本申请实施例提供的另一种流表规则的管理及流量管理过程示意图;Figure 14 is a schematic diagram of another flow table rule management and traffic management process provided by the embodiment of the present application;
图15为本申请实施例提供的另一种流表规则的管理方法的交互示意图;Figure 15 is an interactive schematic diagram of another flow table rule management method provided by an embodiment of the present application;
图16为本申请实施例提供的一种流表规则的管理装置的结构示意图;Figure 16 is a schematic structural diagram of a flow table rule management device provided by an embodiment of the present application;
图17为本申请实施例提供的另一种流表规则的管理装置的结构示意图;Figure 17 is a schematic structural diagram of another flow table rule management device provided by an embodiment of the present application;
图18为本申请实施例提供的一种流量管理装置的结构示意图;Figure 18 is a schematic structural diagram of a traffic management device provided by an embodiment of the present application;
图19为本申请实施例提供的另一种流量管理装置的结构示意图;Figure 19 is a schematic structural diagram of another traffic management device provided by an embodiment of the present application;
图20为本申请实施例提供的一种网络设备的结构示意图;Figure 20 is a schematic structural diagram of a network device provided by an embodiment of the present application;
图21为本申请实施例提供的另一种网络设备的结构示意图。Figure 21 is a schematic structural diagram of another network device provided by an embodiment of the present application.
具体实施方式Detailed ways
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。In order to make the purpose, technical solutions and advantages of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
随着网卡(network interface card,NIC)的发展,智能网卡(smart NIC)应运而生。智能网卡也称智能网络适配器,除了能完成标准网卡所具有的网络传输功能之外,智能网卡还提供内置的可编程、可配置的硬件加速引擎。智能网卡不仅能够提升应用程序的性能,还可以大幅降低中央处理器(central processing unit,CPU)在通信中的消耗,因而能够为应用程序提供更多的CPU资源。也正因为如此,随着网络带宽的增加,VS的一些流量管理操作可由智能网卡实现。本申请实施例提供了一种流表规则的管理方法以及流量管理方法,以在VS将流表规则下发到智能网卡后,能够对智能网卡上的流表规则进行管理,进一步基于流表规则进行流量管理。With the development of network interface card (NIC), smart network card (smart NIC) emerged as the times require. Smart network cards are also called smart network adapters. In addition to completing the network transmission functions of standard network cards, smart network cards also provide built-in programmable and configurable hardware acceleration engines. Smart network cards can not only improve the performance of applications, but also significantly reduce the consumption of the central processing unit (CPU) in communication, thus providing more CPU resources for applications. Because of this, as network bandwidth increases, some traffic management operations of VS can be implemented by smart network cards. The embodiment of this application provides a flow table rule management method and a traffic management method, so that after the VS delivers the flow table rules to the smart network card, it can manage the flow table rules on the smart network card, and further based on the flow table rules Carry out traffic management.
示例性地,本申请实施例提供的方法可应用于如图1所示的实施环境中。图1中,该实施环境包括SDN控制器、VS和智能网卡。SDN控制器与VS连接,VS上插接有至少一个智能网卡(图1中仅以一个为例进行说明)。其中,VS是支持OpenFlow协议的虚拟交换机,OpenFlow协议是一套SDN控制协议,不同厂商使用该标准实现交换机和控制器(controller)能够相互兼容,从而便于实现SDN。可选地,VS可以是开源虚拟交换机(open virtual switch,OVS)。Illustratively, the method provided by the embodiment of the present application can be applied in the implementation environment shown in Figure 1. In Figure 1, the implementation environment includes SDN controller, VS and intelligent network card. The SDN controller is connected to the VS, and at least one smart network card is plugged into the VS (only one is used as an example in Figure 1 for illustration). Among them, VS is a virtual switch that supports the OpenFlow protocol. The OpenFlow protocol is a set of SDN control protocols. Different manufacturers use this standard to make switches and controllers compatible with each other, thereby facilitating the implementation of SDN. Optionally, VS can be an open source virtual switch (OVS).
在一种可能的实现方式中,SDN控制器管理所有流表,流表中包括一条或多条流匹配规则。SDN控制器向VS下发OpenFlow表,OpenFlow表中包括至少一条OpenFlow匹配规则,VS可基于OpenFlow表生成ACL,也即生成一条或者多条ACL流匹配规则。以图2所示的实施环境为例,VS生成ACL之后,可在VS上管理OpenFlow表和ACL,也即管理OpenFlow匹配规则和ACL流匹配规则。其中,ACL包括但不限于入向(ingress)的ACL和出向(egress)的ACL中的至少一种,也即VS生成的ACL流匹配规则包括但不限于入向的ACL流匹配规则和出向的ACL流匹配规则中的至少一种。入向的ACL流匹配规则用于对报文在入向进行访问控制,出向的ACL流匹配规则用于对报文在出向进行访问控制。 In a possible implementation, the SDN controller manages all flow tables, and the flow tables include one or more flow matching rules. The SDN controller delivers an OpenFlow table to the VS, which contains at least one OpenFlow matching rule. The VS can generate an ACL based on the OpenFlow table, that is, generate one or more ACL flow matching rules. Taking the implementation environment shown in Figure 2 as an example, after VS generates an ACL, the OpenFlow table and ACL can be managed on VS, that is, OpenFlow matching rules and ACL flow matching rules can be managed. The ACL includes but is not limited to at least one of an ingress ACL and an egress ACL. That is, the ACL flow matching rules generated by the VS include but are not limited to ingress ACL flow matching rules and egress ACL. ACL flow matches at least one of the rules. Inbound ACL flow matching rules are used to control access to packets in the inbound direction, and outbound ACL flow matching rules are used to control access to packets in the outbound direction.
可选地,VS除了基于OpenFlow表生成ACL之外,还可基于OpenFlow表生成模糊匹配流(MegaFlow)表和精确匹配流(extract match cache,EMC)表中的至少一种。以图3所示的实施环境为例,VS可在VS上管理OpenFlow表、ACL、模糊匹配流表和精确匹配流表。其中,模糊匹配流表中包括至少一条模糊流匹配规则,精确匹配流表中包括至少一条精确流匹配规则,该ACL中包括至少一条ACL流匹配规则,该至少一条ACL流匹配规则包括入向的ACL流匹配规则和出向的ACL流匹配规则中的至少一种。Optionally, in addition to generating an ACL based on the OpenFlow table, VS can also generate at least one of a fuzzy match flow (MegaFlow) table and an exact match flow (extract match cache, EMC) table based on the OpenFlow table. Taking the implementation environment shown in Figure 3 as an example, VS can manage OpenFlow tables, ACLs, fuzzy matching flow tables and exact matching flow tables on VS. The fuzzy matching flow table includes at least one fuzzy flow matching rule, the exact matching flow table includes at least one precise flow matching rule, the ACL includes at least one ACL flow matching rule, and the at least one ACL flow matching rule includes incoming At least one of ACL flow matching rules and outbound ACL flow matching rules.
无论VS上管理的流表是哪种,随着网络带宽的增加,VS可将VS上的流表下发到智能网卡,并指示由智能网卡来进行流表规则的管理以及流量管理。在一种可能的实现方式中,VS上运行有数据平面开发套件(data plane development kit,DPDK),DPDK是在数据平面应用中为快速的数据包处理提供的一个简单而完善的开源框架,VS与智能网卡通过该开源框架连接。不同的智能网卡可通过智能网卡上的驱动程序注册到该开源框架上,从而实现VS与智能网卡的绑定,VS也由此能够获取智能网卡的相关信息,例如端口信息。其中,开源框架上包括多个开源接口,也即应用程序编程接口(application programming interface,API)。VS指示智能网卡进行流表规则的管理时,可通过调用开源框架上对应的API来实现。接下来,以如下几种流表规则的管理方法为例进行说明。No matter what kind of flow table is managed on the VS, as the network bandwidth increases, the VS can deliver the flow table on the VS to the smart network card and instruct the smart network card to manage the flow table rules and traffic management. In a possible implementation, VS runs a data plane development kit (DPDK). DPDK is a simple and complete open source framework that provides fast packet processing in data plane applications. VS Connect with smart network cards through this open source framework. Different smart network cards can be registered to the open source framework through the driver on the smart network card, thereby binding the VS to the smart network card. From this, VS can obtain relevant information about the smart network card, such as port information. Among them, the open source framework includes multiple open source interfaces, namely application programming interface (API). When VS instructs the smart network card to manage flow table rules, it can do so by calling the corresponding API on the open source framework. Next, the following management methods of flow table rules will be explained as examples.
本申请实施例提供了一种流表规则的管理方法,如图4所示的流表规则的管理方法的交互示意图,该管理方法由VS和智能网卡之间的交互来实现。如图4所示,该方法包括但不限于如下步骤401-步骤403。The embodiment of the present application provides a method for managing flow table rules. Figure 4 is an interaction diagram of the method for managing flow table rules. The management method is implemented by the interaction between the VS and the smart network card. As shown in Figure 4, the method includes but is not limited to the following steps 401 to 403.
步骤401,VS获取ACL流匹配规则,ACL流匹配规则用于智能网卡对报文进行运维功能管理。Step 401: VS obtains ACL flow matching rules, which are used by the smart network card to perform operation and maintenance function management on packets.
如图2或图3的实施环境所述,SDN控制器可向VS下发OpenFlow表,VS可基于OpenFlow表生成ACL,也即生成一条或者多条ACL流匹配规则。之后,VS可将生成的ACL流匹配规则下发给智能网卡。示例性地,ACL流匹配规则包括入向的ACL流匹配规则和出向的ACL流匹配规则中的至少一种。任一条ACL流匹配规则用于智能网卡对报文进行运维功能管理,如果ACL流匹配规则仅包括入向的ACL流匹配规则,该入向的ACL流匹配规则可用于智能网卡在入向进行运维功能管理。如果ACL流匹配规则仅包括出向的ACL流匹配规则,该出向的ACL流匹配规则可用于智能网卡在出向进行运维功能管理。如果ACL流匹配规则既包括入向的ACL流匹配规则,也包括出向的ACL流匹配规则,则可用于智能网卡既在入向进行运维功能管理,也在出向进行运维功能管理。As described in the implementation environment of Figure 2 or Figure 3, the SDN controller can deliver an OpenFlow table to the VS, and the VS can generate an ACL based on the OpenFlow table, that is, generate one or more ACL flow matching rules. Afterwards, VS can deliver the generated ACL flow matching rules to the smart network card. Exemplarily, the ACL flow matching rules include at least one of inbound ACL flow matching rules and outbound ACL flow matching rules. Any ACL flow matching rule is used by the smart network card to perform operation and maintenance function management of packets. If the ACL flow matching rule only includes inbound ACL flow matching rules, the incoming ACL flow matching rule can be used by the smart network card in the inbound direction. Operation and maintenance function management. If the ACL flow matching rules only include outbound ACL flow matching rules, the outgoing ACL flow matching rules can be used for outbound O&M function management of the intelligent NIC. If the ACL flow matching rules include both inbound and outbound ACL flow matching rules, the smart NIC can be used to manage both the inbound and outbound O&M functions.
步骤402,VS指示智能网卡管理ACL流匹配规则。Step 402: VS instructs the intelligent network card to manage ACL flow matching rules.
VS将ACL流匹配规则下发给智能网卡后,可指示智能网卡管理ACL流匹配规则,由此实现将ACL流匹配规则下发到智能网卡上,使智能网卡具有运维功能。其中,VS指示智能网卡管理ACL流匹配规则的方式包括但不限于创建ACL流匹配规则、删除ACL流匹配规则以及基于ACL流匹配规则查询统计信息等运维功能。After VS delivers the ACL flow matching rules to the smart network card, it can instruct the smart network card to manage the ACL flow matching rules, thereby delivering the ACL flow matching rules to the smart network card, so that the smart network card has operation and maintenance functions. Among them, the VS instructs the smart network card to manage ACL flow matching rules, including but not limited to creating ACL flow matching rules, deleting ACL flow matching rules, and querying statistical information based on ACL flow matching rules and other operation and maintenance functions.
步骤403,智能网卡管理ACL流匹配规则。Step 403: The intelligent network card manages ACL flow matching rules.
智能网卡接收到VS下发的ACL流匹配规则,根据VS的指示来管理ACL流匹配规则。在一种可能的实现方式中,VS指示智能网卡管理ACL流匹配规则以及智能网卡管理ACL流匹配规则,包括但不限于如下几种情况。The smart network card receives the ACL flow matching rules issued by the VS and manages the ACL flow matching rules according to the instructions of the VS. In a possible implementation, the VS instructs the intelligent network card to manage ACL flow matching rules and the intelligent network card to manage ACL flow matching rules, including but not limited to the following situations.
情况一,VS指示智能网卡创建ACL流匹配规则。 In case 1, VS instructs the smart network card to create an ACL flow matching rule.
在该情况一中,由于VS与智能网卡通过开源框架连接,开源框架上包括多个开源接口,也即API,VS可获取到智能网卡的端口信息。因此,VS指示智能网卡管理ACL流匹配规则时,VS可调用第一API向智能网卡发送第一消息,该第一消息包括智能网卡的第一端口的端口标识,第一消息用于智能网卡在智能网卡的第一端口上创建第一ACL流匹配规则。通过在第一消息中携带端口标识,使得智能网卡能够在对应的端口上创建ACL流匹配规则,提高创建ACL流匹配规则的准确性。In this case, since the VS and the smart network card are connected through an open source framework, which includes multiple open source interfaces, that is, APIs, the VS can obtain the port information of the smart network card. Therefore, when VS instructs the smart network card to manage the ACL flow matching rules, VS can call the first API to send the first message to the smart network card. The first message includes the port identifier of the first port of the smart network card. The first message is used by the smart network card to Create the first ACL flow matching rule on the first port of the smart NIC. By carrying the port identifier in the first message, the smart network card can create an ACL flow matching rule on the corresponding port, thereby improving the accuracy of creating an ACL flow matching rule.
本申请实施例不限定第一API,例如,该第一API对应流表条目创建函数,VS调用第一API,也即实现对流表条目创建函数的调用,进而通过该第一API来封装第一消息,并向智能网卡发送第一消息。由于第一消息包括智能网卡的第一端口的端口标识,使得智能网卡接收到第一消息后,能够确定在哪个端口上创建第一ACL流匹配规则。The embodiment of the present application does not limit the first API. For example, the first API corresponds to the flow table entry creation function. VS calls the first API, that is, it implements the call to the flow table entry creation function, and then uses the first API to encapsulate the first API. message and sends the first message to the smart network card. Since the first message includes the port identifier of the first port of the smart network card, the smart network card can determine on which port to create the first ACL flow matching rule after receiving the first message.
在一种可能的实现方式中,该第一消息除了包括智能网卡的第一端口的端口标识外,第一消息还包括流表规则属性、流表规则匹配项和流表规则动作项中的至少一种;其中,流表规则属性用于指示报文需匹配的组、第一ACL流匹配规则的方向信息、流表类型中的至少一种;流表规则匹配项包括匹配以太层信息、匹配虚拟局域网(virtual local area network,VLAN)信息、匹配网际协议第四版(internet protocol version4,IPv4)信息或匹配网际协议第六版(internet protocol version6,IPv6)信息、匹配虚拟扩展局域网(virtual extensible local area network,VXLAN)信息、匹配项结束、报文标记中的至少一种;流表规则动作项包括流表统计、采样转发和流镜像、为报文设置内标记、修改指定字段和引用句柄操作中的至少一种。通过在第一消息中携带流表规则属性、流表规则匹配项和流表规则动作项中的至少一种信息,使得智能网卡创建的ACL流匹配规则更加的准确和全面。In a possible implementation, in addition to the port identifier of the first port of the smart network card, the first message also includes at least one of flow table rule attributes, flow table rule matching items, and flow table rule action items. One; wherein the flow table rule attribute is used to indicate at least one of the group to which the packet needs to match, the direction information of the first ACL flow matching rule, and the flow table type; the flow table rule matching items include matching Ethernet layer information, matching Virtual local area network (VLAN) information, matching Internet protocol version 4 (IPv4) information or matching Internet protocol version 6 (IPv6) information, matching virtual extensible local area network, VXLAN) information, end of matching items, and at least one of packet tags; flow table rule action items include flow table statistics, sampling forwarding and flow mirroring, setting internal tags for packets, modifying specified fields, and refnum operations at least one of them. By carrying in the first message at least one type of information among flow table rule attributes, flow table rule matching items and flow table rule action items, the ACL flow matching rules created by the intelligent network card are made more accurate and comprehensive.
例如,该流表条目创建函数以及第一消息的内容及说明可如下面的表1所示。表1中,保留(reserved)字段对应保留位的高两位,通过保留位的高两位来代表流表规则类型。对于ACL流匹配规则,该reserved参数的高两位为3,代表创建的流表规则类型为ACL流匹配规则。For example, the flow table entry creation function and the content and description of the first message may be as shown in Table 1 below. In Table 1, the reserved field corresponds to the high two bits of the reserved bits, and the flow table rule type is represented by the high two bits of the reserved bits. For ACL flow matching rules, the high two digits of the reserved parameter are 3, indicating that the flow table rule type created is an ACL flow matching rule.
表1

Table 1

示例性地,上述表1中的流表规则匹配项,包括但不限于如下表2所示的内容。For example, the flow table rule matching items in the above Table 1 include but are not limited to the content shown in the following Table 2.
表2

Table 2

示例性地,上述表1中的流表规则动作项,包括但不限于如下表3所示的内容。For example, the flow table rule action items in Table 1 include but are not limited to the content shown in Table 3 below.
表3
table 3
基于上述表1-表3,针对运维统计需求,通过流(flow)接口(reserved=3)将ACL流匹配规则下发到智能网卡上。智能网卡在创建ACL流匹配规则时可指定ACL流匹配规 则的方向,例如入向(ingress)的ACL流匹配规则或出向(egress)的ACL流匹配规则。对于智能网卡上创建有入向的ACL流匹配规则和出向的ACL流匹配规则的情况,智能网卡对接收到的报文执行入向的ACL流匹配规则匹配,然后进行二三层网络转发,再执行出向的ACL流匹配规则的过程。Based on the above Table 1-Table 3, in order to meet the operation and maintenance statistical requirements, the ACL flow matching rules are delivered to the smart network card through the flow interface (reserved=3). When creating an ACL flow matching rule, the smart NIC can specify the ACL flow matching rule. direction, such as ingress ACL flow matching rules or egress ACL flow matching rules. For the case where inbound ACL flow matching rules and outbound ACL flow matching rules are created on the smart network card, the smart network card performs inbound ACL flow matching rules on the received packets, and then forwards them on the Layer 2 and Layer 3 networks, and then The process of executing outbound ACL flow matching rules.
可选地,如上面表1所示,智能网卡还支持对ACL流匹配规则进行分组,同一端口同一方向的ACL流匹配规则可对每个分组进行匹配查询。例如,可通过表1中的group参数标识不同的规则组编号。Optionally, as shown in Table 1 above, the smart network card also supports grouping ACL flow matching rules. ACL flow matching rules in the same port and the same direction can be matched and queried for each group. For example, different rule group numbers can be identified through the group parameter in Table 1.
在一种可能的实现方式中,本申请实施例提供的方法中的ACL流匹配规则可在入向时为报文设置TAG标记,在出向时通过匹配TAG标记即可实现对报文的统计。In a possible implementation, the ACL flow matching rules in the method provided by the embodiments of this application can set a TAG mark for the packets when inbound, and the statistics of the packets can be realized by matching the TAG mark when going outbound.
需要说明的是,在本申请实施例提供的方法中,ACL流匹配规则支持流表规则匹配项的任意组合。在实施的过程中,本申请实施例提供的方法可不对某一个流表规则匹配项的某些bit进行掩码匹配,但各个流表规则匹配项可通过掩码(mask)的方式确定是否作为上述表2所示的流表规则匹配项。此外,ACL流匹配规则支持上述表3中的流表规则动作项的任意组合。例如,基于表3,可以使用引用1个句柄操作。It should be noted that in the method provided by the embodiment of the present application, the ACL flow matching rules support any combination of flow table rule matching items. During the implementation process, the method provided by the embodiments of the present application may not perform mask matching on certain bits of a certain flow table rule matching item, but each flow table rule matching item may be determined by masking whether it is a The flow table rule matches shown in Table 2 above. In addition, ACL flow matching rules support any combination of the flow table rule action items in Table 3 above. For example, based on Table 3, you can use the reference 1 handle operation.
在一种可能的实现方式中,智能网卡创建ACL规则之后,该方法还包括:智能网卡向VS发送第二消息,第二消息指示在智能网卡的第一端口上创建第一ACL流匹配规则的结果。示例性地,第二消息包括第一端口的端口标识以及创建第一ACL流匹配规则的结果。例如,智能网卡创建第一ACL流匹配规则的结果为成功时,返回对应的返回值,否则为错误信息。例如,创建第一ACL流匹配规则的结果为成功时,返回的返回值为0。或者,返回值为流表条目对象指针。如果创建第一ACL流匹配规则的结果为失败时,返回值为空指针。In a possible implementation, after the smart network card creates the ACL rule, the method further includes: the smart network card sends a second message to the VS, and the second message indicates to create the first ACL flow matching rule on the first port of the smart network card. result. Exemplarily, the second message includes the port identification of the first port and the result of creating the first ACL flow matching rule. For example, when the smart network card creates the first ACL flow matching rule and the result is successful, the corresponding return value is returned; otherwise, an error message is returned. For example, when the result of creating the first ACL flow matching rule is success, the return value is 0. Alternatively, the return value is a flow table entry object pointer. If the result of creating the first ACL flow matching rule is failure, the return value is a null pointer.
相应的,VS接收智能网卡发送的第二消息。由于第二消息用于指示在智能网卡的第一端口上创建第一ACL流匹配规则的结果,因此,VS基于第二消息可获取到智能网卡在第一端口创建第一ACL流匹配规则的结果。例如,第二消息包括创建第一ACL流匹配规则的结果为成功时对应的返回值,则VS能够确定智能网卡成功创建第一ACL流匹配规则,如果第二消息包括的是错误信息,则VS能够确定智能网卡创建第一ACL流匹配规则失败。通过向VS返回用于指示创建ACL流匹配规则的结果,增加可靠性。Correspondingly, VS receives the second message sent by the smart network card. Since the second message is used to indicate the result of creating the first ACL flow matching rule on the first port of the smart network card, the VS can obtain the result of creating the first ACL flow matching rule on the first port of the smart network card based on the second message. . For example, if the second message includes the corresponding return value when the result of creating the first ACL flow matching rule is successful, then VS can determine that the smart network card successfully created the first ACL flow matching rule. If the second message includes error information, then VS It can be determined that the smart network card failed to create the first ACL flow matching rule. Increases reliability by returning results to VS indicating the creation of ACL flow matching rules.
情况二,VS指示智能网卡删除ACL流匹配规则。In case 2, VS instructs the smart network card to delete the ACL flow matching rule.
在该情况二中,VS指示智能网卡管理ACL流匹配规则,包括:VS调用第二API向智能网卡发送第三消息。其中,第三消息用于智能网卡在智能网卡上删除第二ACL流匹配规则。In this second situation, VS instructs the smart network card to manage the ACL flow matching rules, including: VS calls the second API to send a third message to the smart network card. The third message is used by the smart network card to delete the second ACL flow matching rule on the smart network card.
本申请实施例不对第二API进行限定,当创建的ACL流匹配规则发生变化时,VS可调用第二API,进而通过该第二API来封装第三消息,并向智能网卡发送第三消息。其中,第三消息可包括智能网卡的第二端口的端口标识,以指示智能网卡将在第二端口创建的第二ACL流匹配规则进行删除。可选地,第三消息中除了包括端口标识,还可以包括流信息,例如该流信息包括ACL匹配规则方向和ACL匹配规则项等信息,从而通过该第三消息指示智能网卡删除端口标识对应的端口上与该流信息对应的ACL流匹配规则。The embodiment of this application does not limit the second API. When the created ACL flow matching rule changes, VS can call the second API, and then encapsulate the third message through the second API, and send the third message to the smart network card. The third message may include a port identifier of the second port of the smart network card to instruct the smart network card to delete the second ACL flow matching rule created on the second port. Optionally, in addition to the port identification, the third message may also include flow information. For example, the flow information includes information such as ACL matching rule direction and ACL matching rule items, thereby instructing the smart network card to delete the data corresponding to the port identification through the third message. ACL flow matching rules corresponding to the flow information on the port.
需要说明的是,本申请实施例中的第一端口可与第二端口相同,则第一ACL流匹配规则与第二ACL流匹配规则相同,在创建第一ACL流匹配规则之后,可支持对第一ACL 流匹配规则的删除。可选地,第一端口也可与第二端口不同,第二ACL流匹配规则与第二ACL流匹配规则不同,本申请实施例不对创建和删除的ACL流匹配规则是否为同样的ACL流匹配规则进行限定。例如,第二API对应流表条目删除函数。该流表条目删除函数的内容可如下面的表4所示。It should be noted that the first port in the embodiment of the present application can be the same as the second port, then the first ACL flow matching rule is the same as the second ACL flow matching rule. After the first ACL flow matching rule is created, the matching rule can be supported. First ACL Deletion of flow matching rules. Optionally, the first port may be different from the second port, and the second ACL flow matching rule is different from the second ACL flow matching rule. This embodiment of the application does not determine whether the created and deleted ACL flow matching rules match the same ACL flow. The rules are limited. For example, the second API corresponds to the flow table entry deletion function. The content of the flow table entry deletion function can be shown in Table 4 below.
表4
Table 4
相应的,智能网卡管理ACL流匹配规则,包括:智能网卡接收VS调用第二API发送的第三消息,基于第三消息在智能网卡上删除第二ACL流匹配规则。Correspondingly, the smart network card manages the ACL flow matching rules, including: the smart network card receives the third message sent by VS by calling the second API, and deletes the second ACL flow matching rule on the smart network card based on the third message.
在一种可能的实现方式中,智能网卡还可向VS返回删除第二ACL流匹配规则的结果,例如,如果删除成功,向VS返回值为0的消息,以使VS根据返回值确定智能网卡成功删除了第二ACL流匹配规则。又例如,如果智能网卡删除第二ACL流匹配规则失败,则返回错误信息,例如错误信息的参数默认为空值(null),以使VS根据返回的错误信息确定智能网卡未成功删除第二ACL流匹配规则。或者,如果删除成功,返回值为流表条目对象指针。如果删除第一ACL流匹配规则的结果为失败时,返回值为空指针。In a possible implementation, the smart network card can also return the result of deleting the second ACL flow matching rule to VS. For example, if the deletion is successful, a message with a value of 0 is returned to VS, so that VS determines the smart network card based on the return value. The second ACL flow matching rule is successfully deleted. For another example, if the smart network card fails to delete the second ACL flow matching rule, an error message is returned. For example, the parameter of the error message defaults to a null value (null), so that VS determines that the smart network card has not successfully deleted the second ACL based on the returned error message. Stream matching rules. Or, if the deletion is successful, the return value is a flow table entry object pointer. If the result of deleting the first ACL flow matching rule is failure, the return value is a null pointer.
情况三,VS指示智能网卡查询统计信息。In case three, VS instructs the smart network card to query statistical information.
在情况三中,VS指示智能网卡管理ACL流匹配规则,包括:VS调用第三API向智能网卡发送第四消息。其中,第四消息用于智能网卡查询并返回智能网卡的统计信息。In case three, VS instructs the smart network card to manage ACL flow matching rules, including: VS calls a third API to send a fourth message to the smart network card. Among them, the fourth message is used to query the smart network card and return the statistical information of the smart network card.
本申请不限定第三API,VS需要查询智能网卡上的统计信息时,通过调用第三API向智能网卡发送第四消息。示例性地,VS通过调用第三API来封装第四消息,该第四消息中包括智能网卡上的端口的端口标识,用于智能网卡查询并返回该端口标识对应的端口上的统计信息。例如,ACL流匹配规则包括流表统计动作项,则智能网卡进行流表统计动作之后,VS可通过第四消息查询智能网卡上的统计信息。可选地,在ACL流匹配规则不包括流表统计动作项的情况下,VS也可调用第三API向智能网卡发送第四消息,以查询智能网卡上的统计信息,例如查询VS下发至智能网卡上的ACL规则条目。This application does not limit the third API. When VS needs to query the statistical information on the smart network card, it sends a fourth message to the smart network card by calling the third API. Exemplarily, the VS encapsulates the fourth message by calling the third API. The fourth message includes the port identifier of the port on the smart network card, which is used for the smart network card to query and return statistical information on the port corresponding to the port identifier. For example, if the ACL flow matching rule includes a flow table statistics action item, then after the smart network card performs the flow table statistics action, the VS can query the statistical information on the smart network card through the fourth message. Optionally, when the ACL flow matching rule does not include the flow table statistics action item, the VS can also call the third API to send the fourth message to the smart network card to query the statistical information on the smart network card. For example, the query VS sends to ACL rule entries on the smart NIC.
以该第三API对应开源查询函数为例,VS调用第三API,也即调用开源查询函数,查询函数的内容可如下面的表5所示。Taking the open source query function corresponding to the third API as an example, VS calls the third API, that is, calls the open source query function. The content of the query function can be as shown in Table 5 below.
表5
table 5
相应的,智能网卡管理ACL流匹配规则,包括:智能网卡接收VS调用第三API发送的第四消息,基于第四消息查询并返回智能网卡的统计信息。通过第四消息实现统计信 息的查询,使得流表规则的管理更加灵活。Correspondingly, the smart network card manages ACL flow matching rules, including: the smart network card receives the fourth message sent by VS by calling the third API, and queries and returns the statistical information of the smart network card based on the fourth message. Realizing statistical information through the fourth message Information query makes the management of flow table rules more flexible.
在一种可能的实现方式中,智能网卡还可向VS返回查询结果,例如,如果查询成功,向VS返回值为0的消息,以使VS根据返回值确定智能网卡成功查询到了流表规则的条目。又例如,如果智能网卡查询失败,则返回错误信息,例如错误信息的参数默认为null,以使VS根据返回的错误信息确定智能网卡未查询到流表规则的条目。或者,如果查询成功,返回值为流表条目对象指针。如果查询失败时,返回值为空指针。In a possible implementation, the smart network card can also return query results to VS. For example, if the query is successful, a message with a value of 0 is returned to VS, so that VS determines that the smart network card has successfully queried the flow table rule based on the return value. entry. For another example, if the smart network card query fails, error information is returned. For example, the parameter of the error message defaults to null, so that VS determines that the smart network card has not queried the entry of the flow table rule based on the returned error information. Or, if the query is successful, the return value is a flow table entry object pointer. If the query fails, the return value is a null pointer.
本申请实施例提供的方法,通过将运维规则下发到智能网卡,无需流量触发,当使能运维能力时,无需将智能网卡上已存在的转发流表条目清除,首包也不用上送VS进行重新学习;当运维能力关闭或者ACL流匹配规则发生变化时,VS将下发的ACL流匹配规则进行删除,后续收到的报文不经过ACL流匹配规则的匹配即可,使智能网卡具备高可维可靠的运维能力,且灵活性更高。再有,通过智能网卡实现计数统计等运维功能,也即由硬件实现计数统计等,相比于软件实现,统计结果更加准确。The method provided by the embodiment of this application does not require traffic triggering by issuing operation and maintenance rules to the smart network card. When the operation and maintenance capability is enabled, there is no need to clear the existing forwarding flow table entries on the smart network card, and the first packet does not need to be uploaded. Send the VS to re-learn; when the operation and maintenance capability is turned off or the ACL flow matching rules change, the VS will delete the ACL flow matching rules issued, and subsequent received packets will not be matched by the ACL flow matching rules, so that Smart network cards have highly maintainable and reliable operation and maintenance capabilities and are more flexible. Furthermore, operation and maintenance functions such as counting and statistics are implemented through smart network cards, that is, counting and statistics are implemented by hardware. Compared with software implementation, the statistical results are more accurate.
基于上述流表规则的管理方法,本申请实施例提供了一种流量管理方法,参见图5,本申请实施例提供的流量管理方法包括如下步骤501和步骤502。Based on the above management method of flow table rules, an embodiment of the present application provides a traffic management method. Referring to Figure 5, the traffic management method provided by the embodiment of the present application includes the following steps 501 and 502.
步骤501,智能网卡接收报文,将报文与智能网卡上创建的ACL流匹配规则进行匹配。Step 501: The smart network card receives the message and matches the message with the ACL flow matching rule created on the smart network card.
本申请实施例不对智能网卡接收到的报文的类型进行限定,例如,该报文为音视频应用程序的报文,也可以为游戏类应用程序的报文,还可以为即时通讯应用程序的报文等。本申请实施例也不限定智能网卡接收到的报文数量,每个报文均可按照本申请实施例提供的流量管理方法进行管理。The embodiments of this application do not limit the type of packets received by the smart network card. For example, the packets may be packets from audio and video applications, or may be packets from game applications, or may also be packets from instant messaging applications. Messages etc. The embodiment of the present application does not limit the number of packets received by the smart network card. Each packet can be managed according to the traffic management method provided by the embodiment of the present application.
无论是哪种类型的报文,智能网卡接收到该报文后,均将报文与智能网卡上创建的ACL流匹配规则进行匹配。其中,智能网卡上创建的ACL流匹配规则包括入向的ACL流匹配规则和出向的ACL流匹配规则中的至少一种,任一条ACL流匹配规则用于智能网卡对报文进行运维功能管理。例如,如果ACL流匹配规则仅包括入向的ACL流匹配规则,智能网卡将报文与该入向的ACL流匹配规则进行匹配。如果ACL流匹配规则仅包括出向的ACL流匹配规则,该智能网卡将报文与出向的ACL流匹配规则进行匹配。如果ACL流匹配规则既包括入向的ACL流匹配规则,也包括出向的ACL流匹配规则,则智能网卡将报文与入向的ACL流匹配规则和出向的ACL流匹配规则分别进行匹配。Regardless of the type of packet, after the smart NIC receives the packet, it will match the packet with the ACL flow matching rules created on the smart NIC. Among them, the ACL flow matching rules created on the smart network card include at least one of inbound ACL flow matching rules and outgoing ACL flow matching rules. Any ACL flow matching rule is used by the smart network card to perform operation and maintenance function management of packets. . For example, if the ACL flow matching rule only includes the incoming ACL flow matching rule, the smart NIC will match the packet with the incoming ACL flow matching rule. If the ACL flow matching rule only includes the outbound ACL flow matching rule, the smart NIC matches the packet with the outgoing ACL flow matching rule. If the ACL flow matching rule includes both inbound and outbound ACL flow matching rules, the smart NIC will match the packet with the inbound ACL flow matching rule and the outbound ACL flow matching rule respectively.
示例性地,无论是入向的ACL流匹配规则,还是出向的ACL流匹配规则,其中,ACL流匹配规则中的流表规则匹配项可如上面的表2所示。智能网卡将报文与ACL流匹配规则中的各条流表规则匹配项进行匹配,如果报文命中任一流表规则匹配项,则认为报文与ACL流匹配规则匹配成功。For example, whether it is an inbound ACL flow matching rule or an outgoing ACL flow matching rule, the flow table rule matching items in the ACL flow matching rule may be as shown in Table 2 above. The smart network card matches the packet with each flow table rule matching item in the ACL flow matching rule. If the packet matches any flow table rule matching item, the packet is considered to successfully match the ACL flow matching rule.
例如,以ACL流匹配规则中包括表2中用于匹配以太层信息的流表规则匹配项ETH为例,该流表规则匹配项ETH包括源MAC地址、目的MAC地址和协议类型等匹配项参数。智能网卡接收到报文后,获取报文的源MAC地址、目的MAC地址和协议类型,如果报文的源MAC地址、目的MAC地址和协议类型与ACL流匹配规则中的流表规则匹配项ETH包括的源MAC地址、目的MAC地址和协议类型匹配,则确定报文与ACL流匹配规则匹配成功。For example, take the ACL flow matching rule including the flow table rule matching item ETH in Table 2 for matching Ethernet layer information. The flow table rule matching item ETH includes matching item parameters such as source MAC address, destination MAC address, and protocol type. . After receiving the message, the smart network card obtains the source MAC address, destination MAC address and protocol type of the message. If the source MAC address, destination MAC address and protocol type of the message match the flow table rule ETH in the ACL flow matching rule If the included source MAC address, destination MAC address, and protocol type match, it is determined that the packet successfully matches the ACL flow matching rules.
可选地,如果报文与ACL流匹配规则中的各个流表规则匹配项均不匹配,则确定报 文与ACL流匹配规则匹配失败。Optionally, if the packet does not match any flow table rule matching item in the ACL flow matching rule, the report is determined to be The file failed to match the ACL flow matching rule.
步骤502,基于报文与ACL流匹配规则匹配成功,智能网卡根据ACL流匹配规则对报文进行运维功能管理。Step 502: Based on the successful match between the packet and the ACL flow matching rule, the smart network card performs operation and maintenance function management on the packet according to the ACL flow matching rule.
在一种可能的实现方式中,ACL流匹配规则包括入向的ACL流匹配规则和出向的ACL流匹配规则;基于报文与ACL流匹配规则匹配成功,智能网卡根据ACL流匹配规则对报文进行运维功能管理,包括:基于报文与入向的ACL流匹配规则匹配成功,智能网卡根据入向的ACL流匹配规则对报文进行入向的运维功能管理;智能网卡将报文进行二三层网络转发;基于报文与出向的ACL流匹配规则匹配成功,智能网卡根据出向的ACL流匹配规则对报文进行出向的运维功能管理。In a possible implementation, the ACL flow matching rules include inbound ACL flow matching rules and outgoing ACL flow matching rules; based on the successful matching of the packet and the ACL flow matching rule, the smart network card processes the packet according to the ACL flow matching rule. Carry out operation and maintenance function management, including: based on successful matching between packets and inbound ACL flow matching rules, the smart network card performs inbound operation and maintenance function management on the packets based on the incoming ACL flow matching rules; the smart network card processes the packets Layer 2 and Layer 3 network forwarding; based on successful matching between the packet and the outbound ACL flow matching rules, the smart network card performs outbound operation and maintenance function management on the packets based on the outbound ACL flow matching rules.
为了便于说明,以图6所示的流表规则的管理和流量管理过程为例,对本申请实施例提供的方法进行举例说明。图6中,VS基于SDN控制器下发的OpenFlow表生成入向的ACL流匹配规则和出向的ACL流匹配规则后,如图6中的虚线箭头所示,将入向的ACL流匹配规则和出向的ACL流匹配规则下发到智能网卡,在智能网卡上进行流表规则的管理。该流表规则的管理过程可参见上述图4所示的流表规则的管理方法,此处不再赘述。For ease of explanation, the method provided by the embodiment of the present application is illustrated by taking the management of flow table rules and the traffic management process shown in Figure 6 as an example. In Figure 6, after VS generates inbound ACL flow matching rules and outbound ACL flow matching rules based on the OpenFlow table issued by the SDN controller, as shown by the dotted arrow in Figure 6, the inbound ACL flow matching rules and The outbound ACL flow matching rules are delivered to the smart network card, and the flow table rules are managed on the smart network card. For the management process of the flow table rules, please refer to the management method of the flow table rules shown in Figure 4 above, and will not be described again here.
如图6的实线箭头所示,智能网卡接收到报文后,先将报文与入向的ACL流匹配规则进行匹配,如果匹配成功,智能网卡根据入向的ACL流匹配规则对报文进行入向的运维功能管理,也即执行流表规则动作项对应的动作,例如执行入向的流表统计、为报文设置TAG标记等。执行流表规则动作项对应的动作之后,智能网卡将报文进行二三层网络转发。As shown by the solid arrow in Figure 6, after receiving the message, the smart network card first matches the message with the incoming ACL flow matching rules. If the match is successful, the smart network card processes the message according to the incoming ACL flow matching rules. Carry out inbound operation and maintenance function management, that is, execute the actions corresponding to the flow table rule action items, such as performing inbound flow table statistics, setting TAG marks for packets, etc. After executing the action corresponding to the action item of the flow table rule, the smart network card forwards the packet on the Layer 2 and Layer 3 network.
在报文出智能网卡之前,基于报文与出向的ACL流匹配规则进行匹配,如果匹配成功,智能网卡根据出向的ACL流匹配规则对报文进行出向的运维功能管理。例如,对报文执行出向的流表统计,基于入向设置的TAG标记进行报文的统计等。Before the packet leaves the smart network card, the packet is matched based on the outbound ACL flow matching rules. If the match is successful, the smart network card performs outbound operation and maintenance function management on the packet based on the outbound ACL flow matching rules. For example, perform outbound flow table statistics on packets, and perform packet statistics based on the TAG set in the inbound direction.
可选地,本申请实施例提供的方法还包括:基于报文与入向的ACL流匹配规则或者出向的ACL流匹配规则匹配失败,无需执行ACL流匹配规则中的流表规则动作项,智能网卡将报文直接进行二三层网络转发。Optionally, the method provided by the embodiment of this application also includes: based on the failure of matching the packet with the inbound ACL flow matching rule or the outgoing ACL flow matching rule, there is no need to execute the flow table rule action item in the ACL flow matching rule, intelligent The network card forwards the packets directly to the second and third layer networks.
需要说明的是,以上仅以智能网卡管理的ACL流匹配规则包括入向的ACL流匹配规则和出向的ACL流匹配规则为例进行说明。在本申请实施例提供的方法中,智能网卡管理的ACL流匹配规则也可以仅包括入向的ACL流匹配规则,或者仅包括出向的ACL流匹配规则。智能网卡仅包括入向的ACL流匹配规则,或者仅包括出向的ACL流匹配规则可以是VS仅将入向的ACL流匹配规则下发到智能网卡或者仅将出向的ACL流匹配规则下发到智能网卡,也可以是VS将入向的ACL流匹配规则和出向的ACL流匹配规则下发到智能网卡后,又指示将入向的ACL流匹配规则或出向的ACL流匹配规则进行了删除的情况。关于删除ACL流匹配规则的过程,可参见上述图4所示的流表规则的管理方法中的相关说明,此处不再赘述。It should be noted that the above description only takes the ACL flow matching rules managed by the smart network card, including the inbound ACL flow matching rules and the outgoing ACL flow matching rules, as an example. In the method provided by the embodiments of this application, the ACL flow matching rules managed by the smart network card may also include only inbound ACL flow matching rules, or only outbound ACL flow matching rules. The smart NIC only includes inbound ACL flow matching rules, or only outbound ACL flow matching rules. The VS can deliver only incoming ACL flow matching rules to the smart NIC or only outbound ACL flow matching rules. Smart NIC, or the VS delivers the incoming ACL flow matching rules and outgoing ACL flow matching rules to the smart NIC, and then instructs the incoming ACL flow matching rules or the outgoing ACL flow matching rules to be deleted. Condition. Regarding the process of deleting ACL flow matching rules, please refer to the relevant instructions in the management method of flow table rules shown in Figure 4 above, and will not be described again here.
针对智能网卡管理的ACL流匹配规则仅包括入向的ACL流匹配规则的情况,智能网卡接收到报文后,先将报文与入向的ACL流匹配规则进行匹配。如果匹配成功,智能网卡根据入向的ACL流匹配规则对报文进行入向的运维功能管理,也即执行流表规则动作项对应的动作,例如执行入向的流表统计、为报文设置TAG标记等。执行流表规则动作项对应的动作之后,智能网卡将报文进行二三层网络转发。 For the case where the ACL flow matching rules managed by the smart NIC only include incoming ACL flow matching rules, after receiving the packet, the smart NIC first matches the packet with the incoming ACL flow matching rules. If the match is successful, the smart network card performs inbound operation and maintenance function management on the packets based on the inbound ACL flow matching rules, that is, performs the actions corresponding to the action items of the flow table rules, such as performing inbound flow table statistics and updating packets. Set TAG tags, etc. After executing the action corresponding to the action item of the flow table rule, the smart network card forwards the packet on the Layer 2 and Layer 3 network.
针对智能网卡管理的ACL流匹配规则仅包括出向的ACL流匹配规则的情况,智能网卡接收到报文后,先将报文进行理由转发。在报文出智能网卡之前,将报文与出向的ACL流匹配规则进行匹配,如果匹配成功,智能网卡根据出向的ACL流匹配规则对报文进行出向的运维功能管理,也即执行流表规则动作项对应的动作,例如执行出向的流表统计等。执行流表规则动作项对应的动作之后,智能网卡将报文进行二三层网络转发。For the case where the ACL flow matching rules managed by the smart NIC only include outbound ACL flow matching rules, after receiving the packet, the smart NIC first forwards the packet for reasons. Before the packet leaves the smart network card, the packet is matched with the outbound ACL flow matching rules. If the match is successful, the smart network card performs outbound operation and maintenance function management on the packet based on the outgoing ACL flow matching rules, that is, executes the flow table The action corresponding to the rule action item, such as performing outbound flow table statistics, etc. After executing the action corresponding to the action item of the flow table rule, the smart network card forwards the packet on the Layer 2 and Layer 3 network.
本申请实施例提供的方法,当使能运维能力时,由智能网卡实现运维功能的管理,无需将智能网卡上已有的流表条目清除,接收到的报文也不用上送VS进行重新学习,无需流量触发,只需将ACL流匹配规则下发到智能网卡,并让接收到的报文经过智能网卡进行ACL流规则匹配即可,因此,使智能网卡具备高可维可靠的运维能力。再有,通过智能网卡实现计数统计等运维功能,也即由硬件实现计数统计等,相比于软件实现,统计结果更加准确。According to the method provided by the embodiment of this application, when the operation and maintenance capability is enabled, the intelligent network card implements the management of the operation and maintenance function. There is no need to clear the existing flow table entries on the intelligent network card, and the received messages do not need to be sent to the VS for processing. Re-learning does not require traffic triggering. You only need to deliver the ACL flow matching rules to the smart network card, and let the received packets pass through the smart network card for ACL flow rule matching. Therefore, the smart network card has highly maintainable and reliable operation. Dimensional ability. Furthermore, operation and maintenance functions such as counting and statistics are implemented through smart network cards, that is, counting and statistics are implemented by hardware. Compared with software implementation, the statistical results are more accurate.
本申请实施例提供了一种流表规则的管理方法,如图7所示的流表规则的管理方法的交互示意图,该管理方法由VS和智能网卡之间的交互来实现。如图7所示,该方法包括但不限于如下步骤701-步骤703。The embodiment of the present application provides a method for managing flow table rules. Figure 7 is an interaction diagram of the method for managing flow table rules. The management method is implemented by the interaction between the VS and the smart network card. As shown in Figure 7, the method includes but is not limited to the following steps 701 to 703.
步骤701,VS获取硬件匹配流表,硬件匹配流表用于智能网卡对流量进行流量管理。其中,硬件匹配流表包括硬件精确匹配流表和硬件模糊匹配流表中的至少一种。Step 701: VS obtains a hardware matching flow table, which is used by the smart network card to manage traffic. The hardware matching flow table includes at least one of a hardware exact matching flow table and a hardware fuzzy matching flow table.
如图2或图3的实施环境所述,SDN控制器可向VS下发OpenFlow表,VS可基于OpenFlow表生成硬件(hardware,hw)匹配流表,硬件匹配流表中包括一条或者多条硬件匹配流规则。之后,VS可将生成的硬件匹配流表下发给智能网卡。其中,硬件匹配流表包括硬件精确匹配流表(hw EMC)和硬件模糊匹配流表(hw MegaFlow)中的至少一种。硬件精确匹配流表的表容量比硬件模糊匹配流表的表容量要大,但硬件模糊匹配流表的查表效率比硬件精确匹配流表的查表效率要高。As described in the implementation environment of Figure 2 or Figure 3, the SDN controller can deliver an OpenFlow table to the VS, and the VS can generate a hardware (hardware, hw) matching flow table based on the OpenFlow table. The hardware matching flow table includes one or more pieces of hardware. Match flow rules. Afterwards, VS can deliver the generated hardware matching flow table to the smart network card. Among them, the hardware matching flow table includes at least one of a hardware exact matching flow table (hw EMC) and a hardware fuzzy matching flow table (hw MegaFlow). The table capacity of the hardware exact matching flow table is larger than that of the hardware fuzzy matching flow table, but the table lookup efficiency of the hardware fuzzy matching flow table is higher than the table lookup efficiency of the hardware exact matching flow table.
在一种可能的实现方式中,硬件模糊匹配流表中包括用于指定类型的报文上送处理的条目,例如该指定类型的报文包括互联网控制报文协议(internet control message protocol,ICMP)/动态主机配置协议(dynamic host configuration protocol,DHCP)/地址解析协议(address resolution protocol,ARP)报文等,该条目相比于硬件模糊匹配流表中的其他聚合条目能够优先命中。In a possible implementation, the hardware fuzzy matching flow table includes entries for sending and processing specified types of packets. For example, the specified type of packets includes Internet Control Message Protocol (ICMP). /Dynamic Host Configuration Protocol (DHCP)/Address Resolution Protocol (ARP) messages, etc. This entry can be hit preferentially compared to other aggregate entries in the hardware fuzzy matching flow table.
此外,当OpenFlow流表配置变化后,下发到智能网卡的流表全部无效,需要全部上送VS再生成更新后的流表条目,而VS和智能网卡之间的带宽有限,因此,有必要缩减下发到智能网卡上的流表条目的数量。例如,本申请实施例中的硬件模糊匹配流表用于与第一报文进行匹配,第一报文为生成流表条目满足第一阈值条件的网元所产生的报文;硬件精确匹配流表用于与第二报文进行匹配,第二报文为满足第二阈值条件的网元所产生的报文。通过将硬件模糊匹配流表与硬件精确匹配流表分别用于与不同的报文进行匹配,由此减少硬件模糊匹配流表与硬件精确匹配流表的流表条目的数量。In addition, when the OpenFlow flow table configuration changes, all flow tables sent to the smart network card are invalid, and all need to be sent to the VS to generate updated flow table entries. The bandwidth between the VS and the smart network card is limited, so it is necessary Reduce the number of flow table entries delivered to the smart network card. For example, the hardware fuzzy matching flow table in the embodiment of the present application is used to match the first packet, which is a packet generated by a network element whose flow table entry satisfies the first threshold condition; the hardware precise matching flow The table is used to match the second message, and the second message is a message generated by a network element that meets the second threshold condition. By using the hardware fuzzy matching flow table and the hardware exact matching flow table to match different packets respectively, the number of flow table entries in the hardware fuzzy matching flow table and the hardware exact matching flow table is reduced.
本申请实施例不对第一阈值条件和第二阈值条件进行限定,第一阈值条件和第二阈值条件可基于经验设置,也可基于应用场景设置。可选地,在本申请实施例提供的方法中,VS结合控制器的流表规则设置,将会生成超大规格流表条目也即满足第一阈值条件的网元所产生的流量设置为模糊匹配流表并下发至智能网卡,其余场景均作为满足第二 阈值条件的网元,使用精确匹配流表并下发至智能网卡。也就是说,第二阈值条件可以是指除了第一阈值条件之外的条件,也即第二报文为第一报文之外的任意报文。The embodiments of the present application do not limit the first threshold condition and the second threshold condition. The first threshold condition and the second threshold condition can be set based on experience or based on application scenarios. Optionally, in the method provided by the embodiment of this application, the VS combines the flow table rule settings of the controller to generate oversized flow table entries, that is, the traffic generated by network elements that meet the first threshold condition is set as fuzzy matching. The flow table is sent to the smart network card, and other scenarios are used to meet the second For network elements with threshold conditions, use the exact matching flow table and deliver it to the smart network card. That is to say, the second threshold condition may refer to a condition other than the first threshold condition, that is, the second message is any message other than the first message.
步骤702,VS指示智能网卡管理硬件匹配流表。Step 702: VS instructs the intelligent network card to manage the hardware matching flow table.
VS将硬件匹配流表下发给智能网卡后,可指示智能网卡管理硬件匹配流表,由此实现将硬件匹配流表下发到智能网卡上,使智能网卡具有流量管理功能。其中,VS指示智能网卡管理硬件匹配流表包括但不限于管理硬件精确匹配流表和硬件模糊匹配流表中的至少一种。After VS delivers the hardware matching flow table to the smart network card, it can instruct the smart network card to manage the hardware matching flow table, thereby delivering the hardware matching flow table to the smart network card, so that the smart network card has traffic management functions. Wherein, the VS instructs the smart network card to manage hardware matching flow tables including but not limited to managing at least one of a hardware exact matching flow table and a hardware fuzzy matching flow table.
步骤703,智能网卡管理硬件匹配流表。Step 703: The smart network card manages the hardware matching flow table.
智能网卡接收到VS下发的硬件匹配流表,根据VS的指示来管理硬件匹配流表。在一种可能的实现方式中,VS指示智能网卡管理硬件匹配流表以及智能网卡管理硬件匹配流表,包括但不限于如下交互过程。The smart network card receives the hardware matching flow table issued by VS and manages the hardware matching flow table according to the instructions of VS. In a possible implementation, the VS instructs the intelligent network card to manage the hardware matching flow table and the intelligent network card to manage the hardware matching flow table, including but not limited to the following interactive process.
由于VS与智能网卡通过开源框架连接,开源框架上包括多个开源接口,也即API,VS可获取到智能网卡的端口信息。因此,VS指示智能网卡管理硬件匹配流表时,VS可调用对应的第一API向智能网卡发送第五消息,该第五消息包括智能网卡的目标端口的端口标识,第五消息用于智能网卡在智能网卡的目标端口上创建硬件匹配流表。Since VS and the smart network card are connected through an open source framework, which includes multiple open source interfaces, that is, APIs, VS can obtain the port information of the smart network card. Therefore, when VS instructs the smart network card to manage the hardware matching flow table, VS can call the corresponding first API to send the fifth message to the smart network card. The fifth message includes the port identification of the target port of the smart network card. The fifth message is used for the smart network card. Create a hardware matching flow table on the target port of the smart NIC.
本申请实施例不限定第一API,如图4所示的流表规则的管理方法中,该第一API对应流表条目创建函数,VS调用第一API,也即实现对流表条目创建函数的调用,进而通过该第一API来封装第五消息,并向智能网卡发送第五消息。由于第五消息包括智能网卡的目标端口的端口标识,使得智能网卡接收到第五消息后,能够确定在哪个端口上创建硬件匹配流表。The embodiment of the present application does not limit the first API. In the flow table rule management method shown in Figure 4, the first API corresponds to the flow table entry creation function, and VS calls the first API, that is, to implement the flow table entry creation function. Call, and then encapsulate the fifth message through the first API, and send the fifth message to the smart network card. Since the fifth message includes the port identification of the target port of the smart network card, the smart network card can determine on which port to create the hardware matching flow table after receiving the fifth message.
例如,该流表条目创建函数以及第五消息的内容及说明可如下面的表6所示。表6中,reserved参数对应保留位的高两位,通过保留位的高两位来代表流表规则类型。对于硬件匹配流表,该reserved参数的高两位为0和1中的至少一个值。其中,0代表创建的流表规则类型为精确路由转发规则,也即硬件精确匹配流表。1代表创建的流表规则类型为目的IP模糊匹配规则,也即硬件模糊匹配流表。For example, the flow table entry creation function and the content and description of the fifth message may be as shown in Table 6 below. In Table 6, the reserved parameter corresponds to the high two bits of the reserved bits, and the flow table rule type is represented by the high two bits of the reserved bits. For hardware matching flow tables, the high two bits of the reserved parameter are at least one of 0 and 1. Among them, 0 means that the flow table rule type created is an exact routing and forwarding rule, that is, the hardware accurately matches the flow table. 1 means that the created flow table rule type is a destination IP fuzzy matching rule, that is, a hardware fuzzy matching flow table.
表6

Table 6

在一种可能的实现方式中,该第五消息除了包括智能网卡的目标端口的端口标识外,第五消息还包括流表规则属性、流表规则匹配项和流表规则动作项中的至少一种;其中,流表规则属性用于指示报文需匹配的组和流表类型中的至少一种;流表规则匹配项包括但不限于表2所示的规则匹配项和表7所示的规则匹配项。如表2所示的规则匹配项包括匹配以太层信息、匹配虚拟局域网(virtual local area network,VLAN)信息、匹配网际协议第四版(internet protocol version4,IPv4)信息或匹配网际协议第六版(internet protocol version6,IPv6)信息、匹配虚拟扩展局域网(virtual extensible local area network,VXLAN)信息、匹配项结束、报文标记中的至少一种;如表7所示的规则匹配项包括匹配数据面哈希(datapath_hash,dp_hash)值、匹配转向标识(recirc_id)。流表规则动作项包括但不限于表8所示的规则动作项和表9所示的规则动作项;如表8所示的规则动作项包括流表统计、转发到端口、弹出(POP)VLAN、推(PUSH)VLAN、设置VLAN ID、设置VLAN优先级、解封装vxlan头、封装vxlan头、Vxlan头关键(key)值、生存时间值(time to live,TTL)减一、修改源mac地址、修改目的mac地址、采样转发和流镜像、动作(ACTION)结束、为报文设置内标记、修改指定字段、引用句柄操作和丢弃报文中的至少一种。如表9所示的规则动作项包括执行dp-hash动作、匹配dp-hash二级表recirc_id和报文上送VS软件控制面。In a possible implementation, in addition to the port identification of the target port of the smart network card, the fifth message also includes at least one of a flow table rule attribute, a flow table rule matching item, and a flow table rule action item. Among them, the flow table rule attribute is used to indicate at least one of the group and flow table type that the packet needs to match; the flow table rule matching items include but are not limited to the rule matching items shown in Table 2 and the ones shown in Table 7. Rule matches. As shown in Table 2, the rule matching items include matching Ethernet layer information, matching virtual local area network (VLAN) information, matching Internet Protocol version 4 (IPv4) information, or matching Internet Protocol version 6 ( At least one of internet protocol version 6 (IPv6) information, matching virtual extensible local area network (VXLAN) information, end of matching items, and packet tags; as shown in Table 7, the rule matching items include matching data surfaces. Hash (datapath_hash, dp_hash) value, matching redirection ID (recirc_id). The flow table rule action items include but are not limited to the rule action items shown in Table 8 and the rule action items shown in Table 9; the rule action items shown in Table 8 include flow table statistics, forward to port, and pop-up (POP) VLAN , push (PUSH) VLAN, set VLAN ID, set VLAN priority, decapsulate vxlan header, encapsulate vxlan header, Vxlan header key value, time to live value (time to live, TTL) minus one, modify the source mac address , at least one of modifying the destination mac address, sampling forwarding and flow mirroring, ending the action (ACTION), setting an internal mark for the packet, modifying the specified field, refnum operation, and discarding the packet. The rule action items shown in Table 9 include executing dp-hash actions, matching dp-hash secondary table recirc_id, and sending packets to the VS software control plane.
表7
Table 7
表8


Table 8


表9
Table 9
针对上述表8中的修改指定字段的动作,需支持如表10所示的以下字段。For the action of modifying the specified fields in Table 8 above, the following fields shown in Table 10 need to be supported.
表10
Table 10
参见图8,本申请实施例提供的方法还包括步骤704-步骤706。Referring to Figure 8, the method provided by the embodiment of the present application also includes steps 704 to 706.
步骤704,VS获取数据面哈希表,数据面哈希表用于智能网卡对多路径转发报文进行多路径转发。Step 704: VS obtains the data plane hash table. The data plane hash table is used by the intelligent network card to perform multi-path forwarding of multi-path forwarding packets.
如图2或图3的实施环境所述,SDN控制器可向VS下发OpenFlow表,VS可基于OpenFlow表生成硬件匹配流表,硬件匹配流表中包括一条或者多条硬件匹配流规则。之后,VS可将生成的硬件匹配流表下发给智能网卡。其中,硬件匹配流表包括硬件精确匹配流表(hardware EMC,hw EMC)和硬件模糊匹配流表(hw MegaFlow)中的至少一种。As described in the implementation environment of Figure 2 or Figure 3, the SDN controller can deliver an OpenFlow table to the VS, and the VS can generate a hardware matching flow table based on the OpenFlow table. The hardware matching flow table includes one or more hardware matching flow rules. Afterwards, VS can deliver the generated hardware matching flow table to the smart network card. Among them, the hardware matching flow table includes at least one of a hardware exact matching flow table (hardware EMC, hw EMC) and a hardware fuzzy matching flow table (hw MegaFlow).
在一种可能的实现方式中,硬件匹配流表中包括哈希匹配动作项、转向标识匹配动作项和报文上送VS软件控制面匹配动作项的至少一种。VS除了向智能网卡下发硬件匹配流表,还下发数据面哈希表(Datapath-Hash)。其中,哈希匹配动作项用于指示执行数据面哈希表的查询动作,转向ID用于指示数据面哈希表,数据面哈希表包括哈希值、掩码和转向标识,掩码对应下一跳信息。In a possible implementation manner, the hardware matching flow table includes at least one of a hash matching action item, a redirection identifier matching action item, and a packet uploading VS software control plane matching action item. In addition to delivering the hardware matching flow table to the smart network card, VS also delivers the data plane hash table (Datapath-Hash). Among them, the hash matching action item is used to indicate the query action of the data plane hash table, and the redirection ID is used to indicate the data plane hash table. The data plane hash table includes a hash value, a mask, and a redirection identifier. The mask corresponds to Next hop information.
步骤705,VS在智能网卡上管理数据面哈希表。Step 705: VS manages the data plane hash table on the smart network card.
VS将硬件匹配流表下发给智能网卡后,还可向智能网卡下发数据面哈希表,可指示智能网卡管理数据面哈希表,由此实现将硬件匹配流表下发到智能网卡上,节省硬件匹 配流表的条目,且使流量卸载到智能网卡,使智能网卡具有流量管理功能。After VS delivers the hardware matching flow table to the smart network card, it can also deliver the data plane hash table to the smart network card and instruct the smart network card to manage the data plane hash table, thereby realizing the delivery of the hardware matching flow table to the smart network card. to save hardware Configure the entries in the flow table and offload the traffic to the smart network card, so that the smart network card has the traffic management function.
步骤706,智能网卡管理数据面哈希表,数据面哈希表用于智能网卡对多路径转发报文进行多路径转发。Step 706: The smart network card manages the data plane hash table. The data plane hash table is used by the smart network card to perform multi-path forwarding of multi-path forwarding messages.
智能网卡接收到VS下发的数据面哈希表,根据VS的指示来管理数据面哈希表。在一种可能的实现方式中,VS指示智能网卡管理数据面哈希表以及智能网卡管理数据面哈希表,包括但不限于如下交互过程。The smart network card receives the data plane hash table issued by VS and manages the data plane hash table according to the instructions of VS. In a possible implementation, the VS instructs the smart network card to manage the data plane hash table and the smart network card to manage the data plane hash table, including but not limited to the following interaction process.
由于VS与智能网卡通过开源框架连接,开源框架上包括多个开源接口,也即API,VS可获取到智能网卡的端口信息。因此,VS指示智能网卡管理数据面哈希表时,VS可调用对应的第一API向智能网卡发送第六消息,第六消息用于智能网卡在智能网卡的目标端口上创建数据面哈希表。Since VS and the smart network card are connected through an open source framework, which includes multiple open source interfaces, that is, APIs, VS can obtain the port information of the smart network card. Therefore, when VS instructs the smart network card to manage the data plane hash table, VS can call the corresponding first API to send the sixth message to the smart network card. The sixth message is used by the smart network card to create the data plane hash table on the target port of the smart network card. .
本申请实施例不限定第一API,如图4所示的流表规则的管理方法中,该第一API对应流表条目创建函数,VS调用第一API,也即实现对流表条目创建函数的调用,进而通过该第一API来封装第六消息,并向智能网卡发送第六消息。由于该数据面哈希表复用第一API,使得智能网卡接收到第六消息后,能够确定在哪个端口上创建数据面哈希表。The embodiment of the present application does not limit the first API. In the flow table rule management method shown in Figure 4, the first API corresponds to the flow table entry creation function, and VS calls the first API, that is, to implement the flow table entry creation function. Call, and then encapsulate the sixth message through the first API, and send the sixth message to the smart network card. Since the data plane hash table reuses the first API, the smart network card can determine on which port the data plane hash table is to be created after receiving the sixth message.
例如,该流表条目创建函数以及第六消息的内容及说明可如下面的表11所示。表11中,reserved参数对应保留位的高两位,通过保留位的高两位来代表流表规则类型。对于数据面哈希表,该reserved参数的高两位为2。其中,2代表创建的流表规则类型为数据面哈希表,也即DP-HASH。For example, the flow table entry creation function and the content and description of the sixth message may be as shown in Table 11 below. In Table 11, the reserved parameter corresponds to the high two bits of the reserved bits, and the flow table rule type is represented by the high two bits of the reserved bits. For data plane hash tables, the high two bits of the reserved parameter are 2. Among them, 2 means that the flow table rule type created is a data plane hash table, that is, DP-HASH.
表11
Table 11
当OpenFlow中配置了DP-HASH相关流表条目时,则下发下一跳信息至DP-HASH表中,此时代表开启DP-HASH功能,硬件匹配流表中的条目如果动作是DP_HASH,则会经过DP-HASH表查询,否则不查询。When DP-HASH related flow table entries are configured in OpenFlow, the next hop information is delivered to the DP-HASH table. This means that the DP-HASH function is enabled. The hardware matches the entries in the flow table. If the action is DP_HASH, then It will be queried through the DP-HASH table, otherwise it will not be queried.
其中,硬件匹配流表中的条目需要支持DP HASH和RECIRC_ID两个action字段,也即包括执行dp-hash动作、匹配dp-hash二级表recirc_id两个规则动作项,如下面的表12所示。数据面哈希表可如表13所示。 Among them, the entries in the hardware matching flow table need to support the two action fields DP HASH and RECIRC_ID, which include two rule action items: executing the dp-hash action and matching the dp-hash secondary table recirc_id, as shown in Table 12 below. . The data plane hash table can be shown in Table 13.
表12
Table 12
表13
Table 13
需要说明的是,图8仅以VS先下发硬件匹配流表,指示智能网卡管理硬件匹配流表,之后再下发数据面哈希表,指示智能网卡管理数据面哈希表为例进行说明。在一种可能的实现方式中,VS可以同时下发硬件匹配流表和数据面哈希表,指示智能网卡管理硬件匹配流表和数据面哈希表。或者,先下发数据面哈希表,再下发硬件匹配流表,本申请实施例不对硬 件匹配流表和数据面哈希表的下发和管理顺序进行限定。其中,硬件匹配流表包括硬件精确匹配流表和硬件模糊匹配流表中的至少一种。It should be noted that Figure 8 only takes the example of VS first delivering the hardware matching flow table, instructing the smart network card to manage the hardware matching flow table, and then delivering the data plane hash table, instructing the smart network card to manage the data plane hash table. . In one possible implementation, the VS can deliver a hardware matching flow table and a data plane hash table at the same time, instructing the smart network card to manage the hardware matching flow table and data plane hash table. Alternatively, the data plane hash table is delivered first, and then the hardware matching flow table is delivered. The embodiment of this application does not Limit the delivery and management order of the file matching flow table and data plane hash table. The hardware matching flow table includes at least one of a hardware exact matching flow table and a hardware fuzzy matching flow table.
本申请实施例提供的方法,硬件精确匹配流表的转发性能低于硬件模糊匹配流表。在有网元大流量的场景,选择硬件模糊匹配流表下发到智能网卡,能够保证主要场景转发性能最高。网元大流量场景下发硬件模糊匹配流表至智能网卡,减少了硬件精确匹配流表生成的流表数量;而硬件模糊匹配流表本身条目不多,因此,当OpenFlow配置发生变化时,显著提升了流量的稳定性,降低了流量震荡。With the method provided by the embodiments of this application, the forwarding performance of the hardware exact matching flow table is lower than that of the hardware fuzzy matching flow table. In scenarios with large traffic from network elements, choosing hardware fuzzy matching flow tables to deliver them to smart network cards can ensure the highest forwarding performance in major scenarios. The network element delivers the hardware fuzzy matching flow table to the smart network card in a large traffic scenario, which reduces the number of flow tables generated by the hardware exact matching flow table. However, the hardware fuzzy matching flow table itself does not have many entries. Therefore, when the OpenFlow configuration changes, significant Improved traffic stability and reduced traffic oscillation.
当智能网卡支持DP-HASH表处理时,针对ECMP场景,硬件匹配流表中无需源IP、四层源port、四层目的port信息,从而进一步减少了硬件匹配流表的条目。当OpenFlow配置发生变化时,显著提升了流量的稳定性。When the smart network card supports DP-HASH table processing, for ECMP scenarios, source IP, Layer 4 source port, and Layer 4 destination port information are not required in the hardware matching flow table, thus further reducing the number of entries in the hardware matching flow table. Significantly improves traffic stability when OpenFlow configuration changes.
基于上述图7和图8所示的流表规则的管理方法,本申请实施例提供了一种流量管理方法。参见图9,该方法包括步骤901和步骤902。Based on the management method of flow table rules shown in Figure 7 and Figure 8, embodiments of the present application provide a traffic management method. Referring to Figure 9, the method includes step 901 and step 902.
步骤901,智能网卡接收报文,将报文与硬件匹配流表进行匹配。Step 901: The smart network card receives the packet and matches the packet with the hardware matching flow table.
本申请实施例不对智能网卡接收到的报文的类型进行限定,例如,该报文为音视频应用程序的报文,也可以为游戏类应用程序的报文,还可以为即时通讯应用程序的报文等。本申请实施例也不限定智能网卡接收到的报文数量,每个报文均可按照本申请实施例提供的流量管理方法进行管理。The embodiments of this application do not limit the type of packets received by the smart network card. For example, the packets may be packets from audio and video applications, or may be packets from game applications, or may also be packets from instant messaging applications. Messages etc. The embodiment of the present application does not limit the number of packets received by the smart network card. Each packet can be managed according to the traffic management method provided by the embodiment of the present application.
无论是哪种类型的报文,智能网卡接收到该报文后,均将报文与智能网卡上创建的硬件匹配流表进行匹配。其中,智能网卡上创建的硬件匹配流表包括硬件精确匹配流表和硬件模糊匹配流表中的至少一种。例如,如果硬件匹配流表包括硬件精确匹配流表,智能网卡将报文与该硬件精确匹配流表中的流匹配规则进行匹配。如果硬件匹配流表包括硬件模糊匹配流表,该智能网卡将报文与硬件模糊匹配流表中的流匹配规则进行匹配。如果硬件匹配流表包括硬件精确匹配流表和硬件模糊匹配流表,则智能网卡将报文与硬件精确匹配流表和硬件模糊匹配流表中的流匹配规则分别进行匹配。No matter what type of message it is, after the smart network card receives the message, it will match the message with the hardware matching flow table created on the smart network card. The hardware matching flow table created on the smart network card includes at least one of a hardware exact matching flow table and a hardware fuzzy matching flow table. For example, if the hardware matching flow table includes a hardware exact matching flow table, the smart NIC matches the packet with the flow matching rules in the hardware exact matching flow table. If the hardware matching flow table includes a hardware fuzzy matching flow table, the smart network card matches the packet with the flow matching rules in the hardware fuzzy matching flow table. If the hardware matching flow table includes a hardware exact matching flow table and a hardware fuzzy matching flow table, the smart network card will match the packet with the flow matching rules in the hardware exact matching flow table and the hardware fuzzy matching flow table respectively.
示例性地,无论是硬件精确匹配流表,还是硬件模糊匹配流表,硬件精确匹配流表和硬件模糊匹配流表中的流表规则匹配项可如上面的表2和表7所示。智能网卡将报文与各条流表规则匹配项进行匹配,如果报文命中任一流表规则匹配项,则认为报文与硬件匹配流表匹配成功。For example, whether it is a hardware exact matching flow table or a hardware fuzzy matching flow table, the flow table rule matching items in the hardware exact matching flow table and the hardware fuzzy matching flow table may be as shown in Table 2 and Table 7 above. The smart network card matches the packet with each flow table rule match. If the packet matches any flow table rule match, the packet is considered to be successfully matched with the hardware matching flow table.
例如,以硬件匹配流表中包括表2中用于匹配VLAN信息的流表规则匹配项为例进行说明。如表2所示,该流表规则匹配项包括参数名、vlan tci值和内层协议类型。智能网卡接收到报文后,获取报文的参数名、vlan tci值和内层协议类型,如果报文的参数名、vlan tci值和内层协议类型与硬件匹配流表中的流匹配规则包括的流表规则匹配项包括的参数名、vlan tci值和内层协议类型匹配,则确定报文与硬件匹配流表匹配成功。For example, the hardware matching flow table includes the flow table rule matching items used to match VLAN information in Table 2 as an example for explanation. As shown in Table 2, the flow table rule matching items include parameter name, vlan tci value and inner protocol type. After receiving the message, the smart network card obtains the parameter name, vlan tci value and inner protocol type of the message. If the parameter name, vlan tci value and inner protocol type of the message match the hardware, the flow matching rules in the flow table include If the flow table rule matching items include the parameter name, vlan tci value, and inner protocol type, it is determined that the packet matches the hardware matching flow table successfully.
可选地,如果报文与硬件匹配流表中的各个流表规则匹配项均不匹配,则确定报文与硬件匹配流表匹配失败。Optionally, if the packet does not match any flow table rule matching item in the hardware matching flow table, it is determined that the packet fails to match the hardware matching flow table.
步骤902,智能网卡根据报文与硬件匹配流表的匹配结果对报文进行流量管理。Step 902: The smart network card performs traffic management on the packet based on the matching result between the packet and the hardware matching flow table.
为了便于说明,以图10所示的流表规则的管理和流量管理过程为例,对本申请实施例提供的方法进行举例说明。图10中,VS基于SDN控制器下发的OpenFlow表生成硬件精 确匹配流(hw EMC)表和硬件模糊匹配流(hw MegaFlow)表后,如图10中的虚线箭头所示,将硬件精确匹配流表和硬件模糊匹配流表配置下发到智能网卡,在智能网卡上进行流表规则的管理。该流表规则的管理过程可参见上述图7所示的流表规则的管理方法,此处不再赘述。For ease of explanation, the method provided by the embodiment of the present application is illustrated by taking the management of flow table rules and the traffic management process shown in Figure 10 as an example. In Figure 10, VS generates hardware precision based on the OpenFlow table issued by the SDN controller. After confirming the matching flow (hw EMC) table and hardware fuzzy matching flow (hw MegaFlow) table, as shown by the dotted arrow in Figure 10, deliver the hardware exact matching flow table and hardware fuzzy matching flow table configuration to the smart network card. Flow table rules are managed on the smart network card. For the management process of the flow table rules, please refer to the management method of the flow table rules shown in Figure 7 above, and will not be described again here.
如图10的实线箭头所示,智能网卡接收到报文后,先将报文与硬件模糊匹配流表进行匹配,如果匹配成功,智能网卡根据硬件模糊匹配流表对报文进行流量管理,也即执行硬件模糊匹配流表中的流匹配规则包括的流表规则动作项对应的动作。执行流表规则动作项对应的动作之后,智能网卡将报文继续传输。可选地,智能网卡将报文与硬件模糊匹配流表进行匹配后,如果报文未命中硬件模糊匹配流表,则智能网卡将报文与硬件精确匹配流表进行匹配,如果匹配成功,智能网卡根据硬件精确匹配流表对报文进行流量管理,也即执行硬件精确匹配流表中的流匹配规则包括的流表规则动作项对应的动作。As shown by the solid arrow in Figure 10, after receiving the message, the smart network card first matches the message with the hardware fuzzy matching flow table. If the match is successful, the smart network card performs traffic management on the message based on the hardware fuzzy matching flow table. That is, the action corresponding to the flow table rule action item included in the flow matching rule in the hardware fuzzy matching flow table is executed. After executing the action corresponding to the action item of the flow table rule, the smart network card continues to transmit the packet. Optionally, after the smart network card matches the packet with the hardware fuzzy matching flow table, if the packet does not match the hardware fuzzy matching flow table, the smart network card matches the packet with the hardware exact matching flow table. If the match is successful, the smart network card The network card performs traffic management on packets based on the hardware exact matching flow table, that is, it performs actions corresponding to the flow table rule action items included in the flow matching rules in the hardware exact matching flow table.
在一种可能的实现方式中,智能网卡根据报文与硬件匹配流表的匹配结果对报文进行流量管理,包括:基于报文与硬件匹配流表的匹配结果为报文与硬件匹配流表匹配成功,且硬件匹配流表中包括上送动作项,将报文上送VS;或者,基于报文与硬件匹配流表的匹配结果为报文与硬件匹配流表匹配失败,将报文上送VS。如图10中硬件模糊匹配流表向VS的实线箭头,如果报文与硬件模糊匹配流表匹配失败,或者报文命中硬件模糊匹配流表中的流匹配规则,且命中的流匹配规则中的上送动作项,智能网卡将报文上送VS。如图10中硬件精确匹配流表向VS的实线箭头,如果报文与硬件精确匹配流表匹配失败,或者报文命中硬件精确匹配流表中的流匹配规则,且命中的流匹配规则中的上送动作项,智能网卡将报文上送VS。In one possible implementation, the smart network card performs traffic management on packets based on the matching results between the packets and the hardware matching flow table, including: based on the matching results between the packets and the hardware matching flow table, the smart network card If the match is successful, and the hardware matching flow table includes a upload action item, the packet will be uploaded to the VS; or, based on the matching result between the packet and the hardware matching flow table, the packet fails to match the hardware matching flow table, and the packet will be uploaded to the VS. Send VS. As shown in Figure 10, the solid arrow pointing to VS from the hardware fuzzy matching flow table, if the packet fails to match the hardware fuzzy matching flow table, or the packet hits the flow matching rule in the hardware fuzzy matching flow table, and the hit flow matching rule is Send action item, the smart network card sends the packet to VS. As shown in Figure 10, the solid arrow pointing to VS from the hardware exact matching flow table, if the packet fails to match the hardware exact matching flow table, or the packet hits the flow matching rule in the hardware exact matching flow table, and the hit flow matching rule is Send action item, the smart network card sends the packet to VS.
需要说明的是,针对硬件匹配流表包括硬件模糊匹配流表和硬件精确匹配流表的情况,上述报文与硬件匹配流表匹配失败,是指报文与硬件模糊匹配流表和硬件精确匹配流表均匹配失败,也即报文既未命中硬件模糊匹配流表,也未命中硬件精确匹配流表。It should be noted that for the situation where the hardware matching flow table includes a hardware fuzzy matching flow table and a hardware exact matching flow table, the failure of the above packet to match the hardware matching flow table means that the packet matches the hardware fuzzy matching flow table and the hardware exact matching flow table. All flow tables failed to match, that is, the packet neither hit the hardware fuzzy matching flow table nor the hardware exact matching flow table.
需要说明的是,以上仅以智能网卡管理的硬件匹配流表包括硬件模糊匹配流表和硬件精确匹配流表为例进行说明。在本申请实施例提供的方法中,智能网卡管理的硬件匹配流表也可以仅包括硬件精确匹配流表,或者仅包括硬件模糊匹配流表。关于硬件匹配流表的过程,可参见上述图7所示的流表规则的管理方法中的相关说明,此处不再赘述。It should be noted that the above description only takes the hardware matching flow table managed by the smart network card, including the hardware fuzzy matching flow table and the hardware exact matching flow table, as an example. In the method provided by the embodiment of the present application, the hardware matching flow table managed by the smart network card may also include only a hardware exact matching flow table, or only a hardware fuzzy matching flow table. Regarding the process of hardware matching flow tables, please refer to the relevant description in the management method of flow table rules shown in Figure 7 above, and will not be described again here.
在一种可能的实现方式中,智能网卡将报文与硬件匹配流表进行匹配,包括:基于报文为第一报文,智能网卡将报文与硬件模糊匹配流表进行匹配,第一报文为生成流表条目满足第一阈值条件的网元所产生的报文;或,基于报文为第二报文,智能网卡将报文与硬件精确匹配流表进行匹配,第二报文为满足第二阈值条件的网元所产生的报文。In a possible implementation, the smart network card matches the message with the hardware matching flow table, including: based on the message being the first message, the smart network card matches the message with the hardware fuzzy matching flow table, and the first message The message is a message generated by a network element whose flow table entry satisfies the first threshold condition; or, based on the message being the second message, the smart network card matches the message with the hardware exact matching flow table, and the second message is Packets generated by network elements that meet the second threshold condition.
针对该种实现方式,对于智能网卡管理的硬件匹配流表包括硬件模糊匹配流表和硬件精确匹配流表的情况,智能网卡接收到报文后,无需将报文分别与硬件模糊匹配流表和硬件精确匹配流表进行匹配,而是先判断报文为第一报文还是第二报文,然后再与硬件模糊匹配流表或硬件精确匹配流表进行匹配。例如,如果智能网卡接收到的报文为第一报文,则可将该报文与硬件模糊匹配流表进行匹配,而无需再与硬件精确匹配流表进行匹配。如果智能网卡接收到的报文为第二报文,则可将该报文与硬件精确匹配流表进行匹配,而无需再与硬件模糊匹配流表进行匹配。如此,根据报文的类型来进行流量管理,提高了管理效率。 For this implementation method, when the hardware matching flow table managed by the smart network card includes the hardware fuzzy matching flow table and the hardware exact matching flow table, after the smart network card receives the message, there is no need to compare the message with the hardware fuzzy matching flow table and the hardware exact matching flow table respectively. The hardware exact matching flow table is used for matching, but it is first determined whether the packet is the first packet or the second packet, and then matched with the hardware fuzzy matching flow table or the hardware exact matching flow table. For example, if the packet received by the smart network card is the first packet, the packet can be matched with the hardware fuzzy matching flow table instead of matching with the hardware exact matching flow table. If the packet received by the smart network card is the second packet, the packet can be matched with the hardware exact matching flow table without matching with the hardware fuzzy matching flow table. In this way, traffic management is performed according to the type of packets, which improves management efficiency.
在一种可能的实现方式中,报文为多路径转发报文,该方法还包括:智能网卡将报文与数据面哈希表进行匹配;基于报文与数据面哈希表匹配成功,智能网卡对报文进行多路径转发。In a possible implementation, the message is a multi-path forwarded message. The method also includes: the intelligent network card matches the message with the data plane hash table; based on the successful matching between the message and the data plane hash table, the intelligent network card The network card performs multi-path forwarding of packets.
示例性地,硬件匹配流表包括哈希匹配动作项和转向标识匹配动作项;其中,哈希匹配动作项用于指示执行数据面哈希表的查询动作,转向标识用于指示数据面哈希表,数据面哈希表包括哈希值、掩码和转向标识,掩码对应下一跳信息;Exemplarily, the hardware matching flow table includes a hash matching action item and a turn identification matching action item; where the hash matching action item is used to indicate the query action of executing the data plane hash table, and the turn identification is used to indicate the data side hash table. Table, the data plane hash table includes hash value, mask and redirection identifier, and the mask corresponds to the next hop information;
智能网卡将报文与数据面哈希表进行匹配,包括:智能网卡基于哈希匹配动作项,计算报文对应的哈希值,基于哈希值获取报文对应的掩码;基于转向标识匹配动作项,查找数据面哈希表;基于报文对应的掩码与数据面哈希表中的掩码一致,确定报文与数据面哈希表匹配成功;The smart network card matches the message with the data plane hash table, including: the smart network card matches the action item based on the hash, calculates the hash value corresponding to the message, obtains the mask corresponding to the message based on the hash value, and matches based on the redirection identifier The action item is to search the data plane hash table; based on the mask corresponding to the message being consistent with the mask in the data plane hash table, it is determined that the message and the data plane hash table are successfully matched;
智能网卡对报文进行多路径转发,包括:智能网卡按照数据面哈希表中掩码对应的下一跳信息对报文进行多路径转发。The intelligent network card performs multi-path forwarding of packets, including: the intelligent network card performs multi-path forwarding of packets according to the next hop information corresponding to the mask in the data plane hash table.
为了便于理解,以图11所示的流表规则的管理和流量管理过程为例,对本申请实施例提供的方法进行举例说明。图11中,VS基于SDN控制器下发的OpenFlow表生成硬件精确匹配流(hw EMC)表、硬件模糊匹配流(hw MegaFlow)表和数据面哈希表(DP Hash)后,如图11中的虚线箭头所示,将硬件精确匹配流表、硬件模糊匹配流表和数据面哈希表配置下发到智能网卡,在智能网卡上进行流表规则的管理。该流表规则的管理过程可参见上述图8所示的流表规则的管理方法,此处不再赘述。For ease of understanding, the method provided by the embodiment of the present application is illustrated by taking the management of flow table rules and the traffic management process shown in Figure 11 as an example. In Figure 11, after VS generates the hardware exact matching flow (hw EMC) table, hardware fuzzy matching flow (hw MegaFlow) table and data plane hash table (DP Hash) based on the OpenFlow table issued by the SDN controller, as shown in Figure 11 As shown by the dotted arrow, the configuration of the hardware exact matching flow table, hardware fuzzy matching flow table and data plane hash table is delivered to the smart network card, and the flow table rules are managed on the smart network card. For the management process of the flow table rules, please refer to the management method of the flow table rules shown in Figure 8 above, and will not be described again here.
如图11的实线箭头所示,智能网卡接收到报文后,先将报文与硬件模糊匹配流表进行匹配,如果匹配成功,智能网卡根据硬件模糊匹配流表对报文进行流量管理,也即执行硬件模糊匹配流表中的流匹配规则包括的流表规则动作项对应的动作。执行流表规则动作项对应的动作之后,智能网卡将报文与硬件精确匹配流表进行匹配,如果匹配成功,智能网卡根据硬件精确匹配流表对报文进行流量管理,也即执行硬件精确匹配流表中的流匹配规则包括的流表规则动作项对应的动作。之后,智能网卡基于哈希匹配动作项,计算报文对应的哈希值,基于哈希值获取报文对应的掩码;基于转向标识匹配动作项,查找数据面哈希表;基于报文对应的掩码与数据面哈希表中的掩码一致,确定报文与数据面哈希表匹配成功。因此,智能网卡按照数据面哈希表中掩码对应的下一跳信息对报文进行多路径转发。As shown by the solid arrow in Figure 11, after receiving the message, the smart network card first matches the message with the hardware fuzzy matching flow table. If the match is successful, the smart network card performs traffic management on the message based on the hardware fuzzy matching flow table. That is, the action corresponding to the flow table rule action item included in the flow matching rule in the hardware fuzzy matching flow table is executed. After executing the action corresponding to the flow table rule action item, the intelligent network card matches the packet with the hardware exact matching flow table. If the match is successful, the intelligent network card performs traffic management on the packet according to the hardware exact matching flow table, that is, performs hardware exact matching. The action corresponding to the flow table rule action item included in the flow matching rule in the flow table. After that, the smart network card calculates the hash value corresponding to the message based on the hash matching action item, and obtains the mask corresponding to the message based on the hash value; matches the action item based on the redirection identifier, and searches the data plane hash table; based on the message corresponding The mask is consistent with the mask in the data plane hash table, confirming that the packet matches the data plane hash table successfully. Therefore, the smart network card multipath forwards the packet according to the next hop information corresponding to the mask in the data plane hash table.
例如,硬件匹配流表中包括的流匹配规则包括如下两个条目:For example, the flow matching rules included in the hardware matching flow table include the following two entries:
dmac=FF:AB:EE:CB:DE,Ip,dip=63.63.63.63/<maskLen>dmac=FF:AB:EE:CB:DE,Ip,dip=63.63.63.63/<maskLen>
actions=hash(l4(0)),recirc(0x1111)actions=hash(l4(0)),recirc(0x1111)
dmac=FF:AB:EE:CB:DE,Ip,dip=62.62.62.62/<maskLen>dmac=FF:AB:EE:CB:DE,Ip,dip=62.62.62.62/<maskLen>
actions=hash(l4(0)),recirc(0x2222)actions=hash(l4(0)),recirc(0x2222)
智能网卡计算报文的哈希值HASH为:01011101011,将哈希值与掩码0x11做与操作,得到的结果为0x11,数据面哈希表包括如下几个条目:The smart network card calculates the hash value HASH of the message as: 01011101011. The hash value is ANDed with the mask 0x11, and the result is 0x11. The data plane hash table includes the following entries:
第一个条目:recirc_id(0x1111),dp_hash(0x00/0x11),The first entry: recirc_id(0x1111),dp_hash(0x00/0x11),
actions=mod_dl_dst:<vmport1-mac>,mod_dl_src:<vmport1-gw-mac>,actions=mod_dl_dst:<vmport1-mac>,mod_dl_src:<vmport1-gw-mac>,
load:0x5e->NXM_NX_TUN_ID[],output:<vm1-ofport>;load:0x5e->NXM_NX_TUN_ID[],output:<vm1-ofport>;
第二个条目:recirc_id(0x1111),dp_hash(0x01/0x11), Second entry: recirc_id(0x1111),dp_hash(0x01/0x11),
actions=mod_dl_dst:<vmport2-mac>,mod_dl_src:<vmport2-gw-mac>,actions=mod_dl_dst:<vmport2-mac>,mod_dl_src:<vmport2-gw-mac>,
load:0x5F->NXM_NX_TUN_ID[],output:<vm2-ofport>,load:0x5F->NXM_NX_TUN_ID[],output:<vm2-ofport>,
第三个条目:recirc_id(0x1111),dp_hash(0x10/0x11),The third entry: recirc_id(0x1111),dp_hash(0x10/0x11),
actions=mod_dl_dst:<vmport3-mac>,mod_dl_src:<vmport3-gw-mac>,actions=mod_dl_dst:<vmport3-mac>,mod_dl_src:<vmport3-gw-mac>,
load:0x60->NXM_NX_TUN_ID[],load:0x1020303->NXM_NX_TUN_IPV4_SRC[],load:0x60->NXM_NX_TUN_ID[], load:0x1020303->NXM_NX_TUN_IPV4_SRC[],
load:0x1020304->NXM_NX_TUN_IPV4_DST[],output:<vtep-ofport>load:0x1020304->NXM_NX_TUN_IPV4_DST[],output:<vtep-ofport>
第四个条目:recirc_id(0x1111),dp_hash(0x11/0x11),The fourth entry: recirc_id(0x1111),dp_hash(0x11/0x11),
actions=mod_dl_dst:<vmport4-mac>,mod_dl_src:<vmport4-gw-mac>,actions=mod_dl_dst:<vmport4-mac>,mod_dl_src:<vmport4-gw-mac>,
load:0x60->NXM_NX_TUN_ID[],load:0x1020303->NXM_NX_TUN_IPV4_SRC[],load:0x60->NXM_NX_TUN_ID[], load:0x1020303->NXM_NX_TUN_IPV4_SRC[],
load:0x1020305->NXM_NX_TUN_IPV4_DST[],output:<vtep-ofport>load:0x1020305->NXM_NX_TUN_IPV4_DST[],output:<vtep-ofport>
第五个条目:recirc_id(0x2222),dp_hash(0x00/0x11),The fifth entry: recirc_id(0x2222),dp_hash(0x00/0x11),
actions=mod_dl_dst:<vmport3-mac>,mod_dl_src:<vmport3-gw-mac>,actions=mod_dl_dst:<vmport3-mac>,mod_dl_src:<vmport3-gw-mac>,
load:0x5e->NXM_NX_TUN_ID[],output:<vm3-ofport>。load:0x5e->NXM_NX_TUN_ID[],output:<vm3-ofport>.
基于上述数据面哈希表的内容,由于对报文进行计算得到的结果为0x11,该结果与数据面哈希表中的第四个条目匹配,因而可按照第四个条目对应的下一跳信息对报文进行多路径转发。Based on the contents of the above data plane hash table, since the result of calculating the message is 0x11, this result matches the fourth entry in the data plane hash table, so the next hop corresponding to the fourth entry can be Information performs multi-path forwarding of packets.
上述仅以报文与数据面哈希表匹配成功的情况进行的说明,在另一种可能的实现方式中,硬件匹配流表包括哈希匹配动作项(也即表9中执行dp-hash动作)、转向标识匹配动作项(也即表9中匹配dp-hash二级表recirc_id)和报文上送VS软件控制面匹配动作项;其中,哈希匹配动作项用于指示执行数据面哈希表的查询动作,转向标识用于指示数据面哈希表,数据面哈希表包括哈希值、掩码和转向标识,掩码对应下一跳信息;The above description is only based on the situation where the packet successfully matches the data plane hash table. In another possible implementation, the hardware matching flow table includes a hash matching action item (that is, the dp-hash action is performed in Table 9 ), the steering ID matching action item (that is, the matching dp-hash secondary table recirc_id in Table 9) and the message uploading VS software control plane matching action item; among them, the hash matching action item is used to instruct the execution of data plane hashing In the query action of the table, the redirection flag is used to indicate the data plane hash table. The data side hash table includes the hash value, mask and redirection flag. The mask corresponds to the next hop information;
智能网卡将报文与数据面哈希表进行匹配,包括:智能网卡基于哈希匹配动作项,计算报文对应的哈希值,基于哈希值获取报文对应的掩码;基于转向标识匹配动作项,查找数据面哈希表;基于报文对应的哈希值与数据面哈希表中的掩码不一致,确定报文与数据面哈希表匹配失败。针对匹配失败的情况,该方法还包括:智能网卡将报文上送VS。The smart network card matches the message with the data plane hash table, including: the smart network card matches the action item based on the hash, calculates the hash value corresponding to the message, obtains the mask corresponding to the message based on the hash value, and matches based on the redirection identifier Action item: Search the data plane hash table; based on the inconsistency between the hash value corresponding to the message and the mask in the data plane hash table, it is determined that the message fails to match the data plane hash table. In the case of matching failure, the method also includes: the smart network card sends the packet to the VS.
相应的,虚拟交换机VS接收智能网卡发送的报文,该报文由智能网卡在报文与智能网卡上的硬件匹配流表的匹配成功,且硬件匹配流表中包括上送动作项的情况下发送,或者,报文由智能网卡在报文与智能网卡上的硬件匹配流表的匹配失败的情况下发送,或者,报文由智能网卡在报文与智能网卡上的数据面哈希表匹配失败后发送。Correspondingly, the virtual switch VS receives the packet sent by the intelligent network card. The packet is successfully matched by the intelligent network card with the hardware matching flow table on the intelligent network card, and the hardware matching flow table includes the upload action item. Sent, either by the smart NIC after the packet fails to match the hardware matching flow table on the smart NIC, or by the smart NIC after the packet matches the data plane hash table on the smart NIC. Sent after failure.
VS接收到智能网卡上送的报文后,将报文与VS上的开源流表进行匹配,根据匹配结果对报文进行流量管理。After receiving the packet sent by the smart network card, the VS matches the packet with the open source flow table on the VS, and performs traffic management on the packet based on the matching results.
本申请实施例提供的方法,将硬件匹配流表下发到智能网卡,可适用于带宽增加的情况下,使得流量管理的效率更高。此外,根据报文类型,选择将报文与对应的硬件匹配流表进行匹配,实现流量管理。在有网元大流量的场景,选择硬件模糊匹配流表下发到智能网卡,能够保证主要场景转发性能最高。网元大流量场景下发硬件模糊匹配流表至智能网卡,减少了硬件精确匹配流表生成的流表数量,进一步提高了流量管理的效率;又由于硬件模糊匹配流表本身条目不多,因此,当OpenFlow配置发生变化时,显著提升了流量的稳定性,降低了流量震荡。 The method provided by the embodiments of this application delivers the hardware matching flow table to the smart network card, which can be applied when the bandwidth increases, making traffic management more efficient. In addition, according to the packet type, the packet is selected to be matched with the corresponding hardware matching flow table to implement traffic management. In scenarios with large traffic from network elements, choosing hardware fuzzy matching flow tables to deliver them to smart network cards can ensure the highest forwarding performance in major scenarios. In high-traffic scenarios, the network element delivers the hardware fuzzy matching flow table to the smart network card, which reduces the number of flow tables generated by the hardware exact matching flow table and further improves the efficiency of traffic management. Since there are not many entries in the hardware fuzzy matching flow table itself, , when the OpenFlow configuration changes, it significantly improves the stability of the traffic and reduces the traffic oscillation.
当智能网卡支持DP-HASH表处理时,针对ECMP场景,可节省硬件匹配流表中的条目的数量,当OpenFlow配置发生变化时,显著提升了流量管理的稳定性和可靠性。When the smart network card supports DP-HASH table processing, it can save the number of entries in the hardware matching flow table for ECMP scenarios. When the OpenFlow configuration changes, the stability and reliability of traffic management are significantly improved.
本申请实施例提供了一种流表规则的管理方法,参见图12,该方法包括如下步骤1201-步骤1203。This embodiment of the present application provides a method for managing flow table rules. Refer to Figure 12. The method includes the following steps 1201 to 1203.
步骤1201,VS获取ACL流匹配规则、硬件匹配流表和数据面哈希表。Step 1201, VS obtains ACL flow matching rules, hardware matching flow table and data plane hash table.
本申请实施例不限定VS获取ACL流匹配规则、硬件匹配流表和数据面哈希表的先后顺序,获取ACL流匹配规则的过程可参考图4所示的步骤401的相关描述,获取硬件匹配流表的过程可参考图7所示的步骤701的相关描述,获取数据面哈希表的过程可参考图8所示的步骤704的相关描述,此处不再一一赘述。除了管理ACL流匹配规则,还可以管理硬件匹配流表,使得流表规则的管理更加全面,且灵活性更高。The embodiment of this application does not limit the order in which VS obtains the ACL flow matching rules, the hardware matching flow table and the data plane hash table. The process of obtaining the ACL flow matching rules can refer to the relevant description of step 401 shown in Figure 4 to obtain the hardware matching. For the flow table process, please refer to the relevant description of step 701 shown in Figure 7. For the process of obtaining the data plane hash table, please refer to the relevant description of step 704 shown in Figure 8, which will not be described again here. In addition to managing ACL flow matching rules, it can also manage hardware matching flow tables, making the management of flow table rules more comprehensive and more flexible.
步骤1202,VS指示智能网卡管理ACL流匹配规则、硬件匹配流表和数据面哈希表。Step 1202: VS instructs the smart network card to manage ACL flow matching rules, hardware matching flow tables, and data plane hash tables.
步骤1203,智能网卡管理ACL流匹配规则、硬件匹配流表和数据面哈希表。Step 1203: The smart network card manages ACL flow matching rules, hardware matching flow tables and data plane hash tables.
本申请实施例不限定VS指示智能网卡管理ACL流匹配规则、硬件匹配流表和数据面哈希表的先后顺序进行限定,VS指示智能网卡管理ACL流匹配规则以及智能网卡管理ACL流匹配规则的过程可参考图4所示的步骤402和步骤403的相关描述,VS指示智能网卡管理硬件匹配流表的过程以及智能网卡管理硬件匹配流表的过程可参考图7所示的步骤702和步骤703的相关描述,VS指示智能网卡管理数据面哈希表以及智能网卡管理数据面哈希表的过程可参考图8所示的步骤705和步骤706的相关描述,此处不再一一赘述。The embodiment of this application does not limit the order in which VS instructs the intelligent network card to manage ACL flow matching rules, the hardware matching flow table and the data plane hash table. The VS instructs the intelligent network card to manage ACL flow matching rules and the intelligent network card manages ACL flow matching rules. The process can refer to the relevant description of steps 402 and 403 shown in Figure 4. The process of VS instructing the smart network card to manage the hardware matching flow table and the process of the smart network card managing the hardware matching flow table can refer to steps 702 and 703 shown in Figure 7. For related descriptions, the process of VS instructing the smart network card to manage the data plane hash table and the smart network card managing the data plane hash table can refer to the related descriptions of steps 705 and 706 shown in Figure 8, which will not be described again here.
本申请实施例提供了一种流量管理方法,参见图13,该方法包括如下步骤1301-步骤1307。The embodiment of the present application provides a traffic management method. See Figure 13. The method includes the following steps 1301 to 1307.
步骤1301,智能网卡接收报文,将报文与智能网卡上创建的入向的ACL流匹配规则进行匹配。Step 1301: The smart network card receives the packet and matches the packet with the inbound ACL flow matching rule created on the smart network card.
该步骤1301的实现过程可参考图5所示的步骤501以及图6的相关描述,此处不再赘述。For the implementation process of step 1301, reference can be made to step 501 shown in Figure 5 and the related description of Figure 6, which will not be described again here.
步骤1302,基于报文与ACL流匹配规则匹配成功,智能网卡根据入向的ACL流匹配规则对报文进行运维功能管理。Step 1302: Based on the successful match between the packet and the ACL flow matching rule, the smart network card performs operation and maintenance function management on the packet according to the incoming ACL flow matching rule.
该步骤1302的实现过程可参考图5所示的步骤502以及图6的相关描述,此处不再赘述。For the implementation process of step 1302, reference can be made to step 502 shown in Figure 5 and the related description of Figure 6, which will not be described again here.
步骤1303,智能网卡将报文与硬件匹配流表进行匹配,硬件匹配流表包括硬件精确匹配流表和硬件模糊匹配流表中的至少一种。Step 1303: The smart network card matches the packet with a hardware matching flow table. The hardware matching flow table includes at least one of a hardware exact matching flow table and a hardware fuzzy matching flow table.
该步骤1302的实现过程可参考图9所示的步骤901以及图10的相关描述,此处不再赘述。For the implementation process of step 1302, reference can be made to step 901 shown in Figure 9 and the related description of Figure 10, which will not be described again here.
步骤1304,智能网卡根据报文与硬件匹配流表的匹配结果对报文进行流量管理。Step 1304: The smart network card performs traffic management on the packet based on the matching result between the packet and the hardware matching flow table.
该步骤1304的实现过程可参考图9所示的步骤902以及图10的相关描述,此处不再赘述。For the implementation process of step 1304, reference can be made to step 902 shown in Figure 9 and the related description of Figure 10, which will not be described again here.
在一种可能的实现方式中,报文为多路径转发报文,该方法还包括如下的步骤1305。In a possible implementation manner, the message is a multi-path forwarding message, and the method further includes the following step 1305.
步骤1305,智能网卡将报文与数据面哈希表进行匹配;基于报文与数据面哈希表匹配成功,智能网卡对报文进行多路径转发。Step 1305: The smart network card matches the message with the data plane hash table; based on the successful match between the message and the data plane hash table, the smart network card performs multi-path forwarding of the message.
该步骤1305的实现过程可参考图9所示的步骤902下面有关数据面哈希表的相关描述以及图11的相关描述,此处不再赘述。 For the implementation process of step 1305, reference can be made to the relevant description of the data plane hash table below step 902 shown in Figure 9 and the relevant description of Figure 11, which will not be described again here.
步骤1306,智能网卡将报文与智能网卡上创建的出向的ACL流匹配规则进行匹配。Step 1306: The smart network card matches the packet with the outbound ACL flow matching rule created on the smart network card.
该步骤1306的实现过程可参考图5所示的步骤501以及图6的相关描述,此处不再赘述。For the implementation process of step 1306, reference can be made to step 501 shown in Figure 5 and the related description of Figure 6, which will not be described again here.
步骤1307,基于报文与ACL流匹配规则匹配成功,智能网卡根据出向的ACL流匹配规则对报文进行运维功能管理。Step 1307: Based on the successful match between the packet and the ACL flow matching rule, the smart network card performs operation and maintenance function management on the packet according to the outbound ACL flow matching rule.
该步骤1307的实现过程可参考图5所示的步骤502以及图6的相关描述,此处不再赘述。For the implementation process of step 1307, reference can be made to step 502 shown in Figure 5 and the related description of Figure 6, which will not be described again here.
为了便于理解,以图14所示的流表规则的管理过程以及流量管理过程为例,对本申请实施例中上述图12提供的流表规则的管理方法以及图13所示的流量管理方法进行举例说明。图14中,VS基于SDN控制器下发的OpenFlow表生成入向的ACL也即入向的ACL流匹配规则和出向的ACL也即出向的ACL流匹配规则后,如图14中的虚线箭头所示,将入向的ACL流匹配规则和出向的ACL流匹配规则下发到智能网卡,在智能网卡上进行流表规则的管理。该流表规则的管理过程可参见上述图4所示的流表规则的管理方法,此处不再赘述。此外,VS基于SDN控制器下发的OpenFlow表生成硬件精确匹配流(hw EMC)表、硬件模糊匹配流(hw MegaFlow)表和数据面哈希表(DP Hash)后,如图14中的虚线箭头所示,将硬件精确匹配流表、硬件模糊匹配流表和数据面哈希表配置下发到智能网卡,在智能网卡上进行流表规则的管理。该流表规则的管理过程可参见上述图8所示的流表规则的管理方法,此处不再赘述。In order to facilitate understanding, the management process of flow table rules and the traffic management process shown in Figure 14 are taken as an example to illustrate the management method of flow table rules provided in Figure 12 and the traffic management method shown in Figure 13 in the embodiment of the present application. illustrate. In Figure 14, after VS generates the inbound ACL, that is, the inbound ACL flow matching rule, and the outbound ACL, that is, the outbound ACL flow matching rule, based on the OpenFlow table issued by the SDN controller, as indicated by the dotted arrows in Figure 14 Display, deliver the inbound ACL flow matching rules and outbound ACL flow matching rules to the smart NIC, and manage the flow table rules on the smart NIC. For the management process of the flow table rules, please refer to the management method of the flow table rules shown in Figure 4 above, and will not be described again here. In addition, after VS generates the hardware exact matching flow (hw EMC) table, hardware fuzzy matching flow (hw MegaFlow) table and data plane hash table (DP Hash) based on the OpenFlow table issued by the SDN controller, as shown by the dotted line in Figure 14 As shown by the arrows, the hardware exact matching flow table, hardware fuzzy matching flow table and data plane hash table configurations are delivered to the smart network card, and the flow table rules are managed on the smart network card. For the management process of the flow table rules, please refer to the management method of the flow table rules shown in Figure 8 above, and will not be described again here.
智能网卡接收到报文后,如图14的实线箭头所示,先将报文与入向的ACL流匹配规则进行匹配,如果匹配成功,智能网卡根据入向的ACL流匹配规则对报文进行入向的运维功能管理,也即执行流表规则动作项对应的动作,例如执行入向的流表统计、为报文设置TAG标记等。执行流表规则动作项对应的动作之后,智能网卡将报文与硬件模糊匹配流表进行匹配,如果匹配成功,智能网卡根据硬件模糊匹配流表对报文进行流量管理,也即执行硬件模糊匹配流表中的流匹配规则包括的流表规则动作项对应的动作。执行流表规则动作项对应的动作之后,智能网卡将报文与硬件精确匹配流表进行匹配,如果匹配成功,智能网卡根据硬件精确匹配流表对报文进行流量管理,也即执行硬件精确匹配流表中的流匹配规则包括的流表规则动作项对应的动作。之后,智能网卡基于哈希匹配动作项,计算报文对应的哈希值,基于哈希值获取报文对应的掩码;基于转向标识匹配动作项,查找数据面哈希表;基于报文对应的掩码与数据面哈希表中的掩码一致,确定报文与数据面哈希表匹配成功。因此,智能网卡按照数据面哈希表中掩码对应的下一跳信息对报文进行多路径转发。After the smart network card receives the message, as shown by the solid arrow in Figure 14, it first matches the message with the incoming ACL flow matching rules. If the match is successful, the smart network card processes the message according to the incoming ACL flow matching rules. Carry out inbound operation and maintenance function management, that is, execute the actions corresponding to the flow table rule action items, such as performing inbound flow table statistics, setting TAG marks for packets, etc. After executing the action corresponding to the flow table rule action item, the intelligent network card matches the packet with the hardware fuzzy matching flow table. If the match is successful, the intelligent network card performs traffic management on the packet according to the hardware fuzzy matching flow table, that is, performs hardware fuzzy matching. The action corresponding to the flow table rule action item included in the flow matching rule in the flow table. After executing the action corresponding to the flow table rule action item, the intelligent network card matches the packet with the hardware exact matching flow table. If the match is successful, the intelligent network card performs traffic management on the packet according to the hardware exact matching flow table, that is, performs hardware exact matching. The action corresponding to the flow table rule action item included in the flow matching rule in the flow table. After that, the smart network card calculates the hash value corresponding to the message based on the hash matching action item, and obtains the mask corresponding to the message based on the hash value; matches the action item based on the redirection identifier, and searches the data plane hash table; based on the message corresponding The mask is consistent with the mask in the data plane hash table, confirming that the packet matches the data plane hash table successfully. Therefore, the smart network card multipath forwards the packet according to the next hop information corresponding to the mask in the data plane hash table.
在报文出智能网卡之前,基于报文与出向的ACL流匹配规则进行匹配,如果匹配成功,智能网卡根据出向的ACL流匹配规则对报文进行出向的运维功能管理。例如,对报文执行出向的流表统计,基于入向设置的TAG标记进行报文的统计等。Before the packet leaves the smart network card, the packet is matched based on the outbound ACL flow matching rules. If the match is successful, the smart network card performs outbound operation and maintenance function management on the packet based on the outbound ACL flow matching rules. For example, perform outbound flow table statistics on packets, and perform packet statistics based on the TAG set in the inbound direction.
可选地,本申请实施例提供的方法还包括:基于报文与入向的ACL流匹配规则匹配失败,无需执行入向的ACL流匹配规则中的流表规则动作项,智能网卡将报文与硬件模糊匹配流表进行匹配。基于报文与硬件模糊匹配流表的匹配结果为报文与硬件模糊匹配流表匹配成功,且硬件模糊匹配流表中包括上送动作项,将报文上送VS;或者,基于报文与硬件模糊匹配流表的匹配结果为报文与硬件模糊匹配流表匹配失败,将报文上送VS。Optionally, the method provided by the embodiment of this application also includes: based on the failure of the packet to match the incoming ACL flow matching rule, there is no need to execute the flow table rule action item in the incoming ACL flow matching rule, and the smart network card will Match with hardware fuzzy matching flow table. The matching result based on the packet and the hardware fuzzy matching flow table is that the packet matches the hardware fuzzy matching flow table successfully, and the hardware fuzzy matching flow table includes a upload action item, and the packet is sent to the VS; or, based on the packet and the hardware fuzzy matching flow table, the packet is sent to the VS. The matching result of the hardware fuzzy matching flow table is that the packet fails to match the hardware fuzzy matching flow table, and the packet is sent to the VS.
除上述上送VS的情况外,如果报文与硬件模糊匹配流表匹配成功,且硬件模糊匹配流表中不包括上送动作项,按照硬件模糊匹配流表对报文进行流量管理之后,将报文与 硬件精确匹配流表进行匹配。基于报文与硬件精确匹配流表的匹配结果为报文与硬件精确匹配流表匹配成功,且硬件精确匹配流表中包括上送动作项,将报文上送VS;或者,基于报文与硬件精确匹配流表的匹配结果为报文与硬件精确匹配流表匹配失败,将报文上送VS。In addition to the above situation of sending to VS, if the packet successfully matches the hardware fuzzy matching flow table, and the hardware fuzzy matching flow table does not include the sending action item, after traffic management is performed on the packet according to the hardware fuzzy matching flow table, the packet will be message and Hardware exact match flow table for matching. The matching result based on the packet and the hardware exact matching flow table is that the packet and the hardware exact matching flow table are successfully matched, and the hardware exact matching flow table includes a upload action item, and the packet is sent to the VS; or, based on the packet and the hardware exact matching flow table, the packet is sent to the VS. The matching result of the hardware exact matching flow table is that the packet fails to match the hardware exact matching flow table, and the packet is sent to the VS.
如果基于报文与硬件精确匹配流表的匹配结果为报文与硬件精确匹配流表匹配成功,且硬件精确匹配流表中不包括上送动作项,按照硬件精确匹配流表对报文进行流量管理之后,智能网卡基于哈希匹配动作项,计算报文对应的哈希值,基于哈希值获取报文对应的掩码;基于转向标识匹配动作项,查找数据面哈希表;基于报文对应的掩码与数据面哈希表中的掩码一致,确定报文与数据面哈希表匹配成功。因此,智能网卡按照数据面哈希表中掩码对应的下一跳信息对报文进行多路径转发。最后,再将报文与出向的ACL流匹配规则进行匹配,如果匹配成功,智能网卡根据出向的ACL流匹配规则对报文进行出向的运维功能管理。If the matching result based on the packet and hardware exact matching flow table is that the packet successfully matches the hardware exact matching flow table, and the hardware exact matching flow table does not include an upload action item, the packet will be flown according to the hardware exact matching flow table. After management, the smart network card calculates the hash value corresponding to the message based on the hash matching action item, and obtains the mask corresponding to the message based on the hash value; matches the action item based on the redirection identifier, and searches the data plane hash table; based on the message The corresponding mask is consistent with the mask in the data plane hash table, confirming that the packet matches the data plane hash table successfully. Therefore, the smart network card multipath forwards the packet according to the next hop information corresponding to the mask in the data plane hash table. Finally, the packet is matched against the outbound ACL flow matching rules. If the match is successful, the smart network card performs outbound operation and maintenance function management on the packet based on the outbound ACL flow matching rules.
本申请实施例还提供了一种流表规则的管理方法,以该方法由SDN控制器与VS的交互执行为例,如图15所示,该方法包括步骤1501-步骤1503。The embodiment of the present application also provides a method for managing flow table rules. Taking this method as an example of the interaction between the SDN controller and the VS, as shown in Figure 15, the method includes steps 1501 to 1503.
步骤1501,SDN控制器基于流表聚合标记获取策略路由。Step 1501: The SDN controller obtains policy routing based on the flow table aggregation mark.
在一种可能的实现方式中,网元在网元网络共享磁盘(network sharing disk,NSD)描述文件中,对与终端侧相连接的端口所在的虚拟路由器(virtual router)上增加是否为南北向(出入数据中心(data center,DC))的标识,该标识用于指示该端口流表是否聚合使用。当网元从该端口发出三层业务报文时,能够统一去往外部网关(gateway,GW)。SDN控制器在OpenFlow表的处理流程中,对于虚拟路由器中的标识为南北向的标识,增加策略路由,以指示三层报文默认转发到GW。In one possible implementation, the network element adds whether the virtual router (virtual router) where the port connected to the terminal side is located is north-south in the network element network sharing disk (NSD) description file. (Inbound and outbound data center (DC)) identifier. This identifier is used to indicate whether the port flow table is used in aggregation. When the network element sends out Layer 3 service packets from this port, they can be uniformly sent to the external gateway (gateway, GW). In the processing process of the OpenFlow table, the SDN controller adds policy routing for the north-south identifier in the virtual router to instruct Layer 3 packets to be forwarded to the GW by default.
示例性地,策略路由匹配字段包括端口标识(port),可选地,该策略路由匹配字段还包括vlan、源MAC(smac)、目的MAC(dmac)和以太类型(ethtype)中的至少一项。该策略路由匹配字段还包括action,示例性地,该action为转发到GW,例如,以VXLAN封装的方式转发到GW。Exemplarily, the policy routing matching field includes a port identifier (port). Optionally, the policy routing matching field also includes at least one of vlan, source MAC (smac), destination MAC (dmac), and Ethertype (ethtype). . The policy routing matching field also includes an action. For example, the action is forwarding to the GW, for example, forwarding to the GW in a VXLAN encapsulation manner.
步骤1502,SDN控制器将策略路由下发给VS,指示VS基于该策略路由管理硬件模糊匹配流表。Step 1502: The SDN controller delivers the policy route to the VS and instructs the VS to manage the hardware fuzzy matching flow table based on the policy route.
通过将策略路由下发给VS,指示VS基于该策略路由管理硬件模糊匹配表时,用于该端口流表聚合使用,进一步缩减精确匹配表与模糊匹配表的流表条目。By delivering the policy route to VS, instructing VS to manage the hardware fuzzy matching table based on the policy route, it will be used for aggregation and use of the port flow table to further reduce the flow table entries in the exact matching table and fuzzy matching table.
步骤1503,VS接收策略路由,基于策略路由和OpenFlow表生成硬件模糊匹配流表。Step 1503: VS receives the policy routing and generates a hardware fuzzy matching flow table based on the policy routing and the OpenFlow table.
可选地,VS基于策略路由和OpenFlow表生成硬件模糊匹配流表之后,VS可基于该硬件模糊匹配流表进行流量管理。在一种可能的实现方式中,VS还可将生成的硬件模糊匹配流表下发到智能网卡上,指示智能网卡管理硬件模糊匹配流表。也就是说,本申请实施例提供的图15所示的流表规则的管理方法可应用于图7、图8以及图13所示的步骤701中获取硬件模糊匹配流表的过程。VS生成硬件模糊匹配流表之后,还可将生成的硬件模糊匹配流表下发到智能网卡上,指示智能网卡管理硬件模糊匹配流表的过程可参考图7、图8以及图13所示的步骤702及之后的过程,此处不再一一赘述。 Optionally, after VS generates a hardware fuzzy matching flow table based on policy routing and the OpenFlow table, VS can perform traffic management based on the hardware fuzzy matching flow table. In a possible implementation, the VS can also deliver the generated hardware fuzzy matching flow table to the smart network card, instructing the smart network card to manage the hardware fuzzy matching flow table. That is to say, the management method of flow table rules shown in Figure 15 provided by the embodiment of the present application can be applied to the process of obtaining the hardware fuzzy matching flow table in step 701 shown in Figures 7, 8 and 13. After VS generates the hardware fuzzy matching flow table, it can also deliver the generated hardware fuzzy matching flow table to the smart network card. The process of instructing the smart network card to manage the hardware fuzzy matching flow table can be referred to Figure 7, Figure 8 and Figure 13. Step 702 and subsequent processes will not be described again here.
图16是本申请实施例提供的一种流表规则的管理装置的结构示意图,该装置应用于智能网卡,智能网卡用于与VS连接,该智能网卡为上述图4所示的智能网卡。基于图16所示的如下多个模块,该图16所示的流表规则的管理装置能够执行智能网卡所执行的全部或部分操作。应理解到,该装置可以包括比所示模块更多的附加模块或者省略其中所示的一部分模块,本申请实施例对此并不进行限制。如图16所示,该装置包括:Figure 16 is a schematic structural diagram of a flow table rule management device provided by an embodiment of the present application. The device is applied to a smart network card. The smart network card is used to connect to the VS. The smart network card is the smart network card shown in Figure 4 above. Based on the following modules shown in Figure 16, the flow table rule management device shown in Figure 16 can perform all or part of the operations performed by the smart network card. It should be understood that the device may include more additional modules than the modules shown or omit some of the modules shown therein, and the embodiments of the present application are not limited to this. As shown in Figure 16, the device includes:
管理模块1601,用于管理访问控制列表ACL流匹配规则,ACL流匹配规则用于智能网卡对报文进行运维功能管理。The management module 1601 is used to manage the access control list ACL flow matching rules. The ACL flow matching rules are used for the operation and maintenance function management of the packets by the smart network card.
在一种可能的实现方式中,ACL流匹配规则包括入向的ACL流匹配规则和出向的ACL流匹配规则中的至少一种。In a possible implementation manner, the ACL flow matching rules include at least one of an inbound ACL flow matching rule and an outbound ACL flow matching rule.
在一种可能的实现方式中,管理模块1601,用于接收VS调用第一应用程序编程接口API发送的第一消息,该第一消息包括智能网卡的第一端口的端口标识;基于第一消息在智能网卡的第一端口上创建第一ACL流匹配规则。In a possible implementation, the management module 1601 is configured to receive the first message sent by the VS by calling the first application programming interface API. The first message includes the port identification of the first port of the smart network card; based on the first message Create the first ACL flow matching rule on the first port of the smart NIC.
在一种可能的实现方式中,第一消息还包括流表规则属性、流表规则匹配项和流表规则动作项中的至少一种;其中,流表规则属性用于指示报文需匹配的组、第一ACL流匹配规则的方向信息、流表类型中的至少一种;流表规则匹配项包括匹配以太层信息、匹配虚拟局域网VLAN信息、匹配网际协议第四版IPv4信息或匹配网际协议第六版IPv6信息、匹配虚拟扩展局域网VXLAN信息、匹配项结束、报文标记中的至少一种;流表规则动作项包括流表统计、采样转发和流镜像、为报文设置内标记、修改指定字段和引用句柄操作中的至少一种。In a possible implementation, the first message also includes at least one of a flow table rule attribute, a flow table rule matching item, and a flow table rule action item; wherein the flow table rule attribute is used to indicate that the packet needs to match At least one of the group, the direction information of the first ACL flow matching rule, and the flow table type; the flow table rule matching items include matching Ethernet layer information, matching virtual LAN VLAN information, matching Internet Protocol version 4 IPv4 information, or matching Internet Protocol At least one of the sixth version of IPv6 information, matching virtual extended LAN VXLAN information, matching item end, and packet marking; flow table rule action items include flow table statistics, sampling forwarding and flow mirroring, setting internal tags for packets, and modifying Specifies at least one of field and refnum operations.
在一种可能的实现方式中,该装置还包括:发送模块,用于向VS发送第二消息,第二消息指示在智能网卡的第一端口上创建第一ACL流匹配规则的结果。In a possible implementation, the device further includes: a sending module, configured to send a second message to the VS, where the second message indicates the result of creating the first ACL flow matching rule on the first port of the smart network card.
在一种可能的实现方式中,管理模块1601,用于接收VS调用第二API发送的第三消息,基于第三消息在智能网卡上删除第二ACL流匹配规则。In a possible implementation, the management module 1601 is configured to receive the third message sent by the VS by calling the second API, and delete the second ACL flow matching rule on the smart network card based on the third message.
在一种可能的实现方式中,管理模块1601,用于接收VS调用第三API发送的第四消息,基于第四消息查询并返回智能网卡的统计信息。In a possible implementation, the management module 1601 is configured to receive a fourth message sent by the VS by calling a third API, and query and return statistical information of the smart network card based on the fourth message.
在一种可能的实现方式中,管理模块1601,还用于管理硬件匹配流表,硬件匹配流表用于智能网卡对流量进行流量管理,硬件匹配流表包括硬件精确匹配流表和硬件模糊匹配流表中的至少一种。In a possible implementation, the management module 1601 is also used to manage the hardware matching flow table. The hardware matching flow table is used by the smart network card to manage traffic. The hardware matching flow table includes a hardware exact matching flow table and a hardware fuzzy matching. At least one of the flow tables.
在一种可能的实现方式中,硬件模糊匹配流表用于与第一报文进行匹配,第一报文为生成流表条目满足第一阈值条件的网元所产生的报文;硬件精确匹配流表用于与第二报文进行匹配,第二报文为满足第二阈值条件的网元所产生的报文。In one possible implementation, the hardware fuzzy matching flow table is used to match the first packet, which is a packet generated by a network element whose flow table entry satisfies the first threshold condition; hardware exact matching The flow table is used to match the second packet, and the second packet is a packet generated by a network element that meets the second threshold condition.
在一种可能的实现方式中,管理模块1601,还用于管理数据面哈希表,数据面哈希表用于智能网卡对多路径转发报文进行多路径转发。In one possible implementation, the management module 1601 is also used to manage the data plane hash table. The data plane hash table is used by the intelligent network card to perform multi-path forwarding of multi-path forwarding messages.
在一种可能的实现方式中,硬件匹配流表中包括哈希匹配动作项、转向标识匹配动作项和报文上送VS软件控制面匹配动作项的至少一种;其中,哈希匹配动作项用于指示执行数据面哈希表的查询动作,转向标识用于指示数据面哈希表,数据面哈希表包括哈希值、掩码和转向标识,掩码对应下一跳信息。In a possible implementation, the hardware matching flow table includes at least one of a hash matching action item, a redirection identifier matching action item, and a packet upload VS software control plane matching action item; wherein, the hash matching action item It is used to instruct the execution of the query action of the data plane hash table. The redirection flag is used to indicate the data side hash table. The data plane hash table includes the hash value, mask and redirection flag. The mask corresponds to the next hop information.
图17是本申请实施例提供的一种流表规则的管理装置的结构示意图,该装置应用于VS,VS用于与智能网卡连接,该VS为上述图4或图7或图8所示的VS。基于图17所示的如下多个 模块,该图17所示的流表规则的管理装置能够执行VS所执行的全部或部分操作。应理解到,该装置可以包括比所示模块更多的附加模块或者省略其中所示的一部分模块,本申请实施例对此并不进行限制。如图17所示,该装置包括:Figure 17 is a schematic structural diagram of a flow table rule management device provided by an embodiment of the present application. The device is applied to a VS. The VS is used to connect to a smart network card. The VS is as shown in Figure 4 or Figure 7 or Figure 8. VS. Based on the following multiple as shown in Figure 17 Module, the flow table rule management device shown in Figure 17 can perform all or part of the operations performed by the VS. It should be understood that the device may include more additional modules than the modules shown or omit some of the modules shown therein, and the embodiments of the present application are not limited to this. As shown in Figure 17, the device includes:
获取模块1701,用于获取访问控制列表ACL流匹配规则,ACL流匹配规则用于智能网卡对报文进行运维功能管理;The acquisition module 1701 is used to obtain the access control list ACL flow matching rules. The ACL flow matching rules are used by the smart network card to perform operation and maintenance function management of the packets;
指示模块1702,用于指示智能网卡管理ACL流匹配规则。Instruction module 1702 is used to instruct the intelligent network card to manage ACL flow matching rules.
在一种可能的实现方式中,ACL流匹配规则包括入向的ACL流匹配规则和出向的ACL流匹配规则中的至少一种。In a possible implementation manner, the ACL flow matching rules include at least one of an inbound ACL flow matching rule and an outbound ACL flow matching rule.
在一种可能的实现方式中,指示模块1702,用于调用第一应用程序编程接口API向智能网卡发送第一消息,第一消息包括智能网卡的第一端口的端口标识,第一消息用于智能网卡在智能网卡的第一端口上创建第一ACL流匹配规则。In a possible implementation, the instruction module 1702 is configured to call the first application programming interface API to send a first message to the smart network card. The first message includes the port identification of the first port of the smart network card. The first message is used to The smart NIC creates the first ACL flow matching rule on the first port of the smart NIC.
在一种可能的实现方式中,第一消息还包括流表规则属性、流表规则匹配项和流表规则动作项中的至少一种;其中,流表规则属性用于指示报文需匹配的组、第一ACL流匹配规则为入向的ACL流匹配规则还是出向的ACL流匹配规则、流表类型中的至少一种;流表规则匹配项包括匹配以太层信息、匹配虚拟局域网VLAN信息、匹配网际协议第四版IPv4信息或匹配网际协议第六版IPv6信息、匹配虚拟扩展局域网VXLAN信息、匹配项结束、报文标记中的至少一种;流表规则动作项包括流表统计、采样转发和流镜像、为报文设置内标记、修改指定字段和引用句柄操作中的至少一种。In a possible implementation, the first message also includes at least one of a flow table rule attribute, a flow table rule matching item, and a flow table rule action item; wherein the flow table rule attribute is used to indicate that the packet needs to match The group, the first ACL flow matching rule is at least one of the incoming ACL flow matching rule or the outgoing ACL flow matching rule, and the flow table type; the flow table rule matching items include matching Ethernet layer information, matching virtual LAN VLAN information, Matching Internet Protocol version 4 IPv4 information or matching Internet Protocol version 6 IPv6 information, matching virtual extended LAN VXLAN information, matching item end, and packet marking; the flow table rule action items include flow table statistics and sampling forwarding At least one of flow mirroring, setting internal tags for packets, modifying specified fields, and refnum operations.
在一种可能的实现方式中,该装置还包括:接收模块,用于接收智能网卡发送的第二消息,第二消息用于指示在智能网卡的第一端口上创建第一ACL流匹配规则的结果。In a possible implementation, the device further includes: a receiving module, configured to receive a second message sent by the smart network card, where the second message is used to instruct the creation of the first ACL flow matching rule on the first port of the smart network card. result.
在一种可能的实现方式中,指示模块1702,用于调用第二API向智能网卡发送第三消息,第三消息用于智能网卡在智能网卡上删除第二ACL流匹配规则。In a possible implementation, the instruction module 1702 is configured to call a second API to send a third message to the smart network card, where the third message is used by the smart network card to delete the second ACL flow matching rule on the smart network card.
在一种可能的实现方式中,指示模块1702,用于调用第三API向智能网卡发送第四消息,第四消息用于智能网卡查询并返回智能网卡的统计信息。In a possible implementation manner, the instruction module 1702 is configured to call a third API to send a fourth message to the smart network card. The fourth message is used for the smart network card to query and return statistical information of the smart network card.
在一种可能的实现方式中,获取模块1701,还用于获取硬件匹配流表,硬件匹配流表用于智能网卡对流量进行流量管理,硬件匹配流表包括硬件精确匹配流表和硬件模糊匹配流表中的至少一种;In a possible implementation, the acquisition module 1701 is also used to obtain a hardware matching flow table. The hardware matching flow table is used by the smart network card to manage traffic. The hardware matching flow table includes a hardware exact matching flow table and a hardware fuzzy matching. At least one of the flow tables;
指示模块1702,还用于指示智能网卡管理硬件匹配流表。The instruction module 1702 is also used to instruct the smart network card to manage the hardware matching flow table.
在一种可能的实现方式中,硬件模糊匹配流表用于与第一报文进行匹配,第一报文为生成流表条目满足第一阈值条件的网元所产生的报文;硬件精确匹配流表用于与第二报文进行匹配,第二报文为满足第二阈值条件的网元所产生的报文。In one possible implementation, the hardware fuzzy matching flow table is used to match the first packet, which is a packet generated by a network element whose flow table entry satisfies the first threshold condition; hardware exact matching The flow table is used to match the second packet, and the second packet is a packet generated by a network element that meets the second threshold condition.
在一种可能的实现方式中,获取模块1701,还用于获取数据面哈希表,数据面哈希表用于智能网卡对多路径转发报文进行多路径转发;指示模块1702,还用于指示智能网卡管理数据面哈希表。In a possible implementation, the acquisition module 1701 is also used to obtain the data plane hash table, which is used by the smart network card to perform multi-path forwarding of multi-path forwarding messages; the instruction module 1702 is also used to obtain Instructs the smart NIC to manage the data plane hash table.
在一种可能的实现方式中,硬件匹配流表中包括哈希匹配动作项、转向标识匹配动作项和报文上送VS软件控制面匹配动作项的至少一种;其中,哈希匹配动作项用于指示执行数据面哈希表的查询动作,转向ID用于指示数据面哈希表,数据面哈希表包括哈希值、掩码和转向标识,掩码对应下一跳信息。In a possible implementation, the hardware matching flow table includes at least one of a hash matching action item, a redirection identifier matching action item, and a packet upload VS software control plane matching action item; wherein, the hash matching action item It is used to indicate the query action of the data plane hash table. The redirection ID is used to indicate the data plane hash table. The data plane hash table includes the hash value, mask and redirection identifier. The mask corresponds to the next hop information.
图18是本申请实施例提供的一种流量管理装置的结构示意图,该装置应用于智能网卡, 智能网卡用于与VS连接,该智能网卡为上述图5或图9所示的智能网卡。基于图18所示的如下多个模块,该图18所示的流量管理装置能够执行智能网卡所执行的全部或部分操作。应理解到,该装置可以包括比所示模块更多的附加模块或者省略其中所示的一部分模块,本申请实施例对此并不进行限制。如图18所示,该装置包括:Figure 18 is a schematic structural diagram of a traffic management device provided by an embodiment of the present application. The device is applied to a smart network card. The smart network card is used to connect to the VS. The smart network card is the smart network card shown in Figure 5 or Figure 9 above. Based on the following modules shown in Figure 18, the traffic management device shown in Figure 18 can perform all or part of the operations performed by the smart network card. It should be understood that the device may include more additional modules than the modules shown or omit some of the modules shown therein, and the embodiments of the present application are not limited to this. As shown in Figure 18, the device includes:
接收模块1801,用于接收报文,将报文与智能网卡上创建的访问控制列表ACL流匹配规则进行匹配;The receiving module 1801 is used to receive the message and match the message with the access control list ACL flow matching rule created on the smart network card;
管理模块1802,用于基于报文与ACL流匹配规则匹配成功,根据ACL流匹配规则对报文进行运维功能管理。The management module 1802 is configured to perform operation and maintenance function management on the packets according to the ACL flow matching rules based on successful matching between the packets and the ACL flow matching rules.
在一种可能的实现方式中,ACL流匹配规则包括入向的ACL流匹配规则和出向的ACL流匹配规则;管理模块1802,用于基于报文与入向的ACL流匹配规则匹配成功,根据入向的ACL流匹配规则对报文进行入向的运维功能管理;将报文进行二三层网络转发;基于报文与出向的ACL流匹配规则匹配成功,根据出向的ACL流匹配规则对报文进行出向的运维功能管理。In a possible implementation, the ACL flow matching rules include incoming ACL flow matching rules and outgoing ACL flow matching rules; the management module 1802 is configured to, based on successful matching of the packet with the incoming ACL flow matching rule, according to The inbound ACL flow matching rules perform inbound operation and maintenance function management on the packets; the packets are forwarded on Layer 2 and Layer 3 networks; based on successful matching between the packets and the outbound ACL flow matching rules, the packets are processed based on the outbound ACL flow matching rules. The outbound operation and maintenance functions manage the packets.
在一种可能的实现方式中,管理模块1802,还用于将报文与硬件匹配流表进行匹配,硬件匹配流表包括硬件精确匹配流表和硬件模糊匹配流表中的至少一种;根据报文与硬件匹配流表的匹配结果对报文进行流量管理。In a possible implementation, the management module 1802 is also used to match the packet with a hardware matching flow table. The hardware matching flow table includes at least one of a hardware exact matching flow table and a hardware fuzzy matching flow table; according to The matching results between the packets and the hardware matching flow table are used to perform traffic management on the packets.
在一种可能的实现方式中,管理模块1802,用于基于报文为第一报文,将报文与硬件模糊匹配流表进行匹配,第一报文为生成流表条目满足第一阈值条件的网元所产生的报文;或,基于报文为第二报文,将报文与硬件精确匹配流表进行匹配,第二报文为满足第二阈值条件的网元所产生的报文。In a possible implementation, the management module 1802 is configured to match the message with the hardware fuzzy matching flow table based on the message being the first message, and the first message being the generated flow table entry that satisfies the first threshold condition. A packet generated by a network element; or, based on the fact that the packet is a second packet, the packet is matched with the hardware exact matching flow table, and the second packet is a packet generated by a network element that meets the second threshold condition. .
在一种可能的实现方式中,管理模块1802,用于基于报文与硬件匹配流表的匹配结果为报文与硬件匹配流表匹配成功,且硬件匹配流表中包括上送动作项,将报文上送VS;或者,基于报文与硬件匹配流表的匹配结果为报文与硬件匹配流表匹配失败,将报文上送VS。In a possible implementation, the management module 1802 is configured to, based on the matching result between the packet and the hardware matching flow table, that the packet matches the hardware matching flow table successfully, and the hardware matching flow table includes an upload action item, The packet is sent to the VS; or, based on the matching result between the packet and the hardware matching flow table, the packet fails to match the hardware matching flow table, and the packet is sent to the VS.
在一种可能的实现方式中,报文为多路径转发报文,管理模块1802,还用于将报文与数据面哈希表进行匹配;基于报文与数据面哈希表匹配成功,对报文进行多路径转发。In a possible implementation, the message is a multi-path forwarding message, and the management module 1802 is also used to match the message with the data plane hash table; based on the successful matching of the message with the data plane hash table, the Messages are forwarded through multipath.
在一种可能的实现方式中,硬件匹配流表包括哈希匹配动作项和转向标识匹配动作项;其中,哈希匹配动作项用于指示执行数据面哈希表的查询动作,转向标识用于指示数据面哈希表,数据面哈希表包括哈希值、掩码和转向标识,掩码对应下一跳信息;In a possible implementation, the hardware matching flow table includes a hash matching action item and a turn identification matching action item; where the hash matching action item is used to indicate the query action of executing the data plane hash table, and the turn identification is used to Indicates the data plane hash table. The data plane hash table includes hash value, mask and redirection identifier. The mask corresponds to the next hop information;
管理模块1802,用于基于哈希匹配动作项,计算报文对应的哈希值,基于哈希值获取报文对应的掩码;基于转向标识匹配动作项,查找数据面哈希表;基于报文对应的掩码与数据面哈希表中的掩码一致,确定报文与数据面哈希表匹配成功;The management module 1802 is used to calculate the hash value corresponding to the message based on the hash matching action item, and obtain the mask corresponding to the message based on the hash value; match the action item based on the redirection identifier, and search the data plane hash table; based on the report The mask corresponding to the message is consistent with the mask in the data plane hash table, confirming that the message and the data plane hash table are matched successfully;
管理模块1802,用于按照数据面哈希表中掩码对应的下一跳信息对报文进行多路径转发。The management module 1802 is used to multi-path forward packets according to the next hop information corresponding to the mask in the data plane hash table.
在一种可能的实现方式中,硬件匹配流表包括哈希匹配动作项、转向标识匹配动作项和报文上送VS软件控制面匹配动作项;其中,哈希匹配动作项用于指示执行数据面哈希表的查询动作,转向标识用于指示数据面哈希表,数据面哈希表包括哈希值、掩码和转向标识,掩码对应下一跳信息;In one possible implementation, the hardware matching flow table includes a hash matching action item, a redirection identifier matching action item, and a message upload VS software control plane matching action item; where the hash matching action item is used to indicate execution data In the query action of the surface hash table, the redirection identifier is used to indicate the data-plane hash table. The data-plane hash table includes the hash value, mask and redirection identifier. The mask corresponds to the next hop information;
管理模块1802,用于基于哈希匹配动作项,计算报文对应的哈希值,基于哈希值获 取报文对应的掩码;基于转向标识匹配动作项,查找数据面哈希表;基于报文对应的哈希值与数据面哈希表中的掩码不一致,确定报文与数据面哈希表匹配失败;The management module 1802 is used to match action items based on hash, calculate the hash value corresponding to the message, and obtain the hash value based on the hash value. Get the mask corresponding to the message; search the data-side hash table based on the steering identifier matching action item; determine the message and data-side hash based on the inconsistency between the hash value corresponding to the message and the mask in the data-side hash table Table matching failed;
管理模块1802,还用于将报文上送虚拟交换机VS。The management module 1802 is also used to send packets to the virtual switch VS.
图19是本申请实施例提供的一种流量管理装置的结构示意图,该装置应用于VS,VS用于与智能网卡连接,该VS为上述图9所示的VS。基于图19所示的如下多个模块,该图19所示的流量管理装置能够执行VS所执行的全部或部分操作。应理解到,该装置可以包括比所示模块更多的附加模块或者省略其中所示的一部分模块,本申请实施例对此并不进行限制。如图19所示,该装置包括:Figure 19 is a schematic structural diagram of a traffic management device provided by an embodiment of the present application. The device is applied to a VS. The VS is used to connect to a smart network card. The VS is the VS shown in Figure 9 above. Based on the following modules shown in Figure 19, the traffic management device shown in Figure 19 can perform all or part of the operations performed by the VS. It should be understood that the device may include more additional modules than the modules shown or omit some of the modules shown therein, and the embodiments of the present application are not limited to this. As shown in Figure 19, the device includes:
接收模块1901,用于接收智能网卡发送的报文,报文由智能网卡在报文与智能网卡上的硬件匹配流表的匹配成功,且硬件匹配流表中包括上送动作项的情况下发送,或者,报文由智能网卡在报文与智能网卡上的硬件匹配流表的匹配失败的情况下发送,或者,报文由智能网卡在报文与智能网卡上的数据面哈希表匹配失败后发送;The receiving module 1901 is used to receive the message sent by the smart network card. The message is sent by the smart network card when the message successfully matches the hardware matching flow table on the smart network card, and the hardware matching flow table includes an upload action item. , or the message is sent by the intelligent network card when the message fails to match the hardware matching flow table on the intelligent network card, or the message is sent by the intelligent network card when the message fails to match the data plane hash table on the intelligent network card. sent later;
管理模块1902,用于将报文与VS上的开源流表进行匹配,根据匹配结果对报文进行流量管理。The management module 1902 is used to match the packets with the open source flow table on the VS, and perform traffic management on the packets based on the matching results.
本申请实施例提供的一种管理装置,该管理装置可为智能网卡或者VS,用于执行上述图4、图5、图7、图8、图9、图12、图13以及图15中所示的方法中智能网卡或者VS涉及的操作。示例性地,该管理装置包括:处理器,该处理器用于实现智能网卡或者VS所涉及的操作。An embodiment of the present application provides a management device. The management device may be a smart network card or a VS, and is used to execute the steps shown in Figures 4, 5, 7, 8, 9, 12, 13 and 15. The operations involved in the smart network card or VS in the method shown below. Exemplarily, the management device includes: a processor, which is used to implement operations related to the smart network card or VS.
在一种可能的实现方式中,该装置为芯片。In a possible implementation, the device is a chip.
在一种可能的实现方式中,该装置为网络设备,该网络设备的类型包括以下至少一项:路由器、交换机或服务器。In a possible implementation, the device is a network device, and the type of the network device includes at least one of the following: a router, a switch, or a server.
示例性地,处理器是通用中央处理器(central processing unit,CPU)、数字信号处理器(digital signal processor,DSP)、网络处理器(network processer,NP)、图形处理器(graphics processing unit,GPU)、神经网络处理器(neural-network processing units,NPU)、数据处理单元(data processing unit,DPU)、微处理器或者一个或多个用于实现本申请方案的集成电路。例如,处理器1001包括专用集成电路(application-specific integrated circuit,ASIC),可编程逻辑器件(programmable logic device,PLD)或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。PLD例如是复杂可编程逻辑器件(complex programmable logic device,CPLD)、现场可编程逻辑门阵列(field-programmable gate array,FPGA)、通用阵列逻辑(generic array logic,GAL)或其任意组合。其可以实现或执行结合本申请实施例公开内容所描述的各种逻辑方框、模块和电路。该处理器也可以是实现计算功能的组合,例如包括一个或多个微处理器组合,DSP和微处理器的组合等等。Illustratively, the processor is a general central processing unit (CPU), a digital signal processor (DSP), a network processor (NP), a graphics processing unit (GPU) ), neural-network processing units (NPU), data processing unit (DPU), microprocessor or one or more integrated circuits used to implement the solution of the present application. For example, the processor 1001 includes an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. PLD is, for example, a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a general array logic (GAL), or any combination thereof. It may implement or execute various logical blocks, modules and circuits described in connection with the disclosure of the embodiments of this application. The processor may also be a combination that implements computing functions, such as one or more microprocessor combinations, a DSP and a microprocessor combination, and so on.
参见图20,图20示出了本申请一个示例性实施例提供的网络设备2000的结构示意图。图20所示的网络设备2000可为智能网卡或者VS,用于执行上述图4、图5、图7、图8、图9、图12、图13以及图15中所示的方法所涉及的操作。该网络设备2000例如是交换机、路由器等,该网络设备2000可以由一般性的总线体系结构来实现。如图20所示,网络设备2000包括至少一个处理器2001、存储器2003以及至少一个通信接口2004。Referring to Figure 20, Figure 20 shows a schematic structural diagram of a network device 2000 provided by an exemplary embodiment of the present application. The network device 2000 shown in Figure 20 can be a smart network card or a VS, used to perform the methods shown in Figure 4, Figure 5, Figure 7, Figure 8, Figure 9, Figure 12, Figure 13 and Figure 15. operate. The network device 2000 is, for example, a switch, a router, etc., and the network device 2000 can be implemented by a general bus architecture. As shown in Figure 20, the network device 2000 includes at least one processor 2001, a memory 2003, and at least one communication interface 2004.
处理器2001例如是CPU、DSP、NP、GPU、NPU、DPU、微处理器或者一个或多个用于实现本申请方案的集成电路。例如,处理器2001包括ASIC,PLD或者其他可编程逻辑器 件、晶体管逻辑器件、硬件部件或者其任意组合。PLD例如是,CPLD、FPGA、GAL或其任意组合。其可以实现或执行结合本申请实施例公开内容所描述的各种逻辑方框、模块和电路。该处理器也可以是实现计算功能的组合,例如包括一个或多个微处理器组合,DSP和微处理器的组合等等。The processor 2001 is, for example, a CPU, DSP, NP, GPU, NPU, DPU, microprocessor, or one or more integrated circuits used to implement the solution of the present application. For example, processor 2001 includes an ASIC, PLD or other programmable logic components, transistor logic devices, hardware components, or any combination thereof. The PLD is, for example, CPLD, FPGA, GAL or any combination thereof. It may implement or execute various logical blocks, modules and circuits described in connection with the disclosure of the embodiments of this application. The processor may also be a combination that implements computing functions, such as one or more microprocessor combinations, a DSP and a microprocessor combination, and so on.
可选的,网络设备2000还包括总线。总线用于在网络设备2000的各组件之间传送信息。总线可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。总线可以分为地址总线、数据总线、控制总线等。为便于表示,图20中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。Optionally, the network device 2000 also includes a bus. Buses are used to transfer information between components of network device 2000. The bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of presentation, only one thick line is used in Figure 20, but it does not mean that there is only one bus or one type of bus.
存储器2003例如是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其它类型的静态存储设备,又如是随机存取存储器(random access memory,RAM)或者可存储信息和指令的其它类型的动态存储设备,又如是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、只读光盘(compact disc read-only memory,CD-ROM)或其它光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其它磁存储设备,或者是能够用于携带或存储具有指令或数据结构形式的期望的程序指令并能够由计算机存取的任何其它介质,但不限于此。存储器2003例如是独立存在,并通过总线与处理器2001相连接。存储器2003也可以和处理器2001集成在一起。The memory 2003 is, for example, a read-only memory (ROM) or other type of static storage device that can store static information and instructions, or a random access memory (random access memory, RAM) or a device that can store information and instructions. Other types of dynamic storage devices, such as electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disk storage, optical discs Storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or can be used to carry or store desired program instructions in the form of instructions or data structures and can Any other media accessed by a computer, without limitation. The memory 2003 exists independently, for example, and is connected to the processor 2001 through a bus. The memory 2003 may also be integrated with the processor 2001.
通信接口2004使用任何收发器一类的装置,用于与其它设备或通信网络通信,通信网络可以为以太网、无线接入网(RAN)或无线局域网(wireless local area network,WLAN)等。通信接口2004可以包括有线通信接口,还可以包括无线通信接口。具体的,通信接口2004可以为以太(ethernet)接口、快速以太(fast ethernet,FE)接口、千兆以太(gigabit ethernet,GE)接口,异步传输模式(asynchronous transfer mode,ATM)接口,无线局域网(wireless local area networks,WLAN)接口,蜂窝网络通信接口或其组合。以太网接口可以是光接口,电接口或其组合。在本申请实施例中,通信接口2004可以用于网络设备2000与其他设备进行通信。The communication interface 2004 uses any device such as a transceiver to communicate with other devices or a communication network. The communication network can be Ethernet, a radio access network (RAN) or a wireless local area network (WLAN), etc. The communication interface 2004 may include a wired communication interface and may also include a wireless communication interface. Specifically, the communication interface 2004 may be an Ethernet (ethernet) interface, a fast ethernet (FE) interface, a gigabit ethernet (GE) interface, an asynchronous transfer mode (ATM) interface, a wireless LAN ( wireless local area networks, WLAN) interface, cellular network communication interface or a combination thereof. The Ethernet interface can be an optical interface, an electrical interface, or a combination thereof. In this embodiment of the present application, the communication interface 2004 can be used for the network device 2000 to communicate with other devices.
在具体实现中,作为一种实施例,处理器2001可以包括一个或多个CPU,如图20中所示的CPU0和CPU1。这些处理器中的每一个可以是一个单核(single-CPU)处理器,也可以是一个多核(multi-CPU)处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。In specific implementation, as an embodiment, the processor 2001 may include one or more CPUs, such as CPU0 and CPU1 as shown in FIG. 20 . Each of these processors may be a single-CPU processor or a multi-CPU processor. A processor here may refer to one or more devices, circuits, and/or processing cores for processing data (eg, computer program instructions).
在具体实现中,作为一种实施例,网络设备2000可以包括多个处理器,如图20中所示的处理器2001和处理器2005。这些处理器中的每一个可以是一个单核处理器(single-CPU),也可以是一个多核处理器(multi-CPU)。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(如计算机程序指令)的处理核。In specific implementation, as an embodiment, the network device 2000 may include multiple processors, such as the processor 2001 and the processor 2005 shown in FIG. 20 . Each of these processors can be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). A processor here may refer to one or more devices, circuits, and/or processing cores for processing data (such as computer program instructions).
在具体实现中,作为一种实施例,网络设备2000还可以包括输出设备和输入设备。输出设备和处理器2001通信,可以以多种方式来显示信息。例如,输出设备可以是液晶显示器(liquid crystal display,LCD)、发光二级管(light emitting diode,LED)显示设备、阴极射线管(cathode ray tube,CRT)显示设备或投影仪(projector)等。输入设备和处理器2001通信,可以以多种方式接收用户的输入。例如,输入设备可以是鼠标、键盘、触摸屏设备或 传感设备等。In specific implementation, as an embodiment, the network device 2000 may also include an output device and an input device. Output devices communicate with processor 2001 and can display information in a variety of ways. For example, the output device may be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, a projector, etc. Input devices communicate with processor 2001 and can receive user input in a variety of ways. For example, the input device may be a mouse, keyboard, touch screen device, or Sensing equipment, etc.
在一些实施例中,存储器2003用于存储执行本申请方案的程序指令2010,处理器2001可以执行存储器2003中存储的程序指令2010。也即是,网络设备2000可以通过处理器2001以及存储器2003中的程序指令2010,来实现方法实施例提供的流表规则的管理方法或者流量管理方法。程序指令2010中可以包括一个或多个软件模块。可选地,处理器2001自身也可以存储执行本申请方案的程序代码或指令。In some embodiments, the memory 2003 is used to store program instructions 2010 for executing the solution of the present application, and the processor 2001 can execute the program instructions 2010 stored in the memory 2003. That is, the network device 2000 can implement the flow table rule management method or the traffic management method provided by the method embodiment through the processor 2001 and the program instructions 2010 in the memory 2003. Program instructions 2010 may include one or more software modules. Optionally, the processor 2001 itself can also store program codes or instructions for executing the solution of the present application.
在具体实施例中,本申请实施例的网络设备2000可对应于上述图4、图5、图7、图8、图9、图12、图13以及图15中方法实施例中的VS,网络设备2000中的处理器2001读取存储器2003中的指令,使图21所示的网络设备2000能够执行VS所执行的全部或部分操作。In specific embodiments, the network device 2000 in the embodiment of the present application may correspond to the VS in the method embodiments in Figure 4, Figure 5, Figure 7, Figure 8, Figure 9, Figure 12, Figure 13 and Figure 15. The network The processor 2001 in the device 2000 reads the instructions in the memory 2003, so that the network device 2000 shown in Figure 21 can perform all or part of the operations performed by the VS.
在具体实施例中,本申请实施例的网络设备2000可对应于上述图4、图5、图7、图8、图9、图12、图13以及图15中方法实施例中的智能网卡,网络设备2000中的处理器2001读取存储器2003中的指令,使图21所示的网络设备2000能够执行智能网卡所执行的全部或部分操作。In specific embodiments, the network device 2000 in the embodiment of the present application may correspond to the smart network card in the method embodiments in Figure 4, Figure 5, Figure 7, Figure 8, Figure 9, Figure 12, Figure 13 and Figure 15, The processor 2001 in the network device 2000 reads the instructions in the memory 2003, so that the network device 2000 shown in Figure 21 can perform all or part of the operations performed by the smart network card.
网络设备2000还可以对应于上述图16-19所示的装置,该装置中的每个功能模块采用网络设备2000的软件实现。换句话说,装置中包括的功能模块为网络设备2000的处理器2001读取存储器2003中存储的程序指令2010后生成的。The network device 2000 may also correspond to the device shown in FIGS. 16-19, and each functional module in the device is implemented using the software of the network device 2000. In other words, the functional modules included in the device are generated by the processor 2001 of the network device 2000 after reading the program instructions 2010 stored in the memory 2003.
其中,图4、图5、图7、图8、图9、图12、图13以及图15中所示的方法的各步骤通过网络设备2000的处理器中的硬件的集成逻辑电路或者软件形式的指令完成。结合本申请实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法的步骤,为避免重复,这里不再详细描述。Wherein, each step of the method shown in Figure 4, Figure 5, Figure 7, Figure 8, Figure 9, Figure 12, Figure 13 and Figure 15 is implemented in the form of integrated logic circuits or software of hardware in the processor of the network device 2000 The instruction is completed. The steps of the methods disclosed in conjunction with the embodiments of the present application can be directly implemented by a hardware processor for execution, or can be executed by a combination of hardware and software modules in the processor. The software module can be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other mature storage media in this field. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware. To avoid repetition, the details will not be described here.
参见图21,图21示出了本申请另一个示例性实施例提供的网络设备2100的结构示意图。图21所示的网络设备2100可为智能网卡或者VS,用于执行上述图4、图5、图7、图8、图9、图12、图13以及图15中所示的方法所涉及的操作。该网络设备2100例如是交换机、路由器等,该网络设备2100可以由一般性的总线体系结构来实现。如图21所示,网络设备2100包括:主控板2110和接口板2130。Referring to Figure 21, Figure 21 shows a schematic structural diagram of a network device 2100 provided by another exemplary embodiment of the present application. The network device 2100 shown in Figure 21 can be a smart network card or a VS, used to perform the methods shown in Figure 4, Figure 5, Figure 7, Figure 8, Figure 9, Figure 12, Figure 13 and Figure 15. operate. The network device 2100 is, for example, a switch, a router, etc., and the network device 2100 can be implemented by a general bus architecture. As shown in Figure 21, the network device 2100 includes: a main control board 2110 and an interface board 2130.
主控板也称为主处理单元(main processing unit,MPU)或路由处理卡(route processor card),主控板2110用于对网络设备2100中各个组件的控制和管理,包括路由计算、设备管理、设备维护、协议处理功能。主控板2110包括:中央处理器2111和存储器2112。The main control board is also called the main processing unit (MPU) or route processor card. The main control board 2110 is used to control and manage various components in the network device 2100, including route calculation and device management. , equipment maintenance, protocol processing functions. The main control board 2110 includes: a central processing unit 2111 and a memory 2112.
接口板2130也称为线路接口单元卡(line processing unit,LPU)、线卡(line card)或业务板。接口板2130用于提供各种业务接口并实现数据包的转发。业务接口包括而不限于以太网接口、POS(packet over SONET/SDH)接口等,以太网接口例如是灵活以太网业务接口(flexible ethernet clients,FlexE Clients)。接口板2130包括:中央处理器2131网络处理器2132、转发表项存储器2134和物理接口卡(physical interface card,PIC)2133。The interface board 2130 is also called a line processing unit (LPU), line card or service board. The interface board 2130 is used to provide various service interfaces and implement data packet forwarding. Business interfaces include but are not limited to Ethernet interfaces, POS (packet over SONET/SDH) interfaces, etc. Ethernet interfaces are, for example, flexible Ethernet business interfaces (flexible ethernet clients, FlexE Clients). The interface board 2130 includes: a central processor 2131, a network processor 2132, a forwarding entry memory 2134, and a physical interface card (physical interface card, PIC) 2133.
接口板2130上的中央处理器2131用于对接口板2130进行控制管理并与主控板2110上的中央处理器2111进行通信。The central processor 2131 on the interface board 2130 is used to control and manage the interface board 2130 and communicate with the central processor 2111 on the main control board 2110 .
网络处理器2132用于实现报文的转发处理。网络处理器2132的形态可以是转发芯片。 转发芯片可以是网络处理器(network processor,NP)。在一些实施例中,转发芯片可以通过专用集成电路(application-specific integrated circuit,ASIC)或现场可编程门阵列(field programmable gate array,FPGA)实现。具体而言,网络处理器2132用于基于转发表项存储器2134保存的转发表转发接收到的报文,如果报文的目的地址为报文处理设备2100的地址,则将该报文上送至CPU(如中央处理器2131)处理;如果报文的目的地址不是报文处理设备2100的地址,则根据该目的地址从转发表中查找到该目的地址对应的下一跳和出接口,将该报文转发到该目的地址对应的出接口。其中,上行报文的处理可以包括:报文入接口的处理,转发表查找;下行报文的处理可以包括:转发表查找等等。在一些实施例中,中央处理器也可执行转发芯片的功能,比如基于通用CPU实现软件转发,从而接口板中不需要转发芯片。The network processor 2132 is used to implement packet forwarding processing. The network processor 2132 may be in the form of a forwarding chip. The forwarding chip may be a network processor (NP). In some embodiments, the forwarding chip may be implemented by an application-specific integrated circuit (ASIC) or a field programmable gate array (FPGA). Specifically, the network processor 2132 is configured to forward the received message based on the forwarding table stored in the forwarding table memory 2134, and if the destination address of the message is the address of the message processing device 2100, then upload the message to CPU (such as central processing unit 2131) processes; if the destination address of the message is not the address of the message processing device 2100, the next hop and outgoing interface corresponding to the destination address are found from the forwarding table according to the destination address, and the destination address is The packet is forwarded to the outbound interface corresponding to the destination address. Among them, the processing of uplink packets may include: processing of the packet incoming interface, forwarding table search; and the processing of downlink packets may include: forwarding table search, etc. In some embodiments, the central processing unit can also perform the function of the forwarding chip, such as implementing software forwarding based on a general-purpose CPU, so that there is no need for a forwarding chip in the interface board.
物理接口卡2133用于实现物理层的对接功能,原始的流量由此进入接口板2130,以及处理后的报文从该物理接口卡2133发出。物理接口卡2133也称为子卡,可安装在接口板2130上,负责将光电信号转换为报文并对报文进行合法性检查后转发给网络处理器2132处理。在一些实施例中,中央处理器2131也可执行网络处理器2132的功能,比如基于通用CPU实现软件转发,从而物理接口卡2133中不需要网络处理器2132。The physical interface card 2133 is used to implement the docking function of the physical layer. The original traffic enters the interface board 2130 through this, and the processed packets are sent out from the physical interface card 2133. The physical interface card 2133 is also called a daughter card and can be installed on the interface board 2130. It is responsible for converting photoelectric signals into messages and checking the validity of the messages before forwarding them to the network processor 2132 for processing. In some embodiments, the central processor 2131 can also perform the functions of the network processor 2132, such as implementing software forwarding based on a general-purpose CPU, so that the network processor 2132 is not required in the physical interface card 2133.
示例性地,网络设备2100包括多个接口板,例如网络设备2100还包括接口板2140,接口板2140包括:中央处理器2141、网络处理器2142、转发表项存储器2144和物理接口卡2143。接口板2140中各部件的功能和实现方式与接口板2130相同或相似,在此不再赘述。Exemplarily, the network device 2100 includes multiple interface boards. For example, the network device 2100 also includes an interface board 2140. The interface board 2140 includes: a central processor 2141, a network processor 2142, a forwarding entry memory 2144, and a physical interface card 2143. The functions and implementation methods of each component in the interface board 2140 are the same as or similar to those of the interface board 2130 and will not be described again here.
示例性地,网络设备2100还包括交换网板2120。交换网板2120也可以称为交换网板单元(switch fabric unit,SFU)。在网络设备有多个接口板的情况下,交换网板2120用于完成各接口板之间的数据交换。例如,接口板2130和接口板2140之间可以通过交换网板2120通信。Exemplarily, the network device 2100 also includes a switching fabric board 2120. The switching fabric unit 2120 may also be called a switching fabric unit (switch fabric unit, SFU). When the network device has multiple interface boards, the switching network board 2120 is used to complete data exchange between the interface boards. For example, the interface board 2130 and the interface board 2140 can communicate through the switching network board 2120.
主控板2110和接口板耦合。例如。主控板2110、接口板2130和接口板2140,以及交换网板2120之间通过系统总线与系统背板相连实现互通。在一种可能的实现方式中,主控板2110和接口板2130及接口板2140之间建立进程间通信协议(inter-process communication,IPC)通道,主控板2110和接口板2130及接口板2140之间通过IPC通道进行通信。The main control board 2110 is coupled with the interface board. For example. The main control board 2110, the interface board 2130, the interface board 2140, and the switching network board 2120 are connected to the system backplane through a system bus to achieve intercommunication. In a possible implementation, an inter-process communication protocol (IPC) channel is established between the main control board 2110 and the interface board 2130 and the interface board 2140. The main control board 2110 and the interface board 2130 and the interface board 2140 communicate through IPC channels.
在逻辑上,网络设备2100包括控制面和转发面,控制面包括主控板2110和中央处理器2111,转发面包括执行转发的各个组件,比如转发表项存储器2134、物理接口卡2133和网络处理器2132。控制面执行路由器、生成转发表、处理信令和协议报文、配置与维护网络设备的状态等功能,控制面将生成的转发表下发给转发面,在转发面,网络处理器2132基于控制面下发的转发表对物理接口卡2133收到的报文查表转发。控制面下发的转发表可以保存在转发表项存储器2134中。在有些实施例中,控制面和转发面可以完全分离,不在同一网络设备上。Logically, network device 2100 includes a control plane and a forwarding plane. The control plane includes a main control board 2110 and a central processor 2111. The forwarding plane includes various components that perform forwarding, such as forwarding entry memory 2134, physical interface card 2133, and network processing. Device 2132. The control plane executes functions such as router, generates forwarding tables, processes signaling and protocol messages, configures and maintains the status of network devices. The control plane sends the generated forwarding tables to the forwarding plane. On the forwarding plane, the network processor 2132 is based on the control The forwarding table delivered above looks up the table and forwards the packets received by the physical interface card 2133. The forwarding table delivered by the control plane may be stored in the forwarding table item storage 2134. In some embodiments, the control plane and forwarding plane may be completely separated and not on the same network device.
值得说明的是,主控板可能有一块或多块,有多块的时候可以包括主用主控板和备用主控板。接口板可能有一块或多块,网络设备的数据处理能力越强,提供的接口板越多。接口板上的物理接口卡也可以有一块或多块。交换网板可能没有,也可能有一块或多块,有多块的时候可以共同实现负荷分担冗余备份。在集中式转发架构下,网络设备可以不需要交换网板,接口板承担整个系统的业务数据的处理功能。在分布式转发架构下,网络设备可以有至少一块交换网板,通过交换网板实现多块接口板之间的数据交换,提供大容量的数据交换和处理能力。所以,分布式架构的报文处理设备的数据接入和处理能力要大于集中式架构的报 文处理设备。示例性地,网络设备的形态也可以是只有一块板卡,即没有交换网板,接口板和主控板的功能集成在该一块板卡上,此时接口板上的中央处理器和主控板上的中央处理器在该一块板卡上可以合并为一个中央处理器,执行两者叠加后的功能,这种形态的网络设备的数据交换和处理能力较低(例如,低端交换机或路由器等网络设备)。具体采用哪种架构,取决于具体的组网部署场景,此处不做任何限定。It is worth mentioning that there may be one or more main control boards, and when there are multiple main control boards, they can include the main main control board and the backup main control board. There may be one or more interface boards. The stronger the data processing capability of the network device, the more interface boards are provided. There can also be one or more physical interface cards on the interface board. There may be no switching network board, or there may be one or more switching network boards. When there are multiple switching network boards, load sharing and redundant backup can be realized together. Under the centralized forwarding architecture, network equipment does not need switching network boards, and the interface boards are responsible for processing the business data of the entire system. Under the distributed forwarding architecture, network equipment can have at least one switching network board, which enables data exchange between multiple interface boards through the switching network board, providing large-capacity data exchange and processing capabilities. Therefore, the data access and processing capabilities of the distributed architecture message processing equipment are greater than those of the centralized architecture. Document processing equipment. For example, the network device can also be in the form of only one board, that is, there is no switching network board. The functions of the interface board and the main control board are integrated on this board. In this case, the central processor and the main control board on the interface board The central processor on the board can be combined into one central processor on this board to perform the superimposed functions of the two. This form of network equipment has low data exchange and processing capabilities (for example, low-end switches or routers) and other network equipment). The specific architecture used depends on the specific networking deployment scenario and is not limited here.
在一种可能的实现方式中,本申请实施例还提供了一种管理系统,该系统包括:VS和智能网卡。示例性地,VS和智能网卡均适用于上述管理装置。示例性地,该管理系统基于图20和图21示出的网络设备得到。例如,VS为图20所示的网络设备2000或图21所示的网络设备2100,智能网卡为图20所示的网络设备2000或图21所示的网络设备2100。VS和智能网卡所执行的方法可参见上述图4、图5、图7、图8、图9、图12、图13以及图15中所示的方法所示实施例的相关描述,此处不再加以赘述。In a possible implementation manner, this embodiment of the present application also provides a management system, which includes: a VS and a smart network card. For example, both VS and smart network cards are suitable for the above management device. Illustratively, the management system is obtained based on the network devices shown in Figures 20 and 21. For example, the VS is the network device 2000 shown in Figure 20 or the network device 2100 shown in Figure 21, and the smart network card is the network device 2000 shown in Figure 20 or the network device 2100 shown in Figure 21. For the methods performed by the VS and the smart network card, please refer to the relevant descriptions of the embodiments shown in the methods shown in the above-mentioned Figures 4, 5, 7, 8, 9, 12, 13 and 15, which are not included here. Let’s elaborate further.
本申请实施例还提供了一种通信装置,该装置包括:收发器、存储器和处理器。其中,该收发器、该存储器和该处理器通过内部连接通路互相通信,该存储器用于存储指令,该处理器用于执行该存储器存储的指令,以控制收发器接收信号,并控制收发器发送信号,并且当该处理器执行该存储器存储的指令时,使得该处理器执行图4、图5、图7、图8、图9、图12、图13以及图15中智能网卡或者VS所需执行的方法。An embodiment of the present application also provides a communication device, which includes: a transceiver, a memory, and a processor. Wherein, the transceiver, the memory and the processor communicate with each other through an internal connection path, the memory is used to store instructions, and the processor is used to execute the instructions stored in the memory to control the transceiver to receive signals and control the transceiver to send signals. , and when the processor executes the instructions stored in the memory, the processor is caused to execute the required execution of the smart network card or VS in Figure 4, Figure 5, Figure 7, Figure 8, Figure 9, Figure 12, Figure 13 and Figure 15 Methods.
应理解的是,上述处理器可以是CPU,还可以是其他通用处理器、DSP、ASIC、FPGA或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者是任何常规的处理器等。值得说明的是,处理器可以是支持进阶精简指令集机器(advanced RISC machines,ARM)架构的处理器。It should be understood that the above-mentioned processor may be a CPU, or other general-purpose processor, DSP, ASIC, FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor that supports advanced RISC machines (ARM) architecture.
进一步地,在一种可选的实施例中,上述存储器可以包括只读存储器和随机存取存储器,并向处理器提供指令和数据。存储器还可以包括非易失性随机存取存储器。例如,存储器还可以存储设备类型的信息。Further, in an optional embodiment, the above-mentioned memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. Memory may also include non-volatile random access memory. For example, the memory may also store device type information.
该存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(random access memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用。例如,静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(dynamic random access memory,DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(direct rambus RAM,DR RAM)。The memory may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Among them, non-volatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (erasable PROM, EPROM), electrically removable memory. Erase electrically programmable read-only memory (EPROM, EEPROM) or flash memory. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of illustration, but not limitation, many forms of RAM are available. For example, static random access memory (static RAM, SRAM), dynamic random access memory (dynamic random access memory, DRAM), synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access Memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (synchlink DRAM, SLDRAM) and direct memory bus random access memory (direct rambus RAM, DR RAM).
本申请实施例还提供了一种计算机可读存储介质,存储介质中存储有至少一条指令,指令由处理器加载并执行以实现如上图4、图5、图7、图8、图9、图12、图13以及图15中任一所述的方法。Embodiments of the present application also provide a computer-readable storage medium. At least one instruction is stored in the storage medium. The instruction is loaded and executed by the processor to implement the above Figures 4, 5, 7, 8, 9, and 12. The method described in any one of Figure 13 and Figure 15.
本申请实施例还提供了一种计算机程序(产品),当计算机程序被计算机执行时,可以使得处理器或计算机执行上述方法实施例中对应的方法的各个步骤和/或流程。 Embodiments of the present application also provide a computer program (product). When the computer program is executed by a computer, it can cause the processor or computer to execute each step and/or process of the corresponding method in the above method embodiment.
本申请实施例还提供了一种芯片,包括处理器,用于从存储器中调用并运行所述存储器中存储的指令,使得安装有所述芯片的通信设备执行如上图4、图5、图7、图8、图9、图12、图13以及图15中任一所述的方法。Embodiments of the present application also provide a chip, including a processor, configured to call from a memory and run instructions stored in the memory, so that the communication device installed with the chip executes as shown in Figures 4, 5, and 7 above. , the method described in any one of Figure 8, Figure 9, Figure 12, Figure 13 and Figure 15.
本申请实施例还提供另一种芯片,包括:输入接口、输出接口、处理器和存储器,所述输入接口、输出接口、所述处理器以及所述存储器之间通过内部连接通路相连,所述处理器用于执行所述存储器中的代码,当所述代码被执行时,所述处理器用于执行如上图4、图5、图7、图8、图9、图12、图13以及图15中任一所述的方法。An embodiment of the present application also provides another chip, including: an input interface, an output interface, a processor, and a memory. The input interface, the output interface, the processor, and the memory are connected through an internal connection path, and the The processor is used to execute the code in the memory. When the code is executed, the processor is used to execute the steps shown in Figure 4, Figure 5, Figure 7, Figure 8, Figure 9, Figure 12, Figure 13 and Figure 15. any of the methods described.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘solid state disk)等。In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in this application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, e.g., the computer instructions may be transferred from a website, computer, server, or data center Transmission to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains one or more available media integrated. The available media may be magnetic media (such as floppy disks, hard disks, magnetic tapes), optical media (such as DVDs), or semiconductor media (such as solid state disks), etc.
本领域普通技术人员可以意识到,结合本文中所公开的实施例中描述的各方法步骤和模块,能够以软件、硬件、固件或者其任意组合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各实施例的步骤及组成。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。本领域普通技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art will appreciate that the method steps and modules described in conjunction with the embodiments disclosed herein can be implemented in software, hardware, firmware, or any combination thereof. In order to clearly illustrate the interoperability of hardware and software, Alternatively, the steps and compositions of each embodiment have been generally described in terms of functions in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. One of ordinary skill in the art may implement the described functionality using different methods for each specific application, but such implementations should not be considered beyond the scope of this application.
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,该程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps to implement the above embodiments can be completed by hardware, or can be completed by instructing the relevant hardware through a program. The program can be stored in a computer-readable storage medium. As mentioned above, The storage medium can be read-only memory, magnetic disk or optical disk, etc.
当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。该计算机程序产品包括一个或多个计算机程序指令。作为示例,本申请实施例的方法可以在机器可执行指令的上下文中被描述,机器可执行指令诸如包括在目标的真实或者虚拟处理器上的器件中执行的程序模块中。一般而言,程序模块包括例程、程序、库、对象、类、组件、数据结构等,其执行特定的任务或者实现特定的抽象数据结构。在各实施例中,程序模块的功能可以在所描述的程序模块之间合并或者分割。用于程序模块的机器可执行指令可以在本地或者分布式设备内执行。在分布式设备中,程序模块可以位于本地和远程存储介质二者中。When implemented using software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer program instructions. By way of example, methods of embodiments of the present application may be described in the context of machine-executable instructions, such as included in a program module executing in a device on a target's real or virtual processor. Generally speaking, program modules include routines, programs, libraries, objects, classes, components, data structures, etc., which perform specific tasks or implement specific abstract data structures. In various embodiments, the functionality of program modules may be combined or split between the described program modules. Machine-executable instructions for program modules can execute locally or on a distributed device. In a distributed device, program modules can be located in both local and remote storage media.
用于实现本申请实施例的方法的计算机程序代码可以用一种或多种编程语言编写。这些计算机程序代码可以提供给通用计算机、专用计算机或其他可编程的数据处理装置的处理器,使得程序代码在被计算机或其他可编程的数据处理装置执行的时候,引起在流程图和/或框图中规定的功能/操作被实施。程序代码可以完全在计算机上、部分在计算机上、作为独立的软件包、部分在计算机上且部分在远程计算机上或完全在远程计算机或服务器上执行。 Computer program codes for implementing the methods of embodiments of the present application may be written in one or more programming languages. These computer program codes may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when executed by the computer or other programmable data processing device, the program code causes the flowcharts and/or block diagrams to be displayed. The functions/operations specified in are implemented. The program code may execute entirely on the computer, partly on the computer, as a stand-alone software package, partly on the computer and partly on a remote computer or entirely on the remote computer or server.
在本申请实施例的上下文中,计算机程序代码或者相关数据可以由任意适当载体承载,以使得设备、装置或者处理器能够执行上文描述的各种处理和操作。载体的示例包括信号、计算机可读介质等等。In the context of the embodiments of the present application, the computer program code or related data may be carried by any appropriate carrier, so that the device, device or processor can perform the various processes and operations described above. Examples of carriers include signals, computer-readable media, and the like.
信号的示例可以包括电、光、无线电、声音或其它形式的传播信号,诸如载波、红外信号等。Examples of signals may include electrical, optical, radio, acoustic, or other forms of propagated signals, such as carrier waves, infrared signals, and the like.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的系统、设备和模块的具体工作过程,可以参见前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and modules described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be described again here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、设备和方法,可以通过其它的方式实现。例如,以上所描述的设备实施例仅仅是示意性的,例如,该模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个模块或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口、设备或模块的间接耦合或通信连接,也可以是电的,机械的或其它的形式连接。In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the modules is only a logical function division. In actual implementation, there may be other division methods. For example, multiple modules or components may be combined or may be Integrated into another system, or some features can be ignored, or not implemented. In addition, the coupling or direct coupling or communication connection between each other shown or discussed may be indirect coupling or communication connection through some interfaces, devices or modules, or may be electrical, mechanical or other forms of connection.
该作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络模块上。可以根据实际的需要选择其中的部分或者全部模块来实现本申请实施例方案的目的。The modules described as separate components may or may not be physically separated. The components shown as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed to multiple network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments of the present application.
另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以是两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。In addition, each functional module in each embodiment of the present application can be integrated into one processing module, or each module can exist physically alone, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software function modules.
该集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读存储介质中。计算机可读存储介质可以是包含或存储用于或有关于指令执行系统、装置或设备的程序的任何有形介质。计算机可读存储介质可以是机器可读信号介质或机器可读存储介质。计算机可读存储介质可以包括但不限于电子的、磁的、光学的、电磁的、红外的或半导体系统、装置或设备,或其任意合适的组合。计算机可读存储介质的更详细示例包括带有一根或多根导线的电气连接、便携式计算机磁盘、硬盘、随机存储存取器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或闪存)、光存储设备、磁存储设备,或其任意合适的组合。If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. A computer-readable storage medium may be any tangible medium that contains or stores a program for or in connection with an instruction execution system, apparatus, or device. Computer-readable storage media may be machine-readable signal media or machine-readable storage media. Computer-readable storage media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or devices, or any suitable combination thereof. More detailed examples of computer readable storage media include an electrical connection with one or more wires, portable computer disks, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory Memory (EPROM or flash memory), optical storage device, magnetic storage device, or any suitable combination thereof.
还应理解,在本申请的各个实施例中,各个过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should also be understood that in each embodiment of the present application, the size of the sequence number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not be determined by the execution order of the embodiments of the present application. The implementation process constitutes no limitation.
本申请中术语“至少一个”的含义是指一个或多个,本申请中术语“多个”的含义是指两个或两个以上,例如,多个目标对象是指两个或两个以上的目标对象。The term "at least one" in this application means one or more, and the term "multiple" in this application means two or more. For example, multiple target objects means two or more target audience.
应理解,在本文中对各种所述示例的描述中所使用的术语只是为了描述特定示例,而并非旨在进行限制。如在对各种所述示例的描述和所附权利要求书中所使用的那样,单数形式“一个(“a”,“an”)”和“该”旨在也包括复数形式,除非上下文另外明确地指示。It is to be understood that the terminology used in the description of the various examples herein is for the purpose of describing the particular example only and is not intended to be limiting. As used in the description of various described examples and the appended claims, the singular forms "a," "an" and "the" are intended to include the plural forms as well, unless the context dictates otherwise. Instruct clearly.
还应理解,本文中所使用的术语“和/或”是指并且涵盖相关联的所列出的项目中的一个或多个项目的任何和全部可能的组合。术语“和/或”,是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本申请中的字符“/”,一般表示前后关联对象是一种“或”的关系。 It will also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items. The term "and/or" is an association relationship that describes related objects, indicating that there can be three relationships. For example, A and/or B can mean: A alone exists, A and B exist simultaneously, and B alone exists. situation. In addition, the character "/" in this application generally indicates that the related objects are an "or" relationship.
还应理解,术语“包括”(也称“includes”、“including”、“comprises”和/或“comprising”)当在本说明书中使用时指定存在所陈述的特征、整数、步骤、操作、元素、和/或部件,但是并不排除存在或添加一个或多个其他特征、整数、步骤、操作、元素、部件、和/或其分组。It will also be understood that the term "includes" (also "includes," "including," "comprises," and/or "comprising") when used in this specification specifies the presence of stated features, integers, steps, operations, elements , and/or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groupings thereof.
还应理解,术语“若”和“如果”可被解释为意指“当...时”(“when”或“upon”)或“响应于确定”或“响应于检测到”。类似地,根据上下文,短语“若确定...”或“若检测到[所陈述的条件或事件]”可被解释为意指“在确定...时”或“响应于确定...”或“在检测到[所陈述的条件或事件]时”或“响应于检测到[所陈述的条件或事件]”。It should also be understood that the terms "if" and "if" may be interpreted to mean "when" or "upon" or "in response to determining" or "in response to detecting." Similarly, depending on the context, the phrase "if it is determined..." or "if [stated condition or event] is detected" may be interpreted to mean "when it is determined..." or "in response to the determination... ” or “on detection of [stated condition or event]” or “in response to detection of [stated condition or event].”
应理解,根据A确定B并不意味着仅仅根据A确定B,还可以根据A和/或其它信息确定B。It should be understood that determining B based on A does not mean determining B only based on A, and B can also be determined based on A and/or other information.
还应理解,说明书通篇中提到的“一个实施例”、“一实施例”、“一种可能的实现方式”意味着与实施例或实现方式有关的特定特征、结构或特性包括在本申请的至少一个实施例中。因此,在整个说明书各处出现的“在一个实施例中”或“在一实施例中”、“一种可能的实现方式”未必一定指相同的实施例。此外,这些特定的特征、结构或特性可以任意适合的方式结合在一个或多个实施例中。It should also be understood that references throughout this specification to "one embodiment," "an embodiment," and "a possible implementation" mean that specific features, structures, or characteristics related to the embodiment or implementation are included herein. In at least one embodiment of the application. Therefore, “in one embodiment” or “in an embodiment” or “a possible implementation” appearing in various places throughout this specification do not necessarily refer to the same embodiment. Furthermore, the particular features, structures or characteristics may be combined in any suitable manner in one or more embodiments.
需要说明的是,本申请所涉及的信息(包括但不限于用户设备信息、用户个人信息等)、数据(包括但不限于用于分析的数据、存储的数据、展示的数据等)以及信号,均为经用户授权或者经过各方充分授权的,且相关数据的收集、使用和处理需要遵守相关国家和地区的相关法律法规和标准。例如,本申请中涉及到的多个目标对象中的各个目标对象的位置信息都是在充分授权的情况下获取的。It should be noted that the information (including but not limited to user equipment information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application, All are authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions. For example, the location information of each of the multiple target objects involved in this application is obtained with full authorization.
以上描述仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。 The above descriptions are only optional embodiments of this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc. made within the principles of this application shall be included in the protection scope of this application. .

Claims (37)

  1. 一种流表规则的管理方法,其特征在于,所述管理方法由智能网卡执行,所述智能网卡用于与虚拟交换机VS连接,所述方法包括:A management method for flow table rules, characterized in that the management method is executed by an intelligent network card, and the intelligent network card is used to connect to a virtual switch VS. The method includes:
    所述智能网卡管理访问控制列表ACL流匹配规则,所述ACL流匹配规则用于所述智能网卡对报文进行运维功能管理。The smart network card manages access control list ACL flow matching rules, and the ACL flow matching rules are used for the smart network card to perform operation and maintenance function management on messages.
  2. 根据权利要求1所述的方法,其特征在于,所述ACL流匹配规则包括入向的ACL流匹配规则和出向的ACL流匹配规则中的至少一种。The method according to claim 1, wherein the ACL flow matching rules include at least one of inbound ACL flow matching rules and outbound ACL flow matching rules.
  3. 根据权利要求1或2所述的方法,其特征在于,所述智能网卡管理访问控制列表ACL流匹配规则,所述方法包括:The method according to claim 1 or 2, characterized in that the smart network card manages access control list ACL flow matching rules, and the method includes:
    所述智能网卡接收所述VS调用第一应用程序编程接口API发送的第一消息,所述第一消息包括所述智能网卡的第一端口的端口标识;The smart network card receives the first message sent by the VS by calling a first application programming interface API, where the first message includes the port identifier of the first port of the smart network card;
    所述智能网卡基于所述第一消息在所述智能网卡的所述第一端口上创建第一ACL流匹配规则。The smart network card creates a first ACL flow matching rule on the first port of the smart network card based on the first message.
  4. 根据权利要求3所述的方法,其特征在于,所述第一消息还包括流表规则属性、流表规则匹配项和流表规则动作项中的至少一种;The method of claim 3, wherein the first message further includes at least one of flow table rule attributes, flow table rule matching items, and flow table rule action items;
    其中,所述流表规则属性用于指示报文需匹配的组、所述第一ACL流匹配规则的方向信息、流表类型中的至少一种;Wherein, the flow table rule attribute is used to indicate at least one of the group that the packet needs to match, the direction information of the first ACL flow matching rule, and the flow table type;
    所述流表规则匹配项包括匹配以太层信息、匹配虚拟局域网VLAN信息、匹配网际协议第四版IPv4信息或匹配网际协议第六版IPv6信息、匹配虚拟扩展局域网VXLAN信息、匹配项结束、报文标记中的至少一种;The flow table rule matching items include matching Ethernet layer information, matching virtual LAN VLAN information, matching Internet Protocol version 4 IPv4 information or matching Internet Protocol version 6 IPv6 information, matching virtual extended LAN VXLAN information, matching item end, message at least one of the markers;
    所述流表规则动作项包括流表统计、采样转发和流镜像、为报文设置内标记、修改指定字段和引用句柄操作中的至少一种。The flow table rule action items include at least one of flow table statistics, sampling forwarding and flow mirroring, setting internal tags for packets, modifying specified fields, and refnum operations.
  5. 根据权利要求3或4所述的方法,其特征在于,所述方法还包括:The method according to claim 3 or 4, characterized in that, the method further includes:
    所述智能网卡向所述VS发送第二消息,所述第二消息指示在所述智能网卡的所述第一端口上创建所述第一ACL流匹配规则的结果。The smart network card sends a second message to the VS, where the second message indicates the result of creating the first ACL flow matching rule on the first port of the smart network card.
  6. 根据权利要求1-5任一项所述的方法,其特征在于,所述智能网卡管理访问控制列表ACL流匹配规则,所述方法包括:The method according to any one of claims 1 to 5, characterized in that the smart network card manages access control list ACL flow matching rules, and the method includes:
    所述智能网卡接收所述VS调用第二API发送的第三消息,基于所述第三消息在所述智能网卡上删除第二ACL流匹配规则。The smart network card receives the third message sent by the VS by calling the second API, and deletes the second ACL flow matching rule on the smart network card based on the third message.
  7. 根据权利要求1-6任一项所述的方法,其特征在于,所述智能网卡管理访问控制列表ACL流匹配规则,所述方法包括: The method according to any one of claims 1 to 6, characterized in that the smart network card manages access control list ACL flow matching rules, and the method includes:
    所述智能网卡接收所述VS调用第三API发送的第四消息,基于所述第四消息查询并返回所述智能网卡的统计信息。The smart network card receives a fourth message sent by the VS by calling a third API, and queries and returns statistical information of the smart network card based on the fourth message.
  8. 根据权利要求1-7任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-7, characterized in that the method further includes:
    所述智能网卡管理硬件匹配流表,所述硬件匹配流表用于所述智能网卡对流量进行流量管理,所述硬件匹配流表包括硬件精确匹配流表和硬件模糊匹配流表中的至少一种。The smart network card manages a hardware matching flow table. The hardware matching flow table is used by the smart network card to manage traffic. The hardware matching flow table includes at least one of a hardware exact matching flow table and a hardware fuzzy matching flow table. kind.
  9. 根据权利要求8所述的方法,其特征在于,所述硬件模糊匹配流表用于与第一报文进行匹配,所述第一报文为生成流表条目满足第一阈值条件的网元所产生的报文;The method according to claim 8, characterized in that the hardware fuzzy matching flow table is used to match a first message, and the first message is generated by a network element whose flow table entry satisfies a first threshold condition. generated messages;
    所述硬件精确匹配流表用于与第二报文进行匹配,所述第二报文为满足第二阈值条件的网元所产生的报文。The hardware exact matching flow table is used to match the second message, and the second message is a message generated by a network element that meets the second threshold condition.
  10. 根据权利要求8或9所述的方法,其特征在于,所述方法还包括:The method according to claim 8 or 9, characterized in that, the method further includes:
    所述智能网卡管理数据面哈希表,所述数据面哈希表用于所述智能网卡对多路径转发报文进行多路径转发。The smart network card manages a data plane hash table, and the data plane hash table is used by the smart network card to perform multi-path forwarding of multi-path forwarding messages.
  11. 根据权利要求10所述的方法,其特征在于,所述硬件匹配流表中包括哈希匹配动作项、转向标识匹配动作项和报文上送所述VS软件控制面匹配动作项的至少一种;The method according to claim 10, characterized in that the hardware matching flow table includes at least one of a hash matching action item, a redirection identification matching action item and a message uploading matching action item to the VS software control plane. ;
    其中,所述哈希匹配动作项用于指示执行所述数据面哈希表的查询动作,所述转向标识用于指示所述数据面哈希表,所述数据面哈希表包括哈希值、掩码和所述转向标识,所述掩码对应下一跳信息。Wherein, the hash matching action item is used to indicate execution of the query action of the data plane hash table, and the redirection flag is used to indicate the data plane hash table, and the data plane hash table includes a hash value. , a mask and the redirection identifier, where the mask corresponds to next hop information.
  12. 一种流表规则的管理方法,其特征在于,所述管理方法由虚拟交换机VS执行,所述VS用于与智能网卡连接,所述方法包括:A management method for flow table rules, characterized in that the management method is executed by a virtual switch VS, and the VS is used to connect to an intelligent network card. The method includes:
    所述VS获取访问控制列表ACL流匹配规则,所述ACL流匹配规则用于所述智能网卡对报文进行运维功能管理;The VS obtains the access control list ACL flow matching rules, and the ACL flow matching rules are used by the smart network card to perform operation and maintenance function management of messages;
    所述VS指示所述智能网卡管理所述ACL流匹配规则。The VS instructs the smart network card to manage the ACL flow matching rules.
  13. 根据权利要求12所述的方法,其特征在于,所述ACL流匹配规则包括入向的ACL流匹配规则和出向的ACL流匹配规则中的至少一种。The method according to claim 12, wherein the ACL flow matching rules include at least one of inbound ACL flow matching rules and outbound ACL flow matching rules.
  14. 根据权利要求12或13所述的方法,其特征在于,所述VS指示所述智能网卡管理所述ACL流匹配规则,所述方法包括:The method according to claim 12 or 13, characterized in that the VS instructs the smart network card to manage the ACL flow matching rules, and the method includes:
    所述VS调用第一应用程序编程接口API向所述智能网卡发送第一消息,所述第一消息包括所述智能网卡的第一端口的端口标识,所述第一消息用于所述智能网卡在所述智能网卡的第一端口上创建第一ACL流匹配规则。The VS calls a first application programming interface API to send a first message to the smart network card. The first message includes the port identification of the first port of the smart network card. The first message is used for the smart network card. Create a first ACL flow matching rule on the first port of the smart network card.
  15. 根据权利要求14所述的方法,其特征在于,所述第一消息还包括流表规则属性、流表规则匹配项和流表规则动作项中的至少一种; The method of claim 14, wherein the first message further includes at least one of flow table rule attributes, flow table rule matching items, and flow table rule action items;
    其中,所述流表规则属性用于指示报文需匹配的组、所述第一ACL流匹配规则为入向的ACL流匹配规则还是出向的ACL流匹配规则、流表类型中的至少一种;Wherein, the flow table rule attribute is used to indicate at least one of the group that the packet needs to match, whether the first ACL flow matching rule is an inbound ACL flow matching rule or an outgoing ACL flow matching rule, and a flow table type. ;
    所述流表规则匹配项包括匹配以太层信息、匹配虚拟局域网VLAN信息、匹配网际协议第四版IPv4信息或匹配网际协议第六版IPv6信息、匹配虚拟扩展局域网VXLAN信息、匹配项结束、报文标记中的至少一种;The flow table rule matching items include matching Ethernet layer information, matching virtual LAN VLAN information, matching Internet Protocol version 4 IPv4 information or matching Internet Protocol version 6 IPv6 information, matching virtual extended LAN VXLAN information, matching item end, message at least one of the markers;
    所述流表规则动作项包括流表统计、采样转发和流镜像、为报文设置内标记、修改指定字段和引用句柄操作中的至少一种。The flow table rule action items include at least one of flow table statistics, sampling forwarding and flow mirroring, setting internal tags for packets, modifying specified fields, and refnum operations.
  16. 根据权利要求14或15所述的方法,其特征在于,所述方法还包括:The method according to claim 14 or 15, characterized in that the method further includes:
    所述VS接收所述智能网卡发送的第二消息,所述第二消息用于指示在所述智能网卡的所述第一端口上创建所述第一ACL流匹配规则的结果。The VS receives a second message sent by the smart network card, where the second message is used to indicate the result of creating the first ACL flow matching rule on the first port of the smart network card.
  17. 根据权利要求12-16任一项所述的方法,其特征在于,所述VS指示所述智能网卡管理所述ACL流匹配规则,所述方法包括:The method according to any one of claims 12-16, characterized in that the VS instructs the smart network card to manage the ACL flow matching rules, and the method includes:
    所述VS调用第二API向所述智能网卡发送第三消息,所述第三消息用于所述智能网卡在所述智能网卡上删除第二ACL流匹配规则。The VS calls a second API to send a third message to the smart network card, where the third message is used by the smart network card to delete the second ACL flow matching rule on the smart network card.
  18. 根据权利要求12-17任一项所述的方法,其特征在于,所述VS指示所述智能网卡管理所述ACL流匹配规则,所述方法包括:The method according to any one of claims 12 to 17, characterized in that the VS instructs the smart network card to manage the ACL flow matching rules, and the method includes:
    所述VS调用第三API向所述智能网卡发送第四消息,所述第四消息用于所述智能网卡查询并返回所述智能网卡的统计信息。The VS calls a third API to send a fourth message to the smart network card. The fourth message is used for the smart network card to query and return statistical information of the smart network card.
  19. 根据权利要求12-18任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 12-18, characterized in that the method further includes:
    所述VS获取硬件匹配流表,所述硬件匹配流表用于所述智能网卡对流量进行流量管理,所述硬件匹配流表包括硬件精确匹配流表和硬件模糊匹配流表中的至少一种;The VS obtains a hardware matching flow table. The hardware matching flow table is used by the smart network card to manage traffic. The hardware matching flow table includes at least one of a hardware exact matching flow table and a hardware fuzzy matching flow table. ;
    所述VS指示所述智能网卡管理所述硬件匹配流表。The VS instructs the smart network card to manage the hardware matching flow table.
  20. 根据权利要求19所述的方法,其特征在于,所述硬件模糊匹配流表用于与第一报文进行匹配,所述第一报文为生成流表条目满足第一阈值条件的网元所产生的报文;The method according to claim 19, characterized in that the hardware fuzzy matching flow table is used to match a first message, and the first message is generated by a network element whose flow table entry satisfies a first threshold condition. generated messages;
    所述硬件精确匹配流表用于与第二报文进行匹配,所述第二报文为满足第二阈值条件的网元所产生的报文。The hardware exact matching flow table is used to match the second message, and the second message is a message generated by a network element that meets the second threshold condition.
  21. 根据权利要求19或20所述的方法,其特征在于,所述方法还包括:The method according to claim 19 or 20, characterized in that the method further includes:
    所述VS获取数据面哈希表,所述数据面哈希表用于所述智能网卡对多路径转发报文进行多路径转发;The VS obtains a data plane hash table, and the data plane hash table is used by the smart network card to perform multi-path forwarding of multi-path forwarding messages;
    所述VS指示所述智能网卡管理所述数据面哈希表。The VS instructs the smart network card to manage the data plane hash table.
  22. 根据权利要求21所述的方法,其特征在于,所述硬件匹配流表中包括哈希匹配动作项、转向标识匹配动作项和报文上送所述VS软件控制面匹配动作项的至少一种; The method according to claim 21, characterized in that the hardware matching flow table includes at least one of a hash matching action item, a redirection identification matching action item and a message uploading matching action item to the VS software control plane. ;
    其中,所述哈希匹配动作项用于指示执行所述数据面哈希表的查询动作,所述转向ID用于指示所述数据面哈希表,所述数据面哈希表包括哈希值、掩码和所述转向标识,所述掩码对应下一跳信息。Wherein, the hash matching action item is used to indicate the execution of the query action of the data plane hash table, the steering ID is used to indicate the data plane hash table, and the data plane hash table includes a hash value , a mask and the redirection identifier, where the mask corresponds to next hop information.
  23. 一种流量管理方法,其特征在于,所述方法包括:A traffic management method, characterized in that the method includes:
    智能网卡接收报文,将所述报文与所述智能网卡上创建的访问控制列表ACL流匹配规则进行匹配;The smart network card receives the message and matches the message with the access control list ACL flow matching rule created on the smart network card;
    基于所述报文与所述ACL流匹配规则匹配成功,所述智能网卡根据所述ACL流匹配规则对所述报文进行运维功能管理。Based on the successful match between the packet and the ACL flow matching rule, the smart network card performs operation and maintenance function management on the packet according to the ACL flow matching rule.
  24. 根据权利要求23所述的方法,其特征在于,所述ACL流匹配规则包括入向的ACL流匹配规则和出向的ACL流匹配规则;The method according to claim 23, characterized in that the ACL flow matching rules include inbound ACL flow matching rules and outgoing ACL flow matching rules;
    所述基于所述报文与所述ACL流匹配规则匹配成功,所述智能网卡根据所述ACL流匹配规则对所述报文进行运维功能管理,包括:Based on the successful match between the packet and the ACL flow matching rule, the smart network card performs operation and maintenance function management on the packet according to the ACL flow matching rule, including:
    基于所述报文与所述入向的ACL流匹配规则匹配成功,所述智能网卡根据所述入向的ACL流匹配规则对所述报文进行入向的运维功能管理;Based on the successful match between the packet and the inbound ACL flow matching rule, the smart network card performs inbound operation and maintenance function management on the packet according to the inbound ACL flow matching rule;
    所述智能网卡将所述报文进行二三层网络转发;The smart network card forwards the message on the second and third layer networks;
    基于所述报文与所述出向的ACL流匹配规则匹配成功,所述智能网卡根据所述出向的ACL流匹配规则对所述报文进行出向的运维功能管理。Based on the successful match between the packet and the outbound ACL flow matching rule, the smart network card performs outbound operation and maintenance function management on the packet according to the outbound ACL flow matching rule.
  25. 根据权利要求23或24所述的方法,其特征在于,所述方法还包括:The method according to claim 23 or 24, characterized in that, the method further includes:
    所述智能网卡将所述报文与硬件匹配流表进行匹配,所述硬件匹配流表包括硬件精确匹配流表和硬件模糊匹配流表中的至少一种;The smart network card matches the message with a hardware matching flow table, where the hardware matching flow table includes at least one of a hardware exact matching flow table and a hardware fuzzy matching flow table;
    所述智能网卡根据所述报文与所述硬件匹配流表的匹配结果对所述报文进行流量管理。The smart network card performs traffic management on the packet according to the matching result between the packet and the hardware matching flow table.
  26. 根据权利要求25所述的方法,其特征在于,所述智能网卡将所述报文与硬件匹配流表进行匹配,包括:The method according to claim 25, characterized in that the smart network card matches the message with a hardware matching flow table, including:
    基于所述报文为第一报文,所述智能网卡将所述报文与所述硬件模糊匹配流表进行匹配,所述第一报文为生成流表条目满足第一阈值条件的网元所产生的报文;或Based on the fact that the message is the first message, the smart network card matches the message with the hardware fuzzy matching flow table, and the first message is a network element that generates a flow table entry that satisfies the first threshold condition. the message generated; or
    基于所述报文为第二报文,所述智能网卡将所述报文与所述硬件精确匹配流表进行匹配,所述第二报文为满足第二阈值条件的网元所产生的报文。Based on the fact that the message is a second message, the smart network card matches the message with the hardware accurate matching flow table, and the second message is a message generated by a network element that meets the second threshold condition. arts.
  27. 根据权利要求25或26所述的方法,其特征在于,所述智能网卡根据所述报文与所述硬件匹配流表的匹配结果对所述报文进行流量管理,包括:The method according to claim 25 or 26, characterized in that the smart network card performs traffic management on the packet according to the matching result between the packet and the hardware matching flow table, including:
    基于所述报文与所述硬件匹配流表的匹配结果为所述报文与所述硬件匹配流表匹配成功,且所述硬件匹配流表中包括上送动作项,将所述报文上送所述VS;Based on the matching result between the packet and the hardware matching flow table, the packet matches the hardware matching flow table successfully, and the hardware matching flow table includes an upload action item, upload the packet Send the VS;
    或者,基于所述报文与所述硬件匹配流表的匹配结果为所述报文与所述硬件匹配流表匹配失败,将所述报文上送所述VS。 Alternatively, based on the matching result between the packet and the hardware matching flow table being that the packet fails to match the hardware matching flow table, the packet is sent to the VS.
  28. 根据权利要求25-27任一项所述的方法,其特征在于,所述报文为多路径转发报文,所述方法还包括:The method according to any one of claims 25-27, characterized in that the message is a multi-path forwarding message, and the method further includes:
    所述智能网卡将所述报文与数据面哈希表进行匹配;The smart network card matches the message with a data plane hash table;
    基于所述报文与所述数据面哈希表匹配成功,所述智能网卡对所述报文进行多路径转发。Based on the successful matching between the message and the data plane hash table, the smart network card performs multi-path forwarding on the message.
  29. 根据权利要求28所述的方法,其特征在于,所述硬件匹配流表包括哈希匹配动作项和转向标识匹配动作项;其中,所述哈希匹配动作项用于指示执行所述数据面哈希表的查询动作,所述转向标识用于指示所述数据面哈希表,所述数据面哈希表包括哈希值、掩码和所述转向标识,所述掩码对应下一跳信息;The method according to claim 28, characterized in that the hardware matching flow table includes a hash matching action item and a turn identification matching action item; wherein the hash matching action item is used to indicate execution of the data plane hashing Hash table query action, the redirection identifier is used to indicate the data plane hash table, the data plane hash table includes a hash value, a mask and the redirection identifier, the mask corresponds to the next hop information ;
    所述智能网卡将所述报文与数据面哈希表进行匹配,包括:The smart network card matches the message with the data plane hash table, including:
    所述智能网卡基于所述哈希匹配动作项,计算所述报文对应的哈希值,基于所述哈希值获取所述报文对应的掩码;The smart network card calculates a hash value corresponding to the message based on the hash matching action item, and obtains a mask corresponding to the message based on the hash value;
    基于所述转向标识匹配动作项,查找所述数据面哈希表;Based on the steering identifier matching action item, search the data plane hash table;
    基于所述报文对应的掩码与所述数据面哈希表中的掩码一致,确定所述报文与所述数据面哈希表匹配成功;Based on the mask corresponding to the message being consistent with the mask in the data plane hash table, it is determined that the message and the data plane hash table are successfully matched;
    所述智能网卡对所述报文进行多路径转发,包括:The smart network card performs multi-path forwarding of the message, including:
    所述智能网卡按照所述数据面哈希表中所述掩码对应的下一跳信息对所述报文进行多路径转发。The smart network card performs multi-path forwarding of the message according to the next hop information corresponding to the mask in the data plane hash table.
  30. 根据权利要求28所述的方法,其特征在于,所述硬件匹配流表包括哈希匹配动作项、转向标识匹配动作项和报文上送所述VS软件控制面匹配动作项;其中,所述哈希匹配动作项用于指示执行所述数据面哈希表的查询动作,所述转向标识用于指示所述数据面哈希表,所述数据面哈希表包括哈希值、掩码和所述转向标识,所述掩码对应下一跳信息;The method according to claim 28, characterized in that the hardware matching flow table includes a hash matching action item, a steering identification matching action item and a message uploading matching action item to the VS software control plane; wherein, the The hash matching action item is used to indicate the execution of the query action of the data plane hash table, and the turn flag is used to indicate the data plane hash table. The data plane hash table includes a hash value, a mask, and a The redirection identifier and the mask correspond to next hop information;
    所述智能网卡将所述报文与数据面哈希表进行匹配,包括:The smart network card matches the message with the data plane hash table, including:
    所述智能网卡基于所述哈希匹配动作项,计算所述报文对应的哈希值,基于所述哈希值获取所述报文对应的掩码;The smart network card calculates a hash value corresponding to the message based on the hash matching action item, and obtains a mask corresponding to the message based on the hash value;
    基于所述转向标识匹配动作项,查找所述数据面哈希表;Based on the steering identifier matching action item, search the data plane hash table;
    基于所述报文对应的哈希值与所述数据面哈希表中的掩码不一致,确定所述报文与所述数据面哈希表匹配失败;Based on the hash value corresponding to the message being inconsistent with the mask in the data plane hash table, it is determined that the message fails to match the data plane hash table;
    所述方法还包括:The method also includes:
    所述智能网卡将所述报文上送虚拟交换机VS。The smart network card sends the message to the virtual switch VS.
  31. 一种流量管理方法,其特征在于,所述方法包括:A traffic management method, characterized in that the method includes:
    虚拟交换机VS接收智能网卡发送的报文,所述报文由所述智能网卡在所述报文与所述智能网卡上的硬件匹配流表匹配成功,且所述硬件匹配流表中包括上送动作项的情况下发送,或者,所述报文由所述智能网卡在所述报文与所述智能网卡上的硬件匹配流表 匹配失败的情况下发送,或者,所述报文由所述智能网卡在所述报文与所述智能网卡上的数据面哈希表匹配失败后发送;The virtual switch VS receives the message sent by the smart network card. The message is successfully matched by the smart network card with the hardware matching flow table on the smart network card, and the hardware matching flow table includes the uploaded message. action item is sent, or the message is sent by the intelligent network card when the message matches the flow table of the hardware on the intelligent network card. Sent when the match fails, or the message is sent by the smart network card after the message fails to match the data plane hash table on the smart network card;
    所述VS将所述报文与所述VS上的开源流表进行匹配,根据匹配结果对所述报文进行流量管理。The VS matches the packet with the open source flow table on the VS, and performs traffic management on the packet according to the matching result.
  32. 一种管理装置,其特征在于,包括处理器,所述处理器用于实现如权利要求1-11任一项所述的流表规则的管理方法,或者,所述处理器用于实现如权利要求12-22任一项所述的流表规则的管理方法,或者,所述处理器用于实现如权利要求23-30任一项所述的流量管理方法,或者,所述处理器用于实现如权利要求31所述的流量管理方法。A management device, characterized by comprising a processor, the processor being configured to implement the flow table rule management method as claimed in any one of claims 1-11, or the processor being configured to implement the flow table rule management method as claimed in claim 12 The management method of flow table rules according to any one of -22, or the processor is used to implement the traffic management method according to any one of claims 23-30, or the processor is used to implement the traffic management method as claimed in any one of claims 23-30. The traffic management method described in 31.
  33. 根据权利要求32所述的装置,其特征在于,所述管理装置为芯片。The device according to claim 32, wherein the management device is a chip.
  34. 根据权利要求32所述的装置,其特征在于,所述管理装置为网络设备,所述网络设备的类型包括以下至少一项:路由器、交换机或服务器。The device according to claim 32, characterized in that the management device is a network device, and the type of the network device includes at least one of the following: a router, a switch or a server.
  35. 一种管理系统,其特征在于,所述管理系统包括虚拟交换机VS和智能网卡;A management system, characterized in that the management system includes a virtual switch VS and an intelligent network card;
    其中,所述智能网卡用于执行如权利要求1-11中任一项所述的流表规则的管理方法,所述VS用于执行如权利要求12-22任一项所述的流表规则的管理方法;Wherein, the smart network card is used to execute the management method of flow table rules as described in any one of claims 1-11, and the VS is used to execute the flow table rules as described in any one of claims 12-22. management methods;
    或者,所述智能网卡用于实现如权利要求23-30任一项所述的流量管理方法,所述VS用于实现如权利要求31所述的流量管理方法。Alternatively, the smart network card is used to implement the traffic management method as claimed in any one of claims 23-30, and the VS is used to implement the traffic management method as claimed in claim 31.
  36. 一种计算机可读存储介质,其特征在于,所述计算机存储介质中存储有至少一条指令,所述至少一条指令由处理器加载并执行,以使计算机实现如权利要求1-11任一项所述的流表规则的管理方法,或者,实现如权利要求12-22任一项所述的流表规则的管理方法,或者,实现如权利要求23-30任一项所述的流量管理方法,或者,实现如权利要求31所述的流量管理方法。A computer-readable storage medium, characterized in that at least one instruction is stored in the computer storage medium, and the at least one instruction is loaded and executed by a processor, so that the computer implements any one of claims 1-11 The management method of flow table rules described above, or the management method of flow table rules described in any one of claims 12-22, or the traffic management method described in any one of claims 23-30, Or, implement the traffic management method as claimed in claim 31.
  37. 一种计算机程序产品,其特征在于,所述计算机程序产品包括计算机程序,所述计算机程序由计算机加载并执行,以使所述计算机实现如权利要求1-11任一项所述的流表规则的管理方法,或者,实现如权利要求12-22任一项所述的流表规则的管理方法,或者,实现如权利要求23-30任一项所述的流量管理方法,或者,实现如权利要求31所述的流量管理方法。 A computer program product, characterized in that the computer program product includes a computer program, and the computer program is loaded and executed by a computer, so that the computer implements the flow table rule as described in any one of claims 1-11 The management method, or the management method of flow table rules as described in any one of claims 12-22, or the traffic management method as described in any one of claims 23-30, or the management method of the flow table rules as described in any one of claims 23-30, or the management method of The traffic management method described in claim 31.
PCT/CN2023/097966 2022-06-06 2023-06-02 Flow table rule management method, traffic management method and system, and storage medium WO2023236858A1 (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN202210632725 2022-06-06
CN202210632725.7 2022-06-06
CN202210709643.8 2022-06-21
CN202210709643.8A CN117240790A (en) 2022-06-06 2022-06-21 Flow table rule management method, flow management system and storage medium

Publications (1)

Publication Number Publication Date
WO2023236858A1 true WO2023236858A1 (en) 2023-12-14

Family

ID=89093587

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/097966 WO2023236858A1 (en) 2022-06-06 2023-06-02 Flow table rule management method, traffic management method and system, and storage medium

Country Status (2)

Country Link
CN (1) CN117240790A (en)
WO (1) WO2023236858A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117640547A (en) * 2024-01-24 2024-03-01 苏州元脑智能科技有限公司 Access control list issuing method, device, communication equipment and storage medium
CN117714398B (en) * 2024-02-05 2024-05-10 浪潮电子信息产业股份有限公司 Data transmission system, method, electronic equipment and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102739473A (en) * 2012-07-09 2012-10-17 南京中兴特种软件有限责任公司 Network detecting method using intelligent network card
CN102752119A (en) * 2012-07-09 2012-10-24 南京中兴特种软件有限责任公司 Interface realizing method for intelligent network card
US8528041B1 (en) * 2008-11-07 2013-09-03 Sprint Communications Company L.P. Out-of-band network security management
CN104994065A (en) * 2015-05-20 2015-10-21 上海斐讯数据通信技术有限公司 Access control list operation system and method based on software-defined network
CN105207873A (en) * 2015-08-31 2015-12-30 华为技术有限公司 Message processing method and apparatus
CN108200092A (en) * 2018-02-08 2018-06-22 赛特斯信息科技股份有限公司 Accelerate the method and system of message ACL matching treatments based on NFV technologies
WO2018153355A1 (en) * 2017-02-24 2018-08-30 华为技术有限公司 Control information transmission method, server, and system
CN108540387A (en) * 2018-06-06 2018-09-14 新华三云计算技术有限公司 Method for network access control and device
CN113703912A (en) * 2021-07-22 2021-11-26 新华三大数据技术有限公司 Virtual machine management method and device

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8528041B1 (en) * 2008-11-07 2013-09-03 Sprint Communications Company L.P. Out-of-band network security management
CN102739473A (en) * 2012-07-09 2012-10-17 南京中兴特种软件有限责任公司 Network detecting method using intelligent network card
CN102752119A (en) * 2012-07-09 2012-10-24 南京中兴特种软件有限责任公司 Interface realizing method for intelligent network card
CN104994065A (en) * 2015-05-20 2015-10-21 上海斐讯数据通信技术有限公司 Access control list operation system and method based on software-defined network
CN105207873A (en) * 2015-08-31 2015-12-30 华为技术有限公司 Message processing method and apparatus
WO2018153355A1 (en) * 2017-02-24 2018-08-30 华为技术有限公司 Control information transmission method, server, and system
CN108200092A (en) * 2018-02-08 2018-06-22 赛特斯信息科技股份有限公司 Accelerate the method and system of message ACL matching treatments based on NFV technologies
CN108540387A (en) * 2018-06-06 2018-09-14 新华三云计算技术有限公司 Method for network access control and device
CN113703912A (en) * 2021-07-22 2021-11-26 新华三大数据技术有限公司 Virtual machine management method and device

Also Published As

Publication number Publication date
CN117240790A (en) 2023-12-15

Similar Documents

Publication Publication Date Title
US11134132B2 (en) Accelerated network packet processing
WO2023236858A1 (en) Flow table rule management method, traffic management method and system, and storage medium
US11221972B1 (en) Methods and systems for increasing fairness for small vs large NVMe IO commands
CN111901244B (en) Network message forwarding system
US11962501B2 (en) Extensible control plane for network management in a virtual infrastructure environment
US9680746B2 (en) Source routing with fabric switches in an ethernet fabric network
US8913613B2 (en) Method and system for classification and management of inter-blade network traffic in a blade server
CN108781185B (en) System and method for providing a programmable packet classification framework for network devices
US20170033992A1 (en) METHOD FOR PROCESSING VxLAN DATA UNITS
US9504016B2 (en) Optimized multicast routing in a Clos-like network
US8687649B2 (en) Message forwarding toward a source end node in a converged network environment
EP4109830A1 (en) Packet processing method, device, system, and storage medium
EP3968580A1 (en) Method for generating multicast forwarding table entry, and access gateway
EP3820094A1 (en) Vxlan message encapsulation method, device and system, and strategy execution method, device and system
CN114745255B (en) Hardware chip, DPU, server, communication method and related device
CN106992918B (en) Message forwarding method and device
WO2022068744A1 (en) Method for obtaining message header information and generating message, device, and storage medium
CN110401726B (en) Method, device and equipment for processing address resolution protocol message and storage medium
US8467311B2 (en) Method and system for avoiding flooding of packets in switches
WO2022042403A1 (en) Method for generating routing information, method for sending location information, method for forwarding message, and device
US10257087B2 (en) Communication device and communication method
CN116962161A (en) Path detection method, device, system and computer readable storage medium
US20170149663A1 (en) Control device, communication system, control method, and non-transitory recording medium
WO2016082573A1 (en) Packet forwarding method and apparatus for stacking system, and stacking device
EP4304144A1 (en) Communication method and apparatus

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23819023

Country of ref document: EP

Kind code of ref document: A1