GIR: An Opportunistic Network Routing Algorithm Based on Game Theory

A large number of routing algorithms in Opportunistic Networks are based on the assumption that nodes are free to help other nodes forward messages. However, when the Opportunistic Network is applied to an urban environment, the nodes will have certain social attributes. In many cases, a node can decide whether to execute the routing policy or not. Due to the limited resources and poor social relationships, nodes may be unwilling to forward messages from other nodes and have strong motivation to implement selfish policies. As a result, increased network latency reduces message delivery rates and affects the overall network performance. In order to solve this problem, we propose a perceptual routing protocol to promote node cooperation from the perspective of game theory. Specifically, We introduce the concept of virtual currency and construct a price function, and nodes can obtain a certain virtual currency through cooperation. In the process of message forwarding, we consider the change of link degree and energy of node (the energy exists in the form of electricity in this article), and use them as factors of the trading node quotation. The trading node finally makes it through the multiple rounds of bargaining games, so that the proposed game between both sides reaches the Nash equilibrium. Experiments show that the algorithm outperforms Epidemic, EPSR, MINEIRO and ICRP algorithms in terms of delivery rate, average latency and energy consumption. According to the simulation experiments, the average delivery ratio of GIR algorithm is 0.68, which is 13% higher than that of the epidemic algorithm. In terms of average delay, 7% is better than ICRP algorithm.


I. INTRODUCTION
With the progress of wireless communication and the development of intelligent devices, the Opportunistic Network [1] has attracted more and more attention from researchers in academia. The Opportunistic Network is a subclass of Tolerant Delay Network (DTN) [2] and Mobile Ad Hoc Network (Ad-Hoc) [3]. However, Opportunistic Networks are generally not dependent on any infrastructure, so there is no end-to-end connectivity throughout. Nodes in the opportunistic network are various mobile devices, and messages can be received or forwarded by these mobile devices until they reach the destination nodes. Therefore, in some areas where the network infrastructure is lacking, the Opportunistic The associate editor coordinating the review of this manuscript and approving it for publication was Chuan Heng Foh .
Network undoubtedly brings a huge communication potential [4]. At the same time, it is of great significance to the future of ubiquitous computing.
It is worth noting that due to frequent disconnection of nodes in the network, the delivery [5] of messages depends on the movement of some nodes as relays for forwarding [6]. Thereby the message is sent from the source node to the destination node. This also leads to communication in the network based only on the movement and cooperation [7] of the nodes. Compared with the traditional network, in the Opportunistic Network, due to the limitation of the application scenario, the energy (The energy in the article exists in the form of electricity) [8], cache [9] and CPU [10] processing power of the node are limited. Therefore, the nodes in the network are not based on idealism, but on the contrary they have a certain sociality. Usually, there are different social relationships between mobile nodes (friends, loved ones, etc) because of the nodes themselves. This also makes it more difficult to establish a transmission path [11] between them than a traditional network without social relationships.
In general, we assume that nodes are selfless [12] when they help to forward and store messages. However, in real scenarios, nodes usually show some selfishness due to resource limitation, which leads to a lower message delivery rate [13] and a longer average latency [14] for Opportunistic Networks. At present, most researchers only pay attention to the feasibility of the network and the integrity of the data [15]. There are few studies on how to improve the cooperation degree [16] of nodes in the network. Therefore, it is very important to propose a route for the excitation nodes to cooperate with.
The nodes in the network that implement selfish strategies are called selfish nodes. Selfish nodes can be divided into three categories. The first is that the node hopes to maximize network resources and reduce its own consumption of resources. Refusing to participate in helping other nodes to forward messages, but will copy a large number of their own data packets, thereby increasing their delivery rate and reducing average delay. The second is that when the node's own resources are insufficient, it is unable to forward data packet data to other nodes. Show the selfish behavior of not participating in data packet forwarding or discarding forwarded content. The third is for nodes to forge and deceive in order to prove that they are not selfish nodes, and obtain benefits from deception, which affects the interests of other nodes in the network. Li et al. [17] divided selfish behavior into two ways: discarding and not forwarding. The discard mode is that the node receive the message but does not forward it. The non-forwarding method means that the node does not directly accept any node message. Resource issues, security issues, and fraud of malicious nodes [18] in the network are the main causes of selfish behavior [19].
In order to improve the transmission speed and stability of the network. We propose a game incentive routing (GIR). GIR is divided into three small models, namely the link degree model, the energy model and the transaction model. In the link degree model, we obtain the communication quality of nodes in the network with other nodes through algorithms. In the energy model, we use matrix thinking to always pay attention to changes in the energy of nodes in the network. In the transaction model, we introduced the concept of virtual currency. In order to maximize their own interests, the buyer and seller nodes need to go through multiple rounds of bargaining games to make their respective interests reach the Nash equilibrium [20]. We take the link degree and energy of the node (represented by the energy of the node and the attribute of the message) as the influencing factors of the message pricing, in order to find the most suitable relay node for relaying messages within the communication range. The buyer node's popular Epidemic [21], EPSR [22], MINEIRO [23] and ICRP [24] routing algorithms have proved that the GIR algorithm proposed in this article is very effective.
The main contributions of this article are as follows.
• As the proportion of selfish nodes in the network increases [25], the GIR algorithm outperforms the other four routing algorithms in terms of message delivery rate, average delay, and power consumption.
• We use the Money Management Center (MMC) [26] as a third party to manage virtual currency, making the trading node's account transparent, therefore, false quotations of malicious nodes are avoided to some extent [27].
In this way, even if the proportion of malicious nodes in the network increases, the GIR algorithm also shows better performance.
• The link degree of the node [28] is considered in the GIR algorithm and is used as a factor affecting message pricing. In this way, the node can select communication nodes, and then find those nodes with higher communication capability as their own relay nodes, which greatly reduce the packet loss rate in the network.
• The GIR algorithm considers to the change of node energy at all times. The algorithm node will preferentially select those nodes with sufficient energy as their relay nodes, thus the average life of the nodes [29] and the performance of the network are improved. For our proposed routing protocol, we can apply it to various fields of Opportunistic Network. For example, the monitoring of wildlife. The GIR algorithm is good at the nodes' energy because we consider the energy mechanism which can greatly extend the life of then nodes, at the same time, the throughput of the network also is increased. In this way, we can effectively obtain the required information. In the self-organizing network of handheld devices, when the connection is interrupted, our GIR router can also be applied to the network of wireless smart devices carried by individuals. Because we have a corresponding incentive mechanism in the routing mechanism, that can greatly improve the survival rate of the nodes. In the in-vehicle network, the GIR mechanism can reduce the energy consumption of the vehicle, and the time it takes to transmit the message to the destination where vehicle is less.
In the second section of the article, several existing incentive programs are introduced. The third section details the model of the GIR algorithm. The fourth section compares the performance of GIR with Epidemic, EPSR, MINEIRO, and ICRP algorithms by simulation experiments on the ONE platform. Finally, we make a summary and proposed our future work. Some key mathematical notations are explained in Table 1.

II. RELATED WORKS
Due to the limited resources in Opportunistic Network and the lack of end-to-end connectivity, the traditional ''store-andforward'' routing is no longer applicable to today's OPPNET. In recent years, the research on Opportunistic Network's incentive routing algorithm has become a very hot trend. Some routing algorithms have been proposed for the characteristics of Opportunistic Network. Like the Epidemic routing algorithm and the Prophet routing algorithm. Epidemic, VOLUME 8, 2020 proposed by Vahdat and Becker, is a multi-copy routing algorithm in which each message is copied and flooded to all nodes in the network. Therefore, nodes forwarding messages consume a lot of resources, such as energy and cache. This in turn it increases the consumption of resources in the network and reduces the life of the network [30]. In Prophet, there are certain restrictions when messages are forwarded. Only when the node relays those nodes that have a higher probability of encountering the destination node [31], this affects the value of the message to some extent. Since nodes have social attributes such as selfishness, when Opportunistic Network is applied to urban scenes, network performance degradation is particularly noticeable [32]. Therefore, it is extremely important to design a route that can solve node selfishness.
Many new routing protocols for the cooperation of incentive nodes have been proposed in recent years. In order to solve the quality problem of data transmission. Mao and Zhu [33]. proposed an energy-based perceptual routing algorithm. The algorithm enables nodes to forward more messages from other nodes and improves message delivery and reduces latency by coordinating energy resources in the network. However, the routing algorithm does not take into account the number of messages in the network and the number of cache of the nodes.
Peng et al. [34] proposed a kind of cooperative route for stimulating nodes through money. In the process of message forwarding, the buyer node pays a certain virtual currency according to the quality of service of the seller node, thereby meeting with the cooperation requirements of the node. However, the false quotation of malicious nodes in the network is neglected, which will lead to confusion of incentives.
El-Azouzi et al. [35] proposed a trade-off framework for packet duplication and energy consumption. Each mobile has to decide which routing protocol it wants to use for packet delivering.In such a problem, the author consider a non-cooperative game theory approach.The author explore the scenario where the source and the destination mobiles are enclosed in two different regions, which are partially overlapped. Studying the impact of the proportion of the surface covered by both regions on the Nash equilibrium and price of anarchy. The author also design a fully distributed algorithm that can be employed for convergence to the Nash equilibrium. The author considers two overlapping network regions, the source node and the destination node are located in different regions. The source node can only transfer messages to the destination node by moving or communicating with other nodes. When the two nodes meet, the nodes can choose to cooperate or not. If the two nodes choose to cooperate, then the nodes can choose to forward messages byepidemic routing and two-hop routing. The author regards the cooperation of nodes as a game, and the nodes gradually reach Nash equilibrium in maximizing their own benefits. However, packet loss occurs in the network because the transmission quality of the node is not considered.
Wang et al. [36] proposed a hybrid excitation route. In the process of message forwarding, a function for measuring the energy consumption of a node, by setting the energy threshold, makes the probability greater that the message in the buffer area is accepted. However, the life cycle of nodes and messages are not considered, which reduces the throughput of the network to some extent. Xu et al. [37] proposed an incentive route based on relay node selection. This scheme is mainly used to encourage nodes in the network to participate in message forwarding. In the network, the route makes the seller node choose a friend or stranger as its reward object. At the same time, the concept of virtual currency is introduced. When the buyer node forwards the message, the seller node will pay a certain fee as a reward. In addition, transaction pricing can be determined by bargaining games, where subgame perfect Nash is used to calculate the negotiated price. However, this route does not take into account the fraud of malicious nodes in the network, so security needs to be improved.
Our proposed GIR solves the shortcomings of the above routes. Here are our opinions: • Because we consider the quality of message forwarding and the quality of communication between nodes, we calculate the link degree of the node. We divide the link degree into partial link degree and full link degree, not only calculate the link degree between the transaction nodes, but also calculate the link degree between the relay node and other nodes, thus ensure the forwarding quality of the message in the network.
• We always pay attention to the changes in energy and divide the energy into three levels. The remaining energy of the relay node is used as a factor that affects the message pricing. At the same time, we set a threshold for the energy of the node. If a node is to act as a relay node of another node, then the node should have the remaining energy greater than this threshold after forwarding the message, otherwise the node will not meet the requirements as a relay node. This greatly extends the life of the network and ensures that messages are not lost due to insufficient energy during the forwarding process.
• Finally, we set up a bargaining game based on game theory, and the trading node can make its own interests reach the Nash equilibrium through the game. From Figure 1, we can see how the message is transmitted over the network. If the source node S wants to forward the message to the destination node D, but the node S and the node D are in different regions, the node S will forward the message to the neighbor node as its own relay node. We know that nodes have social attributes [38], so nodes generally do not help other nodes to convey messages without compensation. In some cases, they adopt a selfish strategy and refuse to forward messages [39]. In Figure 1, if a node within the communication range of the source node S adopts a self-private policy to refuse to help forward the message, the message in the network will be difficult to reach the destination node. This greatly reduces the network transfer rate [40] and affects the performance of the network.
To solve this problem, we propose a motivational routing (GIR) based on game theory. In Figure 1, we represent the number in the arrow as the benefit that the node receives to help other nodes forward the message. This is obtained by our proposed GIR algorithm. We can clearly see that the red path in the figure is the least expensive than the other blue path message nodes. Thus, through the GIR algorithm, we can get this optimal path [41]. In order to improve the delivery rate and stability of the networkcite [42]. In GIR, we introduce the concept of virtual currency, and the buyer and seller nodes went through multiple rounds of bargaining games [43] to bring their respective interests to Nash equilibrium [44]. We use the link degree of the node, the energy [45] of the node and the attribute of the message as the influence factors of the message pricing, so that we can find the relay node that is most suitable as the relay message in the communication range of the buyer node. By comparing with Epidemic, EPSR, MINEIRO and ICRP, we found that under the same conditions, the delivery rate of GIR is 7% higher than ICRP, 13% higher than Epidemic, and the average delay is lower than EPSR, MINEIRO and ICRP. And in terms of average energy consumption, it also has a slight advantage over other algorithms.

III. SYSTEM MODEL DESIGN
The comparison of the front and back effects based on the GIR algorithm is shown in Figure 2. In Figure 2, we use the depth of the color as the degree of cooperation between the nodes and other nodes. The darker the color of the node, the more willing this node is to work with other nodes in the network. We can see that after using the GIR algorithm, most of the nodes in the network are getting darker and darker, indicating that they are more willing to help other nodes in the network forward messages. At the same time, it is proved by experiments that after using GIR algorithm, the average delay in the network, the energy consumption of nodes and the delivery rate of messages are also better than before.

A. NETWORK MODEL
This article considers the connection between all nodes and nodes in the Opportunistic Network as a directed graph (N , C). N represents the set of all nodes in the network, C represents the direct connection of the node. According to the number of copies of each message in the network. The routing algorithm in the Opportunistic Network can be VOLUME 8, 2020 divided into single copy algorithm and multi-copy algorithm. The number of data copies in the network can be divided into two types: the forwarding strategy and the replication-based strategy. This article uses a multi-copy algorithm based on the forwarding strategy.
In the Opportunistic Network, the energy and buffer space of the node are limited and also non-renewable. In the initial stage of the network, each node has the same energy and buffer space, and once the energy is exhausted, it means the death of the node. As we all know, nodes help other nodes forward messages that will inevitably consume their own resources, so most nodes have certain selfishness due to their social and other attributes, and they are unwilling to help other nodes forward messages because of their selfishness. However, when their resources are sufficient, they are willing to help other nodes to forward messages, because they can obtain certain benefits in this way. The strategy of incentivizing nodes to participate in forwarding cooperation is based on the following assumptions: • There is a currency control center in the network. In the initial stage of the network, all nodes have a certain amount of virtual currency. The Currency Control Center strictly controls currency transactions in the network and develops a series of systems to make the accounts of both trading nodes transparent.
• Selfish nodes in the network can obtain a certain amount of currency by helping other nodes forward messages. Of course, the amount of currency obtained is real quotations and prices based on the value of the message the state of the node, and the like. In this way, the number of currencies that the relay node obtains in this transaction is determined.
• The node treats the message in the cache fairly, and there is no case of packet loss and forwarding.

B. LINK DEGREE MODEL
According to the connectivity rate of nodes in the Opportunistic Network, this article introduces the concept of link degree. In general, the link degree here is the connectivity between nodes in the Opportunistic Network. The link degree is used as a factor of transaction pricing when bidding between nodes in a bargaining game.

1) HISTORICAL BEHAVIOR RECORD MATRIX
The link degree of a node is calculated by the historical behavior of the node. In this article, we assume that there are N nodes in the network, and we define a historical behavior record matrix among each node. In general, within a period of time, nodes in the network record the number of encounters between themselves and other nodes and the duration of each encounter. The link degree between the node and other nodes is calculated based on the information recorded and the previous history. When node i and node j in the network contact behavior, node i will make the contact record and update its own history matrix. Assuming that the time window is T , N (i, j) represents the number of encounters between node i and the node in time window T . We can define the history matrix in node i as follows: Here, t k (i,j)start represents the start time of the kth connection of the node i and the node j in the time window T , and t k (i,n)end represents the k-th disconnection time. In the matrix, we can see that the history matrix defined in node i records the contact history of node i with other nodes in the time window T in the network. We can calculate the average connection time and average disconnection time of node i and node j in time window T based on these historical records.
Then we can define the historical matrix in the node responsible for recording the average connection time and the average disconnection time as follows: When two nodes meet and communicate, they update each other's matrix. The specific update rules are based on formula (1) and formula (2). In the network, according to the values oft (i,j)connection andt (i,j)disconnect , we can roughly see the following three cases: • Whent (i,j)connection = 0, it means that node i and node j do not meet, it may be the initial stage of the network, or there may be no contact history between the two nodes because of the distance or other reasons.
• Whent (i,j)connection = 0 andt (i,j)disconnect = 0, it means that node i and node j are in contact within window time T , but are still disconnected.
• Whent (i,j)connection = 0 andt (i,j)disconnect = 0, it means that node i and node j are in contact within window time T , and communication has been disconnected.

2) NODE LINK DEGREE
The node link degree c (i,j) represents the communication quality between the node i and the node j, that is, the connectivity ratio between the node i and the node j, where 0 ≤ c (i,j) ≤ 1. Usually the devices in the Opportunistic Network are controlled by some rational entities. Because the link degree of the same node to other different nodes is different, the existing link degree is unreasonable. In this article, we define c (i,j) = c (j,i) . The link degree of the node in this article is divided into two parts namely: partial link degree and full link degree. The partial link degree c p (i,j) of the node i to the node j is defined as the connectivity ratio of the node i and the node j within the window time T , and the solution formula of c The full link degree c f (i,j) of the node i is defined as the node i dividing the connection rate of the node j with other nodes within the window time T . This article uses Maximum Likelihood Estimate to find the full link degree of node i. Maximum Likelihood Estimate is a statistical application of probability theory and is also one of the methods of parameter estimation. We can get the sample S 1 , S 2 , S 3 · · · S n based on the discrete random variable S. Because the behavior between two nodes in the network is nothing more than two situations, one is in the connectivity phase and the other is in the disconnect phase. S is 1 when node i and node j are in the connected phase, and S is 0 when node i and node j are in the disconnection phase. So the discrete random variable S obeys the Bernoulli distribution. It can be seen from the previous argument that the probability of the Bernoulli distribution is c Then, we can find the link degree c (i,j) of node i to node j according to formula (3) and formula (4): We can further solve the problem by formula (5): (6) λ and β in the formulas (5) and (6) represent the weights of the present link degree c p (i,j) and the full link degreeĉ f (i,j) of the node i. Under normal circumstances, we think that λ > β, that is, the ratio of the link degree of node i is higher than the full link degree of node i, but for the convenience of calculation, we define λ + β = 1 here.

C. ENERGY MODEL
In this article, we will always pay attention to the changes in node energy. At the initial moment of the network, the energy of each node in the network is the same, and the energy of the node will be consumed with time. In the model we designed, energy consumption in the network is generally divided into two categories. One is that nodes help other nodes forward messages, which consumes a certain amount of energy. The other is when the node is stationary, in other words, the node does not help other nodes to forward energy at the moment because the movement of the node or the like brings about its own energy consumption. Since the energy of a node is finite and non-renewable, in order to preserve energy, rational nodes may choose different collaborative behaviors. When the node is full of energy, it may help other nodes to forward messages in order to earn more benefits. In contrast, when the node energy is insufficient, it may take some selfish behavior in order to prolong its life. As with the link degree model, each node in the network also has a matrix that records the transformed data size B s i (t) and the current remaining energy E r i (t). When messaging between two nodes in the network, the energy of the node itself must be consumed. According to the specification of the nodes in the network, the power p t when the node forwards the message and the power p s when the node is stationary are all limited. Then, we define the history matrix for recording the current remaining energy of the node i and the size of the forwarded message as (E r i (t), B s i (t)). Here t refers to the current moment. Initially, the energy of each node of the network is E, so if the remaining energy of node i is required at time t, it is necessary to find the energy E c i (t) consumed by node i before time t. We define the solution formula of E c i (t) as follows: E s i (t ) in equation (7) represents the energy consumed by node i in the time period t before time t to help other nodes forward the message. E c i (t ) and E s i (t ) are solved as follows: In equation (8), v represents the cumulative time used by node i to forward messages for other nodes. Multiply by the power p t when the node i forwards the message, thereby obtaining E c i (t). Similarly, in equation (9), T i represents the total running time from the beginning of the network to the current time t. The result obtained by T i − n e=1 t e i becomes the time remaining in addition to the accumulated time consumed by node i to help other nodes deliver messages. By multiplying the power p s when the node i is stationary, E s i (t ) can be obtained. Substituting the formula (8) and the formula (9) into the formula (7) can be obtained: The exhaustion of node energy means the death of the node. Death nodes cannot participate in cooperation. Therefore, in order to ensure the delivery rate of the network, the survival time of the node should be extended as much as possible. We set a threshold E for each node. When the remaining energy of the node is below this threshold, the node will refuse to help other nodes forward the message. For example, node j sends a message delivery request to node i, and node i calculates the remaining energy after forwarding the message. If E r i (t) − E c i ≤ E v , then node i will directly refuse to forward this message for node j. E c i is the energy required to forward this message.
We define the energy of the node as rich, generally, and three states of poverty: , then the remaining energy of node i is in a state of poverty at the current moment.

D. TRADING MODEL
In this model, we introduce the game theory in economics, and from this perspective, propose the route of cooperation between the incentive nodes.

1) MONEY MANAGEMENT CENTER
Virtual currency is used to incentivize nodes to cooperate with each other. In the existing Credit-based strategy, virtual currency is a fixed value. Nodes in GIR can use virtual currency to obtain content that they are interested in, or they can store content that they are not interested in. Forward to other nodes to earn virtual currency. In order to maximize the revenue, the node determines whether to store the content by calculating the expected value of the revenue of the uninterested content. The same virtual currency value is set for each node when the network is initialized. Because the message is involved Forwarding, each node in the network wants to maximize the earning of virtual currency, so that when they have a message that needs to be forwarded, other nodes will help forward it through virtual currency.
Here we introduce the concept of the Money Management Center (MMC). This article stipulates that the virtual currency of nodes in the network is managed by the MMC. In general, the role of MMC is similar to that of real-life banks. Each node in MMC will have its own account to store the currency it owns. When the two parties trade, the other party's account is transparent. In this way, malicious nodes existing in the network are prevented from making false quotations, thereby greatly reducing the network overhead. For example, when node j helps node i forward the message and conducts a transaction, node i sends a self-signed receipt to the MMC. At the same time, node j will also submit a self-signed receipt to the MMC. When the MMC receives a receipt with both parties' signatures, it will transfer the accounts to both parties based on the receipt.

2) BARGAINING GAME PLAN
We define buyer node i and seller node j as the two nodes participating in the game in the opportunity network. When two nodes enter each other's communication range, node i sends a message delivery request to node j. If node j agrees to be the relay node of node i, then a response is sent to node i. At this point, the game officially started. In the game, both buyer node i and seller node j will quote based on their status and message attributes. Therefore, we first define the price quoted by both parties. According to the actual scenario, the buyer node i wants to buy the service of the seller node j at the lowest price. The seller node j will definitely want to sell his service at a higher price in order to maximize the benefits. Through a series of bargaining, double convenience will lead to an optimal result.
For buyer node i, factors influencing the price shall be taken into account when quoting. In this article, the degree of link between node i and node j, the size of the message, the remaining buffer space of node i, the remaining energy of the node itself, and the remaining life cycle of the message are used as factors that affect the bid price of the buyer node. The quotation formula of buyer node i is as follows: In the formula (12), c (i,j) is the magnitude of the link degree of the node i to the node j previously obtained according to the formula (6). We define B as the size of the currently forwarded message. C(t) is the remaining buffer space of node i at the current moment, and C is the buffer space of the initial time of node i. W i is the state function of the remaining energy on node i. ul represents the remaining life cycle of the message to be forwarded, and TTL represents the life cycle of the message at the initial moment. η, ζ , ξ , and ψ are the node link degree, message cache space, node energy, and the weight of the message life cycle. This article specifies η+ζ +ξ +ψ = 1.
The degree of link between node j and node i, the size of the message, the remaining buffer space of node j, the remaining energy of node j and the remaining life cycle of the message are the factors that affect the bidding of seller node j. The quote formula for node j is as follows: Similar to the quotation function given by buyer node i, η, ζ , ξ , and ψ represent the same meaning, and η + ζ + ξ + ψ = 1. When the two parties in the transaction complete the quotation, the seller node j will calculate the public benefits brought by forwarding the message. The specific income formula is as follows: In the bargaining game, if H (i,j) < 0, the game ends directly and the transaction fails. If H (i,j) > 0, then node i and node j will share this public interest. The two nodes will start bargaining based on the public interest. In the process of bargaining, both node i and node j will have their respective weights x i, and x j .
In most cases, due to its own social nature, nodes must want to maximize their own interests when sharing public interests, which means that they can obtain more virtual currency. Here, we define the virtual currency obtained by dividing node i and node j into public interests as m i and m j . Then, the solution functions of m i and m j are as follows: In the game we define, if the two nodes want to reach an agreement and complete the transaction, it may take many rounds of bargaining. Then as time goes by, the energy of the node and the value of the message are bound to be affected. Therefore, we define a patience function for both nodes in the game, and the patience function reflects that the interests of both parties will decrease with the passage of time. We use α i and α i to indicate the patience of node i and node j, respectively. We can get the benefit function of node i and node j over time.
In a bargaining game, the patience coefficient of a node is related to the value of the node itself and the attribute of the message. For the buyer node i, if the node itself has enough cache space and sufficient virtual currency. Moreover, if the remaining life cycle of the message is also relatively long, node i will have more patience in the bargaining process in order to obtain more benefits. For the seller node j, the remaining energy of the node itself, the remaining cache space and the degree of link to node i have become factors affecting patience. Therefore, we can define the patience function of both buyer node i and seller node j as f i and f j .
We can see that the larger the independent variable x in the patient function of the buyer node i, the larger the dependent variable f i (x). Then f i (0) = 0 And f i (∞) = 1. Conversely, the larger the independent variable x in the patient coefficient function of the seller node j, the smaller the dependent variable f j (x) is, then f j (0) = 1, f j (∞) = 0. This article stipulates that θ and ε are the patience factors. VOLUME 8, 2020 Because in the Rubinstein-Starr model, there is a unique subgame that makes the bargaining game reach the Nash equilibrium. After several rounds of bargaining, the two parties will eventually reach an agreement The seller node j calculates the values of (x i ,x j ) andm j , and then sends its own interestm j and patience α j to the buyer node i. The buyer node i calculatesm i based on the information sent by the seller node j. Ifm i > 0, the seller node j will forward the message from the seller node i. The two parties will eventually complete the transaction, and the subgame will achieve a perfect Nash equilibrium.

Algorithm 1 Message Forwarding Algorithm
Require: Source node i, Relay node j Ensure: Initialize the parameters of the node 1: Node j enters the RF range of i 2: Node i sends a message delivery request to node j 3: if Node j agrees to help node i forward messages then 4: Calculate the current remaining energy E c i (t) and E c j (t) of node i and node j 5: if E r j (t) − E c j ≤ E then 6: Calculate the link degree of node i and node j 7: Determine the energy level of node i and node j 8: Both nodes make a quote 9: Calculate the difference in quotes between node i and node j 10: if H (i,j) > 0 then 11: The bargaining game officially begins 12: Calculate the ratios x i and x j of node i and node j in the process of distributing the game by means of games 13: Node j will calculate the values of (x i ,x j ) and m j 14: Node j sends the benefitsm j and α j patience to the buyer node i 15: Node i calculates the benefit ofm i based on the information sent by node j 16: ifm i > 0 then 17: Both nodes agree to cooperate 18: Node i and node j send a receipt with their own signature to MMC 19: After receiving the receipts of node i and node j, the MMC performs the transaction of virtual currency between the two parties 20: Successful transaction 21: end if 22: end if 23: end if 24: end if The construction of Algorithm 1 aims to introduce the GIR algorithm in detail to improve readability. Specifically, the social attributes of each node are considered at the initial moment of the network, so the time complexity at this stage is O(n). In the link degree and energy measurement stage, the link degree of the node and the current remaining energy are calculated, so the time complexity of the process is O(n). Based on the game bargaining stage of the node, the node obtains the best next hop of the node in the current communication domain through multiple games. The time complexity of this process is O(log2n). Therefore, through rigorous mathematical analysis, the total computational complexity of the GIR algorithm can be calculated as O(n + n + log2n) = O(n).
Because our paper introduces an energy mechanism and sets thresholds and levels for energy, it reduces the communication overhead of nodes in the network. By introducing a game mechanism, the node can find the optimal relay node at the lowest cost, which greatly reduces the message forwarding overhead. The GIR algorithm we proposed refers to the movement model of the epidemic routing. In the network, nodes move randomly, and the relay nodes encountered are random. Therefore, the node selects the optimal relay node based on the process of playing a game with each relay node, but this process is actually very short, and the time cost of our proposed algorithm is not high.

IV. SIMULATION RESULT ANALYSIS A. SIMULATION PLATFORM AND PARAMETERS
This article introduces the Infocom 2006 [46] data set under the ONE simulation platform to simulate and compare the performance of Epidemic, EPSR, MINEIRO, ICRP and GIR algorithms, in order to investigate the influence of incentive mechanism on algorithm performance. Because the Infocom 2006 data set represents a network scenario where the average number of node encounters is large, the five routes can be better compared and analyzed. In the experiment, we use transmission success rate, transmission delay and energy consumption as the metrics for evaluating the incentive mechanism.
The real data set Infocom 2006 was used in the simulation, which has been widely used in MSN routing simulation. This data set consists of contact trajectories between short-range Bluetooth wearable devices (iMotes) carried by individuals. During the INFOCOM 2006 communication period, participants in groups are required to carry small devices (iMotes) for four days. The communication information of 300 participants was recorded in iMotes. In addition, 20 fixed (remote) iMotes were placed in the experiment. In 342,915 seconds, there were 170601 connections between these nodes. Every 50 seconds, new data is randomly generated in our simulation. In addition, among them, 10 nodes are set as source nodes, and 10 nodes are set as destination nodes.
In the simulation, based on past experience, we set some values for the parameters of the nodes in order to facilitate the calculation. The power p s when the node is stationary is 0.8W, and the power p t consumed by the node forwarding message is 1W. In the bargaining game, we set η, ζ , ξ , and ψ in the quotation function to 0.35, 0.15, 0.35, and 0.15, respectively. Other experimental simulation parameters are shown in Table 2.

B. PERFORMANCE INDICATOR EVALUATION 1) AVERAGE TRANSMISSION SUCCESS RATE
The transmission success rate refers to the ratio of the message successfully arriving from the source node to the destination node and the total number of messages generated in the network. In general, the success rate of message transmission represents the connectivity of the network.
DR represents the transmission success rate of the message, and M arrived and M created represent the number of successfully arriving from the source node to the destination node and the total number of messages generated in the network, respectively.

2) AVERAGE TRANSMISSION DELAY
The average time refers to the time it takes for message to be delivered successfully. AD represents the transmission delay, and T iend and T istart represent the moment when the message is delivered successfully and the message is generated, respectively. NU M d indicates the total number of successful delivery of the message. Then we can get the formula for calculating the average transmission delay.

3) ENERGY CONSUMPTION
Energy consumption is the difference between the energy of the node after simulation and the energy of the node before the simulation. E init and E left represent the energy before and after the simulation of the node, respectively. We reflect the transmission overhead of the node by the consumption of energy. The relevant calculation formula is as follows.

C. SIMULATION RESULT ANALYSIS 1) THE IMPACT OF DIFFERENT PROPORTIONS OF SELFISH NODES ON THE NETWORK
In the Opportunistic Network, the existence of selfish nodes can greatly affect the message delivery rate. We experimented with the effects of GIR and several other routes. The result is shown in Figure 3. It can be seen from the simulation experiment that as the number of selfish nodes in the network increases, the message transmission rate of these five routes will decrease. With the increase of selfish nodes, the message delivery rate of the other four routes is weaker than that of GIR. Epidemic is always the lowest because there is no incentive strategy. This is because in the epidemic, nodes are selfish and refuse to help other nodes to forward messages for their own benefit. Because EPSR, ICRP and GIR have incentive algorithms, as the number of selfish nodes increases, the transfer rate will not fluctuate greatly.
In order to balance the number of hops, MINEIRO motivates nodes to forward messages based on messages. Therefore, it is better than Epidemic, EPSR and ICRP. In our proposed GIR, because of the consideration of the connectivity and energy of the node, the network can effectively control the effective resources. In the link degree of the node, we divide the link degree of the node in order to distinguish the social relationship of the node. Relatively speaking, the ICRP routing protocol does not take into account the social relationship between the node and other nodes, so the delivery rate is not as good as the GIR route we proposed. In GIR, we fully consider the social relationship between nodes, and adopt rewards and games to promote cooperation between nodes. Therefore, the message delivery rate in the network has been at a high level.
It can be seen from Figure 4 that the proportion of selfish nodes in the network will affect the average delay. With the increase of selfish nodes, the delay of the five routes in the network will increase. Epidemic routing protocol has a lower average latency than the other four protocols. Because in the Epidemic routing protocol, the forwarding of messages is based on the flooding algorithm. Each node sends a data packet to all neighbor nodes it encounters, so the average latency is low. However, there are a large number of copies of the message in the network, which consumes resources in the network sharply. So, on the other hand, Epidemic routing is inferior to the other four routings. Although the average delay of this route is low, the network performance of this route is also poor with the increase of selfish nodes in the network.
Our proposed GIR protocol has a lower average latency than the other three solutions. Because in GIR, we have introduced game theory thinking, and it is profitable for nodes to help other nodes to forward messages. When the node helps other nodes to successfully forward the message, the system will reward the node through virtual currency. Therefore, the selfishness of nodes is suppressed to a certain extent, so that more nodes are willing to join the cooperation of message forwarding in the network. Therefore, GIR occupies certain advantages compared with EPSR, MINEIRO and ICRP, which also improves network performance.
Nodes in the network consume energy when transmitting messages. As shown in Figure 5, with the increase of selfish nodes in the network, the energy consumed by Epidemic, which lacks an incentive mechanism, changes very significantly. The other four routes fluctuate relatively little, but all decrease accordingly. For GIR with incentive effect, the fluctuation is the smallest among the five protocols. Because in the GIR protocol, we define three states of node energy, namely abundance, universality and poverty. The three energy states have different effects on the relay node forwarding this message. On the other hand, since we use energy as a pricing factor for node message transactions, the energy distribution mechanism in the GIR protocol can effectively enable nodes with more remaining energy to better participate in collaboration. In the bargaining game between two nodes, each round of bargaining will inevitably consume a certain amount of energy, so this is something that neither node wants to see. In order to maximize their own interests, the nodes in the GIR route will complete transactions with less energy consumption.

2) THE IMPACT OF DIFFERENT CACHES ON THE NETWORK
Due to the relatively large delay of message transmission in opportunistic networks, the long time in the network, and the limited cache resources of nodes. Therefore, buffer overflow and message expiration are prone to occur when large messages are transmitted. Thus, the caching of nodes is an important factor affecting whether a node can forward messages. Since the node's cache capacity is limited, this limits the node's ability to load messages. Considering the social nature of the node, when the node's cache remaining is different, it has a certain impact on message forwarding. When the remaining cache of a node is large, the node is also more willing to help other nodes forward the message. On the contrary, when the remaining cache of the node is small, in order to save cache resources, the node may refuse to help other nodes to forward messages, thereby affecting network connectivity and network throughput. Through simulation experiments, we compared the effects of five routes under different caches on message delivery rate, average delay and average energy consumption.
As shown in Figure 6, the node cache has different effects on the transfer rate of the five routing algorithms. By increasing the cache of the node, the message delivery rate of the five routing algorithms will also increase. This effect is especially obvious when the cached value is small. With the increase of node cache in the network, the message delivery rate of EPSR, MINEIRO, ICRP and GIR has increased significantly. The incentive scheme proposed by EPSR based on compatibility encourages nodes to cooperate with each other in message forwarding, so it is better than MINEIRO and ICRP in the medium term. It can be seen that with the increase of node cache in the network, the message transmission rate of our proposed GIR protocol is better than that of the other three routing protocols. We compared the other three routing protocols. GIR uses node cache as a factor that affects node games. To some extent, its own cache will affect transaction prices. When two nodes play the game, they both hope to pay a relatively low price to get the maximum benefit. However, as the number of games increases, the resources consumed by the two nodes will also increase. Therefore, in the case of having the same cache, the GIR route is easier to achieve collaboration than the other three routes, thereby completing message forwarding and improving the message transfer rate in the network.
The result obtained through the simulation experiment is shown in Figure 7. As the node cache increases, the average latency of these five strategies will increase to a certain extent. Since EPSR, MINEIRO and ICRP and GIR protocols have certain incentive mechanisms, it can be seen that as the node cache increases, the fluctuations are small. The data shows that GIR is superior to the other four routes to a certain extent. Because in the GIR protocol, we have introduced the concept of virtual currency, so nodes can obtain certain benefits by forwarding messages. When the node has enough buffer to forward the message, it greatly stimulates the enthusiasm of the node to participate in cooperation. Therefore, the message can reach the target node faster from the source node. It can be seen from Figure 8 that as the node cache increases, the energy consumption of these five routing protocols will increase significantly. Because when two nodes encounter each other in EPSR routing, they will exchange the messages in their buffers according to the priority of each message. Therefore, under the same incentive mechanism, the energy consumption of this route is higher than that of the other four routes. Comparing GIR and ICRP, our proposed GIR protocol has higher energy consumption than ICRP routing protocol. Because in GIR, the cache of nodes is used as a factor that affects the patience coefficient to promote node collaboration. As the cache space of nodes increases, more nodes will collaborate to gain revenue. Moreover, the energy mechanism we set up to some extent allows more nodes to have the opportunity to participate in cooperation.

3) THE IMPACT OF THE PROPORTION OF MALICIOUS NODES ON THE NETWORK
In the network, not all nodes will cooperate in a sincere manner. Among them, there are some malicious nodes with untrustworthy behavior. In order to obtain more benefits, some malicious nodes make false offers to other nodes. Therefore, malicious attacks often occur in the network. If there are too many malicious nodes in a network, it is very likely to affect the delivery rate of messages in the network, the average delay and increase unnecessary routing overhead. Through simulation experiments, we compared the influence of malicious nodes on the message delivery rate, average delay and average energy consumption of the five routes under different proportions.
The results in Figure 9 show that the message delivery rate of these five routing strategies decreases as the number of malicious nodes in the network increases. Because of Epidemic, MINEIRO and ICRP routing, there is no mechanism to prevent false quotations from malicious nodes. Therefore, the fluctuation is large. For EPSR and GIR, we can see that EPSR is better than GIR for a certain period of time, because in EPSR the source node only needs to pay the reward to the node on the earliest delivery path, and introduce TTP to manage the reward process, so malicious The node has little influence on it. For the GIR protocol, we introduce MMC to manage the currency and make node wealth relatively transparent. Therefore, to a certain extent, false quotations from malicious nodes are avoided. Because both the seller and buyer nodes in the GIR protocol participate in the bargaining game, the node takes some time. However, as can be seen from Figure 10, with the increase in the number of malicious nodes in the network. The network latency of GIR is much less than the fluctuation of the other four protocols. Because MMC is introduced in GIR, the deposit status of both nodes is transparent during the quotation process, thus avoiding the wrong quotation behavior of malicious nodes. Because both the seller and buyer nodes in the GIR protocol participate in the bargaining game, the node takes some time. But as can be seen from Figure 10, as the number of malicious nodes in the network increases. GIR's network latency is much smaller than the fluctuations of the other four protocols. Because in GIR, we introduced MMC, the deposit status of both nodes is transparent during the quotation process, which avoids the false quotation behavior of malicious nodes. Moreover, with the increase of malicious nodes in the network. The network will also evade some malicious nodes that are falsely quoted, so that the network traffic is reduced. However, as the number of malicious nodes increases, the number of nodes in the network that actually participate in cooperative forwarding of messages decreases, and the average latency of the network increases. With the increase of malicious nodes in the network, fake nodes often conduct false transactions to obtain virtual currency, which causes the average energy consumption in the network to greatly increase, but the message delivery rate is very low. In MINEIRO and ICRP routing protocols, there is an incentive mechanism to promote cooperation between nodes. However, there is no measure to prevent and avoid false bids from malicious nodes. Therefore, malicious nodes frantically participate in false cooperation to obtain their own benefits, which leads to energy consumption. Therefore, in the later stage, the energy of MINEIRO and ICRP routing will increase with the increase of malicious nodes.
As shown in Figure 11, in the early stage, the GIR protocol consumes more energy than the first four routes, because after several rounds of bargaining, the node will consume a certain amount of energy. However, due to the existence of MMC, malicious nodes cannot provide wrong quotations to others, thus avoiding future energy consumption to a certain extent. Moreover, in our GIR mechanism, the energy of nodes is also graded, which means that, on the other hand, the energy of each node in the network is balanced. Therefore, with the increase of malicious nodes, the energy consumption of GIR is lower than the other four routing protocols. Therefore, the negative impact of malicious nodes on the network is reduced to a certain extent, and the transmission overhead is reduced.

4) THE IMPACT OF NETWORK RUNNING TIME ON NODE SURVIVAL RATE
In the network, nodes need to be scanned, transmitted, and other tasks anytime and anywhere. As a result, nodes in the network will die one after another because of energy consumption. The results in Figure 12 show that in these five routing protocols, the number of surviving nodes decreases as the network runs. Because the incentive mechanism in EPSR, MINEIRO and ICRP will cause a large number of nodes to cooperate and consume a lot of energy. This leads to premature death of the node due to lack of energy. In our proposed GIR protocol, when a node forwards a message, the node with higher energy is preferred. In addition, we set an energy threshold for the node, and the node will forward the message only when the node has transferred the remaining energy of the message to a value greater than the threshold. In this way, nodes with relatively small remaining energy can obtain a certain amount of cache, thereby improving the life cycle of the network and ensuring the stable and sustainable development of the network.

V. CONCLUSION
In recent years, nodes and collaborative behaviors in the Opportunity Network have become research hot topics. In this article, we have proposed a perceptual routing (GIR) based on bargaining games. It is proved from both theoretical and experimental aspects that GIR protocol can effectively promote cooperation between nodes. The GIR protocol is based on the node's energy level, link degree and game theory. This mechanism can effectively suppress the selfish behavior of nodes. Through the MMC proposed in the mechanism, the false quotation of malicious nodes can be avoided to some extent, thereby reducing unnecessary overhead. The energy mechanism in GIR greatly delays the average lifetime of the nodes, thereby reducing the average latency and increasing network throughput. Simulation results show that the GIR scheme can achieve better performance. In the future, we will further consider the influence of the surrounding environment on the cooperative behavior of the nodes and apply our scheme to the moving model of the nodes to explore the efficiency of the scheme in the mobile scene.