Method for accelerating generation of VXLAN packet with hardware, method for accelerating removal of VXLAN header with hardware, and method for accelerating modification to VXLAN packet with hardware
20240163134 ยท 2024-05-16
Inventors
Cpc classification
International classification
Abstract
A method for accelerating the generation of Virtual Extensible Local Area Network (VXLAN) packets with an application specific integrated circuit (ASIC) includes the following steps: determining whether an original packet is an upstream packet; when the original packet is the upstream packet, determining whether the original packet is for a VXLAN egress interface; when the original packet is for the VXLAN egress interface, adding a prototype outer header to the front of the original packet and thereby generating a VXLAN packet; and after generating the VXLAN packet, determining whether to modify the content of the prototype outer header.
Claims
1. A method for accelerating generation of Virtual Extensible Local Area Network (VXLAN) packets with hardware, the method comprising: determining whether an original packet is an upstream packet; when the original packet is the upstream packet, determining whether the original packet is for a VXLAN egress interface; when the original packet is for the VXLAN egress interface, adding a prototype outer header to a front of the original packet and thereby generating a VXLAN packet; and after generating the VXLAN packet, determining whether to modify content of the prototype outer header of the VXLAN packet.
2. The method of claim 1, further comprising: when the prototype outer header is not stored in a content buffer of a content table of the hardware, acquiring at least a part of the content of the prototype outer header from an upper circuit and storing the prototype outer header in the content buffer.
3. The method of claim 2, wherein the content buffer is devoted to the VXLAN egress interface.
4. The method of claim 2, wherein the upper circuit executes software and/or firmware to generate the at least a part of the content of the prototype outer header.
5. The method of claim 4, wherein the hardware is an Application Specific Integrated Circuit (ASIC), the upper circuit includes a central processing unit (CPU), and both the hardware and the upper circuit are included in a network switch or a network router.
6. The method of claim 2, wherein the step of determining whether to modify the content of the prototype outer header of the VXLAN packet includes: acquiring multiple field values from the upper circuit, and storing the multiple field values in multiple fields of a control entry of a control table respectively; and determining whether to modify the content of the prototype outer header of the VXLAN packet according to the control entry.
7. The method of claim 6, wherein the control entry is devoted to the VXLAN egress interface.
8. The method of claim 6, wherein the upper circuit executes software and/or firmware to generate the multiple field values.
9. The method of claim 6, wherein the prototype outer header includes M fields, and the M is an integer greater than one; and the step of determining whether to modify the content of the prototype outer header of the VXLAN packet according to the control entry includes: checking content of K field(s) of the prototype outer header according to the multiple field values of the multiple fields of the control entry and thereby determining whether to modify the content of the K field(s), wherein the K is a positive integer smaller than the M.
10. The method of claim 9, wherein the K is greater than one, and the K fields include: a Point-to-Point Protocol over Ethernet (PPPoE) field; an Internet Protocol version 4 (IPv4) field or an Internet Protocol version 6 (IPv6) field; and a User Datagram Protocol (UDP) field.
11. The method of claim 10, wherein the step of determining whether to modify the content of the K field(s) includes: determining whether a PPPoE length offset of the PPPoE field is zero, and updating content of the PPPoE field when the PPPoE length offset is not zero; determining whether an IPv4/IPv6 offset of the IPv4/IPv6 field is zero, and updating content of the IPv4/IPv6 field when the IPv4/IPv6 offset is not zero; determining whether a UDP length offset of the UDP field is zero, and updating content of the UDP field when the UDP length offset is not zero; and determining whether a UDP sport (UDP source port) offset of the UDP field is zero, and updating content of the UDP field when the UDP sport offset is not zero.
12. The method of claim 1, further comprising: when the prototype outer header is stored in a content buffer of a content table of the hardware, acquiring the prototype outer header from the content buffer.
13. The method of claim 12, wherein the step of determining whether to modify the content of the prototype outer header of the VXLAN packet includes: determining whether to modify the content of the prototype outer header of the VXLAN packet according to a control entry of a control table of the hardware, wherein the control entry includes multiple field values.
14. The method of claim 13, wherein the prototype outer header includes M fields, and the M is an integer greater than one; and the step of determining whether to modify the content of the prototype outer header of the VXLAN packet according to the control entry of the control table includes: checking content of K field(s) of the prototype outer header according to the multiple field values and thereby determining whether to modify the content of the K field(s), wherein the K is a positive integer smaller than the M.
15. The method of claim 14, wherein the K is greater than one, and the K fields include: a Point-to-Point Protocol over Ethernet (PPPoE) field; an Internet Protocol version 4 (IPv4) field or an Internet Protocol version 6 (IPv6) field; and a User Datagram Protocol (UDP) field.
16. The method of claim 15, wherein the step of determining whether to modify the content of the K field(s) includes: determining whether a PPPoE length offset of the PPPoE field is zero, and updating content of the PPPoE field when the PPPoE length offset is not zero; determining whether an IPv4/IPv6 offset of the IPv4/IPv6 field is zero, and updating content of the IPv4/IPv6 field when the IPv4/IPv6 offset is not zero; determining whether a UDP length offset of the UDP field is zero, and updating content of the UDP field when the UDP length offset is not zero; and determining whether a UDP sport (UDP source port) offset of the UDP field is zero, and updating content of the UDP field when the UDP sport offset is not zero.
17. A method for accelerating removal of Virtual Extensible Local Area Network (VXLAN) headers with hardware, the method comprising: determining whether an original packet is a downstream packet; when the original packet is the downstream packet, determining whether the original packet is a VXLAN packet and includes a matched VXLAN network identifier (VNI); when the original packet is the VXLAN packet and includes the matched VNI, determining whether the original packet is for a VXLAN ingress interface; and when the original packet is for the VXLAN ingress interface, removing an outer header of the original packet to generate an input packet, wherein the outer header includes a VXLAN header.
18. The method of claim 17, wherein the hardware is an Application Specific Integrated Circuit (ASIC).
19. A method for accelerating modification to Virtual Extensible Local Area Network (VXLAN) packets with hardware, the method comprising: packet generation steps for accelerating generation of an upstream VXLAN packet with the hardware, the packet generation steps including: determining whether an upstream packet is for a VXLAN egress interface; when the upstream packet is for the VXLAN egress interface, adding a prototype outer header to a front of the upstream packet and thereby generating the upstream VXLAN packet; and after generating the upstream VXLAN packet, determining whether to modify content of the prototype outer header of the upstream VXLAN packet; and header removal steps for accelerating removal of a VXLAN header with the hardware, the header removal steps including: determining whether a downstream packet is a downstream VXLAN packet and includes a matched VXLAN network identifier (VNI); when the downstream packet is the downstream VXLAN packet and includes the matched VNI, determining whether the downstream packet is for a VXLAN ingress interface; and when the downstream packet is for the VXLAN ingress interface, removing an outer header of the downstream packet to generate an input packet, wherein the outer header includes the VXLAN header.
20. The method of claim 19, wherein the hardware is an Application Specific Integrated Circuit (ASIC).
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0009]
[0010]
[0011]
[0012]
[0013]
[0014]
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0015] The present specification discloses a method for accelerating the generation of Virtual Extensible Local Area Network (VXLAN) packets with hardware, a method for accelerating the removal of VXLAN headers with hardware, and a method for accelerating the modification to VXLAN packets with hardware. These methods can realize VXLAN with hardware quickly. The methods of the present disclosure are applicable to a network device (e.g., a switch or a router) which includes the above-mentioned hardware and other circuits (e.g., a CPU, a memory, a Media Access Control (MAC) circuit, and a physical layer (PHY) circuit). An embodiment of the hardware is an Application Specific Integrated Circuit (ASIC) which can be an independent circuit devoted to VXLAN or can be at least a part of some circuit (e.g., a MAC circuit) of the network device.
[0016]
[0025] Referring to
[0030] Referring to
TABLE-US-00001 TABLE 1 field value description pppoe_len_offset This field value indicates the address of an offset in the content buffer, wherein the offset can be used to ascertain a PPPOE length (existing in the PPPOE field of the prototype outer header) pppoe_len_diff If the pppoe_len_offset is not zero, using the sum of the present field value and the total length of the original packet to update the PPPOE length (existing in the PPPOE field of the prototype outer header) ipv4_offset This filed value indicates the address of an offset in the content buffer, wherein the offset can be used to find an Ipv4 header. If this field value is not zero, recalculating the fields (checksum, ip length, ip dscp, and so on) in the Ipv4 header (existing in the Ipv4 field of the prototype outer header). ipv6_offset This field value indicates the address of an offset in the content buffer, wherein the offset can be used to find an Ipv6 header. ip_len_diff If the ipv4_offset or the ipv6_offset is not zero, using the sum of the present field value and the total length of the original packet to update an IP length (existing in the Ipv4/Ipv6 field of the prototype outer header) ip_dscp If the ipv4_offset or the ipv6_offset is not zero, using the present field value to update an IP Differentiated Services Code Point (IP DSCP) (existing in the Ipv4/Ipv6 field of the prototype outer header) ip_ecn If the ipv4_offset or the ipv6_offset is not zero, using the present field value to update an IP Explicit Congestion Notification ( IP ECN) (existing in the Ipv4/Ipv6 field of the prototype outer header) ip_ttl If the ipv4_offset or the ipv6_offset is not zero, using the present field value to update an IP time-to-live (IP TTL) of the Ipv6 field or update a Hop limit of the Ipv6 field (existing in the Ipv4/Ipv6 field of the prototype outer header) ip_id If the ipv4_offset is not zero, using the present field value to update an Ipv4 Identification. Every time the present field value is read, increasing the present field value by one. udp_len_offset This filed value indicates the address of an offset in the content buffer, wherein the offset can be used to find a UDP length. udp_len_diff If the udp_len_offset is not zero, using the sum of the present field value and the total length of the original packet to update the UDP length. sport_offset This filed value indicates the address of an offset in the content buffer, wherein the offset can be used to find a UDP sport (UDP source port). If the present field value is not zero, referring to flow.vxlan_sport to update the UDP sport. P.S. flow.vxlan_sport is a prestored VXLAN sport (VXLAN source port) in the flow connection of an inner-layer packet (i.e., the original packet) of the VXLAN packet, and it is obtained with hash calculation according to the messages of the second layer/third layer/fourth layer (L2/L3/L4) of the inner-layer packet.
[0035] On the basis of the previous description, the prototype outer header includes M fields (e.g., the 9 fields of the prototype outer header of
[0036] Referring to
[0037]
[0038]
[0044] It is noted that after the removal of the outer header, the hardware can take care of the input packet with a general downstream packet forwarding process.
[0045]
[0059] The method of
[0060] It is noted that people having ordinary skill in the art can selectively use some or all of the features of any embodiment in this specification or selectively use some or all of the features of multiple embodiments in this specification to implement the present invention as long as such implementation is practicable; in other words, the way to implement the present invention can be flexible based on the present disclosure.
[0061] To sum up, the present invention can accelerate the modification to VXLAN packets with hardware (e.g., ASIC). In comparison with the prior art processing VXLAN packets with software, the present invention processes VXLAN packets with hardware to achieve better performance.
[0062] The aforementioned descriptions represent merely the preferred embodiments of the present invention, without any intention to limit the scope of the present invention thereto. Various equivalent changes, alterations, or modifications based on the claims of the present invention are all consequently viewed as being embraced by the scope of the present invention.