{'fraction_non_alphanumeric': 0.02613280354550317, 'fraction_numerical': 0.004966760907771071, 'mean_word_length': 5.056455344747802, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Inter-Network Crosstalk and Communication Solutions for Self-Adaptive Nodes Build Self-Organizing Network

When there are multiple ZigBee wireless sensor networks in the same area, in order to solve the problems such as mutual interference between the transmitted information of these subnetworks, abnormal parameters of coordinator network construction, and disorder of network access between nodes, an improved communication method between ZigBee sub-networks is proposed. Compared with other traditional algorithms that show in the simulation results, the improved algorithm mechanism is more reasonable in network topology and transmission path. Each node can evenly share the network energy consumption, making the network run longer. In practice tests, several sub-networks composed of several improved algorithms are used to verify the feasibility of this method.


Foreword
ZigBee [1] is a short-range, low-power wireless communication technology [2]. It has features such as low cost, short delay, high capacity, and high security, as well as flexible and reliable self-organizing network construction capabilities. It has been widely used in fields such as agricultural planting, forestry monitoring, smart home, modern transportation and industrial control.
Although ZigBee has good ad hoc network characteristics and network self-healing capabilities and supports multiple network topologies, there are still a series of problems in terms of networking, node restart, and coexistence of subnets. Literature [3] proposed a simple and practical method of home networking, which can ensure that the nodes join the designated network according to regulations when the network is established, but cannot ensure that the coordinator and nodes can correctly join the specified network after the node is powered off and restarted. Literature [4] proposed a largecapacity Mesh networking solution. However, only one PAN (personal area network) network is set up, so the node size in the network is bound to be limited and it cannot meet the requirements of largescale deployment.
According to the Z-Stack protocol stack, a protocol stack improvement method based on node types, network PANID (personal area network identifier), channel switching, and network state storage is developed to solve the ZigBee network. Uncertainty in the networking, abnormal powerdown and restart, inter-network crosstalk, and inter-network communication issues improve the reliability and stability of the ZigBee network. In this paper, according to the Z-Stack protocol stack, a protocol stack improvement method based on multiple types of parameters such as node type, network PANID (personal area network identifier), channel switching, and network state storage is developed. This method solves several problems in the ZigBee network such as disordered networking, abnormal power-down and restart, inter-network crosstalk, and inter-network communication, it improves the reliability and stability of the ZigBee network.

Descriptions for the problems
In practical applications, ZigBee networks still have a series of problems. For example, unexpected restart of the coordinator will cause the node to create a new PAN network according to the original procedure. If it detects a PAN network with the same parameters at this time, it will change the PANID according to the ZigBee protocol to create a new network, making the original coordinator node in the network not only unable to rejoin the original network after an unexpected restart, but creating a new unpredictable network. In addition, if there are more than two ZigBee PAN Networks exist at the same time in the current area, the new nodes will also get into the network abnormally. What's more, in large-scale wireless sensor network applications, it needs Multi-subnets not only interfere with independent work but also work together when necessary. This paper improves the Z-Stack protocol stack to solve the above problems. It can not only maintain the original ZigBee network structure without adding additional hardware devices, and it will not add extra energy consumption to the ZigBee network.

Z-Stack and Ad Hoc Networks
Z-Stack is a ZigBee protocol stack released by TI and implements most of the characteristics of the ZigBee protocol. It has become a designated software specification approved and promoted by the ZIGBEE Alliance. After the Z-Stack coordinator is established, the new node will complete the network construction in a self-organizing manner. Figure 1 shows the node self-organizing network flow chart [5]

Improved Optimized Network
The ZigBee coordinator will determine all the parameters of the network when it starts to set up a new network. The key network parameters are: PANID, channel number, channel mask, channel energy and startup options. The unpredictable change of network status parameters when establishing a new network is the fundamental reason of disorder in the network and crosstalk between networks. If the coordinator successfully sets up the network according to the preset parameters and each routing node and terminal node also join the network according to the preset parameters, then the networking at this time is in order and the network parameters are clear. This will provide a good foundation for the inter-network crosstalk and inter-network communication performance.

Establishing an Anti-interference Network
Before compiling the Z-Stack stack, several key macro definitions of "HOLD_AUTO_START", "xREFLECTOR", "NV_RESTORE", and "NV_INIT" need to be added. After the network construction process starts, the network layer will request the Media Access Control (MAC) layer to perform energy detection scanning on the specified channel or the default channel for the -DDEFAULT_CHANLIST parameter in order to select an appropriate channel to establish the network. Then PANID is determined, if ZDAPP_CONFIG_PAN_ID is defined as 0xFFFF, the coordinator will establish a random PANID (0~0x3FFF) according to its MAC address. If ZDAPP_CONFIG_PAN_ID is not defined as 0xFFFF, the PANID of the network will be determined by ZDAPP_CONFIG_PAN_ID [1]. To avoid conflicts with the PANIDs of other networks in the same area, ZDAPP_CONFIG_PAN_ID should be set to the lower 16 bits of the ZigBee device MAC address. In addition, if a low-probability event occurs: the PANID determined by the lower 16 bits of the MAC address of the ZigBee device is exactly the same as the PANID of the same area, then press the button of the coordinator of the pre-existing network in this area, and broadcast notifications perform a collective change of network parameters. This way of avoiding conflicts, the workload is minimal. The detailed function operation for performing the collective synchronization of network parameters changes as shown in Figure 2. After the Z-Stack coordinator waits for more than one routing node to join in, it changes the coordinator node's startup parameters to the routing node type and saves it in the boot area, and then performs a soft-start or waits for the equipment to power off and restart. The specific operation is as follows: change the node type as the logical type to ZG_DEVICETYPE_ROUTER; change the start identifier startoption to ZCD_STARTOPT_AUTO_START; execute zb_ WriteConfiguration () to save the startup parameters to the NV (nonvolatile) storage area. The purpose of this is to ensure that the coordinator node can still join the original network after an unexpected restart. In practice, it is found that after the network is created, the coordinator has basically no difference in its status and functions and routing nodes.

Internet Communication
ZigBee allows PAN subnets to exchange data in a restricted, non-secure, and anonymous manner. The communication function between PANs is performed by the Application Support Layer (APS). The data exchange between PANs is handled by the application support sub-layer (Stub APS) in the form of an Inter Service Access Point (inter SAP), it has the same position with the common Applications Support Sub Layer Data Entity Service Access Points (APSDE-SAP). Specific operation steps here: add the Inter_PAN compile option, the stub_aps.c and stub_aps.h files. The steps to complete the inter-network communication are as following: (1) StubAPS_ RegisterApp () initialization; The initialization of different tasks in GenericApp_Init () must strictly comply with the following method to ensure the smooth construction of network, network, and network communication.
Void Finally, add the "StubAPS_Init (taskID++)" initialization function and the StubAPS event named "StubAPS_ProcessEvent". You also need to call StubAPS_RegisterApp (&GenericApp_epDesc) to register the port number of the user layer to Stub APS. In this way, the application layer of the Z-Stack protocol stack will receive data packets from PDUs transmitted from the Stub APS.

Network authentication
Two common PAN networks A and B are built. Among them Ac, Ar and Ae represent the coordinator, router, and end node in the A network, similarly for Bc, Br and Be. The Light Emitting Diode (LED) of the network indicator of a node in the same network periodically flashes simultaneously as a flag of which nodes are included in the current network. The startup parameters of A and B networks are shown in Table 1. Power on and press the Network button of Ac, then press the network access button of Ar and Ae. After about 1~2 seconds, the network indicators on Ac, Ar, and Ae will begin to blink periodically, indicating that Ac, Ar, and Ae have formed network A. At this time, press the network access button of Br and Be, because of the different network parameters of Br, Be and A, so Br and Be will not be added to the network A. Press the network button of Bc, 1~2 seconds later you can see Bc, Br and Be network indicators are also beginning to periodically flash synchronously, but it is obviously not at a point of time with the flashing light in the network A. It indicates that the preset nodes in the network A and the network B have accurately joined their respective networks, and the network messages are accurately transmitted in the network. The data packet that is sniffed by ZigBee's USB Dongle network sniffer is shown in Figure 3. Address (Source Address) and MAC payload (Load Information) indicates this is an intranet beacon data with a PANID of 0x8888 and it successfully establishes a network B that is consistent with the preset parameters and sends it to the coordinator. The command is "CHANGE#LED1". However, the network beacon set in the program indicates that the data packet is a broadcast transmission, but the destination of the packet is a coordinator whose address is 0x0000, indicating that the terminal node does not have the ability of forwarding and broadcasting, and the data is ultimately owned by the parent having a routing function to complete the forwarding, broadcast and other operations. The command of broadcast "CHANGE#LED1" will flash all nodes LED1 of the entire network 5 times to verify the nodes contained in the current network. In the packet of the third line number 935, it can be seen that Dest.PAN is 0x5555, indicating that the network A has been successfully established and is consistent with the preset table 1. It is verified that this scheme can accurately establish a PAN network with accurate predictive network parameters and overcome the inter-network crosstalk problem.
After powering off and restarting individual Ac, Ar, and Ae devices in the network A, you can still see the network lights on Ac, Ar, and Ae blinking synchronously. The network B phenomenon is the same. It is verified that this method can effectively ensure that all nodes of ZigBee can still join the scheduled network accurately after a fault restart.
Grab PAN inter-network communication data packet as shown in Figure 4, in the first line of data packets, Dest.PAN, Dest.Address, Source PAN, MAC payload and other parameters indicate it is a broadcast packet which the PANID is 0x5555 network A sent to the PANID is 0x8888 network B, the command is "CHANGE#LED2". After receiving the packet, the inter-network message indicator of all nodes in network B will blink 5 times. The data packet sent from the network B to the network A is shown in the second line of Figure 4. It indicates Inter-network messages can be sent and received correctly.

Conclusion
This paper studies deeply the Z-Stack protocol stack, it analyzes and explores the causes of problems such as disordered networking, inter-network crosstalk, inter-network communication and restart anomalies in ZigBe's self-organizing network nodes, and explores a set of methods based on node types and networks PANID, channel switching and network status storage and many other solutions. And tested on the CC2530 platform for networking, in-network communication and inter-network communication under certain conditions, the test results verify the effectiveness of the scheme, which is versatile and has strong practical value.