# US 10,771,286 B2 · Method for sending virtual extensible local area network packet, computer device, and computer readable medium

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 10,771,286 B2
- Document ID: US10771286B2
- Status: Granted
- Kind: B2
- Application number: 16/019,003
- Filed: 2018-06-26
- Published: 2018-10-25
- Granted: 2020-09-08
- Earliest claimed: 2015-12-31
- Assignees: Huawei Technologies Co., Ltd.
- Applicants: Huawei Technologies Co., Ltd.
- Inventors: Zhenliang Ma
- Web page: https://patentgrep.com/patent/US10771286B2

## CPC

- H04L 12/4641: {Virtual LANs, VLANs, e.g. virtual private networks [VPN] (LAN interconnection over a bridge based backbone H04L12/462; encapsulation techniques H04L12/4633; routing of packets H04L45/00; packet switches H04L49/00; virtual private networks for security H04L63/0272)}
- G06F 9/45558: {Hypervisor-specific management and integration aspects}
- H04L 12/46: Interconnection of networks
- H04L 12/4633: {Interconnection of networks using encapsulation techniques, e.g. tunneling}
- H04L 61/103: across network layers, e.g. resolution of network layer into physical layer addresses or address resolution protocol [ARP]
- H04L 61/2592: using tunnelling or encapsulation
- G06F 2009/45595: {Network integration; Enabling network access in virtual machine instances}
- H04L 2101/622: Layer-2 addresses, e.g. medium access control [MAC] addresses
- H04L 2212/00: Encapsulation of packets
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method for sending a VxLAN packet, a computer device, and a computer readable medium are provided. According to the method for forwarding a VxLAN packet provided in the embodiments of the present disclosure, after receiving a first packet, a network adapter determines whether the network adapter stores encapsulation information required for performing VxLAN encapsulation on the first packet; if the network adapter stores the encapsulation information, performs VxLAN encapsulation on the first packet and sends the first packet; or if the network adapter does not store the encapsulation information, requests the encapsulation information from a central processing unit and stores the encapsulation information; and sends a packet obtained after the VxLAN encapsulation is performed on the first packet, so as to resolve a problem that a network adapter cannot forward a VxLAN packet in the conventional art.

## Claims

### Claim 1

A method for sending a virtual extensible local area network (VxLAN) packet, wherein the method is applied to a computer device, the computer device comprises a central processing unit, a network adapter, and a virtual machine, the network adapter comprises a network adapter processor, and the method comprises:
receiving, by the network adapter processor, a first packet sent by the virtual machine;
determining, by the network adapter processor, whether the network adapter stores encapsulation information required for performing VxLAN encapsulation on the first packet, wherein the encapsulation information comprises an encapsulation Media Access Control (MAC) address and an encapsulation Internet Protocol (IP) address, the encapsulation MAC address is a MAC address of a next-hop device passed through when the first packet is sent, and the encapsulation IP address is an IP address of a virtual extensible local area network tunnel end point (VTEP) on a destination end of the first packet; and
in response to the network adapter not storing the encapsulation information required for performing VxLAN encapsulation on the first packet;
sending an obtaining request to the central processing unit;
obtaining the encapsulation information from the central processing unit;
storing the encapsulation information; and
sending a packet obtained after VxLAN encapsulation is performed on the first packet.

### Claim 2 (depends on 1)

The method for sending a VxLAN packet according to claim 1, wherein before the determining whether the network adapter stores the encapsulation information required for performing VxLAN encapsulation on the first packet, the method further comprises:
obtaining, by the network adapter processor from the received first packet, an ID of a virtual function (VF) for forwarding the first packet, and querying, according to the ID of the VF, for a VF attribute corresponding to the ID of the VF; and
obtaining a VxLAN network identifier (VNI) of the VF when the VF attribute is a VxLAN attribute.

### Claim 3 (depends on 2)

The method for sending a VxLAN packet according to claim 2, wherein the determining, by the network adapter processor, whether the network adapter stores the encapsulation information required for performing VxLAN encapsulation on the first packet comprises:
querying, by the network adapter processor according to the VNI and an inner destination MAC address of the first packet, whether the network adapter comprises encapsulation information corresponding to the VNI of the VF and the inner destination MAC address of the first packet; and
determining that the network adapter stores the encapsulation information required for performing VxLAN encapsulation on the first packet when the network adapter comprises the encapsulation information corresponding to the VNI of the VF and the inner destination MAC address of the first packet.

### Claim 4 (depends on 1)

The method for sending a VxLAN packet according to claim 1, wherein:
a manner of storing, by the network adapter, the encapsulation information required for performing VxLAN encapsulation on the first packet comprises:
storing, by the network adapter, a correspondence between a tunnel identifier, and the VNI of the VF for forwarding the first packet and the inner destination MAC address of the first packet, and storing a correspondence between the tunnel identifier and the encapsulation information.

### Claim 5 (depends on 1)

The method for sending a VxLAN packet according to claim 1, wherein the sending, by the network adapter processor, the packet obtained after the VxLAN encapsulation is performed on the first packet comprises:
performing, by the network adapter processor, VxLAN encapsulation on the first packet according to the obtained encapsulation information required for performing VxLAN encapsulation on the first packet, and sending the first packet using a virtual switch in the network adapter.

### Claim 6 (depends on 1)

The method for sending a VxLAN packet according to claim 1, wherein the sending, by the network adapter processor, the packet obtained after the VxLAN encapsulation is performed on the first packet comprises:
receiving and sending, by a virtual switch in the network adapter, the packet that is sent by the central processing unit and that is obtained after the VxLAN encapsulation is performed on the first packet.

### Claim 7 (depends on 1)

The method for sending a VxLAN packet according to claim 1, wherein the method further comprises:
receiving, by the network adapter, a second packet sent to the virtual machine, wherein the second packet is a VxLAN packet;
determining, by the network adapter processor, whether the network adapter stores an encapsulation MAC address and an encapsulation IP address in the second packet; and
sending the second packet to the central processing unit when the network adapter does not store the encapsulation MAC address and the encapsulation IP address in the second packet.

### Claim 8

A computer device, comprising a central processing unit, a network adapter, and a virtual machine, wherein the network adapter comprises a network adapter processor, and the network adapter processor is configured to:
receive a first packet sent by the virtual machine; determine whether the network adapter stores encapsulation information required for performing virtual extensible local area network (VxLAN) encapsulation on the first packet; and in response to the network adapter not storing the encapsulation information required for performing VxLAN encapsulation on the first packet, the network adapter processor is further configured to send an obtaining request to the central processing unit, wherein the encapsulation information comprises an encapsulation Media Access Control (MAC) address and an encapsulation Internet Protocol (IP) address, the encapsulation MAC address is a MAC address of a next-hop device passed through when the first packet is sent, and the encapsulation IP address is an IP address of a virtual extensible local area network tunnel end point (VTEP) on a destination end of the first packet;
receive and store the encapsulation MAC address and the encapsulation IP address that are sent by the central processing unit and that are required for performing VxLAN encapsulation on the first packet; and
send a packet obtained after VxLAN encapsulation is performed on the first packet.

### Claim 9 (depends on 8)

The computer device according to claim 8, wherein the central processing unit is configured to:
receive the obtaining request sent by the network adapter processor, wherein the obtaining request comprises the first packet and a VxLAN network identifier (VNI) of a virtual function (VF) for forwarding the first packet; and
obtain, according to the obtaining request, the encapsulation information required for performing VxLAN encapsulation on the first packet, and send the encapsulation information to the network adapter processor.

### Claim 10 (depends on 8)

The computer device according to claim 8, wherein:
the network adapter processor is further configured to: obtain, from the received first packet, an ID of the virtual function (VF) for forwarding the first packet; query, according to the ID of the VF, for a VF attribute corresponding to the ID of the VF; and obtain the VxLAN network identifier (VNI) of the VF when the VF attribute is a VxLAN attribute.

### Claim 11 (depends on 10)

The computer device according to claim 10, wherein the network adapter processor is further configured to:
query, according to the VNI and an inner destination MAC address of the first packet, whether the network adapter comprises encapsulation information corresponding to the VNI of the VF and the inner destination MAC address of the first packet; and
determine that the network adapter comprises the encapsulation information required for performing VxLAN encapsulation on the first packet when the network adapter comprises the encapsulation information corresponding to the VNI of the VF and the inner destination MAC address of the first packet.

### Claim 12 (depends on 9)

The computer device according to claim 9, wherein
the network adapter processor unit is further configured to store a correspondence between a tunnel identifier, and the VNI of the VF for forwarding the first packet and the inner destination MAC address of the first packet, and store a correspondence between the tunnel identifier and the encapsulation information.

### Claim 13 (depends on 9)

The computer device according to claim 9, wherein the network adapter processor further comprises a virtual switch, and the network adapter processor is further configured to: perform VxLAN encapsulation on the first packet according to the encapsulation MAC address and the encapsulation IP address, and send the first packet by using the virtual switch.

### Claim 14 (depends on 8)

The computer device according to claim 8, wherein the network adapter processor further comprises a virtual switch, the virtual switch is configured to receive and send the packet that is sent by the central processing unit and that is obtained after the VxLAN encapsulation is performed on the first packet.

### Claim 15 (depends on 8)

The computer device according to claim 8, wherein:
the network adapter processor is further configured to: receive a second packet sent to the virtual machine, wherein the second packet is a VxLAN packet; determine whether the entry management unit stores an encapsulation MAC address and an encapsulation IP address in the second packet; and when the entry management unit does not store the encapsulation MAC address and the encapsulation IP address in the second packet, send the second packet to the packet receiving unit; and
the central processing unit is further configured to: receive the second packet from the network adapter processor, and obtain the encapsulation MAC address and the encapsulation IP address in the second packet.

### Claim 16

A non-transitory computer readable medium, comprising computer readable instructions that when executed by a processor in a computer device, configure the processor to:
receive a first packet sent by a virtual machine to a network adapter;
determine whether the network adapter stores encapsulation information required for performing virtual extensible local area network (VxLAN) encapsulation on the first packet, wherein the encapsulation information comprises an encapsulation Media Access Control (MAC) address and an encapsulation Internet Protocol (IP) address, the encapsulation MAC address is a MAC address of a next-hop device passed through when the first packet is sent, and the encapsulation IP address is an IP address of a virtual extensible local area network tunnel end point (VTEP) on a destination end of the first packet; and
in response to the network adapter not storing the encapsulation information required for performing VxLAN encapsulation on the first packet, send an obtaining request to a central processing unit in the computer device, obtain the encapsulation information from the central processing unit and store the encapsulation information, and send a packet obtained after VxLAN encapsulation is performed on the first packet.

### Claim 17 (depends on 16)

The non-transitory computer readable medium according to claim 16, wherein before the processor determines whether the network adapter stores the encapsulation information required for performing the VxLAN encapsulation on the first packet, the processor is further configured to:
obtain, from the received first packet, an ID of a virtual function (VF) for forwarding the first packet, and query, according to the ID of the VF, for a VF attribute corresponding to the ID of the VF; and
obtain a VxLAN network identifier (VNI) of the VF when the VF attribute is a VxLAN attribute.

### Claim 18 (depends on 17)

The non-transitory computer readable medium according to claim 17, wherein the processor is further configured to:
obtain the VxLAN network identifier (VNI) of the VF for forwarding the first packet;
query, according to the VNI and an inner destination MAC address of the first packet, whether the network adapter comprises encapsulation information corresponding to the VNI of the VF and the inner destination MAC address of the first packet; and
determine that the network adapter comprises the encapsulation information required for performing VxLAN encapsulation on the first packet when the network adapter comprises the encapsulation information corresponding to the VNI of the VF and the inner destination MAC address of the first packet.
