CN114338852A - Method for encapsulating data packet based on Thread protocol to obtain IEEE802.11 physical frame - Google Patents

Method for encapsulating data packet based on Thread protocol to obtain IEEE802.11 physical frame Download PDF

Info

Publication number
CN114338852A
CN114338852A CN202111666977.3A CN202111666977A CN114338852A CN 114338852 A CN114338852 A CN 114338852A CN 202111666977 A CN202111666977 A CN 202111666977A CN 114338852 A CN114338852 A CN 114338852A
Authority
CN
China
Prior art keywords
thread
protocol
frame
data packet
network
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN202111666977.3A
Other languages
Chinese (zh)
Other versions
CN114338852B (en
Inventor
陈曙
姜江建
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Espressif Systems Shanghai Co Ltd
Original Assignee
Espressif Systems Shanghai Co Ltd
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 Espressif Systems Shanghai Co Ltd filed Critical Espressif Systems Shanghai Co Ltd
Priority to CN202111666977.3A priority Critical patent/CN114338852B/en
Publication of CN114338852A publication Critical patent/CN114338852A/en
Application granted granted Critical
Publication of CN114338852B publication Critical patent/CN114338852B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a method for encapsulating data packets based on a Thread protocol to obtain IEEE802.11 physical frames, which is executed by Wi-Fi equipment based on the Thread protocol to form a Thread mesh network. The method comprises the following steps: step 1: acquiring a data packet based on a Thread protocol; step 2: according to the preset definition of the IEEE802.11 protocol, performing first encapsulation on a data packet based on a Thread protocol to obtain an IEEE802.11MAC frame; and step 3: second encapsulating the IEEE802.11MAC frame to obtain a physical frame according to a preset definition of the IEEE802.11 protocol, wherein the second encapsulating includes: all fields of the IEEE802.11MAC frame are taken as a service data unit (PSDU) of the physical frame, and a header and a trailer of the IEEE802.11 physical frame are added. The invention also provides a networking method based on the Thread protocol, which is used for forming the Thread mesh network by the Wi-Fi equipment based on the Thread protocol.

Description

Method for encapsulating data packet based on Thread protocol to obtain IEEE802.11 physical frame
Technical Field
The present invention relates to a mesh network, and more particularly, to a method for wireless network communication based on a Thread protocol, and a networking method based on the Thread protocol.
Background
Wi-Fi is a high-speed, high-performance network protocol that has been widely used. Currently, there are two main standards for Mesh networking (Mesh networking) based on Wi-Fi, namely IEEE802.11 s and Easy Mesh protocols, in which:
(1) IEEE802.11 s was introduced by IEEE in 2006, and the standard only defines a mesh networking protocol of a MAC layer, and needs to be matched with an upper layer protocol for commercialization. Because the bottom layer of IEEE802.11 s is relatively complex and difficult to realize, and the upper layer lacks support, the IEEE802.11 s is not developed and has little market application;
(2) easy Mesh is a Wi-Fi Mesh networking protocol that is currently widely used, which is based on AP and Station modes of Wi-Fi. A Wi-Fi node in the Wi-Fi network simultaneously supports two modes of AP and Station, a point-to-point link is established through the traditional AP and Station modes, and then a tree network is formed, and the main purpose is to solve the problem of Wi-Fi coverage.
Because Easy Mesh is a Wi-Fi Mesh network formed after establishing links based on AP and Station modes of Wi-Fi, the Easy Mesh network is not a true pure Mesh structure, the actual network topology is similar to a tree structure, and the defects brought by the Easy Mesh network include:
(1) after a certain node in the network is disconnected, all subsequent nodes taking the node as the AP are disconnected;
(2) the data routing between two nodes must be upward layer by layer and downward layer by layer, and even if the actual physical distance between the two nodes is very close, multi-hop routing is needed to complete one data transmission;
(3) additional data communication is needed between every two nodes with links established to maintain the links, and when more links are established by one node, more links are consumed for maintaining the links.
In summary, there is currently a lack of networking schemes that enable a true mesh network over a Wi-Fi link (i.e., IEEE 802.11).
Drawings
FIG. 1 is a schematic diagram of a protocol stack according to the Thread protocol;
FIG. 2 is a schematic flow chart diagram of a method of encapsulating a data packet based on the Thread protocol to obtain an IEEE802.11 physical frame in accordance with one embodiment of the present invention;
FIG. 3 is a diagram illustrating a frame format of a specific vendor-specific action frame (vendor-specific action frame) in the IEEE802.11 protocol, in accordance with one embodiment of the present invention;
FIG. 4 is a diagram of an exemplary method of encapsulating a data packet based on the Thread protocol to obtain an IEEE802.11 physical frame, in accordance with one embodiment of the present invention;
fig. 5 is a schematic diagram of another exemplary method of encapsulating a data packet based on Thread protocol to obtain an IEEE802.11 physical frame according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a method of encapsulating a data packet based on the Thread protocol to obtain an IEEE802.11 physical frame according to still another example of an embodiment of the present invention;
FIG. 7 is a schematic diagram of establishing parent-child links according to another embodiment of the present invention;
FIG. 8 is a schematic diagram of establishing routing Links (Route Links) between routing nodes according to another embodiment of the present invention;
FIG. 9 is a schematic diagram of becoming a routing node according to another embodiment of the present invention;
FIG. 10 is a diagram of a Router node that can also be demoted to a REED node according to another embodiment of the present invention;
fig. 11 is a schematic diagram of a hybrid networking of a Thread network and a Wi-Fi network through a bridging device according to yet another embodiment of the present invention.
Disclosure of Invention
In view of the above-mentioned problem that the existing networking of a true mesh network cannot be realized on a Wi-Fi link, the present invention aims to provide a method for encapsulating a data packet based on the Thread protocol to obtain an IEEE802.11 physical frame.
In one aspect of the invention, a method of encapsulating a data packet based on a Thread protocol to obtain an IEEE802.11 physical frame is provided, the method being performed by a Wi-Fi device based on the Thread protocol to form a Thread mesh network. The method comprises the following steps: step 1: acquiring a data packet based on a Thread protocol; step 2: according to the preset definition of the IEEE802.11 protocol, performing first encapsulation on a data packet based on a Thread protocol to obtain an IEEE802.11MAC frame; and step 3: second encapsulating the IEEE802.11MAC frame to obtain a physical frame according to a preset definition of the IEEE802.11 protocol, wherein the second encapsulating includes: all fields of the IEEE802.11MAC frame are taken as a service data unit (PSDU) of the physical frame, and a header and a trailer of the IEEE802.11 physical frame are added.
Preferably, the data packet based on the Thread protocol is a data packet from an IPv6 network layer of the Thread protocol or an IEEE802.15.4MAC frame obtained by encapsulating a data packet from a 6LoWPAN adaptation layer of the Thread protocol, wherein the encapsulating includes adding a MAC header and a trailer.
Further preferably, the first package includes: all fields of a single IEEE802.15.4MAC frame are taken as traffic data units (MSDUs) in an IEEE802.11MAC frame, and an IEEE802.11MAC frame header and a frame trailer are added.
Further optionally, the first package comprises: the Payload fields (Payload) of multiple IEEE802.15.4MAC frames are merged as a traffic data unit (MSDU) in an IEEE802.11MAC frame, and the header and the trailer of the IEEE802.11MAC frame are added.
Preferably, the data packet based on the Thread protocol is a data packet from the IPv6 network layer of the Thread protocol or a data packet from the 6LoWPAN adaptation layer of the Thread protocol.
Further preferably, the first package includes: all fields of a data packet based on the Thread protocol are taken as a service data unit (MSDU) in an IEEE802.11MAC frame, and a head frame and a tail frame of the IEEE802.11MAC frame are added.
Preferably, the physical frames are sent to other Wi-Fi devices in the Thread mesh network over an IEEE802.11 communication link.
Preferably, the physical frame is sent to other Wi-Fi devices in the Thread mesh network in a full broadcast manner.
Further preferably, after receiving the physical frame, other Wi-Fi devices in the Thread mesh network parse the physical frame to obtain a destination address of the data packet based on the Thread protocol, and determine whether the destination address matches the address of the current Wi-Fi device, if so, continue to process the physical frame; if not, the physical frame is discarded.
Preferably, the IEEE802.11MAC frame adopts a frame format of a specific vendor-specific action frame (vendor-specific action frame) in the IEEE802.11 protocol, wherein the first encapsulation includes inserting all fields of a Thread protocol-based packet into a specific vendor specific content field (vendor specific content field) in the adapted MAC frame.
Preferably, the plurality of Wi-Fi devices in the Thread mesh network compose the Thread mesh network based on a Thread protocol.
In another aspect of the present invention, a method for networking based on Thread protocol is provided, which is used for forming a plurality of Wi-Fi devices based on Thread protocol into a Thread mesh network. The networking method comprises the following steps: configuring network parameters for each of a plurality of Wi-Fi devices based on a Thread protocol; one Wi-Fi device in a plurality of Wi-Fi devices based on the Thread protocol creates a Thread mesh network according to the Thread protocol, and the Thread mesh network is used as a Leader node of the Thread mesh network; the method comprises the steps that a Wi-Fi device in the Thread network carries out first communication with one or more Wi-Fi devices which do not join the Thread network in a plurality of Wi-Fi devices so as to join the Wi-Fi devices in the Thread network; and performing second communication between Wi-Fi equipment in the Thread network to exchange information based on the Thread protocol. Wherein the first communication and the second communication are performed through IEEE802.11 physical frames, wherein the IEEE802.11 physical frames are obtained by each Wi-Fi device in a plurality of Thread mesh networks through encapsulating data packets based on Thread protocol generated by the Wi-Fi devices according to the scheme.
Preferably, configuring the network parameters includes any one of manually configuring, configuring through a mobile phone, or automatically generating.
In still another aspect of the present invention, there is provided a communication apparatus including: a memory, a processor and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps of the method of encapsulating a data packet based on the Thread protocol to obtain an IEEE802.11 physical frame as described above.
In a further aspect of the present invention, there is provided a computer readable storage medium having stored thereon an implementation program for information transfer, the program, when executed by a processor, implementing the steps of the method for encapsulating a data packet based on Thread protocol to obtain an IEEE802.11 physical frame as described above.
The invention realizes a new networking scheme for realizing the mesh network on the Wi-Fi link by applying the Thread protocol to the Wi-Fi link, and avoids the problem of the traditional Wi-Fi mesh network. Meanwhile, the Wi-Fi protocol and the Thread protocol are communicated on a link layer, so that the Wi-Fi equipment and the Thread equipment can form a unified network, and more intelligent household application scenes are unlocked.
It is to be understood that the above description of background art and summary of the invention is intended to be illustrative and not restrictive.
Detailed Description
The present invention now will be described more fully hereinafter with reference to the accompanying drawings, which form a part hereof, and which show, by way of illustration, exemplary embodiments. It is to be understood that the embodiments shown in the drawings and described below are merely illustrative and not restrictive of the current invention.
Thread is an emerging IP-based low-power consumption Mesh network protocol (b)https:// www.threadgroup.org/) The bottom layer communication is based on the physical layer (PHY layer) and MAC layer of the IEEE802.15.4 standard, and a set of complete protocols such as adaptation, networking, authentication security and the like are defined. The Thread protocol has attracted attention in recent years, and is increasingly applied to low-power smart home products. The protocol stack diagram of the Thread protocol is shown in fig. 1, and the physical layer and the MAC layer of the IEEE802.15.4 protocol are used for communication at the bottom layer, and the adaptation, networking, authentication security, and other protocols defined by the Thread protocol are used at the upper layers, such as the network layer, the application layer, and the like.
The invention can operate the Thread protocol on the Wi-Fi link by packaging the data packet based on the Thread protocol to obtain the IEEE802.11 physical frame, so as to realize a new networking scheme of the Wi-Fi Mesh network and avoid the problem of the traditional Wi-Fi Mesh network. The invention simultaneously enables the Wi-Fi and the Thread to be communicated on a link layer, so that the Wi-Fi and the Thread equipment can form a unified network, and more intelligent household application scenes are unlocked. On one hand, the invention realizes the real mesh network networking on the Wi-Fi link, and simultaneously inherits the advantages of the Thread mesh network, such as pure mesh topology, no single point failure, low time delay, high-efficiency routing and the like; on the other hand, the invention realizes the hybrid networking of the Wi-Fi network and the Thread network from the link layer, and realizes interconnection and intercommunication.
According to one embodiment of the invention, a method for encapsulating data packets based on a Thread protocol to obtain IEEE802.11 physical frames is provided, which is executed by Wi-Fi equipment based on the Thread protocol to form a Thread mesh network. Fig. 2 schematically shows the main steps of the method, including:
step 1: acquiring a data packet based on a Thread protocol;
step 2: according to the preset definition of the IEEE802.11 protocol, performing first encapsulation on a data packet based on a Thread protocol to obtain an IEEE802.11MAC frame;
and step 3: according to the preset definition of the IEEE802.11 protocol, carrying out second encapsulation on the IEEE802.11MAC frame to obtain a physical frame;
wherein the second package includes: all fields of the IEEE802.11MAC frame are taken as a service data unit (PSDU) of the physical frame, and a header and a trailer of the IEEE802.11 physical frame are added.
Further, the physical frames are sent to other Wi-Fi devices in the Thread mesh network over the IEEE802.11 communication link. In addition, optionally, the physical frame can also be sent to other Wi-Fi devices in the Thread mesh network in a full broadcast manner.
Further, after receiving the physical frame, other Wi-Fi devices in the Thread mesh network analyze the physical frame to obtain a destination address of a data packet based on a Thread protocol, and judge whether the destination address matches the address of the current Wi-Fi device, if so, continue to process the physical frame; if not, the physical frame is discarded.
Further, a plurality of Wi-Fi devices in the Thread mesh network form the Thread mesh network based on the Thread protocol.
It should be understood that in the context of the present application, "Wi-Fi devices" refer to devices that are capable of communicating with each other via IEEE802.11 communication protocols, examples of which include, but are not limited to, devices with Wi-Fi communication capabilities used in various scenarios such as home, factory, mall, sports stadium, outdoors, etc., such as cell phones, desktop computers, laptop computers, tablet computers, smart appliances, smart office supplies, smart lights, smart switches, smart speakers, set-top boxes, routers, and so forth. In embodiments of the present invention, the Wi-Fi device can be various devices equipped with a Wi-Fi communication function chip, such as various forms of embedded devices equipped with the Dixin ESP32 chip.
It should be understood that embodiments of the present invention may be applied to various versions of the IEEE802.11 communication protocol, including but not limited to IEEE802.11 a/b/g/n/ac/ax/be and future versions of the IEEE802.11 communication protocol, in accordance with the principles of the present invention.
By way of example and not limitation, an IEEE802.11MAC frame may be sent in any Wi-Fi MAC frame type, such as a management frame, a data frame, and the like. For example, an IEEE802.11MAC frame employs a frame format of a specific vendor-specific action frame (as shown in fig. 3) in the IEEE802.11 protocol, wherein the first encapsulation includes inserting all fields of a data packet based on the Thread protocol into a specific vendor content field (specific content field) in the adapted MAC frame.
Example 1
Specifically, a specific packaging method is shown in fig. 4. Firstly, a data packet based on the Thread protocol is obtained, wherein the data packet based on the Thread protocol is an IEEE802.15.4MAC frame obtained by encapsulating a data packet from an IPv6 network layer of the Thread protocol or a data packet from a 6LoWPAN adaptation layer of the Thread protocol, and the encapsulating comprises adding a MAC frame header and a frame tail. In other words, the Payload field (Payload) of the IEEE802.15.4MAC frame is a packet from the Thread protocol IPv6 network layer or a packet from the Thread protocol 6LoWPAN adaptation layer. Secondly, according to the preset definition of the IEEE802.11 protocol, a data packet based on the Thread protocol is subjected to first encapsulation to obtain an IEEE802.11MAC frame. Wherein the first package includes: all fields of a single IEEE802.15.4MAC frame are treated as traffic data units (MSDUs) in an IEEE802.11MAC frame, and a header and a trailer of the IEEE802.11MAC frame are added. By way of example and not limitation, the header of an IEEE802.11MAC frame is set to a full broadcast address. Second encapsulating the IEEE802.11MAC frame to obtain a physical frame according to a preset definition of the IEEE802.11 protocol, wherein the second encapsulating includes: all fields of the IEEE802.11MAC frame are taken as a service data unit (PSDU) of the physical frame, and a header and a trailer of the IEEE802.11 physical frame are added.
Further, the physical frames are sent to other Wi-Fi devices in the Thread mesh network over the IEEE802.11 communication link. In addition, optionally, the physical frame can also be sent to other Wi-Fi devices in the Thread mesh network in a full broadcast manner.
Further, after receiving the physical frame, other Wi-Fi devices in the Thread mesh network analyze the physical frame to obtain a destination address of a data packet based on a Thread protocol, and judge whether the destination address matches the address of the current Wi-Fi device, if so, continue to process the physical frame; if not, the physical frame is discarded.
As an example and not a limitation, in the present example, the parsing of the destination address is performed by a packet header process, and in the present invention, all received IEEE802.11MAC frames are parsed by default, and the destination address is determined by the packet header of the data packet based on the Thread protocol obtained after parsing. Similarly, the security verification of all received IEEE802.11MAC frames may not be performed, but the security verification of the resolved packet address based on the Thread protocol is performed by software. Therefore, the resolution and the security verification of the destination address are performed by software.
Further, a plurality of Wi-Fi devices in the Thread mesh network form the Thread mesh network based on the Thread protocol.
According to the method of example 1, the MAC layer packet originally sent on the 802.15.4 link in the original Thread protocol can be adapted to the Wi-Fi (i.e., IEEE 802.11) link for sending, the adaptation method is simple, and the method related to encryption, integrity check, networking, authentication, and the like in the Thread protocol can be used without changing the part of the Thread protocol above the MAC layer, so as to implement mesh network networking based on the Thread protocol on the Wi-Fi link. In addition, the MAC layer of the Wi-Fi link adopts a full broadcast mode to send the encapsulated data packet, wherein the address resolution, the security verification and the like of the data packet all follow the requirements of the MAC layer of IEEE802.15.4 adopted in the original Thread protocol and are processed by software. By way of example and not limitation, the process of parsing a physical frame to obtain a MAC frame by the physical layer of IEEE802.15.4, which was originally employed in the Thread protocol, may also be handled by hardware.
Example 2
Specifically, a specific packaging method is shown in fig. 5. Firstly, a data packet based on the Thread protocol is obtained, wherein the data packet based on the Thread protocol is an IEEE802.15.4MAC frame obtained by encapsulating a data packet from an IPv6 network layer of the Thread protocol or a data packet from a 6LoWPAN adaptation layer of the Thread protocol, and the encapsulating comprises adding a MAC frame header and a frame tail. Secondly, according to the preset definition of the IEEE802.11 protocol, a data packet based on the Thread protocol is subjected to first encapsulation to obtain an IEEE802.11MAC frame. Wherein the first package includes: the Payload fields (Payload) of multiple IEEE802.15.4MAC frames are merged as a traffic data unit (MSDU) in an IEEE802.11MAC frame, and an IEEE802.11MAC frame header and trailer are added. By way of example and not limitation, at the time of the first encapsulation, the address information in the header of the IEEE802.15.4MAC frame is mapped into the header of the IEEE802.11MAC frame by the conversion between different address formats, the address format of the IEEE802.11MAC frame is MAC48, and the address format of the IEEE802.15.4MAC frame is EUI 64. Second encapsulating the IEEE802.11MAC frame to obtain a physical frame according to a preset definition of the IEEE802.11 protocol, wherein the second encapsulating includes: all fields of the IEEE802.11MAC frame are taken as a service data unit (PSDU) of the physical frame, and a header and a trailer of the IEEE802.11 physical frame are added.
Further, the physical frames are sent to other Wi-Fi devices in the Thread mesh network over the IEEE802.11 communication link. In addition, optionally, the physical frame can also be sent to other Wi-Fi devices in the Thread mesh network in a full broadcast manner. Still alternatively, unicast or broadcast IEEE802.15.4mac frames based on the Thread protocol may be transmitted using unicast or broadcast in IEEE802.11, respectively.
Further, after receiving the physical frame, other Wi-Fi devices in the Thread mesh network analyze the physical frame to obtain a destination address of a data packet based on a Thread protocol, and judge whether the destination address matches the address of the current Wi-Fi device, if so, continue to process the physical frame; if not, the physical frame is discarded.
Further, a plurality of Wi-Fi devices in the Thread mesh network form the Thread mesh network based on the Thread protocol.
The method of example 2 may fully utilize the advantages of high performance and high throughput of Wi-Fi, combine multiple IEEE802.15.4MAC packets into one Wi-Fi (IEEE 802.11) packet, remove the frame header (MHR) and frame tail (MFR) of the IEEE802.15.4MAC packet, and transmit the IEEE802.15.4MAC packet by using mechanisms such as address filtering and integrity checking of the MAC layer of the Wi-Fi protocol. The adaptation method needs to repackage and transmit the MAC layer data of the Thread protocol.
By way of example and not limitation, with respect to the mechanisms such as CSMA/CA defined in the MAC layer of IEEE802.15.4, which was originally employed in the Thread protocol, similar mechanisms in the Wi-Fi protocol may be followed to improve the efficiency of transceiving packets.
By way of example and not limitation, the scheme according to example 2 may implement hardware encryption and decryption at the Wi-Fi MAC layer based on the MAC layer encryption mechanism in the Wi-Fi protocol, which issues keys to hardware.
Example 3
Specifically, a specific packaging method is shown in fig. 6. Firstly, a data packet based on the Thread protocol is obtained, wherein the data packet based on the Thread protocol is a data packet from the IPv6 network layer of the Thread protocol or a data packet from the 6LoWPAN adaptation layer of the Thread protocol. Secondly, according to the preset definition of the IEEE802.11 protocol, a data packet based on the Thread protocol is subjected to first encapsulation to obtain an IEEE802.11MAC frame. Wherein the first package includes: all fields of a data packet based on the Thread protocol are taken as a service data unit (MSDU) in an IEEE802.11MAC frame, and a header and a tail of the IEEE802.11MAC frame are added. Second encapsulating the IEEE802.11MAC frame to obtain a physical frame according to a preset definition of the IEEE802.11 protocol, wherein the second encapsulating includes: all fields of the IEEE802.11MAC frame are taken as a service data unit (PSDU) of the physical frame, and a header and a trailer of the IEEE802.11 physical frame are added.
Further, the physical frames are sent to other Wi-Fi devices in the Thread mesh network over the IEEE802.11 communication link. In addition, optionally, the physical frame can also be sent to other Wi-Fi devices in the Thread mesh network in a full broadcast manner.
Further, after receiving the physical frame, other Wi-Fi devices in the Thread mesh network analyze the physical frame to obtain a destination address of a data packet based on a Thread protocol, and judge whether the destination address matches the address of the current Wi-Fi device, if so, continue to process the physical frame; if not, the physical frame is discarded.
Further, a plurality of Wi-Fi devices in the Thread mesh network form the Thread mesh network based on the Thread protocol.
The length of an IP data packet of the Thread protocol is 1280 Bytes (Bytes), the length of a MAC frame of the IEEE802.15.4 is 127 Bytes (Bytes), and the length of a part of the MAC frame of the IEEE802.11 is more than or equal to 1280 Bytes (Bytes), so most of the MAC frames of the IEEE802.11 can bear the IP packet of the Thread protocol. The 6LoWPAN adaptation layer plays a role in the Thread protocol in adapting the IP layer and the MAC layer, and its main purpose is to fragment and compress an IP packet. Example 3 the 6LoWPAN layer in the Thread protocol is further removed, and the IP data packet based on the Thread protocol is directly sent through the Wi-Fi link, thereby fully utilizing the advantages of high performance and high throughput of the Wi-Fi link.
According to the scheme of the invention, Mesh networking on a Wi-Fi link is completed based on a Thread protocol, and meanwhile, the AP/Station mode compatible with the Wi-Fi standard can be simultaneously compatible, and the IP network is accessed. Because the physical layer and the MAC layer based on IEEE802.11 are adopted in the scheme, the network layer of the Thread protocol and the Wi-Fi protocol can be simultaneously supported.
The above embodiments have been presented by way of example to illustrate specific procedures and steps, but it should be understood that the scope of the invention is not limited thereto.
In another aspect of the present invention, a method for networking based on Thread protocol is provided, which is used for forming a plurality of Wi-Fi devices based on Thread protocol into a Thread mesh network. The networking method comprises the following steps:
configuring network parameters for each of a plurality of Wi-Fi devices based on a Thread protocol;
one Wi-Fi device in a plurality of Wi-Fi devices based on the Thread protocol creates a Thread mesh network according to the Thread protocol, and the Thread mesh network is used as a Leader node of the Thread mesh network;
the method comprises the steps that a Wi-Fi device in the Thread network carries out first communication with one or more Wi-Fi devices which do not join the Thread network in a plurality of Wi-Fi devices so as to join the Wi-Fi devices in the Thread network;
and performing second communication between Wi-Fi equipment in the Thread network to exchange information based on the Thread protocol;
wherein the first communication and the second communication are performed through IEEE802.11 physical frames, wherein the IEEE802.11 physical frames are obtained by each Wi-Fi device in a plurality of Thread mesh networks through encapsulating data packets based on Thread protocol generated by the Wi-Fi devices according to the scheme.
Example 4
By way of example and not limitation, the networking method based on the Thread protocol comprises the following steps:
step 1: the Wi-Fi equipment is manually configured, configured by a mobile phone or automatically generated to obtain the network parameters. The network parameters include: channel, PanID (one for each Thread Network, which is for IEEE 15.4), Key, Network Name (for Thread protocol), etc.;
step 2: the Wi-Fi equipment sends a parent node request (parent request);
if the reply is not received, the current Wi-Fi device is considered to be the first node of the Thread network;
if a reply (parent response) is received, further executing step 3;
and step 3: transmitting a Child node request (Child ID request);
and 4, step 4: receiving Child node reply (Child ID response);
and 5: the communication is performed according to a routing protocol in the Thread protocol.
By way of example and not limitation, configuring the network parameters includes employing any of manual configuration, configuration via a cell phone, or automatic generation.
Example 5
Example 5 introduces the networking method based on the Thread protocol in terms of establishing Parent-Child Links (Child-Parent Links), establishing routing Links (Route Links), Becoming routing nodes (Becoming a Router), and Becoming REED nodes (Becoming a REED), respectively.
In the first aspect, if a Device chooses to join an existing Network, its Channel, PAN ID, XPAN ID, and Network Name are configured to be the same as the target Network through Thread connectivity, and then an MLE Attach procedure is performed to join as an End Device. This process is used to establish a "Parent-Child link". Fig. 7 shows a schematic diagram of establishing a parent-child link, where dots represent child nodes, pentagons represent parent nodes (Router nodes or REED nodes), dots connected by solid lines represent child nodes that have joined the network, and dots connected by dotted lines represent child nodes that are to join the network, and specifically includes the following steps:
step 1: the child node sends a multicast Parent node Request (Parent Request) to all adjacent Router nodes and REED nodes in the target network;
step 2: all adjacent Router nodes and REED nodes should send Parent node replies (Parent responses) to inform the child nodes of the information of the Parent nodes;
and step 3: the Child node selects a parent node and sends a Child node ID Request (Child ID Request) to the parent node;
and 4, step 4: the parent node sends a Child node ID reply (Child ID Response) to confirm the link establishment.
In a second aspect, fig. 8 shows that Route Links (Route Links) are established between routing nodes (as shown by pentagons in the figure), and bidirectional Links are established through 3 messages (Link Request, Link Accept and Request, Link Accept), which specifically includes the following steps:
step 1: sending a Link Request (Link Request), and if the node becomes a Router node for the first time, using a multicast mode; otherwise, sending the link request to other Router nodes discovered through MLE Advertisements by adopting a unicast mode;
step 2: the Router node of the receiving party replies Link acceptance (Link Accept) in a unicast mode
And step 3: respond with Link Accept and Request messages to establish a routing Link.
In a third aspect, in the Thread protocol, the red node may be upgraded to a Router node, and fig. 9 shows a schematic diagram of becoming a routing node. All routing nodes in a Thread network form a Connected Dominating Set (CDS), i.e., there is a Router-only path between any two Router nodes. Each node in the Thread network is directly connected to a Router node or is a Router node itself.
Thread maintains CDS using a distributed algorithm to ensure minimal redundancy. Each device is initially connected to the network as a child node. As the state of the Thread network changes, the algorithm adds or removes Router nodes to maintain the CDS. When there is an explicit need to support child nodes, the current non-Router child node can be upgraded to a Router node.
In the fourth aspect, in the Thread protocol, the Router node can also be downgraded to a REED node. When Router is downgraded to REED, its routing link is broken and the node starts the MLE Attach procedure to establish the parent-child links, as shown in fig. 10.
As a specific embodiment of the invention, the invention also enables the Thread network and the Wi-Fi network to be combined to form a network, and an independent Mesh network is formed by means of a bridging device. Because the network is formed by an independent Mesh network, the method is more efficient than the traditional mode of connecting a plurality of independent networks based on the Thread Border Router. As shown in fig. 11, the bridging device is a device that combines two nodes together, and after receiving a data packet of a certain standard (Thread protocol or Wi-Fi protocol), parses the data packet to the MAC layer, and then packetizes the data packet into a data packet of another standard (Wi-Fi protocol or Thread protocol). Compared with the traditional Thread Border Router, the bridging device in the invention connects two networks of Wi-Fi and IEEE802.15.4 at a data link layer (MAC layer), and the former carries out forwarding at a routing layer. The forwarding logic of the bridging device of the present invention can be designed according to the requirements of the application layer, such as forwarding all data packets, or forwarding only broadcast data, etc.
In summary, the scheme of the present invention adapts and receives the MAC data frame of ieee802.15.4 on the Wi-Fi connectionless link, and can operate the peer-to-peer mesh networking routing protocol on the Wi-Fi device; in addition, the Thread and the Wi-Fi equipment can be mixed and networked through the bridging equipment, and the interconnection is realized at a link layer to form an independent mesh network.
A Wi-Fi mesh network implemented based on the Thread protocol implemented according to an embodiment of the present invention is a true mesh structure, and nodes within all one-hop ranges can form peer-to-peer links, thereby achieving one or more of the following benefits:
(1) the problem of single point failure does not exist, even if one node in the network is disconnected, the overall connectivity of the network is not influenced, and all nodes and surrounding nodes are kept linked;
(2) the dynamic and efficient routing mechanism in the Thread protocol is realized, a specific node is not required to be used as a root node for forwarding, and an optimal route can be selected in real time according to the network topology and the link quality;
(3) the link maintenance in the Thread protocol is based on broadcasting, and one broadcast can update all the linked neighbor nodes, thereby greatly reducing the overhead of maintaining the mesh network; and
(4) the design of the Thread protocol for low power consumption will also lead to a significant reduction in the node power consumption of the Thread-based Wi-Fi mesh network.
The interconnection of Wi-Fi and Thread at the link layer through the bridging device, which is realized according to the embodiment of the present invention, has the following advantages:
(1) the Mesh network can form an independent Mesh network, and the routing efficiency is higher;
(2) when a plurality of Thread devices cannot be connected with each other in the same environment, the Thread devices can be communicated through the Wi-Fi Mesh network in the invention, so that unified networking is realized.
While various embodiments of various aspects of the invention have been described for purposes of this disclosure, it should not be understood to limit the teachings of the disclosure to these embodiments. Features disclosed in one particular embodiment are not limited to that embodiment, but may be combined with features disclosed in different embodiments. Further, it should be understood that the method steps described above may be performed sequentially, in parallel, combined into fewer steps, split into more steps, combined and/or omitted differently than as described. It will be understood by those skilled in the art that there are many more alternative embodiments and variations possible and that various changes and modifications may be made in the components and arrangements described above without departing from the scope of the present invention as defined in the appended claims.

Claims (15)

1. A method for encapsulating packets based on Thread protocol to obtain IEEE802.11 physical frames, which is executed by a Wi-Fi device based on Thread protocol to form a Thread mesh network, comprising:
step 1: acquiring a data packet based on a Thread protocol;
step 2: according to the preset definition of the IEEE802.11 protocol, performing first encapsulation on the data packet based on the Thread protocol to obtain an IEEE802.11MAC frame;
and step 3: second encapsulating the IEEE802.11MAC frame according to a preset definition of an IEEE802.11 protocol to obtain a physical frame, wherein the second encapsulating includes: and taking all fields of the IEEE802.11MAC frame as a service data unit (PSDU) of the physical frame, and adding a frame head and a frame tail of the IEEE802.11 physical frame.
2. The method according to claim 1, wherein the data packet based on the Thread protocol is a data packet from a Thread protocol IPv6 network layer or an IEEE802.15.4MAC frame obtained by encapsulating a data packet from a Thread protocol 6LoWPAN adaptation layer, wherein the encapsulating includes adding a MAC header and a frame trailer.
3. The method of claim 2, wherein the first package comprises: all fields of a single IEEE802.15.4MAC frame are taken as service data units (MSDUs) in the IEEE802.11MAC frame, and a header and a trailer of the IEEE802.11MAC frame are added.
4. The method of claim 2, wherein the first package comprises: combining Payload fields (Payload) of a plurality of IEEE802.15.4MAC frames as service data units (MSDUs) in the IEEE802.11MAC frame, and adding a header and a trailer of the IEEE802.11MAC frame.
5. The method according to claim 1, wherein the data packet based on Thread protocol is a data packet from the Thread protocol IPv6 network layer or a data packet from the Thread protocol 6LoWPAN adaptation layer.
6. The method of claim 5, wherein the first package comprises: all fields of a data packet based on the Thread protocol are used as service data units (MSDUs) in the IEEE802.11MAC frame, and a header and a tail of the IEEE802.11MAC frame are added.
7. The method of claim 1, wherein the physical frame is sent to other Wi-Fi devices in a Thread mesh network over an IEEE802.11 communication link.
8. The method of claim 1, wherein the physical frame is sent to other Wi-Fi devices in a Thread mesh network in a full broadcast manner.
9. The method according to claim 7 or 8, wherein other Wi-Fi devices in the Thread mesh network, after receiving the physical frame, parse the physical frame to obtain a destination address of the Thread protocol-based packet, and determine whether the destination address matches the current address of the Wi-Fi device, if yes, continue to process the physical frame; if not, the physical frame is discarded.
10. The method of claim 1, wherein the IEEE802.11MAC frame employs a frame format of a specific vendor-specific action frame (vendor-specific action frame) in the IEEE802.11 protocol, wherein the first encapsulation comprises inserting all fields of the Thread protocol based packet into a specific vendor content field (vendor specific content field) in an adapted MAC frame.
11. The method of claim 1, wherein a plurality of Wi-Fi devices in the Thread mesh network compose the Thread mesh network based on a Thread protocol.
12. A networking method based on a Thread protocol is used for forming a plurality of Wi-Fi devices based on the Thread protocol into a Thread mesh network, and is characterized in that the networking method comprises the following steps:
configuring network parameters for each of the plurality of Thread-protocol-based Wi-Fi devices;
one Wi-Fi device in the plurality of Wi-Fi devices based on the Thread protocol creates a Thread mesh network according to the Thread protocol, and the Thread mesh network is used as a Leader node of the Thread mesh network;
carrying out first communication between a Wi-Fi device in the Thread network and one or more Wi-Fi devices which do not join the Thread network in the plurality of Wi-Fi devices so as to join the Wi-Fi devices in the Thread network; and
carrying out second communication between Wi-Fi equipment in the Thread network so as to exchange information based on the Thread protocol;
wherein the first communication and the second communication are performed by means of IEEE802.11 physical frames, wherein the IEEE802.11 physical frames are obtained by each Wi-Fi device of the plurality of Thread mesh networks by encapsulating a Thread protocol based packet generated by the Wi-Fi device according to any one of claims 1 to 11.
13. The networking method of claim 12, wherein configuring the network parameters comprises any one of manual configuration, configuration via a mobile phone, or automatic generation.
14. A communication apparatus, characterized in that the communication apparatus comprises: memory, a processor and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps of the method of encapsulating a data packet based on a Thread protocol to obtain an IEEE802.11 physical frame as claimed in any one of claims 1 to 11.
15. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon an implementation program for information transfer, which when executed by a processor implements the steps of the method of encapsulating a data packet based on Thread protocol to obtain an IEEE802.11 physical frame as claimed in any one of claims 1 to 11.
CN202111666977.3A 2021-12-31 2021-12-31 Method for encapsulating data packet based on Thread protocol to obtain IEEE802.11 physical frame Active CN114338852B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111666977.3A CN114338852B (en) 2021-12-31 2021-12-31 Method for encapsulating data packet based on Thread protocol to obtain IEEE802.11 physical frame

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111666977.3A CN114338852B (en) 2021-12-31 2021-12-31 Method for encapsulating data packet based on Thread protocol to obtain IEEE802.11 physical frame

Publications (2)

Publication Number Publication Date
CN114338852A true CN114338852A (en) 2022-04-12
CN114338852B CN114338852B (en) 2023-09-29

Family

ID=81020093

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111666977.3A Active CN114338852B (en) 2021-12-31 2021-12-31 Method for encapsulating data packet based on Thread protocol to obtain IEEE802.11 physical frame

Country Status (1)

Country Link
CN (1) CN114338852B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101854736A (en) * 2010-05-18 2010-10-06 北京交通大学 Method for converting wireless sensor network protocols
CN102868647A (en) * 2012-09-26 2013-01-09 大唐移动通信设备有限公司 Data processing method and device based on Linux network core
CN105744011A (en) * 2016-01-25 2016-07-06 中国科学技术大学 MAC (Media Access Control) address scanning method based on Openwrt router
CN109246142A (en) * 2018-10-26 2019-01-18 深圳市通用互联科技有限责任公司 Data encapsulation method, router things-internet gateway and storage medium
CN109450875A (en) * 2018-10-23 2019-03-08 清华大学 MAC layer packaging method and device
CN111480320A (en) * 2017-12-14 2020-07-31 谷歌有限责任公司 Wireless mesh access point with user space tunnel

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101854736A (en) * 2010-05-18 2010-10-06 北京交通大学 Method for converting wireless sensor network protocols
CN102868647A (en) * 2012-09-26 2013-01-09 大唐移动通信设备有限公司 Data processing method and device based on Linux network core
CN105744011A (en) * 2016-01-25 2016-07-06 中国科学技术大学 MAC (Media Access Control) address scanning method based on Openwrt router
CN111480320A (en) * 2017-12-14 2020-07-31 谷歌有限责任公司 Wireless mesh access point with user space tunnel
CN109450875A (en) * 2018-10-23 2019-03-08 清华大学 MAC layer packaging method and device
CN109246142A (en) * 2018-10-26 2019-01-18 深圳市通用互联科技有限责任公司 Data encapsulation method, router things-internet gateway and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
杨雷;王鹏;林开伟;: "Thread技术与电梯物联网" *
黄祥才: "《基于Thread 的智能家居无线传感网络系统设计》" *

Also Published As

Publication number Publication date
CN114338852B (en) 2023-09-29

Similar Documents

Publication Publication Date Title
KR101261637B1 (en) Method of transmitting MIH message during handover between heterogeneous networks
TWI425791B (en) Data transmission method in wireless mesh network and a-msdu format
Dely et al. Openflow for wireless mesh networks
EP3228123B1 (en) Efficient hybrid resource and schedule management in time slotted channel hopping networks
EP1886451B1 (en) Multiple wireless spanning tree protocol for use in a wireless mesh network
US8243623B2 (en) Combined device and service discovery technique in stations supporting tunneled direct link setup (TDLS)
TWI463834B (en) Procedure of setting up peer link in wireless mesh network and wireless station supporting the same
US20130301553A1 (en) System and method for wireless station bridging
CN104272836B (en) The apparatus and method compressed for control frame and management frame
US20080205385A1 (en) Data frame formats to improve groupcast efficiency in multi-hop wireless networks
US20130242843A1 (en) Wireless communication system, base station, and terminal
Ayoub et al. Towards ip over lpwans technologies: Lorawan, dash7, nb-iot
EP1886450A1 (en) A spanning-tree protocol for wireless networks
WO2015161767A1 (en) Service discovery method and electronic device
WO2019183919A1 (en) Method and apparatus for converged networking
CN103200283B (en) The implementation method of many relay wireless communications system and this Systems Air Interface IPization
JP6373987B2 (en) Apparatus and method for MAC header compression
US20130097336A1 (en) Method, terminal and gateway for transmitting ipv6 packet in ipv4 network
US20110032842A1 (en) System, apparatus and method for seamless roaming through the use of routing update messages
WO2012106935A1 (en) Data communication network configuration method, gateway element and data communication system
KR20140069307A (en) Systems and method for reduced power wireless communication
WO2022205234A1 (en) Communication method and apparatus
WO2018210114A1 (en) Wifi network, and networking method therefor and data transmission method therein
CN106533503A (en) Method and device for power line network communication
CN106688304B (en) ZigBee system management using TR-069 enabled CPE agent

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant