# Design and Modeling of Self-Adapting MAC (SaMAC) Protocol with Inconstant Contention Loss Probabilities

Authors: Ante Kristić; Julije Ožegović; Ivan Kedžo
Journal: Wireless Communications and Mobile Computing
 (2018)

---

## Abstract

Networks based on IEEE 802.11 standard are one of the main options for deployment in industrial environment. Degradation of throughput in congested networks and short-term unfairness are well-known drawbacks of 802.11 DCF and similar MAC protocols. Those shortcomings represent significant limitation in forecasted growth of wireless usage. This is especially important in industrial wireless networks (IWN) where the scalability of wireless MAC is one of the main requirements. In this paper, a novel self-adapting MAC protocol (SaMAC) is defined and mathematically modeled. SaMAC employs constrained countdown freezing enhanced with shifted window mechanism. As a result, the protocol outperforms 802.11 DCF standard as well as shifted contention window (SCW) and constrained countdown freezing (CPCF) protocols in achieved throughput, fairness, and jitter, while keeping simple implementation. Despite protocol’s simple design, it is shown that its mathematical model is extremely complex. For proposed protocol, the assumption of constant contention loss probability, which is normally used for modeling of MAC schemes, does not hold. In the presented multidimensional Markov chain model, a unique iterative method for determining contention loss probability is developed as well as a method for throughput calculation based on such a chain. Accuracy of the presented model is verified in several network scenarios. Considering the performance of the proposed protocol, authors believe that it could be of benefit to deploy it in heavily loaded wireless networks with timing constraints, such as IWNs.


---

## Body

## 1. Introduction

Due to their attractive properties, wireless networks with distributed Medium Access Control (MAC) are being increasingly deployed, and this trend is expected to continue in the foreseeable future. Well-known instance of such network is Wireless Local Area Network (WLAN), specified in IEEE 802.11 standard [1], which uses Distributed Coordination Function (DCF) for distributed medium access. Other examples of networks with distributed MAC include Wireless Sensor Networks (WSNs) [2], Vehicular Ad Hoc Networks (VANETs) [3], and Wireless Personal Area Networks (WPANs) [4]. Hence, multitude of distributed MAC protocols has been proposed in the literature, along with various enhancements of existing protocols.Besides networks based on IEEE 802.15.4 specifications, wireless networks based on 802.11 standard are one of the main options for industrial wireless networks (IWNs) [5, 6]. While the DCF function from 802.11 generally offers formidable results, it does have certain weaknesses. Its short-term unfairness [7] and throughput degradation in highly saturated networks [8] have been well documented in literature. Furthermore, considerable increase of delay and jitter caused by MAC-level retransmissions in congested networks make DCF unsuited for critical real-time traffic [9]. Consequently, various protocols that try to address these issues have been proposed. However, it seems that most of the developed protocols focus only on fixing one of DCF’s drawbacks [10–12], while preserving or even worsening the other [13–15]. Other protocols, like idle sense [16] and quadratic backoff [14], improve DCF’s fairness, while obtaining the same or slightly higher throughput.In this paper we concentrate on the mentioned shortcomings of 802.11 standard, by designing a new MAC protocol that offers higher throughput and fairness as well as lower jitter compared to 802.11 DCF, making it better suited for industrial deployment. Furthermore, achieved reduction of collision occurrences avoids unnecessary waste of energy needed for data transmission and reception, extending the lifetime of battery-powered devices.The presented protocol, named self-adapting MAC (SaMAC), is based on the use of constrained freezing mechanism [17] and shifted contention window [18]. Constrained freezing reduces collision memory effect which was detected in DCF type of medium contention, offering higher throughput compared to DCF once the number of stations increases. On the other hand, use of shifted contention window (CW) forces selection of new backoff counter (BC) values from low priority window, for both winning stations and stations which are in the countdown for more than specified number of consecutive contentions. Presented SaMAC protocol does not employ any CW management algorithm and uses fixed CW, which is shifted from zero and is common for all active stations. This considerably increases protocol fairness compared to other MAC protocols. The increase in fairness is not accompanied with decline of the throughput, which is usually the case. On the contrary, SaMAC increases the throughput as well. Protocols like DCF need to experience a collision in order to react to increased network congestion by adjusting their CWs. Despite not using any CW management algorithm, SaMAC proactively responds to increasing levels of network congestion by prolonging the average time a station needs to access the medium, lowering number of collisions in the network and demonstrating self-adapting nature of the proposed protocol.Extensive analysis of the proposed protocol was done through design of the mathematical model. Most MAC protocol models presented in the literature are based on the assumption that, from the observed station’s point of view, the probability that some other station starts transmission, i.e., the probability of contention loss for the observed station, is constant and independent of observed station’s state and of other stations. The validity of this assumption has been verified analytically [19] and experimentally [20] for 802.11 DCF, but for other protocols it is simply justified by the model’s accuracy [20].However, model of the proposed SaMAC protocol based on the mentioned approach produces significant errors. This has led us to completely reexamine the modeling method in order to identify the source of discrepancy. Surprisingly, it is revealed that the assumption of constant contention loss probability does not hold for our specific protocol design. In order to create an accurate model, completely new modeling approach was developed. While still based on multidimensional Markov chain, our model determines the probability of contention loss individually for each state of the Markov chain. This is done through novel iterative concept, based on the predictable pattern of countdown during a single medium contention. With the appropriate changes in the structure of the underlying Markov chain, the presented iterative modeling approach can be used for modeling of any protocol for which the usual assumption of constant contention loss probability is not true.The paper is organized as follows. Deployment of 802.11 networks in industrial environment is commented on in Section2. 802.11 DCF protocol is presented as a basis for development and comparison with other distributed MAC protocols. Two protocols of interest, SCW and CPCF, are also presented in more detail. In Section 3, self-adapting MAC (SaMAC) protocol is defined. In Section 4, the need for new approach in modeling of SaMAC protocol is demonstrated and model of SaMAC is defined. In Section 5, a custom simulation tool and mathematical model of SaMAC are verified. Performance characteristics of the presented protocol are evaluated by comparing its results with other protocols in Section 6. Finally, in Section 7 we draw conclusions and indicate future work.


## 2. Related Work

### 2.1. IWNs and IEEE 802.11 Standard

Wireless networks have been identified as an attractive option in distributed control systems, automation, and monitoring [22]. They offer flexibility, easy deployment, increased mobility, improved efficiency, and easier analysis of system performances. As such, industrial wireless networks are the key technology for the deployment of Industry 4.0 [23] and Industrial Internet of Things (IIoT) [24]. Some of the requirements that IWNs should satisfy are(i)
reliability (reliable delivery of data in harsh environment with high level of interference and errors),(ii)
scalability (efficient usage of channel bandwidth in wide range of network sizes),(iii)
power-efficiency (avoiding unnecessary consummation of battery energy, improving longevity),(iv)
timeliness (delivery of data with low and predictable delay, satisfying specific timing constraints),(v)
security (overcoming the threat of the external interference).Various technologies and standards have been employed in industrial environment, including IEEE 802.15.4 based variants, Bluetooth, and Ultra-Wide Band (UWB). Although it was not designed for use in the industry, IEEE 802.11 standard is one of the main technologies used for IWNs. Commercial products for IWNs from companies like Siemens (Scalance W), Cisco (Aironet 15xx), and Moxa (AWK) are based on 802.11- and 802.11-based solutions which are already applied for conditions monitoring [25] and automation control [26]. WLAN networks offer high data rates, rate adaptation, QoS assurance (802.11e enhancement), spatial multiplexing (802.11n enhancement), and simple interoperability with wired networks. However, high power consumption and expensiveness represent disadvantages of WLANs for industrial deployment [5]. In addition to this, the mentioned throughput degradation in congested networks make 802.11 networks unsuited for industrial deployment in scenarios with large number of communicating devices. Relatively high delay and jitter prevent their use when the small and constant delay is of importance, which is often the case. The throughput degradation additionally increases power consumption of the devices, since the (limited) energy is being wasted on transmission and attempts of reception of collided frames.Regarding industrial application of 802.11 standard, great part of the work presented in the literature has been focused on fulfilling the requirements of real-time communication. In [27–31] use of time division multiple access (TDMA) functions atop of 802.11 MAC is proposed. Modifications to packet retransmission scheme are considered in [32–34]. Rate adaptation techniques are studied in [35–37], while [38] aims to improve WLAN’s reliability in industrial environment. In [21] a new MAC protocol, based on 802.11e is proposed for use in IWNs with deadline-constrained periodic traffic. The protocol uses new backoff procedure, which includes doubling of CW after contention loss. Compared to EDCA, protocol from [21] decreases real-time packet losses due to missed deadlines.


### 2.2. 802.11 Distributed Coordination Function (DCF)

IEEE 802.11 standard [1] specifies Distributed Coordination Function (DCF) as the fundamental technique for distributed medium access. DCF is based on CSMA/CA [39] algorithm and Binary Exponential Backoff (BEB), and each data transmission is preceded by contention period, during which active wireless stations compete for medium access. Medium contention starts after the medium has been idle for Distributed Inter-Frame Space (DIFS) interval.The contention is priority based: competing stations randomly select their priority numbers, called backoff counters (BC), from a priority space called contention window (CW), defined asCW=[0,W-1], where W represents the number of different priorities a station can select. Period of medium contention is divided into short periods called timeslots (TS) and the stations decrement their selected BCs in each timeslot during which the channel remains idle. When a station decrements its BC to zero, it wins the contention and starts transmitting data. Other stations, sensing that the medium has become busy, suspend the countdown process and save current BC values to be used in the next medium contention. Having received the data, the receiver sends a short ACK frame, acknowledging the successful transmission. If the transmitter does not receive the ACK frame, it assumes that there was a collision with another transmitting station. In that case, transmitting stations double their current contention windows, up to predefined upper value (CWmax=[0,Wmax-1]). After each successful transmission, transmitting station resets its CW to minimal (initial) value CW0=[0,W0-1]. This CW management scheme represents BEB algorithm of DCF protocol.Besides the basic access method, DCF defines a four-way-handshake method in which short RTS/CTS (Request To Send/Clear To Send) frames are exchanged before the data transmission. Station that won medium access sends RTS frame to which receiver responds with CTS. Only after the reception of CTS can the winning station start transmitting data, after which ACK frame is expected. This method introduces additional overhead to the medium contention process, but it shortens collision duration and can be used to eliminate well documented hidden node problem [40]. Both DCF access methods are shown in Figure 1.Figure 1
(a) Basic access method; (b) RTS/CTS method.
(a) (b)The DCF has been extensively studied and various enhancements have been proposed to improve its performance. Great part of research is focused on effects of BEB algorithm in DCF and similar MAC protocols, and many other CW management algorithms have been presented in the literature. In [41], the use of exponential increase–exponential decrease algorithm is proposed as a substitute for standard BEB algorithm. Adaptation of the CW size based on estimated number of active stations is presented in [42]. In [14] authors propose polynomial CW increase after collision, and in [43] resetting of CW to initial size CW0 is proposed to be restricted depending on number of experienced retransmission failures.While DCF is able to provide high throughput in networks with small number of active stations (n<6), it is known to exhibit throughput degradation if the number of stations increases [7, 44]. To address this problem, different solutions have been presented in the literature. In the next two sections two specific approaches have been presented (SCW and CPCF algorithm) due to their good results and fairly simple implementations.


### 2.3. Shifted Contention Window (SCW) Algorithm

Although not identical, several authors have presented what can be recognized as the same class of CW management algorithms, called shifted contention window (SCW) algorithm [18, 45–47]. The main idea behind SCW algorithm is that in certain conditions a station should not be allowed to randomly select a low value of backoff counter when entering medium contention. That means that the station’s contention window is shifted from zero and is defined as CW=[Wmin>0,Wmax-1]. This way the station is, statistically, given lower priority during the medium contention. By increasing Wmin, the station’s priority lowers and it will wait more time for medium access.Illustration of CW management in a simple SCW algorithm is shown in Figure2. The stations use un-shifted contention window in the initial backoff stage until experiencing collision, indicating congestion. After each collision, CW is shifted further away from zero, while after each successful transmission it is shifted back towards zero.Figure 2
Illustration of CW management in SCW protocol.In [45, 46, 48] it was shown that SCW mechanism can be used to increase network throughput in congested networks, while not impeding high channel utilization in networks with small number of active stations, both in wireless local and personal area networks.


### 2.4. Constrained Priority Countdown Freezing (CPCF)

When two or more competing stations obtain the same priority number (i.e., BC) to be used in contention, priority collision occurs. Since in DCF all stations suspend BC countdown process when they sense that the medium is busy and use current values of BC in the next medium contention, every priority collision in a network is preserved through multiple contention periods, until it eventually results in a physical collision. In [17], this preservation of priority collisions is calledcollision memory. This can lead to an increase of the physical collision rate, which is calledcollision memory effect.In order to mitigate or eliminate the collision memory effect, Constrained Priority Countdown Freezing (CPCF) algorithm was presented in [17]. CPCF introduces a new parameter, freezing limit k, which limits the number of times a station can freeze and countdown BC, which is represented by the station’s freezing counter (FC). If the station loses in k+1 consecutive medium contentions, it is not allowed to freeze its current BC but is forced to randomly select a new BC to be used in the next contention. Thus, priority collisions can potentially be resolved before resulting in physical collisions. Flow diagram of a CPCF station is shown in Figure 3. It was demonstrated that the network throughput can be increased by selecting appropriate value of parameter k, especially in congested networks [17].Figure 3
Flow diagram of CPCF.


## 2.1. IWNs and IEEE 802.11 Standard

Wireless networks have been identified as an attractive option in distributed control systems, automation, and monitoring [22]. They offer flexibility, easy deployment, increased mobility, improved efficiency, and easier analysis of system performances. As such, industrial wireless networks are the key technology for the deployment of Industry 4.0 [23] and Industrial Internet of Things (IIoT) [24]. Some of the requirements that IWNs should satisfy are(i)
reliability (reliable delivery of data in harsh environment with high level of interference and errors),(ii)
scalability (efficient usage of channel bandwidth in wide range of network sizes),(iii)
power-efficiency (avoiding unnecessary consummation of battery energy, improving longevity),(iv)
timeliness (delivery of data with low and predictable delay, satisfying specific timing constraints),(v)
security (overcoming the threat of the external interference).Various technologies and standards have been employed in industrial environment, including IEEE 802.15.4 based variants, Bluetooth, and Ultra-Wide Band (UWB). Although it was not designed for use in the industry, IEEE 802.11 standard is one of the main technologies used for IWNs. Commercial products for IWNs from companies like Siemens (Scalance W), Cisco (Aironet 15xx), and Moxa (AWK) are based on 802.11- and 802.11-based solutions which are already applied for conditions monitoring [25] and automation control [26]. WLAN networks offer high data rates, rate adaptation, QoS assurance (802.11e enhancement), spatial multiplexing (802.11n enhancement), and simple interoperability with wired networks. However, high power consumption and expensiveness represent disadvantages of WLANs for industrial deployment [5]. In addition to this, the mentioned throughput degradation in congested networks make 802.11 networks unsuited for industrial deployment in scenarios with large number of communicating devices. Relatively high delay and jitter prevent their use when the small and constant delay is of importance, which is often the case. The throughput degradation additionally increases power consumption of the devices, since the (limited) energy is being wasted on transmission and attempts of reception of collided frames.Regarding industrial application of 802.11 standard, great part of the work presented in the literature has been focused on fulfilling the requirements of real-time communication. In [27–31] use of time division multiple access (TDMA) functions atop of 802.11 MAC is proposed. Modifications to packet retransmission scheme are considered in [32–34]. Rate adaptation techniques are studied in [35–37], while [38] aims to improve WLAN’s reliability in industrial environment. In [21] a new MAC protocol, based on 802.11e is proposed for use in IWNs with deadline-constrained periodic traffic. The protocol uses new backoff procedure, which includes doubling of CW after contention loss. Compared to EDCA, protocol from [21] decreases real-time packet losses due to missed deadlines.


## 2.2. 802.11 Distributed Coordination Function (DCF)

IEEE 802.11 standard [1] specifies Distributed Coordination Function (DCF) as the fundamental technique for distributed medium access. DCF is based on CSMA/CA [39] algorithm and Binary Exponential Backoff (BEB), and each data transmission is preceded by contention period, during which active wireless stations compete for medium access. Medium contention starts after the medium has been idle for Distributed Inter-Frame Space (DIFS) interval.The contention is priority based: competing stations randomly select their priority numbers, called backoff counters (BC), from a priority space called contention window (CW), defined asCW=[0,W-1], where W represents the number of different priorities a station can select. Period of medium contention is divided into short periods called timeslots (TS) and the stations decrement their selected BCs in each timeslot during which the channel remains idle. When a station decrements its BC to zero, it wins the contention and starts transmitting data. Other stations, sensing that the medium has become busy, suspend the countdown process and save current BC values to be used in the next medium contention. Having received the data, the receiver sends a short ACK frame, acknowledging the successful transmission. If the transmitter does not receive the ACK frame, it assumes that there was a collision with another transmitting station. In that case, transmitting stations double their current contention windows, up to predefined upper value (CWmax=[0,Wmax-1]). After each successful transmission, transmitting station resets its CW to minimal (initial) value CW0=[0,W0-1]. This CW management scheme represents BEB algorithm of DCF protocol.Besides the basic access method, DCF defines a four-way-handshake method in which short RTS/CTS (Request To Send/Clear To Send) frames are exchanged before the data transmission. Station that won medium access sends RTS frame to which receiver responds with CTS. Only after the reception of CTS can the winning station start transmitting data, after which ACK frame is expected. This method introduces additional overhead to the medium contention process, but it shortens collision duration and can be used to eliminate well documented hidden node problem [40]. Both DCF access methods are shown in Figure 1.Figure 1
(a) Basic access method; (b) RTS/CTS method.
(a) (b)The DCF has been extensively studied and various enhancements have been proposed to improve its performance. Great part of research is focused on effects of BEB algorithm in DCF and similar MAC protocols, and many other CW management algorithms have been presented in the literature. In [41], the use of exponential increase–exponential decrease algorithm is proposed as a substitute for standard BEB algorithm. Adaptation of the CW size based on estimated number of active stations is presented in [42]. In [14] authors propose polynomial CW increase after collision, and in [43] resetting of CW to initial size CW0 is proposed to be restricted depending on number of experienced retransmission failures.While DCF is able to provide high throughput in networks with small number of active stations (n<6), it is known to exhibit throughput degradation if the number of stations increases [7, 44]. To address this problem, different solutions have been presented in the literature. In the next two sections two specific approaches have been presented (SCW and CPCF algorithm) due to their good results and fairly simple implementations.


## 2.3. Shifted Contention Window (SCW) Algorithm

Although not identical, several authors have presented what can be recognized as the same class of CW management algorithms, called shifted contention window (SCW) algorithm [18, 45–47]. The main idea behind SCW algorithm is that in certain conditions a station should not be allowed to randomly select a low value of backoff counter when entering medium contention. That means that the station’s contention window is shifted from zero and is defined as CW=[Wmin>0,Wmax-1]. This way the station is, statistically, given lower priority during the medium contention. By increasing Wmin, the station’s priority lowers and it will wait more time for medium access.Illustration of CW management in a simple SCW algorithm is shown in Figure2. The stations use un-shifted contention window in the initial backoff stage until experiencing collision, indicating congestion. After each collision, CW is shifted further away from zero, while after each successful transmission it is shifted back towards zero.Figure 2
Illustration of CW management in SCW protocol.In [45, 46, 48] it was shown that SCW mechanism can be used to increase network throughput in congested networks, while not impeding high channel utilization in networks with small number of active stations, both in wireless local and personal area networks.


## 2.4. Constrained Priority Countdown Freezing (CPCF)

When two or more competing stations obtain the same priority number (i.e., BC) to be used in contention, priority collision occurs. Since in DCF all stations suspend BC countdown process when they sense that the medium is busy and use current values of BC in the next medium contention, every priority collision in a network is preserved through multiple contention periods, until it eventually results in a physical collision. In [17], this preservation of priority collisions is calledcollision memory. This can lead to an increase of the physical collision rate, which is calledcollision memory effect.In order to mitigate or eliminate the collision memory effect, Constrained Priority Countdown Freezing (CPCF) algorithm was presented in [17]. CPCF introduces a new parameter, freezing limit k, which limits the number of times a station can freeze and countdown BC, which is represented by the station’s freezing counter (FC). If the station loses in k+1 consecutive medium contentions, it is not allowed to freeze its current BC but is forced to randomly select a new BC to be used in the next contention. Thus, priority collisions can potentially be resolved before resulting in physical collisions. Flow diagram of a CPCF station is shown in Figure 3. It was demonstrated that the network throughput can be increased by selecting appropriate value of parameter k, especially in congested networks [17].Figure 3
Flow diagram of CPCF.


## 3. Self-Adapting MAC (SaMAC) Protocol

The initial goal of our research was to develop MAC protocol that would address DCF’s throughput degradation and short-term unfairness, achieving fair allocation of channel bandwidth and high throughput for wide range of network congestion levels.Stations using SaMAC protocol randomly select BC values from a single shifted contention windowCW=[Wmin>0,Wmax-1], but do not employ any CW management algorithm. Therefore, CW has only one stage; it is constant for all stations and is not changed after a collision or successful transmission. After random selection of BC, a SaMAC station is allowed to freeze BC countdown process due to contention loss in k consecutive medium contentions. Once the k limit is exceeded or the station wins the medium contention, a new BC is again selected from the shifted window CW. During medium contention, each SaMAC station maintains two variables: backoff counter (BC) and freezing counter (FC). During every idle timeslot of medium contention, selected BC is decremented by 1, and during every busy timeslot (i.e., when the station loses medium contention) FC is incremented by 1. This process continues through multiple medium contentions until the station either decrements its BC to 0, winning the medium access, or until its FC exceeds the value of the freezing limit parameter k. In any of those two cases, the station resets its FC to zero and randomly selects new BC from the same shifted CW for next medium contention. Flow diagram of SaMAC protocol is shown in Figure 4.Figure 4
Flow diagram of SaMAC protocol.Using shifted CW penalizes the stations that finished the countdown by not allowing them to access the high priority set of BC values[0,Wmin-1], ensuring that the stations currently in the countdown process have higher chance of acquiring the medium successfully. On the other hand, use of constrained countdown freezing mechanism reduces collision memory effect by restricting the countdown process. SaMAC allows stations in the congested network to increase the total amount of backoff time to be greater than the maximal upper limit (Wmax–1) by selecting new BC multiple times, owing to limited countdown freezing.


## 4. Mathematical Model of SaMAC Protocol

To understand the protocol’s characteristics and select the optimal values of its parameters, it was important to create appropriate mathematical model of SaMAC [49]. However, as it will be presented in the remainder of the section, creating an accurate mathematical model of the presented new protocol proved to be a very complex task, because of specific properties of SaMAC protocol. Unfortunately, certain assumptions which hold true for other protocols will no longer hold for SaMAC type of protocol. However, those specific properties which make the design of mathematical model complex are actually the reasons behind its good performance results. The model presented in this paper can serve as a foundation for developing mathematical model for any protocol of this type.


### 4.1. Modeling of Wireless Network Protocols

Most models of wireless networks are based on Bianchi’s model of IEEE 802.11 network [50]. Bianchi uses two-dimensional Markov chain to model the operation of a single observed wireless station, with one dimension representing backoff counter selection and countdown, and the other representing congestion window management processes [50, 51]. Thus, each state in the Markov chain represents a unique combination of the station’s current BC value and its contention window stage. Probability τ that the observed station starts transmission in a given timeslot is derived as a sum of probabilities of states in which the station’s BC equals zero. From τ and the probability that the station experiences collision when transmitting, throughput of the whole network is calculated.The key assumption used in [50] is that the collision probability for the transmitting station is constant and independent of its backoff stage, i.e., of the number of retransmissions experienced. As noted in [52], probability of collision for the observed transmitting station is equal to the probability that the observed station experiences busy timeslot (i.e., contention loss) and freezes countdown process in a state with BC > 0. Therefore, the terms probability of collision, probability of busy timeslot, and probability of contention loss from the observed station’s point of view are used interchangeably in this paper. The assumption of constant contention loss probability significantly simplifies Markov chain that represents operation of a wireless station, since this probability determines transition probabilities between states of the chain. Accordingly, all transition probabilities in such a chain are equal..Other simplifying assumptions used in Bianchi’s model are as follows: the channel is ideal (no unsuccessful transmissions due to errors caused by noise), stations are saturated (each station has always packets ready for transmission), and all stations can hear each other (single-hop network).Many extensions of Bianchi’s model were published, aiming to better capture various details of 802.11 DCF networks, such as network of unsaturated stations [53–55] and network with different traffic classes [56, 57]. The first model to correctly model DCF’s backoff freezing mechanism was presented in [52] where the third dimension was added to original Bianchi’s Markov chain in order to differentiate probability of collision after a busy and after an idle timeslot. Later models that accurately capture backoff freezing mechanism redefine the duration of a busy timeslot or introduce additional states to Bianchi’s model to differentiate the probability of a busy timeslot after an idle or after another busy timeslot [58–60].Besides the modeling of DCF, Bianchi’s model and its key assumption have been used as the basis for modeling of many other distributed wireless MAC protocols, some proposed for use in WLAN networks, and some proposed for use in other wireless networks, such as VANET or VLC (Visible Light Communication) networks [48, 61–64].Models of protocols that use SCW algorithm [46, 48] are also based on Bianchi’s assumptions, but Markov chain representing operation of a single station is formed in a way that, during the random selection of a new BC, a station cannot transit to a state in which BC is lower than Wmin for a given contention window stage. Comparing model results with simulations, it was shown that the model’s error in throughput estimation is not greater than 7% for networks with up to 60 stations [48].A model of CPCF protocol was presented in [65], based on Foh’s three-dimensional model [52]. The operation of a single CPCF station is modeled using a four-dimensional Markov chain, where the additional dimension is used to represent station’s incrementing and resetting of freezing counter (FC). Probability of contention loss is assumed to be constant and dependent only on the state of the previous timeslot (idle or busy). Model’s throughput estimation accuracy is in the 1% range for networks with up to 50 competing stations.


### 4.2. Model of SaMAC Protocol with the Assumption of Constant Contention Loss Probability

In this section, results of such a conventional approach in mathematical modeling of considered SaMAC protocol are studied. The model itself is not presented in detail, but only its results. The conventional model is based on the model of CPCF presented in [65] and uses the same assumptions, most notably the assumption that the probability of a contention loss is constant. In accordance with the SaMAC protocol, Markov chain used for modeling of single station’s operation contains only one contention window, shifted from zero. In order to examine its accuracy, results of the model are compared with the results obtained from software simulations of SaMAC. The comparison reveals great discrepancies between the two sets of results. To illustrate, in Figure 5 relative errors in the model’s throughput results for four sets of parameter values of the considered SaMAC protocol with 1040B frames are presented.Figure 5
Relative error of SaMAC throughput estimated by the constant loss probability model.Obviously, the model highly overestimates the network throughput, especially in the congested network with many active stations. Compared to simulation results, relative error of estimated throughput in considered scenarios reaches up to 40%. Error depends on various parameters, such as size of used data frames, parameter values, and network size. Generally, it increases with a shift of used contention windows from zero and with the number of active stations in the network, while decreasing with the increase of the freezing limitk. Given the results presented in Figure 5, it is clear that the conventional approach to modeling of SaMAC protocol is not applicable.


### 4.3. Validity of Constant Collision Probability Assumption

Several network scenarios have been considered in order to determine contention loss probability of the SaMAC protocol. Probability of a busy timeslot for each simulated network station was recorded. The results show that contention loss probability is not constant for SaMAC but that it depends on the station’s backoff counter and freezing counter values. To illustrate, Figure6 shows the probability of contention loss for a single station in a SaMAC network, obtained from MATLAB simulations. The simulated SaMAC protocol had the following parameter values: CW=[8,39] (i.e., Wmin=8 and Wmax=40), k=2. Contention loss probability is shown for a network of 20 active stations, as a function of the observed station’s BC and FC values.Figure 6
Probability of contention loss for SaMAC station withCW=[8,39] and k=2 as a function of BC and FC.As can be seen from the figure, the contention loss probability function can be divided into three domains:(1)
low BC values domain: the probability increases with the decrease of BC and FC;(2)
central domain: the contention loss probability is constant, independent of BC and FC values;(3)
high BC values domain: the probability increases with the decrease of BC and FC.Due to space limitations, graphs for SaMAC with different parameter values are omitted, but it should be noted that the recorded probability of contention loss follows the same pattern in all simulated network scenarios. The widths of the first and the third domain are roughly equal and determined byWmin value, with central domain occupying the rest.This leads to the conclusion that the constant contention loss probability is obviously not an inherent property of distributed MAC protocols that use BC countdown in medium contention process. Therefore, validity of the usual assumption should be confirmed beforehand if the conventional approach is used for modeling of new proposed MAC protocols. On the other hand, in order to accurately model a protocol with inconstant contention loss probability, one should estimate the contention loss probability for each state in the underlying Markov chain. This approach is presented in more detail in the following sections.


### 4.4. Medium Contention Observations

In this section, a detailed inspection of medium contention process in SaMAC network is performed. Figure7 shows an example of medium contention where five active stations (x1-x5) use the same contention window, shifted from zero, with Wmin=4 and Wmax=12. Additionally, stations employ CPCF algorithm with the freezing limit set to k=4. Each station’s state during a contention is determined by its BC and FC values and represented by the station’s position in the depicted BC-FC matrix. Five discrete moments are shown, delimiting four consecutive timeslots, starting with t = 0 when the contention is started (e.g., in t = 0 station x4 has BC = 5 and FC = 1).Figure 7
An example of medium contention between five SaMAC stations.Since no station has the right to access medium in t = 0, during the first timeslot the stations decrement their respective BC values, shifting to the left by one position in the BC-FC matrix. The same decrementing of BC recurs after t = 1 and t = 2. Since it decrements its BC to zero, in t = 3 the station x2 wins the medium and transmits data during the fourth timeslot. During the busy timeslot, other stations increment their FC, if permitted by their current FC value and the value of freezing limitk (stations x1, x4, and x5). On the other hand, the winning station (station x2) and stations not allowed to increment FC (station x3) reset their FC and randomly select new BC, taking one of the shaded initial states in BC-FC matrix.In the presented medium contention a specific countdown pattern can be recognized. All stations behave in the same manner from the beginning (t = 0) until the end of the contention (t = 4). Their positions in the BC-FC state plane are shifted to the left by the amount of empty timeslots in the contention, relative to t = 0 (Figure8). This pattern of stations in the BC-FC matrix is only broken during the busy timeslots, when the winning station (or more winning stations, in case of a collision) and the stations that are not allowed to increment FC randomly select new BC, taking one of the initial states, while all other stations shift up by one position.Figure 8
Translation of SaMAC stations in BC-FC plane during medium contention.From these observations, one can conclude that the probability distribution of station’s states at the end of the medium contention is the same as the distribution at the start of contention, but shifted to the left by the number of idle timeslots in contention. The number of idle timeslots represents the duration of the contention expressed in timeslots. Additionally, with a given probability distribution of states at the start of a busy timeslot, the distribution after the timeslot can be obtained by shifting up by one the probabilities of states with BC > 0 andFC<k, and assigning all initial states equal probability. These conclusions are used as the basis for the mathematical model of SaMAC protocol.


### 4.5. Markov Chain Model of a Single SaMAC Station’s Operation

Consider a network ofn active wireless stations communicating using SaMAC protocol defined in Section 3. In modeling of such a network, several common assumptions are used:(i)
channel is ideal,(ii)
there are no hidden stations (one-hop network),(iii)
there is an unlimited number of retransmissions,(iv)
timeslots are synchronized for all stations,(v)
ACK and CTS timeouts and EIFS times are ignored.However, the usual assumption of the constant contention loss probability is not used.The presented model is defined as follows. Letx(t) andy(t) represent the values of the BC and FC for a given station at a timeslott, respectively, and let s(t) represent the channel state during the previous timeslot (s=1 if channel was busy during the previous timeslot, and s=0 if it was idle). This extra information is needed since the probability of contention loss depends heavily on the channel state during the previous timeslot. Then st,xt,yt defines the state of the station at timeslot t, and during operation each station goes through a sequence of such states. After idle timeslot a station will decrement its BC to find itself in the state 0,xt-1,yt. If the observed station does not start transmitting in the current timeslot, and some other station starts its transmission, the observed nontransmitting station will increment its FC to find itself in the state 1,xt,yt+1. This procedure continues until the observed station decrements its BC to 0 and starts transmitting or loses the contention when its FC equals k. In any of these two cases, the station resets FC to zero and randomly selects a new BC, to find itself in the state 1,BC,0, where Wmin≤BC<Wmax. These states are calledinitial states (the lowest row of states in Figure 9), and from one of them a station reenters the countdown process. The contention window is constant, and a new BC is uniformly selected from the range CW=[Wmin,Wmax-1]. Therefore, the probability of selecting each BC is the same and equals 1/W, where W=Wmax-Wmin.Figure 9
Discrete Markov chain model for SaMAC protocol.In the proposed model, operation of a single station is modeled using the three-dimensional Markov chain presented in Figure9, and the state s,i,j represents the state of the station. Let us adopt the notation Ps1,i1,j1∣s0,i0,j0=Ps(t+1)=s1,x(t+1)=i1,y(t+1)=j1∣s(t)=s0,x(t)=i0,y(t)=j0. One-step transition probabilities in the chain are given with(1)P1,i,j∣0,i,j-1=ti,j-1i∈1,Wmax-2;j∈1,kP0,i,j∣0,i+1,j=ei+1,ji∈0,Wmax-3;j∈0,kP0,i,j∣1,i+1,j=1i∈0,Wmax-2;j∈0,kP1,i,0∣0,0,j=1Wi∈Wmin,Wmax-1;j∈0,kP1,i,0∣0,m,k=tm,kWi∈Wmin,Wmax-1;m∈1,Wmax-2Probabilities of all other one-step transitions equal zero. Probability that a station experiences a busy timeslot (i.e., a contention loss) following an idle timeslot is not constant but depends on the station’s current BC and FC values and is denoted by ti,j for a station with BC=i and FC=j. Accordingly, probability of an idle timeslot following another idle timeslot is denoted by ei,j=1-ti,j. Since all stations in the modeled SaMAC protocol use shifted contention windows, there is no possibility that any station randomly selects BC=0. As a result, there is no possibility of two or more consecutive busy timeslots and the probability of an idle timeslot after a busy timeslot equals 1.In order to effectively model SaMAC wireless network, probability distribution of states and their transition probabilities in the underlying Markov chain must be determined. Since contention loss probability in SaMAC is not constant, these probabilities cannot be determined simply from transmission probability, as in conventional MAC models. In the presented model of SaMAC protocol, probabilities of all possible trajectories that lead the observed station from an arbitrary initial state back to one of initial states are determined first. These trajectories represent transitions of the station in Markov chain during multiple and at mostk+1 medium contentions (because of limited freezing mechanism). Calculation of the station’s transition probabilities from the start of a contention to the start of the next contention is based on observations from Section 4.4. By accounting for all possible combinations of contention durations for k+1 consecutive contentions, conditional states’ probability distribution after a busy timeslot is obtained. Probability distribution of all states in the Markov chain is determined in two steps:(i)
first, conditional probability distributionb1 is estimated using the iterative procedure described below; distribution b1 represents the conditional probability of states after a busy timeslot (states with s=1), given that the previous timeslot was busy;(ii)
afterwards, the probability distributionb of all states in the Markov chain (including the states after an idle timeslot) and probabilities of contention loss ti,j in each of these states are derived.Once the probabilities of all states in the Markov chain and of one-step transitions have been determined, probability of an idle timeslot and of a collision is calculated, and the model is completed with network throughput calculation.


### 4.6. Iterative Procedure for Determining the Probability Distribution of States after a Busy Timeslot

Calculation of the probability distributionb1 is based on the observation that the probability distribution of states at the start of contention can be obtained from the known probability distribution at the beginning of the previous contention, by shifting probability matrix appropriate number of positions to the left and one position up, while assigning initial states an equal probability.Iterative process of estimating probability distributionb1 is carried out as follows:(1)
Initially, probability distributionb1 is assumed to be uniform; i.e., all states in the Markov chain that represent the station after a busy timeslot (states with s=1) are assumed to have equal probability. These are the states from which the station enters medium contention. Distribution b1 is assumed to be the same for all active stations.(2)
For the observed station in one of the initial states1,Wmin≤i<Wmax,0, probabilities of all possible combinations of contention durations, expressed in the number of idle timeslots, for k+1 consecutive contentions, are derived from the probability distribution b1.(3)
New probability distributionb1calc is derived from the probabilities of contention duration combinations.(4)
Filtering of the probability distribution is made in order to assure that theb1 distribution converges to a stable state b1new=α·b1calc+(1-α)·b1old, where α is a filtering constant of common EWMA algorithm tuned for best stability-complexity compromise.(5)
Steps (2)–(4) are iteratively repeated until probability distribution of statesb1 becomes stable (up to a predefined threshold).It is important to note that we have no prior knowledge on the appropriate probability distributionb1. For that reason, uniform distribution has been selected as the initial distribution in the first step of the iterative process. Fixed value of the filtering constant α=0,5 has been used in this paper, since it has been empirically determined that this value provides good compromise between the stability and computation speed for wide range of considered scenarios.


#### 4.6.1. Probability Distribution of Combination of Contention Durations

The goal of the second step of the iterative process is to determine, given a presumed distributionb1 (initial or obtained in the previous iteration), the probability of each combination of contention durations for k+1 consecutive contentions from the point of view of the observed station occupying one of the initial states.First, the probability for each possible durationr of the first contention is calculated, using expression(2)durr=1-∑x=0r-1∑y=0kb1x,yn-1-1-∑x=0r∑y=0kb1x,yn-1,where dur(r) represents the probability that the medium contention consists of r idle timeslots and b1x,y denotes the (assumed) conditional probability of state 1,x,y given that the station is in one of the states representing a station after a busy timeslot (states with s=1). The minuend in (2) is the probability that each of n-1 remaining stations has BC greater than r-1, while subtrahend is the probability that the BCs of all n-1 remaining stations are greater than r.After the probabilities of all possible durations for the first contention have been calculated, for each of these durations distributionb1 is suitably adapted using procedure described below. Using the adapted distribution b1 and (2), probabilities of all possible durations for the second contention are calculated. For each combination of the first two contention durations, distribution b1 is adapted again, and probabilities of all possible third contention durations are determined. This continues until probabilities of all combinations of contention durations for k+1 consecutive contentions are obtained.


#### 4.6.2. Adaptation of the Probability Distributionb1

Suppose that the distributionb1prev before the previous contention is known and that the contention lasted a idle timeslots. Before the calculation of probabilities of durations for the next contention, b1prev must be adapted in such a way that the probabilities of states 1,i,j are annulled if i≤a or j=k, since the stations occupying those states would have counted their BC values down to zero during the previous contention or would not be allowed to increment their FC after the loss of the contention. Afterwards, probabilities of all other states in b1 are shifted a positions to the left and one position up, mimicking the stations’ process of decrementing BC and incrementing FC during the contention. The probabilities of all initial states 1,i,0, where Wmin≤i<Wmax, are assigned the probability equal to the sum of probabilities that have been annulled and divided by W, assuring that the sum of probabilities of all states remains 1. Therefore, given that the previous contention consisted of a idle timeslots, adaptation of distribution b1 for the calculation of probability of the next contention duration is performed using(3)b1nexti,j=b1previ+a,j-1,if0<i<Wmax-1-aandj>0(4)b1nexti,0=1W∑b1prevu,vwhere0<u≤aorv=k,  ifi≥Wmin(5)b1nexti,j=0,otherwiseThe adapted distributionb1next is used to calculate probabilities of all possible durations b of the next contention, given that the distribution before the previous contention was b1prev and it contained a idle timeslots.Figure10 is an example of such a probability distribution adaptation process for SaMAC protocol with k=4, Wmin=4, and Wmax=12. Each position in BC-FC matrices represents assumed probability of one state in Markov chain at the beginning of contention: the first contention in Figure 10(a), the second in Figure 10(b), and the third contention in Figure 10(c). Shaded positions represent probabilities that might be greater than zero. Certain probabilities (pA, pB, and pC) are particularly noted in order to improve understanding of the shifting of the probability matrix during the adaptation process.Figure 10
Example of probability distribution adaptation for calculation of probability of the third contention’s duration.Letdurj(x∣a,b,c,…) denote the probability that the observed station loses in the jth medium contention after x idle timeslots, given that the first contention lasted a idle timeslots, the second lasted b, the third c, etc. Matrices shown in Figure 10 represent the adaptation of distribution b1 for the calculation of probability of duration of the third contention if the first contention contained two and the second contained three idle timeslots dur3(x∣2,3). Figure 10(a) shows probability distributionb1 obtained in step (1) or step (4) of the iterative process. This distribution is used to determine probability that the first contention contains two idle timeslots dur1(2). Figure 10(b) represents probability distribution used for calculation of the second contention’s duration probability, given that the first contention consisted of two idle timeslots. The distribution is obtained by shifting the initial assumed distribution, shown in Figure 10(a), by two steps to the left and one up in (3). While doing this, some probabilities are shifted outside of the probability matrix. Those probabilities are added together and divided by W, defining probabilities of initial states (4), shaded purple in Figure 10(b). This distribution is then used to calculate probability that the second contention contains three idle timeslots, given that the first contained two dur2(3∣2). Afterwards, the distribution is adapted again in order to obtain probability distribution for the calculation of the third contention’s duration probability. The distribution is shifted three positions to the left and one position up. Again, probabilities from positions that are annulled are added together and used to determine probability of initial states (shaded green in Figure 10(c)). Finally, this distribution is used for the calculation of probability of duration of the third contention, given that the first contained two and the second contained three idle timeslots dur3(x∣2,3).After repeating this process fork+1 consecutive medium contentions, the probability p(1,i,j∣1,i+z,0) that the observed station transitions from the initial state 1,i+z,0 to state 1,i,j can be expressed as the sum of probabilities of all combinations of j consecutive contention durations that last z idle timeslots combined:(6)p1,i,j∣1,i+z,0=combDurz,j=∑dur1a·dur2b∣a·…·durjx∣a,b,c,…,such that (a+b+c+⋯+x)=z.To illustrate, Figure11 shows six possible trajectories that take a station from the state 1,i+5,0 to the state 1,i,3. Transitions from 1,i+5,0 to 0,i+4,0 and from 0,i,2 to 1,i,3 are omitted from the figure since they happen with probability 1 for all trajectories. Each matrix cell in Figure 11 represents certain combination of station’s BC and FC values after an idle timeslot, and coordinates of dots on trajectories represent station’s BC-FC values when it loses medium contention. For example, green line represents the trajectory that a station would take if the first contention contained one idle timeslot (contention loss at BC=i+4 and FC = 0) and the second and the third contention contained two idle timeslots each. That means that the probability of the green trajectory is dur11·dur2(2∣1)·dur3(2∣1,2). To calculate the probability p(1,i,3∣1,i+4,0), one needs to calculate probabilities of all 6 trajectories and sum them as in (6).Figure 11
Example of different trajectories that a station can take between two states.Thus, probability of all states that represent a station after a busy timeslot can be expressed as a sum of probabilities that the station gets to that state from one of the initial states, using the following equation:(7)b1i,j=b1Wmax-1,0·∑z=max0,Wmin-iWmax-1-icombDurz,j,where b1Wmax-1 is the probability of each initial state after a busy timeslot. From the normalization condition(8)∑i∑jb1i,j=1the probabilities of initial states are calculated, and consequently probabilities of all other states in the chain.The presented process represents steps (2) and (3) of the iterative modeling of SaMAC station’s operation, and the probability distributionb1calc obtained from (7) and (8) is filtered (step (4) of the iterative process) and used in the next iteration. Obviously, the process of deriving the probability distribution of combination of contention durations for k+1 consecutive contentions is very computationally expensive process, with computational complexity of O(Wmaxk+1).


### 4.7. Probability Distributionb and Probability of Contention Loss ti,j

After the probability distributionb1 becomes stable, iterative calculation of b1 is terminated and the probability distribution b of all states is determined, as well as the probability of contention loss ti,j in every state 0,i,j. Since b1i,j is the probability of state 1,i,j given that the station is in one of the states following a busy timeslot, and b1,i,j is unconditional probability of that state (i.e., in any timeslot, following a busy or an idle timeslot), it is obvious that(9)b1,i,j·b1,Wmax-1,0-1=b1i,j·b1Wmax-1,0-1.Thus, probabilities b1,i,j can be easily expressed as a function of b1,Wmax-1,0 for every i∈[1,Wmax-1],j∈[0,k].From the regularities of Markov chain shown in Figure9, one can conclude that b0,Wmax-2,0=b1,Wmax-1,0. Similarly, for the rightmost states in every chain row, b0,i,j=b1,i+1,j holds. State 1,i,j+1 can only be reached from the state 0,i,j, and the probability of transition is ti,j, the following holds:(10)ti,j=b1,i,j+1b0,i,j.Probabilities of other states in the underlying Markov chain are calculated from(11)b0,i,j=b1,i+1,j+1-ti+1,j·b0,i+1,j(12)b1,i,j=ti,j-1·b0,i,j-1Using (10), (11), and (12), probabilities of all states in Markov chain can be expressed as a function of the probability of the initial state 1,Wmax-1,0, and probabilities of contention loss in those states are calculated. Finally, from normalization condition, probabilities of all states in Markov chain are determined.


### 4.8. Probability of an Idle Timeslot and Collision Probability

After determining the probability distribution of statesb and the probability of a contention loss in each state ti,j, the probability of an idle timeslot and collision probability can be calculated.In various models presented in the literature and based on Bianchi’s assumptions, these probabilities are calculated from the probability, usually denoted byτ, that the observed station starts to transmit in a random timeslot. However, this approach cannot be applied to SaMAC protocol modeling, since the probability that a random station starts transmitting is not constant, as shown in Figure 6.In the model proposed it is assumed that the probability that an observed station starts to transmit is constant only in those timeslots in which at least one ofn active stations (including the observed station) transmits data. Therefore, the assumption of a constant probability of a medium access is replaced with more stringent assumption and limited only to busy timeslots.Probabilityti,j is the probability that at least one of remaining (n-1) stations wins the medium when the observed station is in the state 0,i,j. If i=0,  t0,j represents the probability that the observed station experiences collision when it wins the medium in the state 0,0,j. Hence, the probability that the observed station experiences a collision, given that it wins the medium, is calculated as the weighted sum:(13)Pcolb=∑j=0kt0,j·b0,j·∑j=0kb0,j-1.Probability Pcolb represents the conditional probability that at least one of the remaining (n-1) stations starts transmission, given that the observed station transmits. Hence, assuming constant probability of transmission in busy timeslots for all active stations, the probability of transmission in busy timeslot for each station is given with(14)τb=1-1-Pcolbn-1.Now collision probability Pcol and probability of successful transmission Psucc can be obtained as(15)Pcol=1-n·τb1-τbn-11-1-τbn,Psucc=1-Pcol.The probability of an idle timeslotPidle is determined as a sum of probabilities that the observed station experiences an idle timeslot in each state of Markov chain. Of course, states with BC = 0 are omitted, since in those states the observed station wins the medium:(16)Pidle=∑i=1Wmax-1∑j=0kb0,i,j·1-ti,j+b1,i,j.Product in the square brackets represents the probability of an idle timeslot after another idle timeslot, whileb1,i,j represents the probability of an idle timeslot after a busy timeslot.


### 4.9. Throughput Calculation

Finally, throughput for wireless network ofn active SaMAC stations can be obtained as(17)S=1-Pidle·Psucc·EPidle·σ+1-Pidle·Psucc·Ts+1-Pidle·Pcol·Tc,where σ represents the duration of an idle timeslot, E is average payload size, and Ts and Tc are average times of channel being sensed busy during successful transmission and during collision, respectively.Duration of collision and that of successful transmission depend on the technology and parameter set used in the physical layer and should be differentiated based on the access method used (basic method versus RTS/CTS). LetTRTS, TCTS, and TACK denote durations of control frames RTS and CTS and MAC acknowledgement, respectively, let Tdata denote average time needed for transmission of MAC data frame, including preamble and PHY and MAC headers, and let δ be propagation delay. For basic access method, times Ts and Tc are(18)Ts=Tdata+SIFS+TACK+DIFS+2δTc=Tdata+DIFS+δFor RTS/CTS access mechanism, we have(19)Ts=TRTS+SIFS+TCTS+SIFS+Tdata+SIFS+TACK+DIFS+4δTc=TRTS+DIFS+δTdata can be obtained as a sum of durations of PLCP preamble, PLCP header, MAC header, and, finally, the average duration of MAC frame payload itself:(20)Tdata=Tpreamble+TPHYheader+TMACheader+Tpayload


## 4.1. Modeling of Wireless Network Protocols

Most models of wireless networks are based on Bianchi’s model of IEEE 802.11 network [50]. Bianchi uses two-dimensional Markov chain to model the operation of a single observed wireless station, with one dimension representing backoff counter selection and countdown, and the other representing congestion window management processes [50, 51]. Thus, each state in the Markov chain represents a unique combination of the station’s current BC value and its contention window stage. Probability τ that the observed station starts transmission in a given timeslot is derived as a sum of probabilities of states in which the station’s BC equals zero. From τ and the probability that the station experiences collision when transmitting, throughput of the whole network is calculated.The key assumption used in [50] is that the collision probability for the transmitting station is constant and independent of its backoff stage, i.e., of the number of retransmissions experienced. As noted in [52], probability of collision for the observed transmitting station is equal to the probability that the observed station experiences busy timeslot (i.e., contention loss) and freezes countdown process in a state with BC > 0. Therefore, the terms probability of collision, probability of busy timeslot, and probability of contention loss from the observed station’s point of view are used interchangeably in this paper. The assumption of constant contention loss probability significantly simplifies Markov chain that represents operation of a wireless station, since this probability determines transition probabilities between states of the chain. Accordingly, all transition probabilities in such a chain are equal..Other simplifying assumptions used in Bianchi’s model are as follows: the channel is ideal (no unsuccessful transmissions due to errors caused by noise), stations are saturated (each station has always packets ready for transmission), and all stations can hear each other (single-hop network).Many extensions of Bianchi’s model were published, aiming to better capture various details of 802.11 DCF networks, such as network of unsaturated stations [53–55] and network with different traffic classes [56, 57]. The first model to correctly model DCF’s backoff freezing mechanism was presented in [52] where the third dimension was added to original Bianchi’s Markov chain in order to differentiate probability of collision after a busy and after an idle timeslot. Later models that accurately capture backoff freezing mechanism redefine the duration of a busy timeslot or introduce additional states to Bianchi’s model to differentiate the probability of a busy timeslot after an idle or after another busy timeslot [58–60].Besides the modeling of DCF, Bianchi’s model and its key assumption have been used as the basis for modeling of many other distributed wireless MAC protocols, some proposed for use in WLAN networks, and some proposed for use in other wireless networks, such as VANET or VLC (Visible Light Communication) networks [48, 61–64].Models of protocols that use SCW algorithm [46, 48] are also based on Bianchi’s assumptions, but Markov chain representing operation of a single station is formed in a way that, during the random selection of a new BC, a station cannot transit to a state in which BC is lower than Wmin for a given contention window stage. Comparing model results with simulations, it was shown that the model’s error in throughput estimation is not greater than 7% for networks with up to 60 stations [48].A model of CPCF protocol was presented in [65], based on Foh’s three-dimensional model [52]. The operation of a single CPCF station is modeled using a four-dimensional Markov chain, where the additional dimension is used to represent station’s incrementing and resetting of freezing counter (FC). Probability of contention loss is assumed to be constant and dependent only on the state of the previous timeslot (idle or busy). Model’s throughput estimation accuracy is in the 1% range for networks with up to 50 competing stations.


## 4.2. Model of SaMAC Protocol with the Assumption of Constant Contention Loss Probability

In this section, results of such a conventional approach in mathematical modeling of considered SaMAC protocol are studied. The model itself is not presented in detail, but only its results. The conventional model is based on the model of CPCF presented in [65] and uses the same assumptions, most notably the assumption that the probability of a contention loss is constant. In accordance with the SaMAC protocol, Markov chain used for modeling of single station’s operation contains only one contention window, shifted from zero. In order to examine its accuracy, results of the model are compared with the results obtained from software simulations of SaMAC. The comparison reveals great discrepancies between the two sets of results. To illustrate, in Figure 5 relative errors in the model’s throughput results for four sets of parameter values of the considered SaMAC protocol with 1040B frames are presented.Figure 5
Relative error of SaMAC throughput estimated by the constant loss probability model.Obviously, the model highly overestimates the network throughput, especially in the congested network with many active stations. Compared to simulation results, relative error of estimated throughput in considered scenarios reaches up to 40%. Error depends on various parameters, such as size of used data frames, parameter values, and network size. Generally, it increases with a shift of used contention windows from zero and with the number of active stations in the network, while decreasing with the increase of the freezing limitk. Given the results presented in Figure 5, it is clear that the conventional approach to modeling of SaMAC protocol is not applicable.


## 4.3. Validity of Constant Collision Probability Assumption

Several network scenarios have been considered in order to determine contention loss probability of the SaMAC protocol. Probability of a busy timeslot for each simulated network station was recorded. The results show that contention loss probability is not constant for SaMAC but that it depends on the station’s backoff counter and freezing counter values. To illustrate, Figure6 shows the probability of contention loss for a single station in a SaMAC network, obtained from MATLAB simulations. The simulated SaMAC protocol had the following parameter values: CW=[8,39] (i.e., Wmin=8 and Wmax=40), k=2. Contention loss probability is shown for a network of 20 active stations, as a function of the observed station’s BC and FC values.Figure 6
Probability of contention loss for SaMAC station withCW=[8,39] and k=2 as a function of BC and FC.As can be seen from the figure, the contention loss probability function can be divided into three domains:(1)
low BC values domain: the probability increases with the decrease of BC and FC;(2)
central domain: the contention loss probability is constant, independent of BC and FC values;(3)
high BC values domain: the probability increases with the decrease of BC and FC.Due to space limitations, graphs for SaMAC with different parameter values are omitted, but it should be noted that the recorded probability of contention loss follows the same pattern in all simulated network scenarios. The widths of the first and the third domain are roughly equal and determined byWmin value, with central domain occupying the rest.This leads to the conclusion that the constant contention loss probability is obviously not an inherent property of distributed MAC protocols that use BC countdown in medium contention process. Therefore, validity of the usual assumption should be confirmed beforehand if the conventional approach is used for modeling of new proposed MAC protocols. On the other hand, in order to accurately model a protocol with inconstant contention loss probability, one should estimate the contention loss probability for each state in the underlying Markov chain. This approach is presented in more detail in the following sections.


## 4.4. Medium Contention Observations

In this section, a detailed inspection of medium contention process in SaMAC network is performed. Figure7 shows an example of medium contention where five active stations (x1-x5) use the same contention window, shifted from zero, with Wmin=4 and Wmax=12. Additionally, stations employ CPCF algorithm with the freezing limit set to k=4. Each station’s state during a contention is determined by its BC and FC values and represented by the station’s position in the depicted BC-FC matrix. Five discrete moments are shown, delimiting four consecutive timeslots, starting with t = 0 when the contention is started (e.g., in t = 0 station x4 has BC = 5 and FC = 1).Figure 7
An example of medium contention between five SaMAC stations.Since no station has the right to access medium in t = 0, during the first timeslot the stations decrement their respective BC values, shifting to the left by one position in the BC-FC matrix. The same decrementing of BC recurs after t = 1 and t = 2. Since it decrements its BC to zero, in t = 3 the station x2 wins the medium and transmits data during the fourth timeslot. During the busy timeslot, other stations increment their FC, if permitted by their current FC value and the value of freezing limitk (stations x1, x4, and x5). On the other hand, the winning station (station x2) and stations not allowed to increment FC (station x3) reset their FC and randomly select new BC, taking one of the shaded initial states in BC-FC matrix.In the presented medium contention a specific countdown pattern can be recognized. All stations behave in the same manner from the beginning (t = 0) until the end of the contention (t = 4). Their positions in the BC-FC state plane are shifted to the left by the amount of empty timeslots in the contention, relative to t = 0 (Figure8). This pattern of stations in the BC-FC matrix is only broken during the busy timeslots, when the winning station (or more winning stations, in case of a collision) and the stations that are not allowed to increment FC randomly select new BC, taking one of the initial states, while all other stations shift up by one position.Figure 8
Translation of SaMAC stations in BC-FC plane during medium contention.From these observations, one can conclude that the probability distribution of station’s states at the end of the medium contention is the same as the distribution at the start of contention, but shifted to the left by the number of idle timeslots in contention. The number of idle timeslots represents the duration of the contention expressed in timeslots. Additionally, with a given probability distribution of states at the start of a busy timeslot, the distribution after the timeslot can be obtained by shifting up by one the probabilities of states with BC > 0 andFC<k, and assigning all initial states equal probability. These conclusions are used as the basis for the mathematical model of SaMAC protocol.


## 4.5. Markov Chain Model of a Single SaMAC Station’s Operation

Consider a network ofn active wireless stations communicating using SaMAC protocol defined in Section 3. In modeling of such a network, several common assumptions are used:(i)
channel is ideal,(ii)
there are no hidden stations (one-hop network),(iii)
there is an unlimited number of retransmissions,(iv)
timeslots are synchronized for all stations,(v)
ACK and CTS timeouts and EIFS times are ignored.However, the usual assumption of the constant contention loss probability is not used.The presented model is defined as follows. Letx(t) andy(t) represent the values of the BC and FC for a given station at a timeslott, respectively, and let s(t) represent the channel state during the previous timeslot (s=1 if channel was busy during the previous timeslot, and s=0 if it was idle). This extra information is needed since the probability of contention loss depends heavily on the channel state during the previous timeslot. Then st,xt,yt defines the state of the station at timeslot t, and during operation each station goes through a sequence of such states. After idle timeslot a station will decrement its BC to find itself in the state 0,xt-1,yt. If the observed station does not start transmitting in the current timeslot, and some other station starts its transmission, the observed nontransmitting station will increment its FC to find itself in the state 1,xt,yt+1. This procedure continues until the observed station decrements its BC to 0 and starts transmitting or loses the contention when its FC equals k. In any of these two cases, the station resets FC to zero and randomly selects a new BC, to find itself in the state 1,BC,0, where Wmin≤BC<Wmax. These states are calledinitial states (the lowest row of states in Figure 9), and from one of them a station reenters the countdown process. The contention window is constant, and a new BC is uniformly selected from the range CW=[Wmin,Wmax-1]. Therefore, the probability of selecting each BC is the same and equals 1/W, where W=Wmax-Wmin.Figure 9
Discrete Markov chain model for SaMAC protocol.In the proposed model, operation of a single station is modeled using the three-dimensional Markov chain presented in Figure9, and the state s,i,j represents the state of the station. Let us adopt the notation Ps1,i1,j1∣s0,i0,j0=Ps(t+1)=s1,x(t+1)=i1,y(t+1)=j1∣s(t)=s0,x(t)=i0,y(t)=j0. One-step transition probabilities in the chain are given with(1)P1,i,j∣0,i,j-1=ti,j-1i∈1,Wmax-2;j∈1,kP0,i,j∣0,i+1,j=ei+1,ji∈0,Wmax-3;j∈0,kP0,i,j∣1,i+1,j=1i∈0,Wmax-2;j∈0,kP1,i,0∣0,0,j=1Wi∈Wmin,Wmax-1;j∈0,kP1,i,0∣0,m,k=tm,kWi∈Wmin,Wmax-1;m∈1,Wmax-2Probabilities of all other one-step transitions equal zero. Probability that a station experiences a busy timeslot (i.e., a contention loss) following an idle timeslot is not constant but depends on the station’s current BC and FC values and is denoted by ti,j for a station with BC=i and FC=j. Accordingly, probability of an idle timeslot following another idle timeslot is denoted by ei,j=1-ti,j. Since all stations in the modeled SaMAC protocol use shifted contention windows, there is no possibility that any station randomly selects BC=0. As a result, there is no possibility of two or more consecutive busy timeslots and the probability of an idle timeslot after a busy timeslot equals 1.In order to effectively model SaMAC wireless network, probability distribution of states and their transition probabilities in the underlying Markov chain must be determined. Since contention loss probability in SaMAC is not constant, these probabilities cannot be determined simply from transmission probability, as in conventional MAC models. In the presented model of SaMAC protocol, probabilities of all possible trajectories that lead the observed station from an arbitrary initial state back to one of initial states are determined first. These trajectories represent transitions of the station in Markov chain during multiple and at mostk+1 medium contentions (because of limited freezing mechanism). Calculation of the station’s transition probabilities from the start of a contention to the start of the next contention is based on observations from Section 4.4. By accounting for all possible combinations of contention durations for k+1 consecutive contentions, conditional states’ probability distribution after a busy timeslot is obtained. Probability distribution of all states in the Markov chain is determined in two steps:(i)
first, conditional probability distributionb1 is estimated using the iterative procedure described below; distribution b1 represents the conditional probability of states after a busy timeslot (states with s=1), given that the previous timeslot was busy;(ii)
afterwards, the probability distributionb of all states in the Markov chain (including the states after an idle timeslot) and probabilities of contention loss ti,j in each of these states are derived.Once the probabilities of all states in the Markov chain and of one-step transitions have been determined, probability of an idle timeslot and of a collision is calculated, and the model is completed with network throughput calculation.


## 4.6. Iterative Procedure for Determining the Probability Distribution of States after a Busy Timeslot

Calculation of the probability distributionb1 is based on the observation that the probability distribution of states at the start of contention can be obtained from the known probability distribution at the beginning of the previous contention, by shifting probability matrix appropriate number of positions to the left and one position up, while assigning initial states an equal probability.Iterative process of estimating probability distributionb1 is carried out as follows:(1)
Initially, probability distributionb1 is assumed to be uniform; i.e., all states in the Markov chain that represent the station after a busy timeslot (states with s=1) are assumed to have equal probability. These are the states from which the station enters medium contention. Distribution b1 is assumed to be the same for all active stations.(2)
For the observed station in one of the initial states1,Wmin≤i<Wmax,0, probabilities of all possible combinations of contention durations, expressed in the number of idle timeslots, for k+1 consecutive contentions, are derived from the probability distribution b1.(3)
New probability distributionb1calc is derived from the probabilities of contention duration combinations.(4)
Filtering of the probability distribution is made in order to assure that theb1 distribution converges to a stable state b1new=α·b1calc+(1-α)·b1old, where α is a filtering constant of common EWMA algorithm tuned for best stability-complexity compromise.(5)
Steps (2)–(4) are iteratively repeated until probability distribution of statesb1 becomes stable (up to a predefined threshold).It is important to note that we have no prior knowledge on the appropriate probability distributionb1. For that reason, uniform distribution has been selected as the initial distribution in the first step of the iterative process. Fixed value of the filtering constant α=0,5 has been used in this paper, since it has been empirically determined that this value provides good compromise between the stability and computation speed for wide range of considered scenarios.


### 4.6.1. Probability Distribution of Combination of Contention Durations

The goal of the second step of the iterative process is to determine, given a presumed distributionb1 (initial or obtained in the previous iteration), the probability of each combination of contention durations for k+1 consecutive contentions from the point of view of the observed station occupying one of the initial states.First, the probability for each possible durationr of the first contention is calculated, using expression(2)durr=1-∑x=0r-1∑y=0kb1x,yn-1-1-∑x=0r∑y=0kb1x,yn-1,where dur(r) represents the probability that the medium contention consists of r idle timeslots and b1x,y denotes the (assumed) conditional probability of state 1,x,y given that the station is in one of the states representing a station after a busy timeslot (states with s=1). The minuend in (2) is the probability that each of n-1 remaining stations has BC greater than r-1, while subtrahend is the probability that the BCs of all n-1 remaining stations are greater than r.After the probabilities of all possible durations for the first contention have been calculated, for each of these durations distributionb1 is suitably adapted using procedure described below. Using the adapted distribution b1 and (2), probabilities of all possible durations for the second contention are calculated. For each combination of the first two contention durations, distribution b1 is adapted again, and probabilities of all possible third contention durations are determined. This continues until probabilities of all combinations of contention durations for k+1 consecutive contentions are obtained.


### 4.6.2. Adaptation of the Probability Distributionb1

Suppose that the distributionb1prev before the previous contention is known and that the contention lasted a idle timeslots. Before the calculation of probabilities of durations for the next contention, b1prev must be adapted in such a way that the probabilities of states 1,i,j are annulled if i≤a or j=k, since the stations occupying those states would have counted their BC values down to zero during the previous contention or would not be allowed to increment their FC after the loss of the contention. Afterwards, probabilities of all other states in b1 are shifted a positions to the left and one position up, mimicking the stations’ process of decrementing BC and incrementing FC during the contention. The probabilities of all initial states 1,i,0, where Wmin≤i<Wmax, are assigned the probability equal to the sum of probabilities that have been annulled and divided by W, assuring that the sum of probabilities of all states remains 1. Therefore, given that the previous contention consisted of a idle timeslots, adaptation of distribution b1 for the calculation of probability of the next contention duration is performed using(3)b1nexti,j=b1previ+a,j-1,if0<i<Wmax-1-aandj>0(4)b1nexti,0=1W∑b1prevu,vwhere0<u≤aorv=k,  ifi≥Wmin(5)b1nexti,j=0,otherwiseThe adapted distributionb1next is used to calculate probabilities of all possible durations b of the next contention, given that the distribution before the previous contention was b1prev and it contained a idle timeslots.Figure10 is an example of such a probability distribution adaptation process for SaMAC protocol with k=4, Wmin=4, and Wmax=12. Each position in BC-FC matrices represents assumed probability of one state in Markov chain at the beginning of contention: the first contention in Figure 10(a), the second in Figure 10(b), and the third contention in Figure 10(c). Shaded positions represent probabilities that might be greater than zero. Certain probabilities (pA, pB, and pC) are particularly noted in order to improve understanding of the shifting of the probability matrix during the adaptation process.Figure 10
Example of probability distribution adaptation for calculation of probability of the third contention’s duration.Letdurj(x∣a,b,c,…) denote the probability that the observed station loses in the jth medium contention after x idle timeslots, given that the first contention lasted a idle timeslots, the second lasted b, the third c, etc. Matrices shown in Figure 10 represent the adaptation of distribution b1 for the calculation of probability of duration of the third contention if the first contention contained two and the second contained three idle timeslots dur3(x∣2,3). Figure 10(a) shows probability distributionb1 obtained in step (1) or step (4) of the iterative process. This distribution is used to determine probability that the first contention contains two idle timeslots dur1(2). Figure 10(b) represents probability distribution used for calculation of the second contention’s duration probability, given that the first contention consisted of two idle timeslots. The distribution is obtained by shifting the initial assumed distribution, shown in Figure 10(a), by two steps to the left and one up in (3). While doing this, some probabilities are shifted outside of the probability matrix. Those probabilities are added together and divided by W, defining probabilities of initial states (4), shaded purple in Figure 10(b). This distribution is then used to calculate probability that the second contention contains three idle timeslots, given that the first contained two dur2(3∣2). Afterwards, the distribution is adapted again in order to obtain probability distribution for the calculation of the third contention’s duration probability. The distribution is shifted three positions to the left and one position up. Again, probabilities from positions that are annulled are added together and used to determine probability of initial states (shaded green in Figure 10(c)). Finally, this distribution is used for the calculation of probability of duration of the third contention, given that the first contained two and the second contained three idle timeslots dur3(x∣2,3).After repeating this process fork+1 consecutive medium contentions, the probability p(1,i,j∣1,i+z,0) that the observed station transitions from the initial state 1,i+z,0 to state 1,i,j can be expressed as the sum of probabilities of all combinations of j consecutive contention durations that last z idle timeslots combined:(6)p1,i,j∣1,i+z,0=combDurz,j=∑dur1a·dur2b∣a·…·durjx∣a,b,c,…,such that (a+b+c+⋯+x)=z.To illustrate, Figure11 shows six possible trajectories that take a station from the state 1,i+5,0 to the state 1,i,3. Transitions from 1,i+5,0 to 0,i+4,0 and from 0,i,2 to 1,i,3 are omitted from the figure since they happen with probability 1 for all trajectories. Each matrix cell in Figure 11 represents certain combination of station’s BC and FC values after an idle timeslot, and coordinates of dots on trajectories represent station’s BC-FC values when it loses medium contention. For example, green line represents the trajectory that a station would take if the first contention contained one idle timeslot (contention loss at BC=i+4 and FC = 0) and the second and the third contention contained two idle timeslots each. That means that the probability of the green trajectory is dur11·dur2(2∣1)·dur3(2∣1,2). To calculate the probability p(1,i,3∣1,i+4,0), one needs to calculate probabilities of all 6 trajectories and sum them as in (6).Figure 11
Example of different trajectories that a station can take between two states.Thus, probability of all states that represent a station after a busy timeslot can be expressed as a sum of probabilities that the station gets to that state from one of the initial states, using the following equation:(7)b1i,j=b1Wmax-1,0·∑z=max0,Wmin-iWmax-1-icombDurz,j,where b1Wmax-1 is the probability of each initial state after a busy timeslot. From the normalization condition(8)∑i∑jb1i,j=1the probabilities of initial states are calculated, and consequently probabilities of all other states in the chain.The presented process represents steps (2) and (3) of the iterative modeling of SaMAC station’s operation, and the probability distributionb1calc obtained from (7) and (8) is filtered (step (4) of the iterative process) and used in the next iteration. Obviously, the process of deriving the probability distribution of combination of contention durations for k+1 consecutive contentions is very computationally expensive process, with computational complexity of O(Wmaxk+1).


## 4.6.1. Probability Distribution of Combination of Contention Durations

The goal of the second step of the iterative process is to determine, given a presumed distributionb1 (initial or obtained in the previous iteration), the probability of each combination of contention durations for k+1 consecutive contentions from the point of view of the observed station occupying one of the initial states.First, the probability for each possible durationr of the first contention is calculated, using expression(2)durr=1-∑x=0r-1∑y=0kb1x,yn-1-1-∑x=0r∑y=0kb1x,yn-1,where dur(r) represents the probability that the medium contention consists of r idle timeslots and b1x,y denotes the (assumed) conditional probability of state 1,x,y given that the station is in one of the states representing a station after a busy timeslot (states with s=1). The minuend in (2) is the probability that each of n-1 remaining stations has BC greater than r-1, while subtrahend is the probability that the BCs of all n-1 remaining stations are greater than r.After the probabilities of all possible durations for the first contention have been calculated, for each of these durations distributionb1 is suitably adapted using procedure described below. Using the adapted distribution b1 and (2), probabilities of all possible durations for the second contention are calculated. For each combination of the first two contention durations, distribution b1 is adapted again, and probabilities of all possible third contention durations are determined. This continues until probabilities of all combinations of contention durations for k+1 consecutive contentions are obtained.


## 4.6.2. Adaptation of the Probability Distributionb1

Suppose that the distributionb1prev before the previous contention is known and that the contention lasted a idle timeslots. Before the calculation of probabilities of durations for the next contention, b1prev must be adapted in such a way that the probabilities of states 1,i,j are annulled if i≤a or j=k, since the stations occupying those states would have counted their BC values down to zero during the previous contention or would not be allowed to increment their FC after the loss of the contention. Afterwards, probabilities of all other states in b1 are shifted a positions to the left and one position up, mimicking the stations’ process of decrementing BC and incrementing FC during the contention. The probabilities of all initial states 1,i,0, where Wmin≤i<Wmax, are assigned the probability equal to the sum of probabilities that have been annulled and divided by W, assuring that the sum of probabilities of all states remains 1. Therefore, given that the previous contention consisted of a idle timeslots, adaptation of distribution b1 for the calculation of probability of the next contention duration is performed using(3)b1nexti,j=b1previ+a,j-1,if0<i<Wmax-1-aandj>0(4)b1nexti,0=1W∑b1prevu,vwhere0<u≤aorv=k,  ifi≥Wmin(5)b1nexti,j=0,otherwiseThe adapted distributionb1next is used to calculate probabilities of all possible durations b of the next contention, given that the distribution before the previous contention was b1prev and it contained a idle timeslots.Figure10 is an example of such a probability distribution adaptation process for SaMAC protocol with k=4, Wmin=4, and Wmax=12. Each position in BC-FC matrices represents assumed probability of one state in Markov chain at the beginning of contention: the first contention in Figure 10(a), the second in Figure 10(b), and the third contention in Figure 10(c). Shaded positions represent probabilities that might be greater than zero. Certain probabilities (pA, pB, and pC) are particularly noted in order to improve understanding of the shifting of the probability matrix during the adaptation process.Figure 10
Example of probability distribution adaptation for calculation of probability of the third contention’s duration.Letdurj(x∣a,b,c,…) denote the probability that the observed station loses in the jth medium contention after x idle timeslots, given that the first contention lasted a idle timeslots, the second lasted b, the third c, etc. Matrices shown in Figure 10 represent the adaptation of distribution b1 for the calculation of probability of duration of the third contention if the first contention contained two and the second contained three idle timeslots dur3(x∣2,3). Figure 10(a) shows probability distributionb1 obtained in step (1) or step (4) of the iterative process. This distribution is used to determine probability that the first contention contains two idle timeslots dur1(2). Figure 10(b) represents probability distribution used for calculation of the second contention’s duration probability, given that the first contention consisted of two idle timeslots. The distribution is obtained by shifting the initial assumed distribution, shown in Figure 10(a), by two steps to the left and one up in (3). While doing this, some probabilities are shifted outside of the probability matrix. Those probabilities are added together and divided by W, defining probabilities of initial states (4), shaded purple in Figure 10(b). This distribution is then used to calculate probability that the second contention contains three idle timeslots, given that the first contained two dur2(3∣2). Afterwards, the distribution is adapted again in order to obtain probability distribution for the calculation of the third contention’s duration probability. The distribution is shifted three positions to the left and one position up. Again, probabilities from positions that are annulled are added together and used to determine probability of initial states (shaded green in Figure 10(c)). Finally, this distribution is used for the calculation of probability of duration of the third contention, given that the first contained two and the second contained three idle timeslots dur3(x∣2,3).After repeating this process fork+1 consecutive medium contentions, the probability p(1,i,j∣1,i+z,0) that the observed station transitions from the initial state 1,i+z,0 to state 1,i,j can be expressed as the sum of probabilities of all combinations of j consecutive contention durations that last z idle timeslots combined:(6)p1,i,j∣1,i+z,0=combDurz,j=∑dur1a·dur2b∣a·…·durjx∣a,b,c,…,such that (a+b+c+⋯+x)=z.To illustrate, Figure11 shows six possible trajectories that take a station from the state 1,i+5,0 to the state 1,i,3. Transitions from 1,i+5,0 to 0,i+4,0 and from 0,i,2 to 1,i,3 are omitted from the figure since they happen with probability 1 for all trajectories. Each matrix cell in Figure 11 represents certain combination of station’s BC and FC values after an idle timeslot, and coordinates of dots on trajectories represent station’s BC-FC values when it loses medium contention. For example, green line represents the trajectory that a station would take if the first contention contained one idle timeslot (contention loss at BC=i+4 and FC = 0) and the second and the third contention contained two idle timeslots each. That means that the probability of the green trajectory is dur11·dur2(2∣1)·dur3(2∣1,2). To calculate the probability p(1,i,3∣1,i+4,0), one needs to calculate probabilities of all 6 trajectories and sum them as in (6).Figure 11
Example of different trajectories that a station can take between two states.Thus, probability of all states that represent a station after a busy timeslot can be expressed as a sum of probabilities that the station gets to that state from one of the initial states, using the following equation:(7)b1i,j=b1Wmax-1,0·∑z=max0,Wmin-iWmax-1-icombDurz,j,where b1Wmax-1 is the probability of each initial state after a busy timeslot. From the normalization condition(8)∑i∑jb1i,j=1the probabilities of initial states are calculated, and consequently probabilities of all other states in the chain.The presented process represents steps (2) and (3) of the iterative modeling of SaMAC station’s operation, and the probability distributionb1calc obtained from (7) and (8) is filtered (step (4) of the iterative process) and used in the next iteration. Obviously, the process of deriving the probability distribution of combination of contention durations for k+1 consecutive contentions is very computationally expensive process, with computational complexity of O(Wmaxk+1).


## 4.7. Probability Distributionb and Probability of Contention Loss ti,j

After the probability distributionb1 becomes stable, iterative calculation of b1 is terminated and the probability distribution b of all states is determined, as well as the probability of contention loss ti,j in every state 0,i,j. Since b1i,j is the probability of state 1,i,j given that the station is in one of the states following a busy timeslot, and b1,i,j is unconditional probability of that state (i.e., in any timeslot, following a busy or an idle timeslot), it is obvious that(9)b1,i,j·b1,Wmax-1,0-1=b1i,j·b1Wmax-1,0-1.Thus, probabilities b1,i,j can be easily expressed as a function of b1,Wmax-1,0 for every i∈[1,Wmax-1],j∈[0,k].From the regularities of Markov chain shown in Figure9, one can conclude that b0,Wmax-2,0=b1,Wmax-1,0. Similarly, for the rightmost states in every chain row, b0,i,j=b1,i+1,j holds. State 1,i,j+1 can only be reached from the state 0,i,j, and the probability of transition is ti,j, the following holds:(10)ti,j=b1,i,j+1b0,i,j.Probabilities of other states in the underlying Markov chain are calculated from(11)b0,i,j=b1,i+1,j+1-ti+1,j·b0,i+1,j(12)b1,i,j=ti,j-1·b0,i,j-1Using (10), (11), and (12), probabilities of all states in Markov chain can be expressed as a function of the probability of the initial state 1,Wmax-1,0, and probabilities of contention loss in those states are calculated. Finally, from normalization condition, probabilities of all states in Markov chain are determined.


## 4.8. Probability of an Idle Timeslot and Collision Probability

After determining the probability distribution of statesb and the probability of a contention loss in each state ti,j, the probability of an idle timeslot and collision probability can be calculated.In various models presented in the literature and based on Bianchi’s assumptions, these probabilities are calculated from the probability, usually denoted byτ, that the observed station starts to transmit in a random timeslot. However, this approach cannot be applied to SaMAC protocol modeling, since the probability that a random station starts transmitting is not constant, as shown in Figure 6.In the model proposed it is assumed that the probability that an observed station starts to transmit is constant only in those timeslots in which at least one ofn active stations (including the observed station) transmits data. Therefore, the assumption of a constant probability of a medium access is replaced with more stringent assumption and limited only to busy timeslots.Probabilityti,j is the probability that at least one of remaining (n-1) stations wins the medium when the observed station is in the state 0,i,j. If i=0,  t0,j represents the probability that the observed station experiences collision when it wins the medium in the state 0,0,j. Hence, the probability that the observed station experiences a collision, given that it wins the medium, is calculated as the weighted sum:(13)Pcolb=∑j=0kt0,j·b0,j·∑j=0kb0,j-1.Probability Pcolb represents the conditional probability that at least one of the remaining (n-1) stations starts transmission, given that the observed station transmits. Hence, assuming constant probability of transmission in busy timeslots for all active stations, the probability of transmission in busy timeslot for each station is given with(14)τb=1-1-Pcolbn-1.Now collision probability Pcol and probability of successful transmission Psucc can be obtained as(15)Pcol=1-n·τb1-τbn-11-1-τbn,Psucc=1-Pcol.The probability of an idle timeslotPidle is determined as a sum of probabilities that the observed station experiences an idle timeslot in each state of Markov chain. Of course, states with BC = 0 are omitted, since in those states the observed station wins the medium:(16)Pidle=∑i=1Wmax-1∑j=0kb0,i,j·1-ti,j+b1,i,j.Product in the square brackets represents the probability of an idle timeslot after another idle timeslot, whileb1,i,j represents the probability of an idle timeslot after a busy timeslot.


## 4.9. Throughput Calculation

Finally, throughput for wireless network ofn active SaMAC stations can be obtained as(17)S=1-Pidle·Psucc·EPidle·σ+1-Pidle·Psucc·Ts+1-Pidle·Pcol·Tc,where σ represents the duration of an idle timeslot, E is average payload size, and Ts and Tc are average times of channel being sensed busy during successful transmission and during collision, respectively.Duration of collision and that of successful transmission depend on the technology and parameter set used in the physical layer and should be differentiated based on the access method used (basic method versus RTS/CTS). LetTRTS, TCTS, and TACK denote durations of control frames RTS and CTS and MAC acknowledgement, respectively, let Tdata denote average time needed for transmission of MAC data frame, including preamble and PHY and MAC headers, and let δ be propagation delay. For basic access method, times Ts and Tc are(18)Ts=Tdata+SIFS+TACK+DIFS+2δTc=Tdata+DIFS+δFor RTS/CTS access mechanism, we have(19)Ts=TRTS+SIFS+TCTS+SIFS+Tdata+SIFS+TACK+DIFS+4δTc=TRTS+DIFS+δTdata can be obtained as a sum of durations of PLCP preamble, PLCP header, MAC header, and, finally, the average duration of MAC frame payload itself:(20)Tdata=Tpreamble+TPHYheader+TMACheader+Tpayload


## 5. Simulation Tool and Model Verification

### 5.1. Simulation Tool Verification

To evaluate SaMAC performance, two simulators are used: ns-3 and custom MATLAB simulation tool. ns-3 [66] is a discrete-event network simulator that is often used in network research, and implementation of 802.11 set of standards in ns-3 has been validated in literature [67]. However, it uses whole protocol stack in order to simulate network operation as accurately as possible. This can introduce significant overhead, specifically when testing MAC protocols. Therefore, a custom simulation tool was written in MATLAB to evaluate SaMAC protocol’s performance.To verify accuracy of our custom simulation tool, its results are compared with the results obtained from ns-3 simulator, for several network scenarios and for both SaMAC and 802.11 networks. For that reason, SaMAC protocol (as defined in Section3) was added to ns-3 and simulations of single-hop ad hoc network with ideal channel and saturated stations with turned off frame capture effect were run on both simulators. 802.11 and SaMAC networks were considered and the number of active stations was varied from 3 to 50. In order to examine simulation results for both older and newer versions of 802.11 standard, two sets of simulations were run, with one considering 802.11g and the other 802.11n standard. Accordingly, two sets of simulations were run for SaMAC protocol, with the other set, denoted SaMACn, mirroring advances of the 802.11n standard. 802.11n has new mechanisms implemented in physical layer, manifested in MAC layer primarily through increased data rate. Same as 802.11n standard, SaMACn protocol is capable of sending more than one data frame in a single medium access. Maximum amount of data sent per transmission is determined by max MSDU and max MPDU parameters. Since only saturated stations are considered, the amount of data sent in every transmission is defined by these parameters. Network parameters used in both simulators are presented in Table 1.Table 1
Network parameters used.
Parameter Value Payload size 1040 B DCFW0 16 DCFWmax 1024 SaMACWmin 16 SaMACWmax 48 SaMAC Freezing limitk 4 802.11g and SaMAC SIFS 10µs Idle timeslot duration (σ) 9µs DIFS 50µs Propagation delay (δ) 0µs T preamble 16µs T PHYheader 4µs T ACK 50µs Retry limit 7 Data rate 6 Mbps 802.11n and SaMACn SIFS 16µs Idle timeslot duration (σ) 9µs DIFS (AIFS) 43µs Propagation delay (δ) 0µs T preamble 16µs T PHYheader 4µs T HtSigHeader 8µs T ACK 28µs Guard interval 400 ns Channel 20 MHz max MPDU aggregation 0 B max MSDU aggregation 8192 B 802.11n MCS index 6 Retry limit 7 Data rate 65 MbpsIt should be mentioned thatWmin and Wmax do not denote the same thing in DCF and SaMAC protocols. In DCF, Wmin and Wmax denote the upper bound of the initial (W0) and maximal contention window, respectively, while the lower bound is zero for all DCF contention windows. On the other hand, SaMAC uses only one congestion window (shifted from zero) and does not include any CW size manipulation algorithm. Thus, for SaMAC protocol, Wmin and Wmax denote lower and upper bound of the used CW.Figure12 shows the difference in recorded MAC throughput between MATLAB and ns-3 simulators, expressed as a percentage of throughputs recorded in ns-3 simulator for considered scenarios. As can be seen, the simulators produce almost identical results for both simulated protocols and both versions of each protocol, with the greatest difference in recorded throughput being less than 0,3% in networks with up to 50 stations. Thus, it can be concluded that the custom MATLAB simulator provides quite reliable results. MATLAB simulator is much simpler and faster than ns-3 simulator, optimized for MAC-level network simulation, and allows simple extraction of results. Therefore, further simulations are performed using this simulator.Figure 12
Difference in recorded throughput between ns-3 and custom MATLAB simulator.


### 5.2. SaMAC Model Verification

To verify presented model, its results are compared with the results of simulations of a SaMAC network. Single-hop ad hoc network of saturated stations was simulated. The simulation time was measured in timeslots. Each network scenario was run 30 times and lasted 1 million timeslots. Only data from the final 0,9 million timeslots were taken into account in order to capture steady state condition results. Network parameters used in simulations and model calculations are the same as in Table1. These values are in accordance with 802.11-2007 and 802.11n-2009 standards. Simulation scenarios included various numbers of active stations in the network (from 3 to 50), window sizes W, lower bounds Wmin, and one of two MSDU sizes: 1040B and 290B. These sizes were selected in order to detect possible deficiencies in model’s throughput estimation. Namely, in the case of a network with small number of active stations and small payloads (290B), a large part of time is spent in medium contention, so it is important to correctly estimate probability of an idle timeslot. On the other hand, in networks with greater number of active stations and large data frames (1040B), transmissions take up most of the time. Thus, to correctly estimate network throughput, model should give correct estimations of collision and successful transmission probabilities.In the first step of model validation, we verify the iterative process used to obtain conditional probability distributionb1 of states after a busy timeslot. Stable distribution from the model is compared with the conditional probability of states after a busy timeslot recorded in simulations. Figure 13 shows these probabilities for SaMAC network with 20 active stations, contention window size W=32, lower bound Wmin=16, and freezing limit k=4. Probabilities for each FC value are shown as a function of BC.Figure 13
Probability distribution b1 of states after a busy timeslot in network of 20 active stations andW=32, Wmin=16, and k = 4.The figure shows that the iterative algorithm fairly accurately predicts probabilities of states after a busy timeslot. However, certain discrepancies exist in the areas where the probability of a state is not constant, but increases or reduces with the increase of BC for a given FC. We suspect that this difference is due to some correlations between stations that were ignored by our model (e.g., the fact that, owing to use of shifted window, there must be at leastWmin idle timeslots during k consecutive medium contentions). In scenarios with different network parameters values it was noticed that these discrepancies in probabilities slightly increase with the increase in number of active stations and Wmin.The conditional probability distributionb1 obtained from model’s iterative process is used to obtain the (unconditional) probability distribution b of all states and the probability of contention loss in each state. These probabilities are shown in Figure 14 and compared with the results obtained from simulations. Again, results for network with 20 active stations, W=32, Wmin=16, and k=4, are shown. Certain errors in model’s results for both sets of probabilities can be observed, caused exclusively by the errors in model’s estimation of conditional probability distribution b1. Indeed, if the conditional probability distribution b1 recorded in simulations is used in the model for calculation of unconditional probabilities of states b and of contention loss in those states, model provides accurate results, verifying correctness of the method presented in Section 4.7. However, it is important to notice that the model accurately estimates probabilities of contention loss when the observed station’s BC equals zero. Correct estimation of these probabilities is significant for the accuracy of the model’s network throughput estimation, since they are used for the calculation of the collision probability.Figure 14
Probability of (a) Markov chain states and (b) contention loss after an idle timeslot in network of 20 active stations and W = 32,Wmin=16, and k = 4.
(a) (b)Probabilities of an idle timeslotPidle and timeslots containing a collision PcolTS or successful data transfer PsuccTS obtained from the model and simulations are compared in Figure 15. It should be noted that PcolTS=1-Pidle·Pcol and PsuccTS=(1-Pidle)·Psucc. Results of SaMAC protocol with W=32 and different values of Wmin (Wmin=16,24) and freezing limit k (k=1,4) are shown as a function of the number of active stations in the network. Model’s results, depicted with lines, and simulation results, represented by dots, coincide in Figure 15, since the errors in model’s estimation of depicted probabilities are less than 2%.Figure 15
Probability of timeslot transmission status from model and simulations for SaMAC with W = 32.Finally, using these probabilities network throughput is obtained, and the results are presented in Figure16. Additional scenarios with different values of network parameters are also shown in order to verify model’s accuracy in various conditions. Dots represent simulation results which are compared with presented model’s results. Network throughput is expressed as a portion of channel bandwidth and shown as a function of the number of active stations in the network, from 3 up to 50 stations. Two sets of data are presented, for MSDU sizes of 1040B and 290B. It can be seen that the presented model closely follows the simulation results. The largest error in throughput estimated by model is recorded for scenario with 35 stations, W=16, Wmin=16, k=1, and 1040B payload, where the relative error in estimated throughput equals 1,9%. As shown in Section 4.2, unjustified use of constant contention loss probability assumption would result in model’s errors of up to 40%. However, by determining contention loss probability individually for each state of the Markov chain, the presented model of SaMAC network manages to accurately estimate network throughput.Figure 16
Throughput comparison between model and simulations for (a) MSDU = 1040B and (b) MSDU = 290B.
(a) (b)In order to examine reliability of presented model in networks with higher data rates, in Figure17, we compare throughput obtained from model and simulations for SaMACn network. Since the medium access procedure for both SaMAC and SaMACn is the same, model based on the chain in Figure 9 can be applied for SaMACn. The only adjustments needed are setting the payload size to the one defined by max MSDU and max MPDU parameters and setting the appropriate transmission durations (for successful transmissions and for collisions), as well as IFS and ACK durations. Parameters used in model and simulations are the same as those in Table 1. Only results of scenario with 1040B frames are presented. Again, the presented model is shown to accurately predict the network throughput, regardless of the network size and protocol parameters’ values, with relative errors compared to simulation results being less than 2%.Figure 17
Throughput comparison between model and simulations for SaMACn network.The main causes of inaccuracies in our model’s throughput evaluation are errors in the estimation of the probability distributionb1 and of the collision probability Pcol. These two have approximately the same contribution to the overall error. Indeed, when the distribution b1 obtained from simulations is used for calculation of the distribution b and transition probabilities ti,j in our model, Pidle is correctly estimated while the overall relative error in throughput estimation halves.The presented results show that too constrained countdown freezing (e.g.,k=1) results with lower throughput, since the stations are frequently forced to restart the countdown process by selecting new BC value. In small networks, SaMAC with small Wmin (Wmin=8) achieves high throughput, but it quickly degrades if the number of station increases. On the other hand, selection of too great value of Wmin parameter (Wmin=24) results with better throughput in large networks, but worse in small networks with small data frames. Considering all scenarios, the best results are provided by protocol with CW=[16,47] and k=4.


## 5.1. Simulation Tool Verification

To evaluate SaMAC performance, two simulators are used: ns-3 and custom MATLAB simulation tool. ns-3 [66] is a discrete-event network simulator that is often used in network research, and implementation of 802.11 set of standards in ns-3 has been validated in literature [67]. However, it uses whole protocol stack in order to simulate network operation as accurately as possible. This can introduce significant overhead, specifically when testing MAC protocols. Therefore, a custom simulation tool was written in MATLAB to evaluate SaMAC protocol’s performance.To verify accuracy of our custom simulation tool, its results are compared with the results obtained from ns-3 simulator, for several network scenarios and for both SaMAC and 802.11 networks. For that reason, SaMAC protocol (as defined in Section3) was added to ns-3 and simulations of single-hop ad hoc network with ideal channel and saturated stations with turned off frame capture effect were run on both simulators. 802.11 and SaMAC networks were considered and the number of active stations was varied from 3 to 50. In order to examine simulation results for both older and newer versions of 802.11 standard, two sets of simulations were run, with one considering 802.11g and the other 802.11n standard. Accordingly, two sets of simulations were run for SaMAC protocol, with the other set, denoted SaMACn, mirroring advances of the 802.11n standard. 802.11n has new mechanisms implemented in physical layer, manifested in MAC layer primarily through increased data rate. Same as 802.11n standard, SaMACn protocol is capable of sending more than one data frame in a single medium access. Maximum amount of data sent per transmission is determined by max MSDU and max MPDU parameters. Since only saturated stations are considered, the amount of data sent in every transmission is defined by these parameters. Network parameters used in both simulators are presented in Table 1.Table 1
Network parameters used.
Parameter Value Payload size 1040 B DCFW0 16 DCFWmax 1024 SaMACWmin 16 SaMACWmax 48 SaMAC Freezing limitk 4 802.11g and SaMAC SIFS 10µs Idle timeslot duration (σ) 9µs DIFS 50µs Propagation delay (δ) 0µs T preamble 16µs T PHYheader 4µs T ACK 50µs Retry limit 7 Data rate 6 Mbps 802.11n and SaMACn SIFS 16µs Idle timeslot duration (σ) 9µs DIFS (AIFS) 43µs Propagation delay (δ) 0µs T preamble 16µs T PHYheader 4µs T HtSigHeader 8µs T ACK 28µs Guard interval 400 ns Channel 20 MHz max MPDU aggregation 0 B max MSDU aggregation 8192 B 802.11n MCS index 6 Retry limit 7 Data rate 65 MbpsIt should be mentioned thatWmin and Wmax do not denote the same thing in DCF and SaMAC protocols. In DCF, Wmin and Wmax denote the upper bound of the initial (W0) and maximal contention window, respectively, while the lower bound is zero for all DCF contention windows. On the other hand, SaMAC uses only one congestion window (shifted from zero) and does not include any CW size manipulation algorithm. Thus, for SaMAC protocol, Wmin and Wmax denote lower and upper bound of the used CW.Figure12 shows the difference in recorded MAC throughput between MATLAB and ns-3 simulators, expressed as a percentage of throughputs recorded in ns-3 simulator for considered scenarios. As can be seen, the simulators produce almost identical results for both simulated protocols and both versions of each protocol, with the greatest difference in recorded throughput being less than 0,3% in networks with up to 50 stations. Thus, it can be concluded that the custom MATLAB simulator provides quite reliable results. MATLAB simulator is much simpler and faster than ns-3 simulator, optimized for MAC-level network simulation, and allows simple extraction of results. Therefore, further simulations are performed using this simulator.Figure 12
Difference in recorded throughput between ns-3 and custom MATLAB simulator.


## 5.2. SaMAC Model Verification

To verify presented model, its results are compared with the results of simulations of a SaMAC network. Single-hop ad hoc network of saturated stations was simulated. The simulation time was measured in timeslots. Each network scenario was run 30 times and lasted 1 million timeslots. Only data from the final 0,9 million timeslots were taken into account in order to capture steady state condition results. Network parameters used in simulations and model calculations are the same as in Table1. These values are in accordance with 802.11-2007 and 802.11n-2009 standards. Simulation scenarios included various numbers of active stations in the network (from 3 to 50), window sizes W, lower bounds Wmin, and one of two MSDU sizes: 1040B and 290B. These sizes were selected in order to detect possible deficiencies in model’s throughput estimation. Namely, in the case of a network with small number of active stations and small payloads (290B), a large part of time is spent in medium contention, so it is important to correctly estimate probability of an idle timeslot. On the other hand, in networks with greater number of active stations and large data frames (1040B), transmissions take up most of the time. Thus, to correctly estimate network throughput, model should give correct estimations of collision and successful transmission probabilities.In the first step of model validation, we verify the iterative process used to obtain conditional probability distributionb1 of states after a busy timeslot. Stable distribution from the model is compared with the conditional probability of states after a busy timeslot recorded in simulations. Figure 13 shows these probabilities for SaMAC network with 20 active stations, contention window size W=32, lower bound Wmin=16, and freezing limit k=4. Probabilities for each FC value are shown as a function of BC.Figure 13
Probability distribution b1 of states after a busy timeslot in network of 20 active stations andW=32, Wmin=16, and k = 4.The figure shows that the iterative algorithm fairly accurately predicts probabilities of states after a busy timeslot. However, certain discrepancies exist in the areas where the probability of a state is not constant, but increases or reduces with the increase of BC for a given FC. We suspect that this difference is due to some correlations between stations that were ignored by our model (e.g., the fact that, owing to use of shifted window, there must be at leastWmin idle timeslots during k consecutive medium contentions). In scenarios with different network parameters values it was noticed that these discrepancies in probabilities slightly increase with the increase in number of active stations and Wmin.The conditional probability distributionb1 obtained from model’s iterative process is used to obtain the (unconditional) probability distribution b of all states and the probability of contention loss in each state. These probabilities are shown in Figure 14 and compared with the results obtained from simulations. Again, results for network with 20 active stations, W=32, Wmin=16, and k=4, are shown. Certain errors in model’s results for both sets of probabilities can be observed, caused exclusively by the errors in model’s estimation of conditional probability distribution b1. Indeed, if the conditional probability distribution b1 recorded in simulations is used in the model for calculation of unconditional probabilities of states b and of contention loss in those states, model provides accurate results, verifying correctness of the method presented in Section 4.7. However, it is important to notice that the model accurately estimates probabilities of contention loss when the observed station’s BC equals zero. Correct estimation of these probabilities is significant for the accuracy of the model’s network throughput estimation, since they are used for the calculation of the collision probability.Figure 14
Probability of (a) Markov chain states and (b) contention loss after an idle timeslot in network of 20 active stations and W = 32,Wmin=16, and k = 4.
(a) (b)Probabilities of an idle timeslotPidle and timeslots containing a collision PcolTS or successful data transfer PsuccTS obtained from the model and simulations are compared in Figure 15. It should be noted that PcolTS=1-Pidle·Pcol and PsuccTS=(1-Pidle)·Psucc. Results of SaMAC protocol with W=32 and different values of Wmin (Wmin=16,24) and freezing limit k (k=1,4) are shown as a function of the number of active stations in the network. Model’s results, depicted with lines, and simulation results, represented by dots, coincide in Figure 15, since the errors in model’s estimation of depicted probabilities are less than 2%.Figure 15
Probability of timeslot transmission status from model and simulations for SaMAC with W = 32.Finally, using these probabilities network throughput is obtained, and the results are presented in Figure16. Additional scenarios with different values of network parameters are also shown in order to verify model’s accuracy in various conditions. Dots represent simulation results which are compared with presented model’s results. Network throughput is expressed as a portion of channel bandwidth and shown as a function of the number of active stations in the network, from 3 up to 50 stations. Two sets of data are presented, for MSDU sizes of 1040B and 290B. It can be seen that the presented model closely follows the simulation results. The largest error in throughput estimated by model is recorded for scenario with 35 stations, W=16, Wmin=16, k=1, and 1040B payload, where the relative error in estimated throughput equals 1,9%. As shown in Section 4.2, unjustified use of constant contention loss probability assumption would result in model’s errors of up to 40%. However, by determining contention loss probability individually for each state of the Markov chain, the presented model of SaMAC network manages to accurately estimate network throughput.Figure 16
Throughput comparison between model and simulations for (a) MSDU = 1040B and (b) MSDU = 290B.
(a) (b)In order to examine reliability of presented model in networks with higher data rates, in Figure17, we compare throughput obtained from model and simulations for SaMACn network. Since the medium access procedure for both SaMAC and SaMACn is the same, model based on the chain in Figure 9 can be applied for SaMACn. The only adjustments needed are setting the payload size to the one defined by max MSDU and max MPDU parameters and setting the appropriate transmission durations (for successful transmissions and for collisions), as well as IFS and ACK durations. Parameters used in model and simulations are the same as those in Table 1. Only results of scenario with 1040B frames are presented. Again, the presented model is shown to accurately predict the network throughput, regardless of the network size and protocol parameters’ values, with relative errors compared to simulation results being less than 2%.Figure 17
Throughput comparison between model and simulations for SaMACn network.The main causes of inaccuracies in our model’s throughput evaluation are errors in the estimation of the probability distributionb1 and of the collision probability Pcol. These two have approximately the same contribution to the overall error. Indeed, when the distribution b1 obtained from simulations is used for calculation of the distribution b and transition probabilities ti,j in our model, Pidle is correctly estimated while the overall relative error in throughput estimation halves.The presented results show that too constrained countdown freezing (e.g.,k=1) results with lower throughput, since the stations are frequently forced to restart the countdown process by selecting new BC value. In small networks, SaMAC with small Wmin (Wmin=8) achieves high throughput, but it quickly degrades if the number of station increases. On the other hand, selection of too great value of Wmin parameter (Wmin=24) results with better throughput in large networks, but worse in small networks with small data frames. Considering all scenarios, the best results are provided by protocol with CW=[16,47] and k=4.


## 6. Performance Evaluation of SaMAC Protocol

### 6.1. Throughput of SaMAC Protocol

In order to evaluate performance of SaMAC protocol, we compare its throughput results with 802.11 network. Results for both lower (802.11g and SaMAC) and higher (802.11n and SaMACn) data rate networks are compared. Additionally, results of SCW (as defined in [46]) and CPCF protocols are also presented. For higher data rate network, these protocols were enhanced with data aggregation mechanism and are denoted SCWn and CPCFn. Again, single-hop network with ideal channel and saturated stations was simulated. Values of network parameters used are the same as in Table 1. Simulation scenarios included various numbers of active stations in the network (from 3 to 50) and one of two MSDU sizes: 1040B and 290B. For the higher data rate scenarios, only 1040B frames were used, since frame aggregation negates the influence that frame size has on overall throughput in saturated conditions. Recorded throughput is expressed as a portion of channel bandwidth and is shown as a function of the number of active stations in the network.Despite not including CW size manipulation algorithm, Figure18 shows that SaMAC provides higher network throughput in networks with a large number of active stations, in both low and high data rate networks. Compared to DCF, the increase in throughput is more than 20%. The reason for this is the fact that in congested network, and owing to imposed freezing limit k, SaMAC stations are frequently forced to reset FC and select new BC, restarting medium contention process. This prolongs the time needed to count BC down to zero and reduces the probability of accessing the medium in a random timeslot, decreasing collision probability. While DCF, SCW, and CPCF stations need to experience a collision to adapt their CW, a mere increase of network congestion causes SaMAC stations to more frequently abort current BC countdown process and select new BCs from shifted window. The duration of the countdown process is adaptively increased by frequent random selections of new BC, which serves as an equivalent to the increase of CW size in other protocols. Therefore, SaMAC protocol is proactive in responding to higher network congestion levels, avoiding collisions. For networks with small number of active stations (n<6), SaMAC achieves lower throughput, because of longer duration of medium contention owing to its use of shifted contention window.Figure 18
Throughput evaluation of considered protocols for (a) lower rate (6Mbps) and (b) higher rate (65Mbps) networks.
(a) (b)As evidenced in Figure19, good throughput results of SaMAC are consequence of its reduced collisions compared to other protocols. DCF with Wmin=16 has from 200% to 50% greater probability of collision (from channel’s point of view) than SaMAC protocol, for networks with 3 and 50 stations, respectively. For DCF with Wmin=32 probability of collision is from 80% to 40% greater. Since SCW and CPCF protocols react to collisions more aggressively than DCF, they experience 60% to 7% more collisions than SaMAC.Figure 19
Probability of collision from channel’s point of view.To further demonstrate adaptive nature of SaMAC protocol, network with varying number of active stations was considered and SaMAC throughput results are compared with DCF, SCW, and CPCF protocols. In a simulated scenario, only 5 stations were active at the start of simulation time. In the 10th second of the simulated time additional 10 stations were added to the network. In the 20th second of the simulation time, 20 new stations were added, bringing the total number of active stations to 35. In the 25th second 30 stations were removed from the network, lowering the number of active stations back to 5. The stations used 1040B frames and lower data rates (6Mbps channel). Network throughput was recorded every 0,2s and the results are shown in Figure20(a). Not only does SaMAC offer the highest throughput during the whole simulation time, but it is also the fastest among considered protocols to converge to steady throughput levels at the times of congestion increase. This is evident at t = 10s and t = 20s, when the number of stations in the network increases from 5 to 15 and from 15 to 35, respectively. Throughput of other examined protocols significantly deteriorates at those moments, before rising to steady value for the considered congestion level. The time needed to recover after congestion increases and reaches steady value is about 1s for all other protocols. On the other hand, SaMAC does not experience such a throughput decline but immediately adjusts to steady state throughput simply by experiencing more frequent contention losses caused by increased congestion. This is evidenced in Figure 20(b). While other protocols have spikes in recorded collision probability at times of congestion increase (t = 10s and t = 20s), SaMAC does not experience such maximums. All protocols are shown to be equally fast in reaction to network congestion decrease (t = 25s).Figure 20
Evaluation of considered protocols in a network with varying number of active stations: (a) network throughput and (b) collision probability.
(a) (b)


### 6.2. Fairness Evaluation of SaMAC Protocol

In Figure21 fairness results of SaMAC and other considered protocols are compared. Jain’s fairness index (JFI) [68] is calculated for various intervals (0,2s–10s) and shown for networks with 6 and 20 active stations. As expected, SaMAC clearly outperforms other considered protocols by considerate margin. JFI value of 0,95 is often considered as a threshold for differentiation between fair and unfair resource allocation [69–71]. In a network with 6 stations, SaMAC attains threshold value (i.e., JFI > 0,95) in less than 0,2s, while other protocols require from 0,5s (DCF with Wmin=32) to 2s (DCF with Wmin=16). In a network with 20 stations, SaMAC is again the fairest protocol, reaching fair allocation in less than 0,7s. Other protocols require from 7s (DCF with Wmin=32, CPCF) to more than 10s (DCF with Wmin=16, SCW) for JFI to reach 0,95.Figure 21
Fairness evaluation of considered protocols for networks with (a) 6 stations and (b) 20 stations.
(a) (b)The reason for such a superior performance of SaMAC in terms of fairness is its use of a single contention window, common for all network stations. While SCW and CPCF can be used to improve DCF’s throughput in congested networks, they still employ CW management mechanism and do not alleviate DCF’s unfairness. On the contrary, by the use of those mechanisms they can even decrease network fairness, as evident in the case of SCW in a network with 20 stations. On the other hand, SaMAC does not discriminate against the stations that experienced a collision by increasing the size or shift of its CW. Considering CW used for BC selection, all stations are always equal in SaMAC. Thus, SaMAC can achieve fair resource allocation even in very short intervals.


### 6.3. Jitter and Delay of SaMAC Protocol

In saturated conditions, total delay that a generated frame experiences depends on how congested the transmission buffer has become and this is determined by the difference in the offered load and saturation throughput. Therefore, the delay depends on duration and degree of saturation conditions. On the other hand, delay experienced by head of line (HOL) frame depends on the rate of successful transmission of data frames and is reciprocal to the network throughput (Figure18). Since low delay and jitter are one of the main requirements for real-time traffic, in this section we focus on HOL jitter and maximal experienced delay. Jitter results of SaMAC are compared with other protocols in Figure 22(a). Average jitter per station is shown for 6Mbps network with 1040B frames, and the results are normalized to SaMAC. Among the considered protocols, SaMAC offers the lowest jitter: 2 to 4 times lower than others, depending on the number of active stations. This is, again, due to common and fixed CW used in SaMAC. Owing to this, all stations have similar BC values and excessive waiting for medium access after (consecutive) collisions is avoided. Additionally, Figure 22(b) shows maximal delay recorded during the simulation (50s) experienced by any successfully transmitted HOL frame, averaged over 10 simulation runs. Increase of delay because of retransmissions is especially evident in CPCF protocol (Figure 22(b)), where stations that experienced collisions can get locked in high BC values for a long time. This is not so accentuated for DCF and SCW stations. Still, the recorded maximal delay for DCF is from 2,2 to 12,1 times greater than in SaMAC network (in a network with 50 and 3 stations, respectively). Results for smaller frames (290B) and higher data rates (n-version) are omitted since the results are very similar to those in Figure 22.Figure 22
(a) Average jitter experienced by a station, normalized to SaMAC and (b) maximal recorded delay experienced by a successfully transmitted HOL frame.
(a) (b)


### 6.4. Traffic Differentiation Using SaMAC

In this section we explore a possibility of traffic differentiation based on SaMAC protocol. To do so, we consider a network consisting of high priority stations and low priority stations. High priority stations transfer real-time data, such as media streams or some real-time controlling data. Low priority stations transfer background data whose timely delivery is not of critical importance. However, low priority stations should not be completely shut off from the medium by high priority stations. For that reason, high priority stations useCW=[8,23] and low priority stations use CW=[16,47]. Congestion windows are selected so there is an overlap between CWs of high and low priority stations, giving low priority stations a chance to win medium access. Freezing limit k is set to 3 for all stations.Figure23(a) shows portion of channel time used by an average high and low priority station, and average delay experienced by a station is shown in Figure 23(b). It should be noted that logarithmic scale is used. Each network consisted of 5 high priority stations, and the number of low priority stations was varied from 5 to 45, making total of 10 to 50 active stations. Low rate network (6Mbps) and 1040B frames were considered. Figure shows that traffic prioritization can be easily accomplished by selecting appropriate SaMAC parameters’ values for different classes of traffic (similar to 802.11e EDCA). By shifting a CW closer to zero, or by increasing the freezing limit, a station’s priority is increased. High priority stations used the most of the channel time (92% in a network with 5 low priority stations, and 73% in a network with 45 such stations). Consequently, high priority stations experienced very small delays, even in a network with total of 50 stations (16ms). The same approach can also be applied on different priority classes of traffic transmitted by the same station.Figure 23
Network with 5 high priority SaMAC stations: (a) channel time per station and (b) average delay experienced.
(a) (b)In [21], a deadline-constrained MAC protocol with QoS differentiation was proposed for use in soft real-time networked control systems (NCSs). The protocol builds on 802.11e EDCA and, compared with EDCA, lowers probability of frame losses caused by not satisfying timing deadlines for periodic real-time traffic. To evaluate applicability of traffic differentiation based on SaMAC in IWNs, we compare it with MAC protocol from [21]. In the simulated scenario, there were 10 high priority stations with periodic traffic, and the number of saturated low priority stations with background traffic was varied from 10 to 40, making total of 20 to 50 network stations. Different periods of frame generation for high priority stations were considered (20ms, 15ms, and 10ms), with the deadline for delivery being equal to the period. All stations used 290B frames, and parameters for 802.11g from Table 1 with 6Mbps channel were used. Parameter values for high and low priority SaMAC stations were the same as in the previous simulation. The exception is that the freezing limit for high priority stations was increased from k=3 to k=4, giving them higher probability of accessing the medium. Parameters for MAC from [21] are the same as in the original paper. Figure 24 shows packet loss ratio due to missed deadline. Logarithmic scale is used in the figure. Taking into account channel rates, the results are in agreement with those from [21]. Evidently, SaMAC is more successful in satisfying the imposed timing constraints, for all considered deadlines and numbers of low priority stations. This is especially apparent in highly congested network with 40 low priority stations, where SaMAC achieves from 2 to 30 times lower loss ratio, for 10ms and 20ms periods, respectively. This is because low priority stations in MAC from [21] quickly reach retry limit and reset their CWs to [0,31], selecting low BC values and clogging the medium. Contrarily, after reaching retry limit SaMAC low priority stations select BCs from the same shifted CW=[16,47] with relatively high BC values, giving high priority stations greater probability to successfully transmit. Considering the longest period (20ms), MAC from [21] does not experience missed deadlines if there are 10 additional low priority stations, while SaMAC does not experience them even in network with 15 low priority stations. For better readability, the same results are presented in Table 2.Table 2
Percentage of frames lost due to missed deadline.
period number of active stations 20 25 30 35 40 45 50 MAC from [21] 20 ms 0 0,004 0,02 0,08 0,23 0,4 0,68 15 ms 0,02 0,12 0,45 1,01 1,74 2,54 3,59 10 ms 2,84 5,38 8,05 10,75 13,17 15,5 17,59  SaMAC 20 ms 0 0 0,0007 0,006 0,008 0,016 0,02 15 ms 0,02 0,06 0,11 0,2 0,29 0,37 0,48 10 ms 2,67 4,09 5,22 6,25 7,02 7,81 8,44Figure 24
Comparison of frame losses for periodic real-time traffic between SaMAC and MAC from [21] in a network with 10 high priority stations.


## 6.1. Throughput of SaMAC Protocol

In order to evaluate performance of SaMAC protocol, we compare its throughput results with 802.11 network. Results for both lower (802.11g and SaMAC) and higher (802.11n and SaMACn) data rate networks are compared. Additionally, results of SCW (as defined in [46]) and CPCF protocols are also presented. For higher data rate network, these protocols were enhanced with data aggregation mechanism and are denoted SCWn and CPCFn. Again, single-hop network with ideal channel and saturated stations was simulated. Values of network parameters used are the same as in Table 1. Simulation scenarios included various numbers of active stations in the network (from 3 to 50) and one of two MSDU sizes: 1040B and 290B. For the higher data rate scenarios, only 1040B frames were used, since frame aggregation negates the influence that frame size has on overall throughput in saturated conditions. Recorded throughput is expressed as a portion of channel bandwidth and is shown as a function of the number of active stations in the network.Despite not including CW size manipulation algorithm, Figure18 shows that SaMAC provides higher network throughput in networks with a large number of active stations, in both low and high data rate networks. Compared to DCF, the increase in throughput is more than 20%. The reason for this is the fact that in congested network, and owing to imposed freezing limit k, SaMAC stations are frequently forced to reset FC and select new BC, restarting medium contention process. This prolongs the time needed to count BC down to zero and reduces the probability of accessing the medium in a random timeslot, decreasing collision probability. While DCF, SCW, and CPCF stations need to experience a collision to adapt their CW, a mere increase of network congestion causes SaMAC stations to more frequently abort current BC countdown process and select new BCs from shifted window. The duration of the countdown process is adaptively increased by frequent random selections of new BC, which serves as an equivalent to the increase of CW size in other protocols. Therefore, SaMAC protocol is proactive in responding to higher network congestion levels, avoiding collisions. For networks with small number of active stations (n<6), SaMAC achieves lower throughput, because of longer duration of medium contention owing to its use of shifted contention window.Figure 18
Throughput evaluation of considered protocols for (a) lower rate (6Mbps) and (b) higher rate (65Mbps) networks.
(a) (b)As evidenced in Figure19, good throughput results of SaMAC are consequence of its reduced collisions compared to other protocols. DCF with Wmin=16 has from 200% to 50% greater probability of collision (from channel’s point of view) than SaMAC protocol, for networks with 3 and 50 stations, respectively. For DCF with Wmin=32 probability of collision is from 80% to 40% greater. Since SCW and CPCF protocols react to collisions more aggressively than DCF, they experience 60% to 7% more collisions than SaMAC.Figure 19
Probability of collision from channel’s point of view.To further demonstrate adaptive nature of SaMAC protocol, network with varying number of active stations was considered and SaMAC throughput results are compared with DCF, SCW, and CPCF protocols. In a simulated scenario, only 5 stations were active at the start of simulation time. In the 10th second of the simulated time additional 10 stations were added to the network. In the 20th second of the simulation time, 20 new stations were added, bringing the total number of active stations to 35. In the 25th second 30 stations were removed from the network, lowering the number of active stations back to 5. The stations used 1040B frames and lower data rates (6Mbps channel). Network throughput was recorded every 0,2s and the results are shown in Figure20(a). Not only does SaMAC offer the highest throughput during the whole simulation time, but it is also the fastest among considered protocols to converge to steady throughput levels at the times of congestion increase. This is evident at t = 10s and t = 20s, when the number of stations in the network increases from 5 to 15 and from 15 to 35, respectively. Throughput of other examined protocols significantly deteriorates at those moments, before rising to steady value for the considered congestion level. The time needed to recover after congestion increases and reaches steady value is about 1s for all other protocols. On the other hand, SaMAC does not experience such a throughput decline but immediately adjusts to steady state throughput simply by experiencing more frequent contention losses caused by increased congestion. This is evidenced in Figure 20(b). While other protocols have spikes in recorded collision probability at times of congestion increase (t = 10s and t = 20s), SaMAC does not experience such maximums. All protocols are shown to be equally fast in reaction to network congestion decrease (t = 25s).Figure 20
Evaluation of considered protocols in a network with varying number of active stations: (a) network throughput and (b) collision probability.
(a) (b)


## 6.2. Fairness Evaluation of SaMAC Protocol

In Figure21 fairness results of SaMAC and other considered protocols are compared. Jain’s fairness index (JFI) [68] is calculated for various intervals (0,2s–10s) and shown for networks with 6 and 20 active stations. As expected, SaMAC clearly outperforms other considered protocols by considerate margin. JFI value of 0,95 is often considered as a threshold for differentiation between fair and unfair resource allocation [69–71]. In a network with 6 stations, SaMAC attains threshold value (i.e., JFI > 0,95) in less than 0,2s, while other protocols require from 0,5s (DCF with Wmin=32) to 2s (DCF with Wmin=16). In a network with 20 stations, SaMAC is again the fairest protocol, reaching fair allocation in less than 0,7s. Other protocols require from 7s (DCF with Wmin=32, CPCF) to more than 10s (DCF with Wmin=16, SCW) for JFI to reach 0,95.Figure 21
Fairness evaluation of considered protocols for networks with (a) 6 stations and (b) 20 stations.
(a) (b)The reason for such a superior performance of SaMAC in terms of fairness is its use of a single contention window, common for all network stations. While SCW and CPCF can be used to improve DCF’s throughput in congested networks, they still employ CW management mechanism and do not alleviate DCF’s unfairness. On the contrary, by the use of those mechanisms they can even decrease network fairness, as evident in the case of SCW in a network with 20 stations. On the other hand, SaMAC does not discriminate against the stations that experienced a collision by increasing the size or shift of its CW. Considering CW used for BC selection, all stations are always equal in SaMAC. Thus, SaMAC can achieve fair resource allocation even in very short intervals.


## 6.3. Jitter and Delay of SaMAC Protocol

In saturated conditions, total delay that a generated frame experiences depends on how congested the transmission buffer has become and this is determined by the difference in the offered load and saturation throughput. Therefore, the delay depends on duration and degree of saturation conditions. On the other hand, delay experienced by head of line (HOL) frame depends on the rate of successful transmission of data frames and is reciprocal to the network throughput (Figure18). Since low delay and jitter are one of the main requirements for real-time traffic, in this section we focus on HOL jitter and maximal experienced delay. Jitter results of SaMAC are compared with other protocols in Figure 22(a). Average jitter per station is shown for 6Mbps network with 1040B frames, and the results are normalized to SaMAC. Among the considered protocols, SaMAC offers the lowest jitter: 2 to 4 times lower than others, depending on the number of active stations. This is, again, due to common and fixed CW used in SaMAC. Owing to this, all stations have similar BC values and excessive waiting for medium access after (consecutive) collisions is avoided. Additionally, Figure 22(b) shows maximal delay recorded during the simulation (50s) experienced by any successfully transmitted HOL frame, averaged over 10 simulation runs. Increase of delay because of retransmissions is especially evident in CPCF protocol (Figure 22(b)), where stations that experienced collisions can get locked in high BC values for a long time. This is not so accentuated for DCF and SCW stations. Still, the recorded maximal delay for DCF is from 2,2 to 12,1 times greater than in SaMAC network (in a network with 50 and 3 stations, respectively). Results for smaller frames (290B) and higher data rates (n-version) are omitted since the results are very similar to those in Figure 22.Figure 22
(a) Average jitter experienced by a station, normalized to SaMAC and (b) maximal recorded delay experienced by a successfully transmitted HOL frame.
(a) (b)


## 6.4. Traffic Differentiation Using SaMAC

In this section we explore a possibility of traffic differentiation based on SaMAC protocol. To do so, we consider a network consisting of high priority stations and low priority stations. High priority stations transfer real-time data, such as media streams or some real-time controlling data. Low priority stations transfer background data whose timely delivery is not of critical importance. However, low priority stations should not be completely shut off from the medium by high priority stations. For that reason, high priority stations useCW=[8,23] and low priority stations use CW=[16,47]. Congestion windows are selected so there is an overlap between CWs of high and low priority stations, giving low priority stations a chance to win medium access. Freezing limit k is set to 3 for all stations.Figure23(a) shows portion of channel time used by an average high and low priority station, and average delay experienced by a station is shown in Figure 23(b). It should be noted that logarithmic scale is used. Each network consisted of 5 high priority stations, and the number of low priority stations was varied from 5 to 45, making total of 10 to 50 active stations. Low rate network (6Mbps) and 1040B frames were considered. Figure shows that traffic prioritization can be easily accomplished by selecting appropriate SaMAC parameters’ values for different classes of traffic (similar to 802.11e EDCA). By shifting a CW closer to zero, or by increasing the freezing limit, a station’s priority is increased. High priority stations used the most of the channel time (92% in a network with 5 low priority stations, and 73% in a network with 45 such stations). Consequently, high priority stations experienced very small delays, even in a network with total of 50 stations (16ms). The same approach can also be applied on different priority classes of traffic transmitted by the same station.Figure 23
Network with 5 high priority SaMAC stations: (a) channel time per station and (b) average delay experienced.
(a) (b)In [21], a deadline-constrained MAC protocol with QoS differentiation was proposed for use in soft real-time networked control systems (NCSs). The protocol builds on 802.11e EDCA and, compared with EDCA, lowers probability of frame losses caused by not satisfying timing deadlines for periodic real-time traffic. To evaluate applicability of traffic differentiation based on SaMAC in IWNs, we compare it with MAC protocol from [21]. In the simulated scenario, there were 10 high priority stations with periodic traffic, and the number of saturated low priority stations with background traffic was varied from 10 to 40, making total of 20 to 50 network stations. Different periods of frame generation for high priority stations were considered (20ms, 15ms, and 10ms), with the deadline for delivery being equal to the period. All stations used 290B frames, and parameters for 802.11g from Table 1 with 6Mbps channel were used. Parameter values for high and low priority SaMAC stations were the same as in the previous simulation. The exception is that the freezing limit for high priority stations was increased from k=3 to k=4, giving them higher probability of accessing the medium. Parameters for MAC from [21] are the same as in the original paper. Figure 24 shows packet loss ratio due to missed deadline. Logarithmic scale is used in the figure. Taking into account channel rates, the results are in agreement with those from [21]. Evidently, SaMAC is more successful in satisfying the imposed timing constraints, for all considered deadlines and numbers of low priority stations. This is especially apparent in highly congested network with 40 low priority stations, where SaMAC achieves from 2 to 30 times lower loss ratio, for 10ms and 20ms periods, respectively. This is because low priority stations in MAC from [21] quickly reach retry limit and reset their CWs to [0,31], selecting low BC values and clogging the medium. Contrarily, after reaching retry limit SaMAC low priority stations select BCs from the same shifted CW=[16,47] with relatively high BC values, giving high priority stations greater probability to successfully transmit. Considering the longest period (20ms), MAC from [21] does not experience missed deadlines if there are 10 additional low priority stations, while SaMAC does not experience them even in network with 15 low priority stations. For better readability, the same results are presented in Table 2.Table 2
Percentage of frames lost due to missed deadline.
period number of active stations 20 25 30 35 40 45 50 MAC from [21] 20 ms 0 0,004 0,02 0,08 0,23 0,4 0,68 15 ms 0,02 0,12 0,45 1,01 1,74 2,54 3,59 10 ms 2,84 5,38 8,05 10,75 13,17 15,5 17,59  SaMAC 20 ms 0 0 0,0007 0,006 0,008 0,016 0,02 15 ms 0,02 0,06 0,11 0,2 0,29 0,37 0,48 10 ms 2,67 4,09 5,22 6,25 7,02 7,81 8,44Figure 24
Comparison of frame losses for periodic real-time traffic between SaMAC and MAC from [21] in a network with 10 high priority stations.


## 7. Conclusion

The contribution of the presented work is twofold: new MAC protocol for distributed wireless networks is defined and evaluated, and a novel approach to MAC protocol modeling is developed and used in design of proposed protocol’s mathematical model.The presented self-adapting MAC (SaMAC) protocol aims to eliminate throughput degradation and short-term unfairness exhibited in 802.11 DCF and similar protocols. Unlike other distributed MAC protocols presented in the literature, SaMAC employs fixed CW, common for all active stations and lacks any CW management algorithm. As a consequence, the presented protocol exhibits exceptional fairness, achieving fair resource allocation order of magnitude faster than other MAC protocols. Also, the use of the same CW by all stations and at all times significantly lowers jitter and maximal delay when compared to other protocols. For instance, SaMAC has from 2 to 3,5 times lower jitter than 802.11 DCF and up to 12 times lower maximal HOL frame delay, depending on number of stations in the network. These numbers are even greater when SaMAC is compared with other protocols, such as SCW and CPCF, which use more aggressive CW management in order to achieve better throughput in congested network. However, the advantages of SaMAC are not obtained by lowering network throughput. Despite its simple design, SaMAC exhibits significant throughput increase when compared to DCF protocol, avoiding sharp throughput decline if the number of active stations increases. By using constrained countdown freezing mechanism and having its CW shifted from zero, SaMAC achieves up to 20% higher throughput than 802.11 network. Additionally, comparison with SCW and CPCF protocols shows that SaMAC offers superior throughput results for most studied scenarios. SaMAC is shown to be very adaptive to differing network congestion levels, being the only among considered protocols to avoid unnecessary collisions and throughput degradation in the moments of congestion increase.Lower jitter and delay and higher throughput in networks with a wide range of active stations mean that SaMAC can satisfy IWNs’ requirements of timeliness and scalability better than 802.11 DCF and other considered protocols. Collision reduction offered by SaMAC can reduce the power consumption and prolong the lifetime of battery-powered devices. Additionally, preliminary results show that SaMAC can be used for traffic differentiation and transport of high priority real-time data, with high delivery ratio for deadline-constrained frames.In the presented paper, a mathematical model of the SaMAC protocol is developed. We focus on the widely used assumption that the probability of a contention loss, from the observed station’s point of view, is constant and independent of that station’s current state and of other stations’ states. While the assumption holds for models of other distributed MAC protocols, it is shown that the use of the assumption in modeling of SaMAC results in great model’s inaccuracies, since the probability of contention loss varies highly for SaMAC stations. Therefore, a new approach to MAC modeling is presented, while still using Markov chain to represent a single SaMAC station’s operation. The new approach is based on the observation that the probability distribution of Markov chain states after a contention (i.e., busy timeslot) can be obtained from the known (or assumed) probability distribution before the contention, by shifting probability matrix in an appropriate manner depending on contention duration. Iterative algorithm is introduced and used to obtain probabilities of a combination of several consecutive contention durations. From this and Markov chain regularities, states’ probability distribution is calculated, as well as probability of a busy timeslot in each state. A new method for calculation of idle timeslot and collision probability from Markov chain is presented, since the conventional method is applicable only if busy timeslot probability is constant. Finally, throughput of modeled SaMAC network is calculated. Proposed modeling approach is validated by comparing model’s results with simulation results for network scenarios with different protocol parameter values and various numbers of active stations.The proposed protocol has been studied only in a limited number of scenarios, of which all include one-hop network, saturated stations, and ideal channel with constant data rates (6 or 65Mbps). In our future work we plan to further investigate characteristics of SaMAC, including analysis of protocol performance in unsaturated conditions, multihop networks and with lossy channel. Of special interest should be traffic differentiation based on SaMAC and its use in highly deadline-constrained networks. In order to facilitate deployment of SaMAC in real-life networks, its coexistence with 802.11 networks should be studied as well. In a mixed network composed of both 802.11 and SaMAC stations, the stations using SaMAC might be negatively affected by the imposed minimum value during BC selection process, with 802.11 stations gaining unfairly high share of the bandwidth. Therefore, SaMAC should be tuned in order to allow such a coexistence and gradual inclusion to real-life networks.



---

*Source: 6375317-2018-09-12.xml*