#### Abstract

Game theory may offer a useful mechanism to address many problems in mobile ad hoc networks (MANETs). One of the key concepts in the research field of such networks with Optimized Link State Routing Protocol (OLSR) is the security problem. Relying on applying game theory to study this problem, we consider two strategies during this suggested model: cooperate and not-cooperate. However, in such networks, it is not easy to identify different actions of players. In this paper, we have essentially been inspired from recent advances provided in game theory to propose a new model for security in MANETs. Our proposal presents a powerful tool with a large number of players where interactions are played multiple times. Moreover, each node keeps a cooperation rate (CR) record of other nodes to cope with the behaviors and mitigate aggregate effect of other malicious devices. Additionally, our suggested security mechanism does not only take into consideration security requirements, but also take into account system resources and network performances. The simulation results using Network Simulator 3 are presented to illustrate the effectiveness of the proposal.

#### 1. Introduction

In our everyday life, we are very interested in and dependent on wireless connection technology. In addition, the use of mobile devices and applications based on wireless networks is continuously increasing day after day. However, this may generate several kinds of problems in terms of communication between mobile devices in some difficult situations. These problems can be observed, especially where a network infrastructure is missing. Therefore, we need a powerful and efficient mobile ad hoc network (MANET) to ensure and improve communication between devices in different situations such as military fields, conferencing, and sensor networks.

MANETs are a collection of wireless mobile devices that form a temporary network without an existing infrastructure or a centralized administration. Furthermore, and due to limited transmission range of wireless interfaces, it may be necessary for one node to identify other nodes to forward their packets to its destinations. In such networks, each node does not merely work as a host for transmitting and receiving data but acts as a router or gateway for routing packets from other nodes as well. Moreover, each node participates in routing process that allows it to establish paths to reach any possible destination inside the network. In addition, all nodes dynamically establish paths between themselves to create network infrastructure that depends on individual behavior of nodes. Along these lines, and in a spontaneous nature of MANET, all nodes move randomly across the network because of the nodes mobility and bandwidth-constrained wireless connection for communicating with each other. This nature permits infiltrating and disrupting network performances by malicious and selfish nodes. Thereby, malicious behavior represents one of the most famous challenges and destructive routing problems that can influence network performances. Additionally, the concept of selfish node attack is based on the absorbing of significant amount of traffic, dropping received packets, and not cooperating during the packet routing process. However, this problem arises when examining network topology where malicious nodes cannot be easily detected.

MANETs are infrastructureless and self-organized; all nodes have to cooperate between themselves in order to provide the best performances and offer necessary network functionalities. The cooperation mechanism must comply with the rules imposed by the routing protocol for transmitting and receiving data. On the other hand, the noncooperation behavior can be produced by nodes that do not follow these rules. However, all nodes act as routers or gateways and contribute to discovering and maintaining the routing process. Moreover, each node is constrained in terms of limited resources (energy, etc.), and it may not always be interesting to accept relay requests that require consumption of most resources. Therefore, a cooperative system should be integrated and incorporated with any network operations such as packet forwarding and route discovery. The goal of this system is to prevent malicious behavior and encourage nodes to cooperate with each other. However, the application of cooperation mechanism is particularly difficult because of MANET features that impose certain requirements.

In this context, many researchers have investigated selfish nodes and security problems in MANETs. In this way, the authors in [1] proposed a solution to improve network performances when attacks are launched and mitigate aggregate effect, especially that all nodes in such networks are vulnerable to being isolated by malicious nodes. Furthermore, the authors in [2] presented a powerful intrusion detection system called Enhanced Adaptive ACKnowledgment (EAACK). Compared to other intrusion detection mechanisms, EAACK shows an efficient attack detection without affecting network performances. Likewise, the authors in [3] surveyed the impact of packet dropping attacks in MANET. In their work, the authors try to demonstrate the importance of attacks, elaborate a new detection system, and avoid malicious nodes during communication with each other. Additionally, MANET nature makes it more attractive to many types of attacks. In this way, the authors in [4] proposed a survey in two parts: the first one addresses important security mechanisms and types of attacks that can affect network performances, especially in the network layer. The second one addresses the classification of detection mechanisms that deal with a single or series of attacks. Furthermore, in the work presented in [5], the authors suggested a powerful solution called I-Watchdog protocol to detect malicious nodes in MANETs. In addition, the authors proved through simulations the effectiveness of this solution with Destination-Sequenced Distance-Vector (DSDV) routing protocol in terms of packet drop ratio (PDR), throughput, and end-to-end delay.

Recently, game theory provides a useful solution for modeling and addressing different problems in MANETs. In such networks, players (nodes) have conflicting objectives and different profiles with each other. Additionally, in the game theory, a utility function represents a payoff (reward) that allows each player to evaluate a particular outcome that reflects its objectives. The utility of each player depends not only on its actions (strategies), but also on others’ actions. In addition, a security scheme must take into account past and current strategies of different players to be successful in MANETs.

In the same context, our research is focused on mobile ad hoc networks using Optimized Link State Routing Protocol (OLSR) which is a proactive protocol. In such networks, OLSR is one of the most used routing protocols. Moreover, the cooperation concept is an essential element that can result in the evolution of network performances in MANET. In this way, and in this paper the cooperation rate (CR) represents the value which indicates how many times a node cooperates or not during the game (or during network lifetime). Through this value, each node can evaluate the behavior of another node before sending a packet. Moreover, in this paper, a threshold is considered as the minimum value of the CR accepted by all rational nodes. We consider that each node which has a CR > 0 is considered as a legitimate node, whereas a node with CR < 0 is considered as a noncooperative node. Therefore, our contribution is briefly summarized below:(i)Firstly, our conduct is to put forward an enhanced algorithm based on game theory and establishing confident relationships between nodes. In this proposed model, each node keeps a cooperation rate (CR) record of other nodes to evaluate their behaviors and avoid malicious nodes.(ii)Secondly, the calculation of CR is based on OLSR messages (HELLO and topology control (TC)) exchanged between nodes and forwarding processes.(iii)Thirdly, the cooperation rate will be shared between nodes in addition to other network information using HELLO and TC messages.(iv)Fourthly, the key novelty of this paper is that the value of CR will be used as a metric to construct routing tables instead of hop count metric used by OLSR standard.The remainder of this paper is organized as follows: The OLSR routing protocol as a proactive scheme is presented in Section 2. Some previous studies that aim at addressing cooperation and selfish behavior in MANETs are presented in Section 3. A game model formulation is described in Section 4. Our suggested system model based on cooperation between nodes is discussed in Section 5. A malicious detection algorithm and enhanced routing table computation are introduced in Section 6. A simulation environment used to address our approach is discussed in Section 7. The results that concern the validation of our solution are presented in Section 8. Finally, the paper is concluded in Section 9 with future work.

#### 2. Proactive Schema: Case of OLSR

OLSR is a proactive routing protocol [6] based on MPR (multipoint relay) mechanism that is considered as the key concept used in this protocol. The MPRs are used to maintain routing tables and topology control. In addition, and owing to the proactive nature of OLSR, the control of the state links and paths is done proactively and periodically. In the same way, the optimization in this protocol can be done in two steps: the first one uses control messages with reduction in size. The second one uses a reduced number of links to forward the link state packets. In addition, this reduction is made by declaring only a subset of links in link state updates. Moreover, each node in OLSR uses HELLO messages to find its one-hop and two-hop neighbors through their replies. The transmitter node can select its MPR based on its one-hop neighbors set that offers the best reachability to nodes belonging to the two-hop neighbors. Furthermore, the transmitter uses TC (topology control) messages to declare a set of links (advertised link set) that must include at least the links to all nodes of its MPR selector set [6].

The routing in MANETs using OLSR is a method through which each node sends information to a quite precise recipient. The problem of routing is limited not only to how to find a path between two nodes inside the network, but also to how to find an optimal and secure routing path. However, in such networks, one of the major problems of routing processes is the noncooperative and selfish behaviors as denoted in Figure 1. In these cases, the noncooperative and selfish nodes take advantage of legitimate nodes and do not cooperate with others in order to save resources for their own communication. Thereby, network resources become unavailable for legitimate nodes.

#### 3. State of the Art

MANETs are used in a wide range of applications in various fields. For successful execution of different operations in such networks, routing processes are the most important operations that improve network performances. Therefore, many researches have been reported in the literature to address routing processes. In this way, the authors in [7] presented an incentive solution for probabilistic routing in order to stimulate selfish nodes to cooperate with others. In addition, the authors proved properties of this solution and extensively evaluated it using GloMoSim. Furthermore, the result presents more than 75.8% of the gain concerning delivery ratio compared to other probabilistic routing protocols without incentive.

On the other hand, and in order to address joint routing, network coding, and scheduling problems, matrix game theoretic models, which are based on a nonlinear cubic game, have been proposed in several works such as [8]. The authors in this work, due to necessity of the inherent multicast gain of network, proposed a new approach based on a compressed topology matrix to model routing and network coding problems. Additionally, the authors proposed a new approach called Network Graph Soft Coloring (NGSC) to optimize scheduling problems. Furthermore, the authors in [9] presented a solution based on a two-hop relay with limited packet redundancy , to propose a forwarding game and address the optimal forwarding problem in MANETs. In this game, each node () chooses a strategy with probability () to send and forward its own traffic. Additionally, each node () helps to forward other traffic with probability , where , while its payoff is the attainable throughput capacity of its own traffic.

In wireless ad hoc networks, the routing is the most important process that needs cooperation between nodes. Thus, some cooperation schemes and trusted models have been proposed in several works such as [10–15]. The main objectives of these works are the following: (i) to enforce cooperation between nodes and (ii) to evaluate and address aggregate effect of malicious nodes. Moreover, and in order to reach these objectives, the authors presented many solutions such as collaborative reputation model, a game theoretic trust model, collaborative caching priority, coalition formation, and cooperation strategies for processing requests. In addition, the authors in [16] presented, in noncooperative wireless ad hoc networks, a study of collusion-resistant routing. This work is based on two solutions: Group Strategy Proofness and Strong Nash Equilibrium for collusion resistance in game theory. Also, the authors proposed a cryptographic mechanism to avoid profit transfer among colluding players (nodes). In the same context, the authors in [17] used the game theory to address cooperation incentive of nodes based on reputation mechanisms, price-based systems, and a system without cooperation incentive strategy. Through this work, a strategy based on a threshold to determine node reliability and reward cooperative nodes may be manipulated by selfish nodes. In addition, the authors in [18] proposed a powerful solution built on Mean Field Game (MFG) approach with multiple players for security enhancements in MANET. Based on recent advances in MFG theory, this approach permits enabling each node to elaborate strategic security defense decisions. Additionally, this approach takes into account system resources, permits each node to know its own state information and evaluate aggregate effect of other nodes. However, the authors studied the interactions between nodes and only one attacker.

In MANETs, nodes must cooperate between them to send and forward packets from sources to destinations. In this way, the work presented in [19] showed that node misbehavior problems can influence MANETs and sensor networks performances. In addition, and in order to avoid this problem, the authors proposed a solution adapted to wireless multihop network in order to deal with collusive networking behavior based on game theory. Additionally, this solution is derived from recent works that are based on the theory of imperfect private monitoring for the dynamic Bertrand Oligopoly. Also, the authors showed the effectiveness of this solution under a wireless environment. Along these lines, and due to the importance of the cooperation concept, the authors in [20] proposed a solution called Finite-Time Reputation System (FITS) that uses a new technique named Threat To Interfere (TTI) to enforce cooperation between nodes. In addition, this mechanism is based on two solutions: the first one called FITS-D needs a Perceived Probability Assumption (PPA). The second one called FITS-I uses more techniques to avoid the necessity of PPA. Moreover, this work showed that both of schemes have a Subgame Perfect Nash Equilibrium (SPNE) in which the probability of forwarding packet of nodes is close to one.

In the same context, the authors in [21, 22] proposed a secure routing protocol to protect nodes from anonymous behaviors. These works are based on game theory which provides a powerful tool to analyze, formulate, and address selfish behaviors. In addition, these authors used the Dynamic Bayesian Signaling Game (DBSG) to analyze strategy profiles for rational and malicious nodes to find the best strategies for each player (node). Furthermore, the authors studied the equilibrium by combining strategies and utility functions (payoff) of nodes to solve this incomplete information problem. Moreover, and to reach this goal, the authors used Perfect Bayesian Equilibrium (PBE) that offers an important solution for signaling games. Likewise, the authors presented in [23] a solution to deal with selfishness and moral hazard in noncooperative wireless networks. In addition, they proposed a solution based on several methods that discourage hidden actions under secret information. Furthermore, some mechanisms for routing scenarios have been proposed; for instance, each malicious node tries to maximize its utility function when it sincerely declares its cost and actions. Also, the authors proved through simulations that payments are larger compared to current cost incurred by all intermediate devices.

Along these lines, and in order to detect and isolate packet dropping attacks efficiently, the work in [24] proposed a protocol named SADEC (Stealthy Attacks in Wireless Ad Hoc Networks: Detection and Countermeasure). This protocol is based on two techniques: the first one is based on how to keep additional information about routing paths by neighbors. The second one is based on how to add some checking mechanisms to each neighbor. This protocol can offer a powerful solution to use local monitoring. In addition, the authors showed by simulations the effectiveness of the protocol in how to reduce the impact of packet dropping attack. In the same way, the authors in [25] proposed a solution based on Social Network Analysis (SNA) to develop an intrusion detection mechanism (SN-IDS) in MANETs using MAC and network layers data. After that, these authors selected relevant social functionalities and constructed a set of sociomatrices. Moreover, these authors showed that these methods based on social analysis can be applied to these matrices to detect malicious activities of mobile nodes using multiple rules.

Similarly, in the work proposed in [26], the authors presented an intrusion detection system to detect attack sequences in MANET using MAC layer applications. This system can be applicable to MANET environment based on stable and efficient attack observations. In such a way, the solution presented in [27] suggested an intrusion detection and adaptive response mechanism to provide an effective reply in case of a range of attacks in MANETs. This solution, in order to offer a better security requirement, proposed a flexible response scheme based on effectiveness level of network performances, measured confidence, and the impact of attacks. In addition, the authors in [28] proposed a solution called Sentinel Protocol (SP) to detect and deal with replica attacks that can influence network performances. The main objective of this attack is that malicious nodes deploy a large number of replicas of compromised or captured devices across the network. Furthermore, the authors proved through simulations the effectiveness of this protocol.

Due to the importance of the routing efficiency in delay tolerant networks, the authors in [29] suggested an enhanced routing protocol which is based on the social link awareness. The main objective of this algorithm is to avoid the selfish nodes and solve the problems of intermittent connection and high latency in order to improve the routing process. In addition, the proposed algorithm used the social links to construct the friendship communities of the nodes. Moreover, different mechanisms such as the intracommunity and intercommunity forwarding are implemented to improve network performances in terms of the successful delivery ratio with low overhead and decrease the transmission delay. In the work presented in [30] the authors proposed a solution based on game theory and load feedback control (LFC) with price elasticity to maximize profit benefits for distributed generations (DGs) for their participation in energy loss reduction. In addition, the proposed model can be used to reward DGs and improve their profit by using the game theory approach. Moreover, and where a distributed locational marginal pricing (DLMP) feedback signal is calculated by customer demand, the proposed mechanism can be used to regulate peak-load value of multiple customers by using an LFC submodel with price elasticity. In addition, the authors in [31] proposed a global punishment-based repeated game model to enforce the cooperation between nodes across the network. Additionally, when the whole network is in a cooperative state, the authors investigated the equilibrium conditions of packet forwarding strategies by taking into account rational nodes. Moreover, a metamodel is used to design forwarding strategies in order to reduce the impact of selfish nodes on network performances and encourage the cooperation between mobile nodes.

Recently, the effective cooperation incentive of nodes has become a hot issue in cooperative communication such as mobile ad hoc networks. In such a way, the authors in [32] proposed a topology transform-based recommendation trust model to stimulate the cooperation between nodes and mitigate effect of selfish behaviors. Furthermore, the model is used to mitigate the aggregate of malicious effects on the accuracy of recommendation trust, which result from fake recommendation. In addition, the authors used some mathematical models and simulation to ensure the effectiveness of their proposed model.

To address these problems and imperfections, and through this paper, our concern is to design a new algorithm of cooperation based on relationships between nodes. Then, we will compare the proposal with the original OLSR and a selfish OLSR protocol; after that, we integrate it with original OLSR. Additionally, we address the proposal based on a mathematical model and set of simulations. Furthermore, the main objective is to be fully extended to universal ad hoc networks and practical MANET applications, especially routing processes and malicious node detection.

#### 4. Game Model Formulation

##### 4.1. Modeling Ad Hoc Network as a Game

In this section, we propose a description of a mobile ad hoc network , which is formed by a set of mobile nodes, using the game theory approach. This formulation contains a set of nodes (players) denoted by (), a strategy space denoted by (), and a utility function denoted by (). Thus, the network can be expressed by . Table 1 presents briefly a duality between a game approach and the mobile ad hoc network in our situation.

In the abovementioned network , each node has a utility function that represents the payoff of each player (node) across the network. In addition, a utility function represents a payoff (reward) that allows each player to evaluate a particular outcome which reflects its objectives. The main objective of all nodes (players) is how to maximize or minimize the utility function depending on a context. In the same way, each player acts as a relay or gateway for routing packets from other players based on available routing and topology tables. In addition, each player () chooses its strategy from the strategy space defined by (cooperate means to participate in packet forwarding and not-cooperate means packet dropping).

##### 4.2. Static and Repeated Game Approach

To analyze the outcome of the static game, our two-player game is similar to the prisoners dilemma game [33]. Each player can choose different strategies: cooperate (C) or not-cooperate (NC). If one of the two players chooses to cooperate, it will act as a router or gateway for the other player. However, if the player chooses the not-cooperate strategy, it will forward its own packets and will not participate in routing packets for the other player.

In this paper, we consider that if a player chooses to cooperate, it will be rewarded by a lot of information (ACKs, topology control, links update, routing of packets, etc.); this reward is denoted by , but at the same time it will lose a cost denoted by . However, if the two players choose not-cooperate strategy, both of them will lose the information already mentioned above.

Let us denote by the reward of each player that chooses to cooperate and by the reward of the player that chooses not-cooperate in case the first player chooses to cooperate and by the punishment that each player receives if both choose not-cooperate strategy. Therefore, in the rest of this paper, we assume that .

The only optima equilibrium if the two players are rational is the strategy profile , where the first strategy denoted in the pair is that of player and the second is that of player . This strategy profile will be available only if the two players choose the cooperate strategy. Moreover, this situation cannot be realized in all static games due to a selfish behavior of some players. However, the profile where the two players choose the not-cooperate strategy is undesirable from the network perspective.

In our situation, we consider that the past strategies influence the payoff (utility) function in current period (stage). Thus, the game can be analyzed using the repeated game approach [34, 35], where all players face the same static game many times and in every period . Therefore, we choose to apply the repeated game approach in our situation for the following reasons:(1)The game or nodes interactions are played several times. In addition, when a node (player) takes into consideration the impact of its current strategy on future actions of other nodes, the game is called repeated game.(2)During this kind of games, all nodes (players) can observe different actions of other players, and this characteristic helps to adapt their actions (strategies) to respond to other players, especially that each node keeps track of the cooperation rate (CR) record of other nodes.(3)Furthermore, selfish players act as routers or gateways only to their interest without taking into consideration network performances. So we can define and impose some rules to enforce cooperation between nodes. In addition, these rules can be modeled using the repeated game.(4)These rules can be implemented to reach a desirable result of developed games. Moreover, repeated games support different equilibrium solutions which are adapted for many requirements of ad hoc networks. In this paper, and in order to enforce cooperation between nodes, each player keeps track of the cooperation rate (CR) record of other players as a rule in this game model. The main objective of this rule is to show the importance of cooperation potential benefits through interactions between nodes. Also, this rule can be modeled in a repeated game.

##### 4.3. Problem Formulation and Nash Equilibrium

###### 4.3.1. Pure Strategy

In this section, we consider a problem that may exist in different types of networks, where optimization of communication is very important. In our study, we consider a flow of network traffic generated by a finite number of nodes (players). In addition, each node knows a list of paths that fits its strategy, and its objective is to maximize its utility function. The situation where all players maximize their utility functions is known as Nash Equilibrium (NE) [31, 36]. In the repeated and noncooperative game models, the NE is used to predict the stable situation where no player (node) has nothing to gain by changing its strategy unilaterally.

In the same context, and in this pure strategy, a Nash Equilibrium is a strategic profile such that each player () has its utility , and for each strategy ,where is the best response of player (), are the best responses of other players, and is the set of strategies of player (). In addition, we are dealing with a dynamic game with players (nodes) playing a repeated game. The payoff of different profiles in strategic form is presented in (bimatrix) Table 2, with cooperate strategy denoted by C and not-cooperate strategy denoted by NC.

We use the strategic form because our game is considered as a simultaneous game, where both players can choose their strategies simultaneously.

Based on the matrix payoff (Table 2), if one of the two players chooses to cooperate and if the other player chooses not-cooperate strategy, thus, the payoff of the second player is improved from () to (). In addition, if one of the two players chooses not-cooperate strategy and the other player also chooses the same strategy, then, the payoff of the second player is decreased from () to (). Furthermore, we note that any strategy (cooperate or not-cooperate) cannot always offer a better utility to each player in different situations. Thus, a dominant or dominated strategy does not exist. However, in terms of stability, this game supports two Nash Equilibria (NE): and . In both situations of NE, no player can profitably change its strategy. Furthermore, and cannot be NE because the two players would have an incentive to change their strategies. In this game, the two NE are considered as situations of stability but are not equitable, because only one of the two players can be rewarded. Additionally, the strategy profile is undesirable from the network context.

###### 4.3.2. Mixed Strategy

A mixed strategy of a player () is a probability distribution defined upon all its pure strategies. Let us denote by all mixed strategies of player () and by a mixed strategy of this player.

A mixed strategy Nash Equilibrium is a mixed profile of strategies , such that for each player () and for all ,where is the best response of player () and are the best responses of other players.

In the mixed strategy, and to analyze the outcome of the static game, each player chooses a strategy cooperate (C) with probability (or ) and the other strategy, not-cooperate, with probability or . Table 3 presents the payoff matrix of the two players in the mixed strategy.

Let us denote by the average utility of player when it chooses cooperate strategy. Thus, the average utility can be written asLet us denote by the average utility of player when it chooses not-cooperate strategy. Thus, the average utility can be written asAt the mixed strategy Nash Equilibrium: = (i.e., (3) = (4)). Then,Equation (5) can be written as Therefore,Thus, (7) can be written aswhere represents the probability at the mixed strategy Nash Equilibrium.

In this game, represents a punishment that needs to penalize the players and encourage them to cooperate. In addition, if the value of is very high (see infinity) the players will tend to cooperate in order to avoid this punishment. Therefore, we can calculate the limit of when approaches infinity (): We can follow the same operations concerning player because the game is symmetrical; therefore, Thus the mixed strategy (, ) is a Nash Equilibrium.

However, in case of () players the situation can be considered as the volunteer’s dilemma game [37, 38]. In addition, we can demonstrate that in such a situation the cooperation between nodes decreases.

Therefore, in this case and from Table 3, we can calculate the average utility of each player () depending on actions of other players. Thus, we will study two cases.

*Case 1. *Let us denote by the average utility of player () if it chooses to cooperate. Then, we have to study two subcases. *Case **1.1*. If at least one of the other players chooses to cooperate,where is the probability that at least one of the other players chooses to cooperate.*Case **1.2*. If no player chooses to cooperate,where is the probability that no player chooses to cooperate.

Then, the average utility of player () can be written as SoEquation (14) can be written as

*Case 2. *Let us denote by the average utility of player () if it chooses not-cooperate strategy. In this case we have to study two subcases as well.*Case **2.1*. If at least one of the other players chooses to cooperate,where is the probability that at least one of the other players chooses to cooperate.*Case **2.2*. If no player chooses to cooperate,where is the probability that no player chooses to cooperate.

Then, the average utility of player () can be written as SoEquation (19) can be written asAt the mixed strategy Nash Equilibrium: (i.e., (15) = (20)). Thus,Equation (21) can be written as So Therefore, So where represents the probability at the mixed strategy Nash Equilibrium. In addition, we can follow the same operations concerning player because the game is symmetrical; therefore, Thus, when the number of players is increased (i.e., when approaches infinity) the limit of when is Therefore, we notice that, in such a situation, where the number of players increases, the cooperation between nodes decreases as well and becomes more interesting to encourage nodes (players) to cooperate. In addition, we notice that the noncooperative strategy can offer a selfish player to take advantage of a cooperating player. Therefore, we must take into account a cooperative system to deal with this behavior and enforce cooperation between nodes. In addition, this cooperative system must offer each node (player) a reward for cooperating and impose a punishment on each node for not cooperating.

Thus, let us denote by the cooperation utility (the cooperation history) of the th player in the entire reputation game and in each stage or period . The utility is the sum of its utilities in all stages. Additionally, let us denote by the value added or subtracted periodically according to player behavior (cooperate or not-cooperate) during the game in order to update its . The cooperation rate (CR) of each player () is calculated using the following equation:In the next section, we propose a mathematical model where we formulate the calculation of the cooperation rate (CR).

#### 5. System Model

##### 5.1. Cooperation-Based Mechanism

In other similar game theory models which have been cited above in related work section, a reputation entity, such as the watchdog, is used to detect misbehaving nodes. In addition, and in every time a monitoring entity needs to monitor and verify the correct execution of a function. However, this mechanism is based on an assumption which is not always true and required more energy consumption. Moreover, many other game models are not adequate to OLSR routing protocol.

Concerning our proposed model, we have selected, for performance evaluation, the OLSR protocol that considers the stability of links. The key novelty of this model is to stimulate the cooperation between nodes in a MANET using the cooperation rate (CR) in order to prevent selfish behavior. Additionally, the CR value is calculated based on various types of specific OLSR messages (HELLO and topology control (TC)) and different network operations (forwarding and routing). In our proposal, the correct execution of a function is according to the player behavior: cooperate or not-cooperate (cooperate means to participate in packet forwarding and the exchange of OLSR messages (HELLO and TC) with reception of ACKs and not-cooperate means packet dropping). Thus, this process ensures the correct execution of an OLSR function.

In this paper, we propose a new strategy based on the game theory to enforce the cooperation between nodes by calculating a cooperation rate (CR) for each node. Additionally, this strategy has evaluated using OLSR messages (HELLO and TC) and different network processing (forwarding and routing). In the rest of this section, we propose a mathematical model where we formulate the calculation of the cooperation rate (CR).

In the rest of this section, we propose a mathematical model where we formulate the calculation of cooperation rate (CR). In this model, each node () can know the cooperation rate of a node () inside the network.

###### 5.1.1. Cooperation Rate: CR

The cooperation rate (CR) of a node () in relation to its neighbors set is directly calculated from an observation of each node () which belongs to the neighbors set of the node (). The CR, at time interval , is calculated using a weighted average of the observations’ rating factors provided by nodes belonging to the neighbors set of the node . Moreover, and in order to (i) reach a better evaluation of node behaviors, (ii) avoid incorrect detections due to connection breaks, (iii) and ensure that the nodes which are involuntary noncooperative due to their limited resources (energy levels, etc.) are not excluded from the network, we should take into consideration a minimal impact on the evaluation of the final cooperation value. In addition, the CR value is calculated periodically over a given time interval () that depends on the default time of OLSR messages exchanged between nodes. Therefore, in case of HELLO message the time interval is 2 seconds, in case of TC message the time interval is 5 seconds, and in case of a forwarding process it is directly calculated after the end of this process. Moreover, in this paper, the threshold is considered as the minimum value of the CR accepted by all rational nodes. We consider that each node which has a (CR 0) is considered as a legitimate node, whereas a node with (CR 0) is considered as a noncooperative node. Moreover, at the beginning of this algorithm, the cooperation rate of each node is initialized by zero. In addition, all newly joined nodes will have a CR which is initialized to zero as well.

The equation that permits calculating the CR of node () at time interval and based on a network operation iswhere is the value added or subtracted periodically according to node behavior (cooperate or not-cooperate) during the game. (i) is the network operation (TC and HELLO messages processing and forwarding processes).(ii)() represents the cooperation rate (CR) record saved by a given node () in relation to another node (). Also, it is a time dependent function that gives higher relevance to past values of CR. Additionally, () is used to update the CR according to node behavior (cooperate or not-cooperate) during the game in order to update its (). Also, this value is influenced and depends on the observations’ rating factors (other cooperation rates) provided, at time interval , by other nodes belonging to neighbors set of node ().

###### 5.1.2. Weighting Calculation

The cooperation rate depends on different network function (HELLO and TC messages processing and forwarding processes). Therefore, during the calculation of the cooperation rate, we must take into account the impact of each function according to its importance. In this way, and in order to calculate the weight related to each function , we use AHP (analytic hierarchy process) method [39, 40]. In AHP method, the decision process requires the execution of the following stages:(1)Establish the main objective:(i)Choose a processing function(2)Define the criteria:(i)Security, routing, and reliability(3)Select options:(i)HELLO message processing(ii)TC messages processing(iii)Forwarding processing

In our case, we consider that the security is the most important criterion, followed by routing process and reliability. The rest of the AHP process is very long, so we are going to present the results directly, and the CR of the node (), which is presented in (29), can be written as follows:where (i) = 1.328, if the function is a TC processing. (ii) = 1.3060, if the function is a forwarding processing. (iii) = 1.2720, if the function is a HELLO message processing.

Moreover, each node must share its correct cooperation rate (CR) with other nodes using OLSR messages. We present in Figure 2 the enhanced format of HELLO message that contains the CR of the transmitter node, and the standard format is presented in Figure 3.

We present in Figure 4 the enhanced format of TC message that contains the CR of the transmitter node, and the standard format is presented in Figure 5.

#### 6. Malicious Node Detection Algorithm

In this section, we propose an algorithm to detect and avoid malicious behavior based on CR value of all nodes across the network using the routing game approach during the routing tables computation.

##### 6.1. Routing Game

The routing process requires cooperation between nodes for routing packets from other nodes. Therefore, the key novelty of this paper is to develop an algorithm based on game theory to enforce cooperation between nodes in order to avoid selfish and malicious nodes during the routing process. However, the existence of malicious nodes in this area threatens cooperation and influences network performances (routing control, lifetime, etc.) as denoted in Figure 6. Additionally, each node (player) tries to reach the following objectives: it tries to maximize its utility function, minimize a path cost function, or find an optimal and secure routing path. In the game theory, these objectives have been addressed in what is known as the routing game. Moreover, in each routing process, every node chooses its path and updates its strategy in terms of its utility function and the action it has chosen.

We represent our routing game model using an undirected graph (, ), where(i) is the set of nodes or vertices,(ii) is the set of arcs (link) between nodes,(iii) denotes all players (nodes), where ,(iv)any player () is characterized by the following information:(1)CR() is utility or cooperation rate.(2)A pair of vertices (, ) () which represents its source and destination, respectively.(3) is set of the shortest paths ranging from source to destination with cardinality .(4)A strategy space indexed on the set .(5)For each path () , where (32) represents the utility function of the player () in relation to the path (, ) which belongs to and is based on CR values of nodes belonging to this path. In addition, and in case of multiple choice, each node chooses the path with greater value of this utility function .

The routing table computation is an essential process in OLSR protocol. Therefore, and in order to avoid communication with malicious nodes which may act as routers or gateways, the calculated cooperation rate (CR) must be integrated in the routing table as a new metric in parallel with other information (destination address, next address, and next interface) to establish secure routes between nodes. In this way, we propose a new routing table shape as mentioned in Table 4.

##### 6.2. Enhanced Routing Table Algorithm

In this section, we present a brief description of our enhanced routing table algorithm that provides the solution to avoid selfish nodes.

*BEGIN*(1)Based on modified HELLO message with the cooperation rate of nodes, control all one-hop nodes.(2)Add appropriate entries for each node to its routing table using its one-hop table.(3)Update entries of routing table with the topology set.(4)Keep recursively, for each node, its last address until attaining the destination.(5)Based on modified TC message with the cooperation rate of nodes, save all path information in the routing table.(6)Delete the loop entries, if any.(7)For each node across the network select all paths of a given source-destination.(8)Evaluate the behavior of each node based on CR to avoid selfish nodes on each path.(9)Get the CR of each node on each path.(10)For each node (), calculate the utility function on each selected path using (32).(11)Find out the maximum utility function on each selected path.(12)Use this selected path.

*END*

In the next subsection, we present an example to give a walk through example to explain our malicious node detection algorithm.

##### 6.3. Proposed Example

In this example which is presented in Figure 7, we propose a MANET with six nodes, where the source node tries to send packets to its destination node . After (i) calculating the cooperation rate of each node as mentioned in Tables 5, 6, 7, 8, and 9, (ii) sharing this value between all nodes using HELLO and TC messages, and (iii) introducing this value on routing tables, the source node must choose one short path among the two possibilities to avoid malicious nodes. Therefore, the source node must calculate its utility function in relation to the path (1, 2 4, 6) and path (1, 3, 5, 6) based on CR values of the nodes belonging to these paths. In addition, the source node will choose the path with greater value of this utility function . In this example, we propose that the calculating of cooperation rate is made after five iterations needed to exchange OLSR messages (HELLO and TC). Additionally, we suppose that node is considered as a malicious node and does not cooperate with other nodes.

In this example, we suppose that iteration 1 means that node and node exchange the HELLO message and both of them received a reply (the ACK); it means also that the link between them is symmetric. Therefore, the CR of node in relation to node , which is initialized by zero, will be updated by adding 1. In addition, these nodes will exchange the HELLO message in the second iteration, and both of them received the ACK and the CR will be updated by adding 2. Furthermore, the nodes will exchange the TC message in iteration 3 and the CR will be updated again by adding 3 and so on.

Thus, the same situation can be considered for other nodes and we can follow the same operations as mentioned in Tables 6, 7, 8, and 9.

Calculating the cooperation rate of node in relation to nodes and : Concerning the cooperation rate of node , which is considered in this example as malicious node, we suppose that this node and other nodes will exchange the HELLO and TC messages during iterations and . Additionally, the CR of node , which is initialized by zero, will be updated by adding 1 in the first iteration and by 2 in the second. However, we suppose that node chooses not-cooperate with other nodes from iteration 3 (to save its energy); it means that this node will not send HELLO and TC messages. Therefore, when the other nodes do not receive these messages (it means that the ACK is not received) from node , then they will start by subtracting the last value added, which is 2, in iteration 3 and by subtracting 1 in iteration 4. Additionally, when the CR is equal to zero, it will be updated by subtracting 1 and so on.

Calculating of the cooperation rate of node in relation to nodes and :

Calculating of the cooperation rate of node in relation to nodes and :

Calculating of the cooperation rate of node in relation to nodes and :

Thus, when the cooperation rate of node will be shared, all nodes must detect that () according to threshold, proposed in this paper, the nodes will handle this node as a noncooperative node. Therefore, the utility function of node in relation to the path (1, 2, 4, and 6) isThe utility function of the node in relation to the path (1, 3, 5, and 6) isTherefore, the source node will choose the first path with the greater value of its utility function in order to send packets to its destination which is node .

#### 7. Simulation Environment

Our proposal is evaluated using Network Simulator 3 (NS-3.17) [41] that contains the OLSR module. In this work, we implement our algorithm and compare it with the original routing table algorithm described in the standard OLSR. In addition, we compare our proposal with a selfish OLSR where nodes choose to drop packets rather than forwarding them to their destinations. During all simulations, the network contains a variable number of mobile nodes and moving in a fixed area. We used the Random WayPoint (RWP) mobility model with pause time fixed to 0 seconds, various random seeds, and max speed of 20 meters/second. The choice of the simulation parameters can be justified by many scenarios of MANET applications such as military fields and conferencing. Additionally, and concerning the mobility, RWP seems to be an arduous environment to evaluate the effectiveness of our proposal. Moreover, our proposed model, original OLSR, and selfish OLSR protocols are evaluated based on the same mobility scenarios that define the nodes movement. Furthermore, in this experimental study, we conducted exhaustive simulations and Table 10 recapitulates all the simulation parameters.

##### 7.1. Performance Metrics

The main objective of the experiments using Network Simulator 3 is to evaluate and validate our proposal by analyzing and addressing the following performance metrics.(i)Energy is the metric used to quantify and evaluate the lifetime of nodes and network.(ii)Throughput is the number of messages successfully delivered per time unit.(iii)End-to-end delay is the time interval between the transmission of a packet and its reception.(iv)Total packets forwarded are the total traffic and packets received and forwarded by nodes across the network(v)Packets received are the successful packets transmitted to their destination.

#### 8. Analytical Results

In this section we are going to compare between three variants of protocol: original OLSR, enhanced OLSR, and selfish OLSR.

Figure 8 shows the evolution of the residual energy in relation to the number of nodes. We can observe the impact of selfish behavior on energy consumption and the difference between original OLSR and selfish OLSR protocols. Furthermore, we notice that malicious nodes are able to save energy when they refuse to cooperate for routing packets from other nodes because these operations require most energy consumption. Therefore, the rational nodes need to do more work to compensate the job of selfish nodes and then spend more energy to complete this task.

In Figure 9, we observe the evolution of throughput as function of the number of nodes in different variants of OLSR. It is evident that the throughput in case of original OLSR is high compared to the selfish OLSR. We interpret the results by the existence of malicious nodes that choose to drop packets rather than forwarding them to their destinations. Therefore, this behavior can affect the throughput by the retransmission of the lost packets by rational nodes. In another observation, we notice that the throughput in case of enhanced OLSR is high compared to the selfish OLSR. This improvement can be justified because the packets discarded by the malicious nodes are decreased in enhanced OLSR using malicious detection algorithm. Furthermore, through our proposal, we can get almost the same performances and mitigate the aggregate effect in case of existence of malicious nodes compared to the original protocol.

In Figure 10, we observe the evolution of end-to-end delay (ETED) in relation to the number of nodes in the three variants of OLSR. In addition, we notice the impact of selfish nodes on ETED compared to the original and enhanced OLSR. The results concerning ETED in original and enhanced OLSR can be justified because the number of nodes that participate in the routing process is increased. Moreover, in OLSR routing protocol, the ETED depends on the routing process and the number of nodes involved. On the contrary, in the selfish OLSR and in our situation we are interested only in ETED of packets which are successfully transmitted. Additionally, most of the packets cannot reach their destinations due to the selfish nodes that choose to drop any packets that pass on instead of forwarding them to their destinations. Therefore, and owing to the large number of selfish nodes, the ETED must be less than the original and enhanced OLSR. On the other hand, our proposal can offer nearly the same performance compared to the original OLSR. Furthermore, and due to the impact of some packet collision, noise transmission, and the processing time that is needed to calculate CR, our solution provides an ETED which is less effective than the original OLSR.

In Figure 11, we observe the evolution of the total packets forwarded (TPF) as function of the number of nodes in original OLSR, selfish OLSR, and enhanced OLSR. We notice that the TPF is high in original and enhanced OLSR compared to selfish OLSR. Moreover, we interpret this result by the existence of malicious nodes that attempt to reduce network connectivity and undermine the network security. In addition, the impact of selfish behavior is due to the malicious nodes that choose to drop packets received instead of forwarding them to their destinations. Therefore, the TPF must be high in original and enhanced OLSR using malicious node detection mechanism. Furthermore, we interpret the difference between original OLSR and enhanced OLSR due to the impact of some packet collision and noise transmission during the calculation of CR.

In Figure 12, we observe the evolution of packets received in relation to the number of nodes concerning the three variants of OLSR. From this figure, we notice that the number of packets received is high in original OLSR and enhanced OLSR compared to selfish OLSR. This result is due to the malicious nodes that choose to drop packets received rather than forwarding them to their destinations. Therefore, this behavior should influence the number of received packets. In addition, the result in this figure shows the effectiveness of our proposal using malicious node detection mechanism and reinforces the result mentioned above concerning the total packets forwarded in Figure 11.

#### 9. Conclusion and Future Work

In this paper, we have proposed a new idea based on a game theoretic approach to enhance OLSR security mechanism in MANETs. This proposal can be used to model interactions between selfish nodes and a large number of legitimate nodes inside the network. Contrary to some existing research on security in MANETs that rely on the game theory, the proposed solution can enable each node to evaluate behaviors of other nodes. Furthermore, the rational nodes can intelligently choose their strategies to deal with selfish behavior when each node keeps track of the cooperation rate (CR) record of other nodes. Moreover, many parameters (throughput, end-to-end delay, total packets forwarded, and packets received) can be improved significantly and the aggregate effect of selfish nodes can be reduced as well. In addition, the simulation results have shown that our proposed solution scheme takes into account, in addition to the security requirements, the system resources. Furthermore, in this paper we have proved that our proposal can be used as a security mechanism in order to enforce the cooperation between nodes, improve network performances, and prevent malicious nodes. However, the comparison with other game theory models can enhance the efficiency of this proposed solution. Therefore, and as future works,(i)we plan to study and address other game models especially those treating OLSR routing protocol in order to compare our proposed solution with these models,(ii)additionally, the cooperation rate is not the unique parameter to evaluate node behavior. For this, and as future work, we plan to improve this model to support other parameters like the overload of the path and the energy consumption of the nodes constituting the path. Moreover, and in order to optimize the energy consumption, we will change the interval needs to calculate the cooperation rate. Therefore, instead of using HELLO interval which is 2 seconds we will use 6 seconds, that is, after receiving three HELLO messages, and instead of using TC interval which is 5 seconds we will use 10 seconds, that is, after receiving two TC messages.

#### Competing Interests

The authors declare that there is no conflict of interests regarding the publication of this paper.