Jan 30, 2018 - payoff: we try to enforce a fair use of the network total throughput. .... of having n2 stations that follow a uniform backoff, and hen...

2 downloads 0 Views 696KB Size

Wireless Networks under a Backoff Attack: A Game Theoretical Perspective Juan Parras * and Santiago Zazo Information Processing and Telecommunications Center, Universidad Politécnica de Madrid, ETSI Telecomunicación, Av. Complutense 30, 28040 Madrid, Spain; [email protected] * Correspondence: [email protected] Received: 30 November 2017; Accepted: 24 January 2018; Published: 30 January 2018

Abstract: We study a wireless sensor network using CSMA/CA in the MAC layer under a backoff attack: some of the sensors of the network are malicious and deviate from the defined contention mechanism. We use Bianchi’s network model to study the impact of the malicious sensors on the total network throughput, showing that it causes the throughput to be unfairly distributed among sensors. We model this conflict using game theory tools, where each sensor is a player. We obtain analytical solutions and propose an algorithm, based on Regret Matching, to learn the equilibrium of the game with an arbitrary number of players. Our approach is validated via simulations, showing that our theoretical predictions adjust to reality. Keywords: CSMA/CA; backoff attack; game theory; Nash equilibrium; correlated equilibrium; regret matching

1. Introduction The remarkable advances and proliferation in wireless networks in recent years have brought a significant interest in the security and threats to these networks. Specially wireless sensor networks can be the target of many different attacks due to the limited capabilities of the sensors, as some recent surveys show (for instance, [1,2]). A very important kind of attack addressed to these networks is the backoff attack. It affects to the Medium Access Control (MAC) layer when a CSMA/CA (carrier-sense medium access with collision avoidance) scheme is used to regulate the access to the medium. The backoff mechanism minimizes the risk of collision, i.e., that two or more stations transmit simultaneously, by deferring transmissions during a certain random time period: the backoff window. In a backoff attack, a sensor uses a lower backoff window than the rest of the sensors, thus obtaining a higher throughput at expense of the other sensors [3]. Backoff attacks are a real threat to wireless sensor networks. Firstly, because network adapters are highly programmable [4], thus allowing sensors to modify their backoff parameters. In addition, secondly, because many MAC layer protocols proposed for wireless sensor networks make use of CSMA as medium access mechanism, for instance, SMAC [5], WiseMAC [6], TMAC [7] and DSMAC [8]. Two surveys on MAC layer protocols [9,10] show that CSMA is the most common access mechanism in contention based MAC protocols. Some studies that treat backoff attacks, such as [11,12], focus only in the defense mechanism. However, any attack is a conflict between the attacker agents and the defense mechanism. In order to better model this conflict, we will make use of game theory tools: a branch of mathematics used to model conflict. This approach is pretty popular: [13] is a survey on game theory approaches to multiple access situations in wireless networks and [14] is another survey focused on CSMA methods. Two works which study backoff attacks in wireless networks are [4,15]. We differ from these works in the following points and contributions:

Sensors 2018, 18, 404; doi:10.3390/s18020404

www.mdpi.com/journal/sensors

Sensors 2018, 18, 404

•

•

•

2 of 19

We assume that the defense mechanism lies in a sensor, to which other sensors communicate. We model the conflict individually between each communicating sensor—which can behave normally or attack —and the defending sensor. This is the case of networks with a star topology, in which a central sensor receives the packets of the rest of the network. This topology appears, for instance, in hierarchical routing protocols [16]: in these protocols, the sensors are clustered in order to be energy efficient (one recent example is [17]), each cluster following a star topology. Yet our approach could be adapted to other network topologies (e.g., to a mesh); however, we focus in star topology in this work for simplicity. By differentiating between attacking sensors and the defense sensor, we use a heterogeneous network model: the attacking sensors are greedy and want the maximum individual throughput they can obtain, whereas the defending sensor tries to divide fairly the total throughput among the sensors that communicate with it. This makes our model different from [4,15]: each sensor may have different interests, which is a more complex and realistic situation. We use Bianchi’s model to estimate the total network throughput and use this metric as game payoff: we try to enforce a fair use of the network total throughput. By modeling the total throughput, we contribute to provide a deeper insight on how different parameters influence the fairness of the network. Namely, we will show that fairness is related to the backoff parameters and the number of greedy sensors. We solve our game both analytically and empirically, proposing a simple algorithm to obtain the game solution, based on regret-matching (RM) algorithm [18]. Our contribution here is twofold: on one side, we provide a theoretical framework to the backoff attack problem, and solve it analytically. On the other side, we provide a simple algorithm that learns the solution to the game, which is very simple to implement, even in sensors with low computational capabilities. This makes our model both well theoretically founded and also, practical to implement in real-life situations.

Finally, note that we refer to the sensors as stations if we study the network from the MAC protocol perspective or as players or agents if we are studying the network from the game theoretic perspective. The rest of the work goes as follows. In Section 2, we explain the CSMA/CA mechanism as used in the IEEE 802.11 standard [19]. We study this case because there is no standard for MAC layer protocols in wireless sensor networks and the 802.11 defines a very well known CSMA/CA implementation. The results we obtain can be applied to other MAC access mechanisms based on CSMA/CA. Then, in Section 3 we will use Bianchi model to obtain the theoretical throughput of the network and show how greedy stations do have a strong impact on the network throughput. In Section 4, we model the CSMA/CA problem using game theory tools, and solve it in Section 5. After, in Section 6, we will simulate the solutions proposed and analyze the results. Finally, in Section 7 we will draw some conclusions. 2. CSMA/CA in IEEE 802.11 The IEEE 802.11 standard [19] defines the MAC and physical (PHY) layer specifications for a wireless local area network (WLAN). Each device connected using this standard is known as station (STA). The access to the shared medium can be regulated using the Distributed Coordination Function (DCF), which uses CSMA/CA to access the medium. The basic mechanism used by the DCF in IEEE 802.11 standard is CSMA/CA to control the medium access and a positive acknowledgment frame (ACK): if no ACK is received, there is a retransmission. CSMA/CA operates using two procedures: a carrier sense (CS) which determines whether the channel is busy (i.e., other station is transmitting) or idle (i.e., no other station is transmitting); and a backoff procedure which determines when a station should start transmitting. A station willing to transmit invokes the CS mechanism to determine whether the channel is idle or not. If it is busy, the station defers the transmission until the channel is idle without interruption for a fixed period of time. After, the station starts a counter, called backoff, for an additional deferral time

Sensors 2018, 18, 404

3 of 19

before transmitting: the station transmits when its backoff counter reaches 0. This procedure minimizes collisions among multiple stations that have been deferring to the same event. The backoff follows a uniform random variable in the interval [0, CW − 1], where CW stands for contention window. If a collision is detected when a station transmits, its CW is duplicated (binary exponential backoff) and the backoff procedure starts over. When the station has transmitted the packet, it waits for an ACK; if none is received in a certain time (ACK timeout), the station starts the transmission procedure again. This mechanism is known as Basic Access (BA), and is based on a two-way handshaking. The standard also defines an alternative procedure, based on a four-way handshaking, called request-to-send/clear-to-send (RTS/CTS). In this case, the transmitter station sends a RTS frame to the receiver, using the BA mechanism described above. The RTS frame is used to reserve the medium: when the receiver station receives a RTS, proceeds to reserve the channel for some time, sending a CTS frame to indicate that the channel reservation was successful. When the transmitting receives the CTS frame, starts transmitting its packet; when it finishes, if the transmission was successful, the receiving STA sends a positive ACK. While the channel is reserved, the rest of stations remain silent. The RTS/CTS procedure helps easing the hidden node problem [20,21] and provides a higher throughput than the BA mechanism when the MAC payload is large [22]. 3. Network Throughput under Backoff Modification 3.1. Theoretical Network Throughput The 802.11 standard does not provide a way to estimate the network throughput that is achieved. The best-known model to estimate the throughput in a network is Bianchi’s model [22], which provides expressions both for BA and RTS/CTS mechanisms. The main advantage of this model is that it provides analytical expressions to determine the network throughput. It assumes saturation of the network, that is, that each station always has a packet to transmit. This assumption could be relaxed using more complex models (as [23]). The CSMA/CA mechanism described in Section 2 assumes that all stations will respect the backoff procedure. However, the stations can modify their backoff in such a way that they can obtain a higher throughput, at expense of other stations [4,15]. In order to analyze these effects, we will use Bianchi’s model [22] to estimate the total network throughput. The results will be used in the posterior sections to study how to enforce network throughput fairness. This model relies on the computation of the following system for each of the i stations of the network: τi =

2 m −1 1+Wi + pi Wi ∑ j=i 0 (2pi ) j

p = 1 − ∏ (1 − τ ) i j j 6 =i

(1)

where pi is the collision probability for station i (the probability that station i observes a collision while transmitting a packet, which Bianchi’s model assumes to be constant) and τi is the probability that station i transmits a packet. The system (1) assumes a binary exponential backoff, where the contention window CW lies in the interval [W, CWmax ], where m is the maximum backoff stage, defined as CWmax = 2m W where W is the minimum size of the contention window. Let us assume that we have a network with n stations, split into two different classes. There are n1 stations characterized by using a binary exponential backoff as described by IEEE 802.11 standard, and thus, following (1). Also, there are n2 = n − n1 stations using a uniformly distributed backoff in the range [0, W2 − 1], whose expression [22] is: τi =

2 1 + Wi

(2)

Sensors 2018, 18, 404

4 of 19

The probabilities τi and pi are the same for all the members of each class. Hence, (1) becomes: 2 τ1 = m −1 1 + W + p W ∑ j=10 (2p1 ) j 1 1 1 2 τ2 = 1+W2 p1 = 1 − (1 − τ1 )n1 −1 (1 − τ2 )n2 p2 = 1 − (1 − τ1 )n1 (1 − τ2 )n2 −1

(3)

where the subscript i denotes the class of a station. Now, we will obtain the total throughput of the network [22,23]. The probability that there is at least one station transmitting is denoted as Ptr : n

Ptr = 1 − ∏(1 − τi ) = 1 − (1 − τ1 )n1 (1 − τ2 )n2

(4)

i =1

and hence, 1 − Ptr is the probability that no station is transmitting. The probability that there is exactly one station of class i transmitting, Ps,i , is: (

Ps,1 = τ1 (1 − τ1 )n1 −1 (1 − τ2 )n2 Ps,2 = τ2 (1 − τ1 )n1 (1 − τ2 )n2 −1

(5)

and the probability that there are two or more stations transmitting simultaneously (i.e., the collision probability), denoted by Pc , is obtained as the total probability minus the probabilities of having exactly none or one station transmitting: Pc = 1 − ∑ Ps − (1 − Ptr ) = Ptr − n1 Ps,1 − n2 Ps,2

(6)

i

Now, we obtain the expected duration of a slot time, Tslot . We define Ts as the time to count down a backoff unit (i.e., the time that lies between two consecutive calls to the CS method when the channel was sensed idle), Tt as the time duration of a successful transmission and Tc as the time duration of a collision. We assume that the stations of both classes share the same duration of a successful transmission and the same duration of a collision. Thus, Tslot is: Tslot = (1 − Ptr ) Ts + (n1 Ps,1 + n2 Ps,2 ) Tt + Pc Tc

(7)

We consider Tp the payload information time duration in a successful transmission and we assume that all stations share the same Tp . We define Si , the throughput ratio for station i, as the fraction of time used by station i to successfully transmit payload bits. Si is obtained as: Si =

Ps,i Tp Ps,i Tp = Tslot (1 − Ptr ) Ts + (n1 Ps,1 + n2 Ps,2 ) Tt + Pc Tc

(8)

In (8), we could use units of time for the magnitudes Tp , Ts , Tt and Tc , or measure its length in bits, as long as the units are the same for the four parameters. Finally, the total network throughput, defined as the fraction of the time spent by all the stations transmitting successfully payload bits, is: S=

N

∑ S i = n 1 S1 + n 2 S2

(9)

i =1

The parameters Ts , Tt and Tc are obtained from the 802.11 standard. Ts is the empty slot time. In case of using BA mechanism, we have [22]: (

Tcba = H + Tp + DIFS + δ Ttba = H + Tp + SIFS + δ + ACK + DIFS + δ

(10)

Sensors 2018, 18, 404

5 of 19

where H is the total header transmission time (adding PHY and MAC layers headers), DIFS and SIFS are interframe spacing defined in the standard, ACK is the transmission time of an ACK and δ is the propagation delay. We also consider that all payloads have the same size, whose transmission time is Tp . In case of using RTS/CTS mechanism, we have [22]: (

Tcrts = RTS + DIFS + δ Ttrts = RTS + SIFS + δ + CTS + SIFS + δ + Ttba

(11)

Comparing (10) and (11), we see that BA mechanism uses less time for a successful transmission, whereas the time spent in a collision depends on the payload size. Intuitively, in case of large payloads and a high collision probability, RTS/CTS could achieve a higher throughput, since less time is spent on retransmissions and that might compensate the longer time spent on transmitting. Indeed, this is observed in [22]. 3.2. Simulation 1: Network Throughput and Fairness Now, we will make use of the expressions derived in the previous section to analyze the impact of having n2 stations that follow a uniform backoff, and hence, do not respect the binary backoff procedure. The values used for time durations are the same as in [22], extracted from 802.11 standard, and can be seen in Table 1. Observe that we consider two different payload lengths, a short one, Tp,s , and a long one, Tp,l . We consider that the stations of class 1 follow the IEEE 802.11 standard binary backoff mechanism (normal stations), with W1 = CWmin,1 = 32, CWmax,1 = 1024 and hence, m1 = 5. The stations of class 2 (malicious stations) will follow a uniformly distributed backoff in the interval [0, W2 − 1]. With these values, we obtain the throughput for each station using (8) and (9) for these cases: •

•

Using the large payload: Tp = Tp,l . We test four cases: first, we consider that n2 = 0, that is, all stations follow the binary exponential backoff and we vary the number of stations for n ∈ [1, 20]. Then, we fix the number of stations to n = 5 and simulate for n2 ∈ {1, 2, 4}, that is, for respectively 1, 2 and 4 malicious stations. We show the results for different values of W2 , namely, for W2 ∈ [1, W1 ]. The obtained results are in Figure 1. Using the short payload, Tp = Tp,s . We test the same four cases than we did for the large payload case. The obtained results are in Figure 1.

Sensors 2018, 18, 404

6 of 19

Version January 8, 2018 submitted to Sensors

6 of 19

0.3

0.3

0.3

0.3

0.2

0.2

0.2

0.2

0.1

0.1

0.1

0.1

0

5

10 N

15

20

0

0

10

20

30

0

0

W2

(a) n2 = 0

20

10

30

0

1

0.8

0.8

0.8

0.8

0.6

0.6

0.6

0.6

0.4

0.4

0.4

0.4

0.2

0.2

0.2

0.2

(e) n2 = 0

15

20

0

0

10

20 W2

(f) n = 5, n2 = 1

BA total throughput RTS/CTS total throughput

30

0

0

20

10

W2

(g) n = 5, n2 = 2

BA S1 throughput RTS/CTS S1 throughput

30

(d) n = 5, n2 = 4

1

10 N

20 W2

(c) n = 5, n2 = 2

1

5

10

W2

(b) n = 5, n2 = 1

1

0

0

30

0

0

10

20

30

W2

(h) n = 5, n2 = 4 BA S2 throughput RTS/CTS S2 throughput

Figure 2. Throughput (S) results for the simulations using Bianchi’s model with short payload, Tp,l ,

Figure 1. and Throughput (S)Tresults for the simulations using Bianchi’s model with short payload, (a-d) long payload, p,l , (e-h). In cases (a) and (e), there are no malicious stations; in cases (b-d) Tp,l , (a–d) andthere longare payload, Tp,l , (e–h).SIn cases (a) and (e), there are no malicious stations; in cases and (f-h) malicious stations. 1 is the throughput of normal stations, S2 the throughput of (b–d)malicious and (f–h)stations. there are malicious stations. S1 is the throughput of normal stations, S2 the throughput of malicious stations. 159

they have higher chances to win the contention procedure against normal stations. This causes

161

stationsshowed behave more similarly to thethat: normal ones) the throughputs difference becomes smaller. The results in Figure 1 show

3.3. Discussion 160 that the throughput is not fairly distributed among stations. As W2 increases (i.e., the malicious 162

• If there is only one malicious station, this station consumes the major part of the network

throughput for W2 , because it usually winssignificantly the contentions. independent •163 The throughput oflow normal stations decreases for This lowisvalues of W2of . the This is 164 mechanism used (BA or RTS/CTS) and the payload size. Yet when there are more than one independent of the number of malicious stations, the mechanism used (BA or RTS/CTS) and 165 malicious stations, the total throughput becomes 0 for W2 = 1, because there are some stations the payload size. This happens because the malicious stations use lower backoffs and hence, 166 trying to access the network that will always collide. As the W2 value increases, we observe that they have higher chances to win the contention procedure against normal stations. This causes 167 the throughput for the malicious stations also increases, presenting a maximum value which that the throughput notnumber fairly distributed among stations. (i.e., the malicious 2 increases 168 depends on the is total of stations in the network andAs theWW 2 parameter. Also, as n2 stations behave more similarly to the normal ones) the throughputs difference becomes smaller. 169 increases, the throughput a malicious station obtains decreases: it is better for a malicious station •170 If there isthe only malicious station, this station consumes the major part of the network to be onlyone malicious station in the network. 171 throughput • RTS/CTS mechanism throughput using larger payloads: in Figure 2 (e-h), for low W2 , provides becausehigher it usually wins when the contentions. This is independent of the 172 mechanism RTS/CTS curves are always above BA curves. The opposite happens when using short payloads. used (BA or RTS/CTS) and the payload size. Yet when there are more than one malicious stations, the total throughput becomes 0 for W = 1, because there are some stations 173 Hence, if in a network using CSMA/CA there is one or more2stations which can modify the binary trying to access the network used that by will always As the increases, weseriously observe that 2 value 174 exponential backoff procedure 802.11, thecollide. throughput thatW each station gets can be throughput for the malicious alsomechanisms. increases, presenting a maximum which 175 the affected. This happens using both BA stations or RTS/CTS The results obtained in thisvalue section the total number of stations network and Wsections parameter. Also, 176 depends show that on network fairness is seriously affectedinbythe a backoff attack; thethe next will propose aas n2 2 177 increases, solution to the this throughput situation using game theory tools. obtains decreases: it is better for a malicious station a malicious station to be the only malicious station in the network. • RTS/CTS mechanism provides higher throughput when using larger payloads: in Figure 1e–h, RTS/CTS curves are always above BA curves. The opposite happens when using short payloads.

Hence, if in a network using CSMA/CA there is one or more stations which can modify the binary exponential backoff procedure used by 802.11, the throughput that each station gets can be seriously

Sensors 2018, 18, 404

7 of 19

affected. This happens using both BA or RTS/CTS mechanisms. The results obtained in this section show that network fairness is seriously affected by a backoff attack; the next sections will propose a solution to this situation using game theory tools. Table 1. Values used for simulation 1. Parameter

Value

Parameter

Value

Tp,s MAC header ACK CTS δ SIFS

256 bits 272 bits 112 bits + PHY header 272 bits + PHY header 1 µs 28 µs

Tp,l PHY header RTS Bit rate Ts DIFS

8184 bits 128 bits 160 bits + PHY header 1 Mbps 50 µs 128 µs

4. Problem Modelling as a Static Game 4.1. Introduction to Static Games We define a static game as follows [24]: Definition 1 (Static game). A static game G is a triple h Np , A, ui, where: • • •

Np is the number of players, numbered as 1, ..., Np . A is the set of actions available to all players. The pure actions available to player i are denoted by ai , with ai ∈ Ai , being Ai the set of actions available to player i. A is defined as A ≡ ∏i Ai . A is assumed to be a compact (i.e., bounded and closed) subset of R Np . u is a continuous function that gives the game payoffs: u:

∏ A i → R Np

(12)

i

For our game, the players are the sensors and the actions are to attack or not to attack in case of greedy sensors, and detect a malicious behavior or not for the sensor that is receiving the packets. We will use discrete sets of actions (i.e., Ai are finite sets). Thus, the payoff functions will be discrete. Each of this discrete actions will be denoted as pure actions. Also, if there are Np = 2 players, the payoff functions for each player can be expressed using a matrix Ri . The matrices will have dimension m × n, where m is the number of actions for player 1 and n the number of actions for player 2. Hence, the element r a1 ,a2 of the matrix Ri corresponds to the payoff for player i when player 1 plays pure action a1 and player 2 pure action a2 [24]. A game is said to be a zero-sum game if the sum of the payoffs of all players equals zero, that is, ∑i ui ( a) = 0, ∀ a ∈ A. This means that the gains of some players are the loses of the others, and hence, zero-sum games model situations of extreme competition among players. In a zero-sum game of two players with a discrete set of actions, the payoff matrix satisfy that R1 = − R2 = R: player 1 maximizes the payoffs from R whereas player 2 tries to minimize the same payoff matrix R. If the sum of the payoffs is different from zero, then the game is called non-zero sum game. These games can model very different situations, ranging from extreme competition (i.e, the zero-sum case) until fully cooperative games (i.e., when all players have the same payoff function). 4.2. Problem Description We use the network scheme in Figure 2 to model the CSMA/CA problem that arises when some stations modify their backoff procedure. There will be n1 normal stations (NS), which always follow the binary exponential backoff; and n2 malicious stations (MS), which can choose between using the binary

Sensors 2018, 18, 404

8 of 19

exponential backoff or the uniform backoff. We denote by n the number of stations, with n = n1 + n2 . All n stations are connected to a gateway, called server, which forwards their packets to a network. The stations communicate with the server: we only consider the uplink in the problem. Observe that this problem arises in a situation in which a star topology is used. For convenience, we will denote the malicious stations as clients. The players of the game will be the server on one side, and the clients on the other. Thus, there will be Np = n2 + 1 players (where Np denotes the number of players). Each client tries to maximize the throughput available to it, whereas the server tries to enforce that all stations in the network obtain a fair throughput. By fair, we mean that no station is getting a higher throughput at expense of others. Under the saturation condition imposed before, this means that all clients receive the same proportion of the total throughput. The clients will have two different actions: either they behave selfishly (s) by using the uniform backoff or they do not behave selfishly (ns) by using the binary exponential backoff. The server will also have two actions: it can detect (d) if the network throughput is begin fairly distributed or not to detect (nd). If the server detects and catches a client behaving selfishly, it will drop its packet, as a punishment. This means that the client has to send again the packet, and the higher throughput advantage it had obtained by modifying its backoff vanishes. We must also take into account that this detection procedure cannot be free of charge for the server: there must be a cost associated to the detection procedure in terms of computational resources. Two of the possible schemes that could be used to detect this selfish behavior are [12], which is based in Kolmogorov-Smirnov (K-S) statistics, and [11], which is based on a modified Cramer-von Mises (C-M) test [25]. To simplify the modellinfg, Version January 8, 2018 submitted Sensors 8 of 19 we will assume that the server is toable to perfectly detect when a station behaves selfishly.

NS1 ... NSn1 Server

Network

MS1 ... MSn2 Figure 3. Network scheme for the case that there are n1 normal stations (NS) and n2 malicious stations

Figure 2. Network scheme forbinary the case that there arewhereas n1 normal stations 2 malicious (MS). NS respect 802.11 exponential backoff, MS can choose to(NS) use itand or to n use a uniform stations (MS). NS respect backoff. 802.11 binary exponential backoff, whereas MS can choose to use it or to use a uniform backoff. 209

Observe that this problem arises in a situation in which a star topology is used. For convenience, we

will denote 4.3. Two210Player Case: the Npmalicious = 2 stations as clients. 211

The players of the game will be the server on one side, and the clients on the other. Thus, there

Now, we be center case when n2N= 1, thatthe is,number there are only two players in the game: the server 212 will Np =in n2 the + 1 players (where of players). Each client tries to maximize p denotes ns the throughput the throughput available to it, whereas the serverfor tries to enforce thatWe all stations theSnetwork obtain and one213client. We proceed to describe the payoffs each player. denoteinby that 1 214 a fair throughput. By fair, we mean that no station is getting a higher throughput at expense of others. the client can obtain by playing ns. In that case, the n1 normal stations will obtain each a throughput 215 Under the saturation condition imposed before, this means that all clients receive the same proportion Snns1 = S2161ns = Snstotal , that is, all stations obtain the same amount of throughput (cases (a,e) in Figure 1). of the throughput. If the client plays it obtains a throughput Sc1 if the server This(s) causes thethenormal 217 Thes, clients will have two different actions: either they plays behavend. selfishly by using uniformstations to s s 218 backoff or they do not behave selfishly (ns) by using the binary have a lower throughput, Sn1 < S1 , as observed in Figure 1. exponential backoff. The server will also have two actions: it can detect (d) if the network throughput is begin fairly distributed or not We219define −k d (with k d > 0) as the cost of detecting malicious behavior for the server. We model 220 to detect (nd). If the server detects and catches a client behaving selfishly, it will drop its packet, as the cost221function for client server as aclient linear of the with k s throughput and k j as a constant a punishment. Thisand means that the hasfunction to send again thethroughput, packet, and the higher

227

advantage it had obtained by modifying its backoff vanishes. We must also take into account that this detection procedure cannot be free of charge for the server: there must be a cost associated to the detection procedure in terms of computational resources. Two of the possible schemes that could be used to detect this selfish behavior are [15], which is based in Kolmogorov-Smirnov (K-S) statistics, and [14], which is based on a modified Cramer-von Mises (C-M) test [25]. To simplify the modellinfg, we will assume that the server is able to perfectly detect when a station behaves selfishly.

228

4.3. Two Player Case: Np = 2

222 223 224 225 226

Sensors 2018, 18, 404

9 of 19

for the server and the client respectively. Finally, we will assume that both players are maximizers, hence, they try to maximize the payoff function, that we define as follows: •

•

• •

If they play (nd, s) (the first action corresponds to the server, the second to the client), the client is modifying its backoff and hence, the throughputs in the network. The server does not detect this modification, and hence, does not punish the client. Thus, the client obtains a throughput increment, which provides it a gain of k1 (S1s − Sns ). The server has a cost proportional the throughput loss that the normal stations suffer: k s n1 (Sns 1 − Sns ). If they play (d, s), the client modifies its backoff, but it is caught by the server, who drops its packet. This causes the client a loss of k1 (0 − Sns ) = −k1 Sns . The server has a gain proportional to the throughput that the normal stations would have lost minus the cost of the detection: k s n1 (Sns − Sns 1 ) − k d . If they play (d, ns), the client does not modify its backoff and hence, does not affect the throughput. Hence, it has no gain nor lose. However, the server detects and hence, it incurs in the cost of detection, expressed as −k d . If they play (nd, ns), the client again has no gain nor lose. The server does not detect and hence, it incurs in no cost since the client is behaving properly: it also has no gain nor lose.

All of these payoffs do not vary along the game, provided that there is no modification of the game conditions (e.g., the number of players). Since Np = 2, we can pose the game as a bimatrix, non-zero sum, static game, whose game payoffs as a function of the player actions are in Table 2. Table 2. Payoffs values for the game posed, when n2 = 1. The payoff vectors are of the form u = (u1 , u2 ), where u1 is the payoff of the server and u2 is the payoff of the client. s nd

d

k s n1 (Sns 1

ns

− Sns ), k

s 1 ( S1

− Sns )

k s n1 (Sns − Sns 1 ) − k d , −k1 Sns

0, 0

− kd , 0

In order to simplify, we will substitute the payoff values in Table 2 for the following constants, where R1 is the payoff matrix for player 1 and R2 for player 2: R1 =

−αm αc

0 −α f

! R2 =

βs −βc

0 0

! (13)

Observe that all parameters in (13) are strictly positive, that is, αc , αm , α f , β s , β c ∈ (0, +∞). This arises because: • •

•

•

k1 , k c , k d , n1 and all the throughput values (Sns 1 , S1s , Sns ) are all strictly positive parameters. The throughput of the client must be higher if it behaves selfishly than if it does not. If that were not the case, this would mean that the client achieves higher throughput by following the exponential binary backoff - and from Figure 1, we see that this is not the case if there is only one client (n2 = 1). This means that S1s > Sns . The throughput of the normal stations must decrease when the client behaves selfishly with respect to their throughput when the client follows the binary exponential backoff. As we observe in Figure 1, that is indeed the case if there are malicious stations (i.e., n2 ≥ 1). This means that Sns > Sns 1 . It must happen that k s n1 (Sns − Sns 1 ) > k d (observe that the previous point showed that the left hand side is positive). This simply means that the cost of detecting is lower than the gain of detecting a deviation from the client. If that did not happen, it would be counterintuitive: the server incurs in a loss when it successfully detects a deviation from the client.

Sensors 2018, 18, 404

10 of 19

Observe that our model includes the case in which there is no selfishness in the client as a particular case. If the server knows that the client will always play ns (i.e., like a normal station), then the server will always play nd and hence, both players receive a payoff of 0. 4.4. Extension to Np > 2 The payoff functions derived in the previous section for the case that there are only two players can be extended to the general case when there are more than two players. In this case, again, there is one server which can choose between two pure actions (d, nd) and there will n2 > 1 clients, each client being able to choose between two pure actions (s, ns). In the general case, the payoff function of each player will be a multidimensional array of dimensions na1 × na2 × ... × na Np , where nai denotes the number of pure actions available to player i ∈ {1, Np }. Observe that when Np = 2, each player payoff function is a matrix. We define a vector of pure actions as a p = ( a p,1 , a p,2 , ..., a p,Np ). Observe that the payoff multidimensional array contains a payoff value for each possible vector a p . In order to obtain the payoff function of each player, for each a p , we will define n2s as the number of clients that play pure action s and n2ns = n2 − n2s as the number of clients that play pure action ns. The payoff each player receives will be coupled with the actions of the rest of the players: in general, it will be a function f i ( a p ), where i denotes a concrete player. There will be a payoff function for each a p . The payoff function for the server will depends on a p as follows. If the server plays d, the payoff function of the server will be k s n1 (Sns − Sns 1 ) − k d . Remark that Sns is obtained considering that there are n = n1 + n2 stations. Also, there will be different possible values of n2s , thus Sns 1 will depend on the number of clients playing s. Finally, observe that if all clients played ns, n2s = 0 and hence, Sns = Sns 1 ; thus, the payoff of the server in this case is −k d . If the server plays nd, the payoff value for each a p is k s n1 (Sns 1 − Sns ) . It is the same as when the server played d, but now there is no cost k d and the sign is reversed. The payoff for client j, j ∈ {1, ..., n2 } if it plays ns will be 0. If client j plays s and the server plays d, the payoff for client j will be −k j Sns . If client j plays s and the server plays nd, the payoff for client j will be k j (Ssj − Sns ). Observe that Ssj will depend on n2s . We follow this procedure for each a p value in order to obtain the payoff values. Observe that if n2 = 1, all the expressions in this section reduce to the ones given in the previous section. 5. Game Theory Analysis of the CSMA/CA Problem When Np = 2 In this section, we solve analytically the CSMA/CA static game, for the case in which Np = 2, that is, for the two player case. We also provide an algorithm to solve the game for Np ≥ 2, that is, for an arbitrary number of players. 5.1. Nash Equilibrium Concept The CSMA/CA game posed when Np = 2 is a non-zero sum, two player game. A very popular equilibrium concept for these games is the Nash equilibrium (NE) concept: it defines a situation in which no player can obtain a better payoff by deviating unilaterally. Non-zero sum games might have more than one NE (Chapter 3, [24] and finding all of them might be hard (see [26–28]). However, it is well known that every non-zero sum game has, at least, one NE in mixed strategies (Theorem 3.2, [24]). In a mixed equilibrium, each player has access to a randomizing device which outputs which pure action the player should play, with a given probability. This probability is the mixed NE. If there are two players, each of them with two actions to choose, we can define the payoff matrices as: ! ! 1 1 2 2 r11 r12 r11 r12 R1 = R2 = (14) 1 1 2 2 r21 r22 r21 r22

Sensors 2018, 18, 404

11 of 19

and we can obtain a mixed NE as it is shown in (Chapter 3, [24]). We define y as the probability that player 1 chooses her action 1, and 1 − y the probability that she chooses action 2 (for player 2, we define in an equivalent form z and 1 − z). The equilibrium conditions are the following:

(y∗v )T R1 z∗v ≥ yvT R1 z∗v

(y∗v )T R2 z∗v ≥ (y∗v )T R2 zv

(15)

where yv = (y, 1 − y), zv = (z, 1 − z) and yvT denotes the transposed of vector yv . In (15) we assume that both players are maximizers: otherwise, the inequality is reversed. One mixed NE for (15) can be obtained as (pp. 85–87, [24]): y∗ =

2 r11

2 − r2 r22 21 2 − r2 − r2 + r22 21 12

z∗ =

1 r11

1 − r1 r22 12 1 − r1 − r1 + r22 21 12

(16)

where y∗ ∈ [0, 1] and z∗ ∈ [0, 1] is the mixed NE. 5.2. Nash Equilibrium Solution to the CSMA/CA Game The CSMA/CA game can be solved using the mixed NE concept. Using (16), the game presents the following NE, where the payoff matrices used are (13): y∗ =

βc βc + βs

z∗ =

αf α f + αm + αc

(17)

This means that the server plays d with probability 1 − y∗ and nd with probability y∗ . The client plays s with probability z∗ and ns with probability 1 − z∗ . We define the expected payoff that each player obtains if they play mixed strategies with probability (y, 1 − y) for the server and (z, 1 − z) for the client as: u1 (y, z) =(y, 1 − y) R1 (z, 1 − z) T = −zy(αm + αc + α f ) + z(αc + α f ) + α f (y − 1) u2 (y, z) =(y, 1 − y) R2 (z, 1 − z) T = zy( β s + β c ) − zβ c

(18)

Thus, the payoff that each player receives by playing their mixed NE strategy, from (17) and (18) is: u1 = −

α f αm αm + αc + α f

u2 = 0

(19)

The values in (19) show that the equilibrium payoff for the client is 0, regardless of the game parameters. The equilibrium payoff for the server will depend on the values that the α parameters take. This means that the client can always guarantee a throughput as good as if he behaved normally. The server will have always a loss, derived from the cost of detecting (k d , collected by the parameter α f ). 5.3. Correlated Equilibrium Concept Another important equilibrium concept is the correlated equilibrium (CE) concept, owed to Aumann [29], which generalizes NE concept. It assumes that there is a correlating device that produces a signal sent to both players: the players use this signal to coordinate. Each signal of the correlating device corresponds to a pure action for each player. The CE is defined so that it has no advantage to any player deviating from the prescription of the correlating device. A CE for Np = 2 players is defined as a distribution probability φ( a) over the set of joint pure actions of the players A = A1 × A2 , where a = ( a1 , a2 ) is a vector of pure actions such that a ∈ A. The equilibrium condition that must be satisfied for every player i ∈ {1, 2} is [29,30]:

∑

a −i ∈ A −i

φ ( a −i | ai ) ui ( ai , a −i ) ≥

∑

a −i ∈ A −i

φ( a−i | ai )ui ( ai0 , a−i )

∀ ai0 ∈ Ai ,

ai 6= ai0

(20)

Sensors 2018, 18, 404

12 of 19

where A−i is the set of pure actions of the other player: A−i = A2 for i = 1 and A−i = A1 for i = 2. The concept of CE is a generalization of NE concept: every NE will be a CE (but the converse is not true). Yet CE are less expensive to compute (see [31,32]). Also CE will, in general, provide different solutions to a game. 5.4. Correlated Equilibrium Solution to the CSMA/CA Game The CSMA/CA game can be solved using the CE concept. The equilibrium condition (20) becomes:

∑

a2 ={s,ns}

∑

a2 ={s,ns}

φ( a2 |d)u1 (d, a2 ) ≥

φ( a2 |nd)u1 (nd, a2 ) ≥

∑

a1 ={d,nd}

∑

a1 ={d,nd}

∑

φ( a2 |d)u1 (nd, a2 )

∑

φ( a2 |nd)u1 (d, a2 )

∑

φ( a1 |s)u2 (ns, a1 )

∑

φ( a1 |ns)u2 (s, a1 )

a2 ={s,ns} a2 ={s,ns}

φ( a1 |s)u2 (s, a1 ) ≥

a1 ={d,nd}

φ( a1 |ns)u2 (ns, a1 ) ≥

a1 ={d,nd}

(21)

Replacing the payoffs from (13), (21) becomes: αc φ(s|d) − α f φ(ns|d) ≥ −αm φ(s|d) + 0φ(ns|d)

−αm φ(s|nd) + 0φ(ns|nd) ≥ αc φ(s|nd) − α f φ(ns|nd) − β c φ(d|s) + β s φ(nd|s) ≥ 0φ(d|s) + 0φ(nd|s)

(22)

0φ(d|ns) + 0φ(nd|ns) ≥ − β c φ(d|ns) + β s φ(nd|ns)

We know that the following is satisfied: φ( a|b) =

φ( a ∩ b) φ(b)

φ( a ∩ b) = φ(b ∩ a)

(23)

We simplify (22) using (23). We use the following shorthand notation: φ11 = φ(nd ∩ s), φ12 = φ(nd ∩ ns), φ21 = φ(d ∩ s) and φ22 = φ(d ∩ ns). Observe that this is the joint distribution probability, considering that the first subscript refers to the pure action of the server, and the second, to the pure action of the client. We also consider that pure action 1 for the server is nd, and pure action 2, d; for the client, s will be its pure action 1 and ns its pure action 2. Using all this, (22) becomes: −αm φ11 + 0φ12 ≥ αc φ11 − α f φ12

αc φ21 − α f φ22 ≥ −αm φ21 + 0φ22 β s φ11 − β c φ21 ≥ 0φ11 + 0φ21

(24)

0φ12 + 0φ22 ≥ β s φ12 − β c φ22

where we assumed that φ(nd) > 0, φ(d) > 0, φ(s) > 0 and φ(ns) > 0. By taking into account that all α and β parameters are greater than 0 (that is, α, β ∈ (0, +∞)), and also restraining φ to be a valid distribution, we obtain the following simplified equilibrium conditions from (24): φ11 φ22 = φ12 φ21 βs φ = 22 βc φ12 αc + αm φ = 22 αf φ21

(25)

φ11 + φ12 + φ21 + φ22 = 1 φij ≥ 0,

i = {1, 2},

α, β ∈ (0, +∞)

j = {1, 2}

Sensors 2018, 18, 404

13 of 19

The system in (25) has only one solution: αf βc αc + αm + αc β c + β s αf βs = αc + αm + αc β c + β s

αc + αm βc αc + αm + αc β c + β s αc + αm βs = αc + αm + αc β c + β s

φ11 =

φ12 =

φ21

φ22

(26)

Thus, there is only one CE which corresponds to the mixed NE we already found in (17): observe that φ11 = y∗ z∗ , φ12 = y∗ (1 − z∗ ), φ21 = (1 − y∗ )z∗ and φ22 = (1 − y∗ )(1 − z∗ ). This happens with all games following the payoff matrices from (13). The payoff for each player if they follow the CE is: u1 = −αm φ11 + αc φ21 − α f φ22

u2 = β s φ11 − β c φ21

(27)

The payoffs obtained using CE (replacing (26) in (27)) are the same that were obtained using mixed NE, in (19). This is obvious: both are the same equilibrium. 5.5. Learning Algorithms: Regret Matching There are algorithms for learning static equilibria. One of the simplest and best known is Regret Matching (RM) algorithm, proposed by Hart and Mas-Colell [18,33]. It is a simple, adaptive strategy that guarantees that the joint distribution of play converges to the set of correlated equilibria of the underlying game if each player plays a regret matching strategy [33]. The main idea of RM is to play a static game repeatedly and update a regret measure for each player depending on the outcome the players obtain each time they play the game. This algorithm requires that each player knows only her payoff and the actions of the other players (i.e., a player does not need to know the payoff functions of the other players). Each time the game is played, the regret Wi ( ai0 ) is obtained as: Wi ( ai0 ) = ui ( ai0 , a−i ) − ui ( ai , a−i ),

∀ ai0 ∈ Ai

(28)

where ai is the pure action played by player i, a−i denotes the pure actions played by all the other players, ai0 is used to denote all pure actions available to player i and Ai is the set of pure actions for player i. If Wi ( ai0 ) > 0, RM will assign positive probability to play ai0 in the future, because the player would have gained in the past if she had played ai0 . On the other hand, if Wi ( ai0 ) ≤ 0, the player will assign probability 0 to play ai0 . At the beginning of the game, all regrets are initialized to 0, and they are updated with each repetition of the static game following: Wit+1 ( ai0 ) = Wit ( ai0 ) + Wi ( ai0 ),

∀ ai0 ∈ Ai

(29)

where Wit ( ai0 ) is the regret at the beginning of the previous iteration t and Wi ( ai0 ) is obtained using (28). Observe that subscripts denote players, and superscripts denote time. At the beginning of the static game t, each player chooses a pure action randomly following a distribution pi ( ai ), where pi ( ai ) is the probability that player i uses pure action ai . pi ( ai ) is obtained at the beginning of each static game as follows: •

If Wi ( ai ) ≤ 0, ∀ ai ∈ Ai , then choose a pure action randomly following the uniform distribution pi ( ai ): 1 pi ( ai ) = (30) | Ai |

where | Ai | stands for the number of pure actions available to player i.

Sensors 2018, 18, 404

14 of 19

If there are regrets strictly higher than zero, then choose a pure action randomly following this distribution pi ( ai ): (

•

pi ( ai ) =

Wit ( ai ) W

0

where W=

if Wik ( ai ) > 0 if Wit ( ai ) ≤ 0

(31)

Wit ( ai )

(32)

∑

ai ∈ Ai |Wit ( ai )>0

that is, W is the sum of all positive regrets in game t. Observe that W is computed in each iteration, as the vector Wit is updated in each iteration. This definition of W guarantees that pi ( ai ) in (31) is an actual distribution: it sums 1 and has nonnegative components. Algorithm 1 Regret matching for each player. 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12:

Initialize Wi = (0, 0, ..., 0), the dimension of Wi is | Ai | Fix T, the number of iterations for t ∈ {1, 2, ..., T } do if max{Wit } ≤ 0 then

Assign ait following (30) else Assign ait following (31) and (32) end if Obtain payoff uit ( a1t , a2t ) for i ∈ {1, 2} Update regrets using (29) and (28) end for return Strategies using (33)

We use RM to obtain the solution for the CSMA/CA game. A possible implementation for each player is found in Algorithm 1. If the static game is played T times, we obtain the equilibrium strategies yˆ for player 1 and zˆ for player 2 as: yˆ =

∑tT=1 a1t , T

zˆ =

∑tT=1 a2t T

(33)

where ait denotes the pure action taken by player i in time t. We know RM converges to the set of correlated equilibria [18], which in our game is only one point (see (26)). This correlated equilibrium is also the only Nash equilibrium of the game (see (17)). Hence, in the CSMA/CA game with two players, RM will converge to the Nash equilibrium. 6. Simulations for the CSMA/CA Game We perform some simulations in order to observe and compare the theoretical developments done in previous sections. We define network using the model in Figure 2. We set the number of stations to n = 5, we use BA mechanism and Tp,l (long payload) in order to estimate the network throughput using Bianchi’s model. The parameters of normal stations, denoted by subscript 1 will be W1 = 32, CWmax,1 = 1024, and hence, m1 = 5 (extracted from IEEE 802.11 standard). The malicious stations, denoted with subscript 2, will use the uniform random mechanism modification described in Section 3, with a window length W2 = 8. The rest of IEEE 802.11 parameters are in Table 1, taken from [22]. We solve equations (3) to (10), and obtain the throughput values for different number of malicious stations: n2 ∈ {1, 2, 3, 4}. We also need to define the parameters that are used to model the payoff functions. We use k s = k c = 1, k d = 0.1. The payoff functions are obtained using Table 2 for the case of two players

Sensors 2018, 18, 404

15 of 19

and the procedure in Section 4.4 for the case Np > 2. For two players, Sns = 0.1617, Sns = 0.0700, Scs = 0.5225, which gives rise to the payoff matrix in Table 3. Table 3. Payoffs values for the game when n1 = 4 and n2 = 1. The first entry of the payoff vector is the server payoff, the second is the client payoff. s nd d

ns

− 0.3668, 0.3608 0.2668, −0.1617

0, 0

− 0.1, 0

Simulation 2: Myopic Solutions We can use (17) and Table 3 to obtain the theoretical solutions for the two player game. The mixed equilibrium actions are yn = 0.3095 and zn = 0.1364, which yield a payoff of −0.05 for the server and 0 for the client. Recall that the CE, obtained using (26), yields the same equilibrium. Table 4. Empirical payoffs obtained using RM for each value of n2 . The payoff vector u has the server payoff first and then, the payoff of each client. Observe that payoffs do not significantly vary as the number of players increase. This is consistent with Figure 4: the game tends to the two player situation, even if there are more players. n2

u

1 2 3 4

(−0.0493, −0.0015) (−0.0504, −0.0011, −0.0012) (−0.0502, −0.0011, −0.0011, −0.0013) (−0.0499, −0.0008, −0.0008, −0.0004, −0.0003)

Version January 8, 2018 submitted to Sensors

16 of 19

40

40

40

40

20

20

20

20

0

0

0.1

0.2

0.3

0

0

0.1

0.2

0.3

0

0

0.1

0.2

0.3

0

0

0.2

0.4

Mixed action

Mixed action

Mixed action

Mixed action

(a) n2 = 1

(b) n2 = 2

(c) n2 = 3

(d) n2 = 4

Server

Client 1

Client 2

Client 3

0.6

Client 4

Figure 3. 4. Histogram Histogram of and variable number Figure of actions actions obtained obtainedusing usingRM RMalgorithm, algorithm,for forn n==5 5stations stations and variable number of malicious stations. Each histogram is computed using 5 bins. Cl stands for client. Observe that thethe of malicious stations. Each histogram is computed using 5 bins. Cl stands for client. Observe that action of the server does not vary significantly, whereas the actions of the clients do. Also, observe how action of the server does not vary significantly, whereas the actions of the clients do. Also, observe how as n increses, the clients histogram presents two peaks: the biggest close to 0 and a smaller peak at as n22 increses, the clients histogram presents two peaks: the biggest close to 0 and a smaller peak at another mixed action value. This hints that the game tends to the two player case when there are many another mixed action value. This hints that the game tends to the two player case when there are many clients: all but one client tend to behave as normal stations. clients: all but one client tend to behave as normal stations. 380 381 382 383 384 385

moreThen, than we one simulate player behaving selfishly at once. As we{1, saw in4Figure thenumber numberofofiterations clients using RM algorithm for n 2, 3, }. We 2, setasthe 2 ∈ the run advantages of playing s for the clients decreased:payoffs the difference between the normal Tincreased, = 2000, and the learning process 50 times. The empirical obtained are in Table 4, and in behavior throughput and the throughput obtained when using a different backoff shrank. Since thecan Figure 3, the histogram of the mixed actions obtained is represented for all the n2 cases tested. We payoff of the clients is proportional to this difference, it is not enough gain for them to play ns: the loss when they play s and the server plays d do not compensate the gains when they play s and the server plays nd; hence, it is better for them playing ns. 0.6

40

40

40

40

20

20

20

20

Sensors 2018, 18, 404

16 of 19

0

0 0 0 0 0.2 0.3 0 0 0 0.2 0.6 0.1 0.1 0.2 0.3 0.1 0.2 0.3 0.4 compare to the theoretical results expected in the two player case, by computing the difference between Mixed action Mixed action Mixed action Mixed action the actions and payoff obtained using RM (Algorithm 1) and the theoretical values using (17) and (19). (a) n2 = in 1 mixed actions (b) (d)the n2 server =4 2 = 2 ± 0.0183 (mean(c) 2 =3 The mean difference is −n0.0224 ±nstandard deviation) for and 0.0056 ± 0.0087 for the client. TheClient mean1difference in payoffs isClient also small: 0.0007 Server Client 2 3 Client±40.0024 for the server and −0.0015 ± 0.0013 for the client. Thus, RM provides a very good approximation to the Figurevalues. 4. Histogram of actions obtained using RM algorithm, for n = 5 stations and variable number expected game malicious stations. Each that, histogram computed using bins. Cl stands for client. Observe the It is ofofspecial interest noting for n2is≥ 2, each of the 5clients distribution presents twothat peaks, action of the server does not vary significantly, whereas the actions of the clients do. Also, observe how clearer as n2 grows; one of them is nearly 0. We observe that in each game realization all clients but n2 increses, the clients histogram presents peaks: to 0 and smaller peak at one tend toasbehave as normal stations (i.e., they tendtwo to play ns),the asbiggest can be close observed alsoa in Figure 4 for another mixed This hints that to the two player case many n2 = 4: client 1 plays a action mixedvalue. action around z =the 0.5game and tends the rest of clients tend to when play zthere = 0,are that is, clients: all but one client tend to behave as normal stations. they tend to always play ns. This means that the game tends to the two player case, even if there are more than two players. This might be due to having payoffs such that they do not encourage having more than than one player behaving selfishly at once. As we Figure 1, as 2, theasnumber of clients 380 more one player behaving selfishly at once. Assaw we in saw in Figure the number of clients increased, the advantages of playing s for the clients decreased: the difference between the normal 381 increased, the advantages of playing s for the clients decreased: the difference between the normal behavior throughput and the obtained whenwhen usingusing a different backoff shrank. SinceSince the the 382 behavior throughput andthroughput the throughput obtained a different backoff shrank. payoff of theofclients is proportional to thistodifference, it is not gain for them to play 383 payoff the clients is proportional this difference, it isenough not enough gain for them to ns: playthe ns:loss the loss when they play s and the server plays d do not compensate the gains when they play s and the server 384 when they play s and the server plays d do not compensate the gains when they play s and the server plays nd; hence, it is better for them playing ns. ns. 385 plays nd; hence, it is better for them playing

Mixed action

0.6

0.4

0.2

0

Server

0

500 Client 1

1,000 Iteration Client 2

1,500 Client 3

2,000 Client 4

5. Example evolution of mixed the mixed action for each player, RM algorithm, FigureFigure 4. Example of the the evolution of the action for each player, usingusing RM algorithm, wherewhere Cl Cl for client. Insimulation, each simulation, all clients tend play ns, except forThis one.one Thisrandomly one randomly standsstands for client. In each all clients tend to playtons, except for one. arises arises atsimulation each simulation RM algorithm. This means that the game theplayer two player situation. at each using using RM algorithm. This means that the game tends tends to theto two situation.

7. Conclusions 386 7. Conclusions In this paper, we study a CSMA/CA wireless sensor network under a backoff attack: some of the 387 In this paper, we study a CSMA/CA wireless sensor network under a backoff attack: some of the sensors of the network are malicious and deviate from the defined contention mechanism. We first use 388 sensors of the network are malicious and deviate from the defined contention mechanism. We first use Bianchi’s network model to theoretically study the network throughput and observe that the malicious 389 Bianchi’s network model to theoretically study the network throughput and observe that the malicious sensors have a gain on throughputs, at the expense of other sensors in the network. Even though the total throughput in some situations stays the same, it is not fairly distributed among sensors. This effect depends on the backoff parameters used by the malicious sensors, as well as on the number of malicious sensors present in the network. We then proceed to model the situation as a static game between the malicious sensors and a network gateway (thus, using a star topology): the gateway (server) tries to enforce the malicious sensors to behave following the contention mechanism, whereas the malicious sensors try to obtain a higher throughput. We solve analytically the game for the case that there is only one malicious sensor

Sensors 2018, 18, 404

17 of 19

and propose an algorithm based on Regret-Matching to learn the equilibrium with any number of players. Our approach is validated via simulations. The framework we introduce in this paper can be further deepened in different ways. The malicious sensors could vary their parameters (for instance, their contention window) in order not to be easily detected by the defense system: this would mean that the action set of the client grows up and also, the game complexity. Another line of research would be modeling the game using dynamic game tools: in this case, the stations would choose their actions in order to maximize not their immediate rewards, but taking into account future interactions: in a wireless network, it is rare that the stations communicate only once. Finally, our approach shows that there is a trade-off between modeling complexity and computational complexity. By making use of payoff matrices, we alleviate this trade-off: the game theoretic solutions we provide are agnostic with regards to where these payoffs come from. That is, we could use Bianchi’s model as we do to relate rewards with the throughput, or we could relate rewards to other network parameters (as delay or any other measure of the quality of service) and yet our game modeling would be valid: we should only replace the payoff matrix and solve the game, with these new matrices. Hence, we believe that we introduce a framework simple enough to accommodate different situations, but also complex enough as to model the conflict and the actions of the different stations involved by using game theory tools. Acknowledgments: This work was supported by a Ph.D. grant given to the first author by Universidad Politécnica de Madrid, as well as by the Spanish Ministry of Science and Innovation under the grant TEC2016-76038-C3-1-R (HERAKLES) and the COMONSENS Network of Excellence TEC2015-69648-REDC. Author Contributions: J.P. and S.Z. conceived and designed the experiments; J.P. performed the experiments; J.P. and S.Z. analyzed the data; S.Z. contributed analysis tools; J.P. wrote the paper. Conflicts of Interest: The authors declare no conflict of interest.

Abbreviations The following abbreviations are used in this manuscript: ACK BA CE CS CSMA/CA CW DCF MAC MS NE NS RM RTS/CTS STA WLAN

Acknowledgement frame Basic Access mechanism Correlated Equilibrium Carrier Sense mechanism Carrier-Sense Medium Access with Collision Avoidance Contention Window size Distributed Coordination Function Medium Access Control Malicious (greedy) Station Nash Equilibrium Normal Station Regret-Matching algorithm Request-to-Send/Clear-to-Send mechanism Station Wireless Local Area Network

References 1. 2. 3.

Fragkiadakis, A.G.; Tragos, E.Z.; Askoxylakis, I.G. A survey on security threats and detection techniques in cognitive radio networks. IEEE Commun. Surv. Tutor. 2013, 15, 428–445. Zhang, L.; Ding, G.; Wu, Q.; Zou, Y.; Han, Z.; Wang, J. Byzantine attack and defense in cognitive radio networks: A survey. IEEE Commun. Surv. Tutor. 2015, 17, 1342–1363. Bayraktaroglu, E.; King, C.; Liu, X.; Noubir, G.; Rajaraman, R.; Thapa, B. Performance of IEEE 802.11 under jamming. Mob. Netw. Appl. 2013, 18, 678–696.

Sensors 2018, 18, 404

4.

5. 6. 7.

8.

9. 10. 11.

12. 13. 14. 15. 16.

17. 18. 19.

20. 21. 22. 23. 24. 25. 26. 27.

18 of 19

Cagalj, M.; Ganeriwal, S.; Aad, I.; Hubaux, J.P. On selfish behavior in CSMA/CA networks. In Proceedings IEEE 24th Annual Joint Conference of the IEEE Computer and Communications Societies, Miami, FL, USA, 13–17 March 2005; Volume 4, pp. 2513–2524. Ye, W.; Heidemann, J.; Estrin, D. Medium access control with coordinated adaptive sleeping for wireless sensor networks. IEEE/ACM Trans. Netw. 2004, 12, 493–506. Enz, C.C.; El-Hoiydi, A.; Decotignie, J.D.; Peiris, V. WiseNET: An ultralow-power wireless sensor network solution. Computer 2004, 37, 62–70. Van Dam, T.; Langendoen, K. An adaptive energy-efficient MAC protocol for wireless sensor networks. In Proceedings of the 1st international conference on Embedded networked sensor systems, Los Angeles, California, USA, 5–7 November 2003; pp. 171–180. Lin, P.; Qiao, C.; Wang, X. Medium access control with a dynamic duty cycle for sensor networks. In Proceedings of the 2004 Wireless Communications and Networking Conference (WCNC), Atlanta, GA, USA, 21–25 March 2004; Volume 3; pp. 1534–1539. Demirkol, I.; Ersoy, C.; Alagoz, F. MAC protocols for wireless sensor networks: A survey. IEEE Commun. Mag. 2006, 44, 115–121. Yadav, R.; Varma, S.; Malaviya, N. A survey of MAC protocols for wireless sensor networks. UbiCC J. 2009, 4, 827–833. Wang, W.; Sun, Y.; Li, H.; Han, Z. Cross-layer attack and defense in cognitive radio networks. In Proceedings of the 2010 IEEE Global Telecommunications Conference (GLOBECOM 2010), Miami, FL, USA, 6–10 December 2010; pp. 1–6. Toledo, A.L.; Wang, X. Robust detection of selfish misbehavior in wireless networks. IEEE J. Sel. Areas Commun. 2007, 25, 1124–1134. Akkarajitsakul, K.; Hossain, E.; Niyato, D.; Kim, D.I. Game theoretic approaches for multiple access in wireless networks: A survey. IEEE Commun. Surv. Tutor. 2011, 13, 372–395. Ghazvini, M.; Movahedinia, N.; Jamshidi, K.; Moghim, N. Game theory applications in CSMA methods. IEEE Commun. Surv. Tutor. 2013, 15, 1062–1087. Konorski, J. A game-theoretic study of CSMA/CA under a backoff attack. IEEE/ACM Trans. Netw. 2006, 14, 1167–1178. Goyal, D.; Tripathy, M.R. Routing protocols in wireless sensor networks: A survey. In Proceedings of the 2nd International Conference on Advanced Computing & Communication Technologies (ACCT), Rohtak, India, 7–8 January 2012; pp. 474–480. Yang, L.; Lu, Y.; Xiong, L.; Tao, Y.; Zhong, Y. A Game Theoretic Approach for Balancing Energy Consumption in Clustered Wireless Sensor Networks. Sensors 2017, 17, 2654. Hart, S.; Mas-Colell, A. A simple adaptive procedure leading to correlated equilibrium. Econometrica 2000, 68, 1127–1150. IEEE Standard for Information Technology—Telecommunications and Information Exchange between Systems Local and Metropolitan Area Networks—Specific Requirements-Part 11: Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) Specifications; IEEE: Piscataway, NJ, USA, 2016; pp. 1–3534. Buehrer, R.M., Synthesis Lectures on Communications; Chapter Code division multiple access (CDMA); Morgan & Claypool Publishers: San Rafael, CA, USA, 2006; Volume 1, pp. 1–192. Rahman, A.; Gburzynski, P. Hidden problems with the hidden node problem. In Proceedings of the 23rd Biennial Symposium on Communications, Kigston, ON, Canada, 30 May–1 June 2006; pp. 270–273. Bianchi, G. Performance analysis of the IEEE 802.11 distributed coordination function. IEEE J. Sel. Areas Commun. 2000, 18, 535–547. Malone, D.; Duffy, K.; Leith, D. Modeling the 802.11 distributed coordination function in nonsaturated heterogeneous conditions. IEEE/ACM Trans. Netw. 2007, 15, 159–172. Basar, T.; Olsder, G.J. Dynamic Noncooperative Game Theory; SIAM: Philadelphia, PA, USA, 1999; Volume 23. Anderson, T.W. On the distribution of the two-sample Cramer-von Mises criterion. Ann. Math. Stat. 1962, 33, 1148–1159. McKelvey, R.D.; McLennan, A. Computation of equilibria in finite games. Handb. Comput. Econ. 1996, 1, 87–142. Von Stengel, B. Computing equilibria for two-person games. Handb. Game Theory Econ. Appl. 2002, 3, 1723–1759.

Sensors 2018, 18, 404

28. 29. 30. 31. 32. 33.

19 of 19

Avis, D.; Rosenberg, G.D.; Savani, R.; Von Stengel, B. Enumeration of Nash equilibria for two-player games. Econ. Theory 2010, 42, 9–37. Aumann, R.J. Subjectivity and correlation in randomized strategies. J. Math. Econ. 1974, 1, 67–96. Fudenberg, D.; Tirole, J. Game Theory; MIT Press: Cambridge, MA, USA, 1991. Gilboa, I.; Zemel, E. Nash and correlated equilibria: Some complexity considerations. Games Econ. Behav. 1989, 1, 80–93. Goldberg, P.W.; Papadimitriou, C.H. Reducibility among equilibrium problems. In Proceedings of the 38th Annual ACM Symposium on Theory of Computing, Seattle, WA, USA, 21–23 May 2006; pp. 61–70. Hart, S.; Mas-Colell, A. Simple Adaptive Strategies: From Regret-Matching to Uncoupled Dynamics; World Scientific: Singapore, 2013; Volume 4. c 2018 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access

article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).