THE SIMULATION OF P-PERSISTENT CSMA ALGORITHM OF UNEQUAL RANDOM MULTIPLE ACCESS

Context. The relevance of the simulation of p-persistent CSMA algorithm of unequal random multiple access is caused by importance of accounting personal node priorities for execution of adequate assessment of probable and time response characteristics of information transfer in designing widespread fieldbus-networks LonWorks, BacNet, etc. The aim of this work is to obtain analytical expressions for estimating probabilities of successful and failed node access to the channel, the transmission time information in the network with equal and unequal rivalry of nodes based on p-persistent and predictive p-persistent CSMA algorithms of random multiple access. Method. The method of probability theory has been used there to solve problems. The analysis of equal and unequal multiple access p-persistent CSMA nodes in the saturation mode of the channel by the transmission with a constant number of node-rivals has been executed. A method of estimating the time of successful transmission of information by the node through an average number of cycles of rivalry and probabilistic characteristics of the access nodes has been proposed. Expressions to estimate the necessary probabilistic and time characteristics were obtained: the average length of transmission and time of information transmission by the node, the effective bandwidth. The proposed method mainly differs from analogs by the possibility of characteristics estimation of information transmission given the manifold priorities of the network nodes, which improves the accuracy of the performed calculations. Results. The analytical expressions have been received, quantification and analysis of probabilistic and temporal characteristics of information transfer in a network with equal and unequal random multiple p-persistent CSMA access has been performed. Conclusions. The simulation results of equal and unequal rivalry network channel illustrate the importance of taking into account individual priorities of the nodes in the network. The feasibility of using access priorities is the need to transfer important information on the background of universal low-priority data. The significance of the results is to perform an adequate quantitative assessment of the characteristics of information transmission in a channel with equal and unequal parties.


NOMENCLATURE
CSMA -an algorithm of unequal random carrier-sense multiple access; BL -predicted load on channel (backlog); c, C -nominal and effective carrier capacity of channel in the network; d к , d у -an average number of access slots with collision and at successful transmission; у l d -an average number of access slots for a successful node transfer with l-priority; D -a probability function of selection by the node with priority r ≠ l of the winning node, of slot >s; E -an average number of access attempts until successful transmission; I -an function that determines whether a node with priority l, slot s < l; k -an access number leading to successful transmission; l, L -number of priority access slots of the node and a plurality of slots of network nodes; ln -information packet length in bits; m, M -number of messages in the node and the set of messages in the network nodes; n -number of nodes in the network; p к , к Т -an average time of successful information transfer by one network node; Т l -an average time of successful transfer of the information packet by the node with l-priority; Т m -an average time of successful transmission of m information messages from the node queue; Т п -an average duration of successful transmission of the information packet; W, W base -the current and base width of access window (race) X, Y -sets of parameters and characteristics of observations; 1

INTRODUCTION
The wide prevalence of random multiple access algorithms in industrial fieldbus networks is caused by the potentially high efficiency of transfer channel capacity usage and low time of information delivery in the transmission of sporadic traffic, as compared with deterministic algorithms. A variety of modifications of the probabilistic algorithms of unequal random carrier-sense multiple access CSMA is caused by different efficiency of information transmission depending on: channel occupancy, the number of nodes in the network, regular/sporadic traffic and other parameters. Such access algorithms are widespread: CSMA/CA (CAN, KNX/EIB, DeviceNet networks), 1-CSMA/CD (EtherNet/IP, ModBus/ TCP), predictive p-Persistent CSMA (BacNet, LonWorks). Literature analysis [1][2][3][4][5][6] shows the high efficiency of p-persistent CSMA access algorithms adapted or selfadapting (predictive) to the changing network channel load. The problem of using this algorithm in an industrial network is caused by several factors. Firstly, the small elaboration of the methods and the low accuracy of the quantitative assessment of the information delivery performance and warranty do not allow develop real-time networks. Secondly, the methods of analyzing the characteristics of networks with unequal participants, which limits the effectiveness of the algorithm in the transfer of technological information of varying importance (priority): controlling, regulation, signaling, measurement, data, are practically not worked out. This significantly reduces the efficiency of the p-persistent CSMA algorithm. The solution of the problems actualizes the study of the issues of upgrading of the known and creating new models of the algorithm and methods for analyzing the characteristics of information transmission in the network.
The object of the research is the algorithm of unequal random multiple access p-Persistent CSMA nodes to the shared transmission medium.
The subject of the study is models and methods for evaluation the probabilistic and temporal characteristics of information transfer in the network with the analyzed algorithm.
The aim of this work was to develop a method for evaluating the characteristics of information transmission in the network with the algorithm p-Persistent CSMA, characterized by a set of parameters {c, n, M, L, W, BL, ln, 1 β , 2 β , 3 β }: the probability of successful p у and unsuccessful p к access of nodes to the channel, the average time T of successful information transmission, the effective carrier channel capacity C.

PROBLEM STATEMENT
Let there are a complete set of observations <X, Y>, where X is a set of observation parameters, Y is a set of characteristics. The set of parameters and characteristics of the observations can be represented as arrays: Since the parameters of {x q } observations take discrete values, the evaluation of particular probability characteristics of {y q } can be performed using the probability multiplication theorem. Since the set of observations is finite and formed by a complete group of events, and observations are equally probable, the evaluation of the general probabilistic characteristics p q for the groups of observations can be performed in several ways. The first method is based on the classical definition of probability, according to which the probability of an event is the relation of the number of favorable elementary outcomes to the total number of all possible outcomes. The second method is based on the use of the formula of total probability and Bayes′ rule that allow to calculate absolute p and conditional p′ probabilities of events. This method is preferable because of the complexity of direct calculation of probabilities in solving problem. In this case, the evaluation of the average values of the observation characteristics can be obtained by superposition of their individual values, given the conditional probabilities of the outcomes:

REVIEW OF THE LITERATURE
The analysis of networks with different algorithms of random multiple access in the literature is execute mainly with the use of classical Queuing systems with repeated calls (as a result of loss or lack of response). Such works include publications of famous Russian authors: A. A. Nazarov [7,8], I. I. Khomyakov [9], S. N. Stepanov [10]. Because of the specificity of access algorithms, the results of the work are mainly applicable to the analysis of networks with 1-persistent CSMA/CD access algorithm used in Industrial Networks Industrial Ethernet, ModbusTCP, EtherNet / IP, HSE, ProfiNet, Interbus-TCP / IP, etc. Taking into account the functioning peculiarities of the studied protocols p-persistent CSMA with and without loading is performed in the works of the authors Moshe Kam [1], M. Miśkowicz [2,3], P. Buchholz and J. Plonnigs [4], S. A. Dadenkov's [5]. The analysis is performed using the apparatus of probability theory and discrete Markov chains.
The research of p-persistent protocols of the CSMA family in [1][2][3] was performed in the mode of channel saturation with information transmission by a constant number of network nodes. The models and methods of analysis constructed as a result of researches allow to execute an assessment of the top level of information transmission delay in the network. The models take into account the set of algorithm parameters [6]. To obtain more accurate estimates of probabilistic and temporal characteristics of the network with sporadic nature of the information load in the works [4,5], were suggested the models considering the dynamics of changes not only in the Protocol parameter of the width of the access algorithm window, which is characteristic of the works [1][2][3], but also the number of messages and nodes-rivals for the communication channel. From the literature [6] there is well known the possibility of using the priorities of access nodes for the information transmission of different importance. The small elaboration of this issue and the absence of models and methods for assessing the characteristics of networks with unequal access of nodes limit the possibility of applying the procedure in practice. This actualizes the solution of the tasks set in the work.

MATERIALS AND METHODS
The algorithm of random multiple access p-persistent CSMA is characterized by pseudo-constant level of persistence p nodes of network, determined by the ability to start transfer to one of the temporary access slots. The predictive p-persistent CSMA Protocol is characterized by a variable persistence level, changing according to the load predicted for the communication channel. Regulation of probability p of beginning of transfer by a node in a wide range [0.0625..0.000976] allows to reduce probability of collision at increase of loading on the network channel and to reduce time of access at decrease in loading of the channel. Load prediction is carried out by distributed evaluation by the nodes, where "response" network traffic expected to transfer according to the data of the field delta_backlog package.
Access nodes to the channel according to the algorithm p-persistent CSMA is performed in burst (packet) cycles. Cycles are divided into free and busy packets. A busy packet cycle represents the channel access time and packet transfer time ( fig. 1).
The algorithm of access to the channel includes the following steps ( Fig. 1) [6]: 1. Testing channel activity. The node monitors the state of the channel and moves to the next step when there is no activity in the channel.
2. Minimum inter-packet access interval. The node waits for the time inter-packet interval в 1 to determine that the channel is free.
3. Priority access interval. The node waits for a fixed number of priority time slots l, which each duration is 2 β . A A lower number of access slots correspond to the highest priority. Priorities for access are used only after employing burst cycles [6].  .64]. The access slot length determines the adaptive (for predictive) probability level of node beginning transfer p=1/W. 5. Testing channel activity and transmission package. The node starts transmission if the channel is free and suspends it on the next packet cycle otherwise. Packet transmission delay is to product of the packet length ln in bits and the transfer time of one information bit 3 β , inversely proportional to the carrier capacity of channel. When several nodes choose an equal number of temporary (priority and random) slots, the transfer results in a collision that damages the packets. The packets involved in the collision, depending on the service transmission will be lost or require retransmission. The algorithm with prediction at collision increases the load level, and in a successful and free cycle decreases by 1 [6]. Let us analyze the communication rivalry of nodes according to the algorithm of multiple access p-persistent CSMA in saturation mode, but taking into account the priorities of nodes not previously analyzed in the known works. Saturation mode is characterized at every moment by competition for the channel of n nodes, each of which has an individual number of priority slots l and contains m≥1 messages for transfer.
where E -is the average number of access attempts for a successful transmission; τ -is the average duration of the burst (packet) cycle, regardless of the type (successful/ unsuccessful); delay 0 τ = 0 for saturation mode, while the stochastic transfer о 1 τ τ β ≤ − . The number of access attempts E is unique for each node and depends on the number of priority access slots l i of nodes-rivals per channel.
The probability of successful transmission can be determined by the sum of the probability of winning of n nodes with different priorities l belonging to the set L: where у1 l p is the probability of successful access and transmission by one node with l-priority.
• In a channel with no or equal priority of nodes, the probability of successful transmission does not depend on the priority and is determined only by the number of nodes-rivals: The probability of an unsuccessful (collision) in saturation mode of the network channel: 1 .
The probability of successful transmission of the node 1 l у p with an l-priority passing on an access attempt (in a burst cycle) with a number k is determined by the product of event probabilities: -the node hadn't been winning the rivalry before attempt with the number k; -the node won the rivalry on the access attempt k: In that case the average number of transmission attempts by the node E with the l-priority: Multiplying both sides of the expression (6) by the value, we obtain: The expression difference (6) and (7) determine the average number of attempts of node access with an l-priority: The expression (8) contains an infinite geometric series, so: The average number of attempts before a successful transmission by nodes without regard to the priority level of a node can be defined as the arithmetic mean: The average number of attempts before a successful transmission by nodes without regard to the priority level of a node can be defined as the arithmetic mean: To assess the probability of successful access of the node with an l-priority in the burst cycle with the time slot length W, let us analyze rivalry of n nodes with different priorities in the field of access with the number of time-slots equal to the sum of the number of priority l and random d slots (for example, the slot width W = W base = 16) ( fig. 2).
The duration of the rivalry between the nodes for access to the channel is limited by the number of time slots W free burst cycle, regardless of the priorities of the nodes. This limits the number of random slots that can be used to organize successful transmission of information by nodes: {l+1 ... W-l min }, where l is the number of priority slots of the node, l min is the minimum number of priority slots of the node of analyzed network. Thus, the width of the random access range does not change and remains equal to W-l min (for convenience in work W). In the access field of nodes with the number of priority slots greater than 0, access slots appear, the use of which cannot lead to a successful transmission. These slots are the initial slots s ≤ l and the final access slots s > W-l min ( fig. 2, l=4, l min =0). This should be taken into account when calculating the probabilities of successful access of nodes with different priorities. Further analysis of the mechanism of slot access is advisable to perform for slots, the number of which starts with 1. Therefore, if the value of l min exceeds 0, the shift "to the left" is necessary and renumbering of priorities of all nodes to the value of l min according to the rule l = (l old -l min + 1), l oldthe old number of access slots of the node. The value of the l min shift must then be taken into account as a constant component of the number of network channel access slots.
The probability of a node's successful access to a channel is the sum of the probability The probability , у1 l s p selecting by the node a slot number s, provided that the node wins on this slot, is determined by the joint execution of the next conditions: -the winning node has a choice of slot number s≥l; -the winning node with priority l selects one slot from W; -other nodes with priority l select one of the (W -s) of later slots; -other nodes with priorities other than l select one of the later slots: where the indicator function I (s ≥ l) considers the inability of choice by node with priority l of a slot with absolute number s < l ( fig. 2), probability function D (s > r) of selecting by nodes with priorities r, different from l winning node, of slot with number > s: The expression (3) to assess the probability of successful transmission in the channel takes the form: Particular type of the expression of the probability of a successful transmission regardless of the type of priority: The average number of burst cycles (9) before a successful transmission by node with l-priority, considering (12): The expression (17), without regard to the priorities of the nodes-rivals: The average length of the packet cycle in (1) at the width of the access window W is the sum of the lengths of the successful and failed packet cycles, taking into account their probabilities: where у τ , к τ -average length of successful and unsuccessful packet cycles, where l min is the minimum number of priority access slots of a network node, d у is the average number of slots in which a node wins a rivalry; d к is the average number of slots at the collision; п τ is the packet transmission duration The average number of slots in an unsuccessful access is determined similarly (21): -the possibility of participating in collision of different numbers of i= [2..n] nodes-rivals for the network channel.
Thus, an expression to evaluate the probability of a collision on a slot with a number s: The application of the proposed expression (27) in practice is complicated by the realization of the procedure of search of various combinations of i-nodes in collision and (n-i) nodes not in collision with different levels of priorities l. Therefore, an expression can be used to evaluate this value, regardless of the priorities of the rivalry-nodes: The expression (28) allows to obtain the upper estimation of probability of collision on slot s for the scenario of rivalry of n nodes with different levels of priorities. To define more precisely the value of the probability of collision should be taken into account for each slot s access the maximum number n of rivalry-nodes.
The expression (19) for estimating the duration of a burst cycle takes the form: Average time of successful transmission of one information packet by a node with l-priority, taking into account delay of messages transmission of other n-1 nodes: For the channel network, regardless of or equal to the priorities of the nodes, the expression (31): The average transmission time of any node message with queue m ≥ 1: The effective network capacity, which shows the number of packets successfully transmitted per unit of time, inversely proportional to the duration of transmission: The performed analysis allowed us to obtain analytical expressions for estimating the main probabilistic and temporal characteristics of information transmission in the network channel with the algorithm of unequal random multiple access p-Persistent CSMA in the conditions of unequal rivalry between n nodes with individual l-priorities, and the width of the access window.
Packet transmission over the network with the predictive p-persistent CSMA access algorithm is accompanied by a dynamic change in the width of contention window W, and hence the transmission characteristics. Analytical models of dynamic change of window width and methods of estimation of characteristics of information transmission in saturation mode are offered in works [1][2][3]. The work [5] proposes a multidimensional discrete Markov chain describing the sporadic process of formation and transmission of information messages by nodes, considering the change not only in the width of the access window, but also the number of rival nodes per channel and messages for transmission. The use of the proposed expressions for assessing the characteristics of unequal rivalry in these models will improve the accuracy of calculations. The ongoing study of access priorities at the constant width of the contention window W is aimed at evaluating the effectiveness of the mechanism of unequal access of the algorithm p-persistent CSMA.

EXPERIMENTS
Study of the effectiveness of the unequal access of the algorithm p-persistent CSMA is performed in the saturation mode of the network channel. The estimation and comparative analysis of probabilities of successful and unsuccessful access of nodes to the channel, time of information transmission at equal and unequal rivalry in a network with different number of nodes are carried out. The initial data of the experiments and evaluate the characteristics shown in table 1.  The average length of successful transmission through the communication channel, taking into account possible collision, is determined by (32), but taking into account the full probability of successful access:

RESULTS
The of the rivalry window W. The legends of the graphs contain quantitative values of the probability of access to the channel by one and all nodes with a certain priority, the probability of collision. The analysis of the results will assess the potential efficiency of using access algorithm priorities to reduce the probability of collision, as well as reducing the probability of successful transmission for nodes with low priorities. The results of estimating the average time of successful T п transmission in a network channel with equal and unequal nodes (experiment 1 and 2) are given in table 2. The analysis of taken results will allow to estimate the potential increase of the effective capacity C from the channel by reducing the probability of collision between the p к and unequal access.

DISCUSSION
A comparative analysis of probabilities of successful and unsuccessful information transmission at equal and unequal rivalry between the node slots of the window ( fig.  3, fig. 4) illustrates a reduction in the probability of a collision p к in a channel using access priorities. For experiment 1, the relative decrease in the probability of collision was ≈ 16% (from 9.18% to 7.66%, fig. 3), but with the increase in the number of nodes (experiment 2, fig. 4) reached ≈ 33% (from 25.79% to 17.07%). Reducing of collision probability in unequal rivalry achieved by the redistribution of probability of access in a time slots of rivalry window. Separation of access of rival nodes on initial (1-4) slots, which account for the greatest probability of collision ( fig. 3a, fig. 4a), contributes to the organization of successful transmission nodes with high priority (fig. 3b, fig. 4b, fig. 5). The displacement of the rivalry nodes from the initial slots leads to the appearance of probability peaks of collision on slots s = 3, 5 with an increasing number of nodes-rivals on the channel ( fig. 3b, fig. 4b). The tendency to decrease the probability of a collision with an increasing number of the access slot is maintained due to reducing the probability of a collision of packets on later slots.
Predictable feature of unequal rivalry is essential difference of probabilities of successful nodes access to the channel, hence time of information transmission. Analysis of graphical dependencies ( fig. 3b, fig. 4b) illustrates a small difference in the probability of successful access of nodes with different priorities on the slots of the contention window W. However, the analysis of the absolute values of the access probabilities у1 l p of l-priority nodes shows the opposite. In the first and second experiments, the probability ratios for nodes with extreme priorities (0 and 4) are 3 (48.19:15.57) and 10 (18.64:1.86), respectively, against 1 for equal competition. So that, the access time for successful transmission of low-priority nodes is also 3 and 10 times different from high-priority nodes. The difference in the probability of successful access , у1 l s p ′ of nodes with different priorities for slots is clearly illustrated in figure 5. A significant difference in access probabilities was found on the initial and final slots. However, the degree of significance of the final slots of the access is low due to the smallness of the absolute value of the successful transmission probability (<1%) (fig. 3b, fig. 4b). On the middle slots of the contention window ( fig. 5) there is a low differentiation of access probabilities of nodes with different priorities. As the width of the rivalry window W increases, access probabilities "blur" (fig. 5), which reduces the differences between high-and low-priority nodes and without priority nodes. There is also an abrupt reduction in the difference between unsuccessful equal and unequal access. The ratio of probabilities of successful access of high-and low-priority nodes decreases rapidly to 2 and below. The obtained result at W=16 is due to the high ratio of the number of priority access slots l=4 and the window width.
The disadvantage of reducing the probability of collision with a small width of the window W, besides to differentiating the probability of access of unequal nodes, is the increase the number of temporary access slots for successful transmission of information compared to equal rivalry. For example, for experiment 2 (W=16), the number of successful/ unsuccessful access slots, with equal and unequal rivalry is 2.09/2.30 and 3.28/4.46, accordingly. The increase in the number of slots leads to an increase in the delay of access and information transmission. However, the increase in the number of slots of unequal access is accompanied by a decrease in the probability of collision. The results of the assessment of the opposite influence of given characteristics of unequal access on the time of information transmission T п are compared with the indicators characteristic of equal access in table 2 at different widths of the contention window W. The analysis of the obtained results evidences the privileged influence on the transmission time of the number of access slots. The achieved reduction in transmission time by reducing the probability of a collision does not exceed the increase time access due to the increased number of time slots. A minor exception is observed only in the second experiment at W=16. Thus, the transmission time of the information packet on the network channel is less for equal access. This ensures more efficient use of the bandwidth of the channel with the transmission of a large amount of useful information per unit of time. All the conclusions obtained in the work are also valid for the rivalry of nodes with a minimum number of priority slots other than 0. Comparing the unequal rivalry of nodes with the same rivalry, but with the priorities of nodes shifted by l, illustrates the equality of the absolute probabilistic characteristics of access, but a significant increase in the number of access slots, which increases the delay in the information transmission.
The analysis of the experimental results illustrates the expedience of using access priorities of the p-persistent CSMA algorithm to organize cycles of important information transmission against the background of the transfer of generally significant low-priority data. In this case, a reduction in the probability of collision is achieved and the time of information transmission is less than with equal rivalry. Unequal rivalry can't be used to increase the effective use of the bandwidth of the channel, due to the increase in the number of slots and, accordingly, the access time.

CONCLUSIONS
The article analyzes the algorithm of access to the transmission medium p-persistent CSMA. The review of publications and literature sources revealed the relevance and insufficient elaboration of the problem of quantitative estimation of probabilistic and temporal characteristics of information transmission in networks with unequal access on the basis of the analyzed algorithm. As a result of the analysis, analytical expressions are obtained for assessing the probability of successful/unsuccessful access and the time of information transmission considering the diverse priorities of nodes. Experiments are performed and the comparative analysis of equal and unequal rivalry of knots for the network channel is executed. The conclusions about the importance of taking into account the priorities in the network with the method of access are drawn. The expediency of using access priorities for organization of cycles of important information transmission against the background of general-purpose low-priority data transfer is noted. Obtaining adequate quantitative estimates and conclusions of the use of priorities in the sporadic nature of the information load requires additional research, for example, using the model [5]. The practical significance of the obtained results lies in the possibility of quantitative assessment and design of network channels with unequal random multiple access type p-persistent CSMA with specified probabilistic and temporal characteristics of information transmission.