Packet forwarding method and apparatus
AssigneeHuawei Technologies Co., Ltd.
InventorsYuefeng Wu, Yifan Wu
Life of this patent
Estimating the term…
Abstract
A network node encapsulates an IPv6 packet into a data frame including a layer-2 forwarding header and a MAC header, where the data frame includes a 6LoWPAN compressed IPv6 packet, and the layer-2 forwarding header and the MAC header are located in an outer layer of the 6LoWPAN compressed IPv6 packet. The network node obtains a MAC address of a next-hop node based on a final MAC address in the layer-2 forwarding header, and sends the data frame to the next-hop node, so that the next-hop node forwards the data frame directly based on the layer-2 forwarding header.
Claims20
A packet forwarding method implemented by a network node in a low-rate wireless mesh network, the packet forwarding method comprising:
- obtaining an original medium access control (MAC) address of the network node based on a source Internet Protocol version 6 (IPv6) address of an IPv6 packet, wherein the network node is an original node of the IPv6 packet in the low-rate wireless mesh network;
- obtaining a final MAC address of a final node based on a destination IPv6 address of the IPv6 packet, wherein the final MAC address is a MAC address of the final node of the IPv6 packet in the low-rate wireless mesh network;
- obtaining a next-hop MAC address of a next-hop node based on the final MAC address;
- generating a data frame based on the IPv6 packet, wherein the data frame comprises an IPv6 over Low-Power Wireless Personal Area Network (6LoWPAN) compressed IPv6 packet, wherein the 6LoWPAN compressed IPv6 packet comprises an outer layer, wherein the outer layer comprises a layer-2 forwarding header and a MAC header, wherein the layer-2 forwarding header comprises the original MAC address and the final MAC address, wherein the MAC header comprises a source MAC address and a destination MAC address, wherein the source MAC address is the original MAC address, and wherein the destination MAC address is the next-hop MAC address;
- sending the data frame to the next-hop node to prompt the next-hop node to forward the data frame based on the final MAC address;
- and
- querying a layer-2 forwarding table of the network node based on the final MAC address to obtain the next-hop MAC address, wherein the layer-2 forwarding table comprises a correspondence between the final MAC address and the next-hop MAC address, and wherein before querying the layer-2 forwarding table, the packet forwarding method further comprises translating a layer-3 routing table of the network node into the layer-2 forwarding table based on a correspondence between an IPv6 address and a MAC address of each node in the low-rate wireless mesh network.
A packet forwarding method implemented by a network node in a low-rate wireless mesh network, the packet forwarding method comprising:
- receiving a data frame, wherein the data frame comprises an Internet Protocol version 6 (IPv6) over Low-Power Wireless Personal Area Network (6LoWPAN) compressed IPv6 packet, wherein the 6LoWPAN compressed IPv6 packet comprises an outer layer, wherein the outer layer comprises a medium access control (MAC) header and a layer-2 forwarding header, wherein the MAC header comprises a source MAC address and a destination MAC address, wherein the layer-2 forwarding header comprises an original MAC address and a final MAC address, and wherein before receiving the data frame, the packet forwarding method comprises translating a layer-3 routing table of the network node into the layer-2 forwarding table based on a correspondence between an IP address and a MAC address of each node in the low-rate wireless mesh network;
- obtaining a next-hop MAC address of a next-hop node based on the final MAC address when the final MAC address does not belong to the network node;
- updating the source MAC address to a MAC address of the network node;
- updating the destination MAC address to the next-hop MAC address;
- and
- sending the data frame to the next-hop node.
A network node in a low-rate wireless mesh network, the network node comprising:
- a memory;
- and
- a processor coupled to the memory and configured to:
- obtain an original medium access control (MAC) address of the network node based on a source Internet Protocol version 6 (IPv6) address of an IPv6 packet, wherein the network node is an original node of the IPv6 packet in the low-rate wireless mesh network;
- obtain a final MAC address of a final node based on a destination IPv6 address of the IPv6 packet, wherein the final MAC address is a MAC address of the final node of the IPv6 packet in the low-rate wireless mesh network;
- obtain a next-hop MAC address of a next-hop node based on the final MAC address;
- generate a data frame based on the IPv6 packet, wherein the data frame comprises an IPv6 over Low-Power Wireless Personal Area Network (6LoWPAN) compressed IPv6 packet, wherein the 6LoWPAN compressed IPv6 packet comprises an outer layer, wherein the outer layer comprises a layer-2 forwarding header and a MAC header, wherein the layer-2 forwarding header comprises the original MAC address and the final MAC address, wherein the MAC header comprises a source MAC address and a destination MAC address, wherein the source MAC address is the original MAC address, and wherein the destination MAC address is the next-hop MAC address;
- send the data frame to the next-hop node to prompt the next-hop node to forward the data frame based on the final MAC address;
- query a layer-2 forwarding table of the network node based on the final MAC address to obtain the next-hop MAC address, wherein the layer-2 forwarding table comprises a correspondence between the final MAC address and the next-hop MAC address;
- and
- translate a layer-3 routing table of the network node into the layer-2 forwarding table based on a correspondence between an IPv6 address and a MAC address of each node in the low-rate wireless mesh network.
Dependencies are inferred from the claim text.