Algorithms for composing communication protocols of wireless sensor networks with random access

. The work is devoted to solving the problem of applying information technology methods and tools to monitoring environmental parameters based on the Internet of Things concept, taking into account the uncertainty of information sources and the possibility of critical situations. The principles of construction, technological solutions and directions of development of environmental monitoring systems are analyzed. The advantages and disadvantages of the known approaches are revealed and the expediency of constructing mathematical models, methods and algorithms for compiling communication protocols of WSN wireless sensor networks with random access and corresponding information technologies for monitoring environmental parameters to ensure high performance, quality and survivability of their functioning is proved. Stochastic models of the functioning of wireless sensor networks have been improved, which made it possible to estimate the probability of signal collisions and design Internet of Things communication protocols more efficiently.


Introduction
With the accepted principles of implementing WSN wireless sensor networks, the correctness of the network operation is determined by the transfer of protocols from nodes to the base station (sink) without collisions. When searching for the simplest solution for the network in the sense of ensuring simplicity of implementation, rational cost of components (mainly nodes, taking into account the possibility of losses during operation), and above all in the sense of simplifying all procedures (simplex type communication, which means only a device transmitting on the node side), maximum saving of node power supply -all this, taken together, it means that many solutions imply the lifetime of the node. It is also necessary to take into account the limitations of the occupied radio band and the reduction of the network operation to work on a single carrier frequency.
These basic principles define solutions for the WSN network when using random access of nodes to the base station based on the PASTA model. It should also be emphasized that in order to perform the tasks under consideration, it is necessary to analyze the event in the radio space of the functioning of the nodes and its environment, taking into account possible external interference.
The most essential element of this analysis is that there are no collisions during the radio transmission of individual nodes in the network operation area. Since radio transmission is a transmission of a protocol in space that occurs at random periods of time, there is a possibility of at least two transmissions in time in such a way that the protocols are superimposed on each other at some time interval. This event is called a collision and physically means a complete loss of information from the nodes in the collision. Therefore, the essence of developing this method and determining the branches of its application is reduced to analyzing collision events, minimizing them and determining the probability of collisions in the context of proper network operation. One of the important components of this solution is the passage time of the � protocol.

Criteria for choosing the continuation time of the transmission protocol
Based on the consideration of the access technology of the solution under consideration based on the PASTA model, the protocol transit time ( � ) should be the shortest. The shorter it is, the less likely the collision is, and therefore the less likely the loss of information coming, for example, from measuring sensors. In turn, the protocol must contain all the necessary information related to the identification of the node, the sensor in the node and the required resolution of the sensors connected to the node. Certain necessary protocol elements are added to this, since identification in the network or a checksum (or redundant cyclic code). This allows you to control the correctness of the transmission. Such control is not necessarily related to a collision; it may also be due to external interference. In any case, the protocol should be maximally limited from unnecessary redundant information [1,2,4]. Limiting the protocol in time is also useful because of the energy savings that the node spends on radio transmission. This is important for the case when the node's lifetime is determined by the capacity of the power source. On the other hand, the protocol must be viewed from the side of the transmitted radio signal. Then the continuation time will be related to the type of modulation used (the number of significant states per bit of information), the signal spectrum generated for the accepted modulation method and the acceptance of modulation parameters in the context of an existing radio channel. These are important technical parameters of the WSN, which must be set for each type of solution of this type of network [7,10].
There are many criteria for the final determination of the continuation time of the communication protocol, and each time it is necessary to choose priority values for which final decisions will be made. This type of analysis is necessary for each solution of the proposed WSN network, but it is not possible in this paper to present even the majority of possible solutions. Therefore, the following example shows the problem of constructing a communication protocol, and further reflects the implementation of the waveform (modulation selection, spectrum analysis) transmitted by the node.

Transmission protocol
The listed justifications and prerequisites related to the proposed PASTA-based random access model are taken into account, as well as information about the design of protocols used in communication networks. Let's imagine the developed two protocols that can be used in the WSN network under discussion. The protocol designs are shown in Figure 1.  Figure 1. a) shows a protocol consisting of 16 bits. The protocol contains the following fields: Start (1 bit), node ID (node number) is a 5-bit field, and, therefore, allows you to implement a network containing 32 nodes, sensor ID in the node (sensor number) is a 2-bit field, therefore, we can identify 4 sensors connected to the node, 7-bit data field, which allows you to record 128 levels of values of the state of this sensor. The last field is the 16th parity bit, which allows you to control the correctness of the transmission. Figure 1. b) shows a protocol composed of 32 bits. The protocol has the following fields: Flag (4 bits), node identifier (node number) -a 7-bit field, and, therefore, allows you to implement a network containing 128 nodes, sensor identifier in the node (sensor number)a 3-bit field, so that 8 sensors connected to the node can be identified; A 12-bit data field that allows you to record 4096 levels of values of the state of this sensor, allowing you to get a high resolution of the transmitted data (for example, the measurement result). The last 6-bit field allows you to control the correctness of the transmission.
Using a 16-bit transmitting device with FSK modulation and 512 kbit/s binary bandwidth for protocol transmission, it turns out that the transmission time � of the protocol lasts about 32 mks. Similarly, using a 32-bit protocol and a providing device with a speed of 1 Mbit/s, the transmission duration is also 32 mks. In the further analysis related to the probability of collisions, which is the main part of this work, such a proper time � is accepted. Of course, this does not mean in any way that this is some special meaning of time. Every other value of the protocol passage time is also possible and the essence of the issue will not be violated.

Spectral properties
Theoretical generalizations and arguments on the topic of the continuation time of the communication protocol have another very important meaning. While waiting for the shortest transmission time for a given number of bits superimposed on the protocol, transmission devices with a large binary bandwidth should be used. However, the greater the bandwidth, the wider the bandwidth of the transmission channel. Below is a certain simplified solution about the necessary bandwidth for proper network operation. Such justification allows, in essence, to solve the problem of band allocation when using various types of modulation and serial production devices. For example, let's turn to the solution of using a provisioning device that works with FSK modulation. Then the transmission signal from the sensor will look like, as shown in Figure  2, and will consist of sinusoidal waves with two different approximate frequencies � and � , corresponding respectively to � logical zero (0) and � logical unit (1). Changes in significant states from 1→0 and 0→1 occur in compliance with the continuity of the phase of sinusoidal waves with frequencies f. The continuation time of sequences � and � corresponds to the length of the protocol and is � . The fact of the completed continuation time of the sine waves � and � has a decisive influence on the spectral width of the signal. Therefore, setting the required bandwidth of the radio channel requires determining the spectrum of the modulated signal for the selected FSK modulation.
A detailed definition of the spectrum of such a signal is quite difficult. To estimate the required bandwidth of a radio channel, the following justification can be used: it is assumed that the minimum required bandwidth of the channel corresponds to the width of the main "leaf" of the function � (x), which makes up the spectrum of a sinusoidal signal with a finite continuation time ( � ) (Figure 3). In addition, it is assumed (simplification) that the signal is inherent in the frequency f 0 , which is the average of the frequencies � and � . Ensuring phase continuity between state changes in FSK, i.e. � by � and vice versa, in this case, will not lead to a greater spread of the signal spectrum than is provided for by the finite (rather short) continuation time � . Let � , � be pulsations corresponding to � and � so that � � 2 � , � � 2 � and let The function f(t) under consideration is represented by the formula: The Fourier transform (spectrum) of F(ω), a function given by formula (2) is as follows: , � ℜ� As shown above, the bandwidth B of the transmission channel is taken as the width of the main "leaf" of the spectral density function � �.  Using the properties of the function ���� �, we obtain: It is accepted that where k ∈ N and means the number of complete periods of sinusoidal carrier waves. On the basis of (5) received � � �� � � .
(8) Estimating the bandwidth that is necessary for the implementation of transmission with the appropriate bandwidth, and, consequently, determining the time � essential for the operation of the network based on the PASTA model, in the future we will illustrate the corresponding dependencies with several examples.
The required binary bandwidth of the transmitter for 16-bit protocols ranges from 400 kbit/s to 800 kbit/s, and for 32-bit protocols it is twice as high. The required bandwidth for the FSK modulation in question is about 100 kHz. For such parameters, serial sensors are available and cheap, the main thing is in the ISM bands. Of course, the reduction in � time is quite significant from the point of view of using random access methods in WSN networks.
This improves the transmission quality (fewer collisions). There is a very large choice here, but you always need to take into account that by choosing a shorter protocol continuation time, you need to have a much wider bandwidth available. Decisions regarding WSN networks and applications are very different and are not always able to have a wide enough bandwidth for use. The very fact that the transmission in the whole network uses only one channel (simplex), and this is the main principle of this development, which allowed the WSN network to operate in different, even narrow bands with more scarce frequencies that are still at the disposal of users. Using channels in ISM bands is one of the most frequently used and not the best features. Unlicensed bands in any way make it possible to implement the network without problems (only sensor power levels apply to the restrictions imposed by the norms), however, work in these bands is subject to significant external interference that occurs from other users of these bands and there is no way to avoid this type of problems.
Of course, the best solution is to use licensed frequencies, but this is more difficult due to legal procedures and strictly defined use of the band. The estimates presented in the above table for different bands are also of practical importance. In addition, it should be remembered that this evaluation is performed only for the simplest type of FSK modulation. Currently, sensors have appeared on the market that it is advisable to offer for use in the WSN network and working with complex types of FSK, PSK and ASK modulations, which makes it possible to significantly (multiply) increase the binary bandwidth of the transmitter for the same available bandwidth B (for example, determined by the range of the licensed frequency). For each case, considering the choice of � , one should keep in mind the relationship between the available bandwidth (often superimposed) and the possible transmission rate (the binary bandwidth of the transmitter), which, in turn, can be applied by appropriate selection of the modulation used.
Each of the WSN networks used operates in the appropriate spatial conditions, burdened with many external factors that must be taken into account each time. The conditions for the propagation of radio waves and the choice of carrier frequency predetermined by them are associated with a direct impact on the design and overall dimensions of the nodes (we are talking mainly about the size of antennas and means of coordination), which often does not remain without significance for the construction of the corresponding network.

Spectral limitations
The space in which electromagnetic waves diverge in the translational sense of the body is the tele-translational impedance track of 377 ohms (in vacuum), to which everyone has access. In order to ensure an effective way, taking into account the interests of different parties in the use of space for radio broadcasting, the disposal of technically accessible spectrum between many users on a global scale should be put in order.
For radio waves, the borders of countries do not matter. So, there was an international organization called ITU-R (International Telecommunication Union -Radiocommunication Sector), the purpose of which is:  ensuring the rational, fair, efficient and economic use of the radio frequency spectrum for radio communication services,  adoption of radio communication recommendations.

Conclusion
ITU-R recommendations have been developed by administration experts, operators, telecommunications industry specialists and other specialists involved in radio communication affairs from around the world. The recommendations have been approved by ITU-R member States. Their implementation, although not mandatory, is accepted for implementation all over the world.
Thus, one of the main provisions of this study was the adoption of the principle of maximum bandwidth limitation for the operation of the WSN network. The adoption of this principle led to the development of simplex transmission on a single frequency for the entire network and laid the foundations for random access of nodes, in particular on the basis of PASTA, to the base station (sink).