Barter Exchange Economy: A New Solution Concept for Resource Sharing in Wireless Multimedia Cloud Networks

One of the most significant types of Mobile Cloud Networking (MCN) is Cloud-based Wireless Multimedia Social Networks (CWMSNs). We believe that microeconomics theory is a good candidate to model the bandwidth sharing operations in CWMSNs. We model the interactions of mobile users in terms of the barter exchange economy. In our modeling, bandwidth is chosen as the exchangeable commodity and mobile users and desktop users act as players . From a microeconomics point of view, the allocated bandwidth subject to each service plays the role of “endowment” (budget) for players. With this endowment and leveraging the concept of barter exchange, mobile users can interact with each other to gain more quality of service (QoS) in the future. We prove that by applying the exchange economy, users’ social welfare could reach to global maximum, known as Pareto efficiency. To the best of our knowledge, the idea of a barter exchange economy has never been employed in any study on cloud computing. Simulation results, obtained through the CloudSim framework, established the robustness of our modeling in terms of significant metrics such as social welfare, number of blocked users, satisfaction level, and Pareto efficiency.


Introduction
Unfair distribution of wealth and resources in society is one of the unsolved problems in the world for which various solutions have been proposed by economists as everyone feels a sense of utility and fairness in accessing the resources.
General equilibrium theory is one of the methods to achieve fairness in resource distribution. In this article, at first, we are going to describe this method and the Pareto optimal point which is the ideal point, and finally, we will use this economic method in the resource distribution in the cloud network.
Mobile Cloud Networking (MCN) is a large-scale project of EU FP7 focused on combining cloud computing and network virtualization technologies for mobile networks [1]. One of the most significant types of MCN is the Cloud-based Wireless Multimedia Social Network (CWMSN) [2]. The system consists of content providers as well as a desktop and mobile users. The content providers present their applications including live streaming Video-on-Demand (VoD), video conferencing, VoIP, photo sharing, and so on. [ Figure 1-a] shows the general architecture for CWMSN.
A literature survey reveals that the allocation issue in CWMSNs can be divided into three major categories, including bandwidth allocation, request allocation, and workflow allocation. In this research, we merely focus on the bandwidth allocation problem. The bandwidth allocation consists of reserving and allocating bandwidth to users and content providers. The bandwidth reservation for users ensures that bandwidth will be available in the future as well [3]. In Section 2, we will explain bandwidth allocation approaches in depth. One major challenge for these models is how to allocate bandwidth to cloud-based VOD users by cloud providers [4]. Like the Internet Protocol Television (IPTV), VoD is a protocol allowing users to view video content whenever they need it rather than at specific times [5]. The ultimate goal of cloud providers is to minimize bandwidth costs and maximize their profits by maximizing users' profits [6]. Our focus in this paper is designing a cost-oriented bandwidth sharing mechanism. Literature survey shows that many researchers have applied game theory to model interactions among users on a cost-oriented basis [ [24]. However, as is the case in game theory, it requires considering some non-realistic assumptions which do not exist in real-world cloud networks at all! To cope with this problem, some researchers have applied heuristic approaches [25]  This paper is the first research that models the interactions of mobile and desktop nodes in terms of the barter exchange economy. In our modeling, bandwidth is chosen as the exchangeable commodity and mobile users and desktop users act as players. Each mobile user, upon joining the system, contacts a Software-Defined Network (SDN) controller and sends the list of his/her desired services to it. Then, the SDN controller negotiates with multiple desktop users to find a proper one as a provider of service to the requesting mobile user. Eventually, the SDN controller introduces the best desktop user(s) to the mobile node. Now, the mobile node gets those services freely from a designated desktop user(s). From a microeconomics point of view, the allocated bandwidth of each service is, in fact, his/her "endowment" (budget). With

Related works
So far, numerous studies have been carried out subject to the bandwidth allocation problem in cloud-based VoD systems. Interested readers can refer to [1][37] [38] for comprehensive surveys on pricing approaches in cloud computing. We have divided the studies in the context of bandwidth allocation into two categories, including cost-oriented resource allocation methods and non-cost-oriented resource allocation ones. Given that, here, our proposed method is cost-oriented, non-cost ones will not be discussed. Also, we classify the previous costoriented researches into two minor categories, including game-theoretic approaches and nongame-theoretic ones.

Game-theoretic pricing approaches
Gui et al. [8] have used the Vickrey-Clarke-Groves (VCG) auction model to reserve bandwidth for achieving social welfare and strategy-proof properties [9]. In this method, tenants do not have the incentive to lie about their revenue, and cloud lenders simultaneously send their bids to the cloud provider to compete for bandwidth. Shi et al. [10] used Shapley value-based auction method for modeling resource allocation in cloud networks. The VCG Mechanism ensures both feasibility and optimal economic efficiency. Also, Besharati and Rezvani [39] used auction theory to model offloading operations in cloud-fog networks. The Reverse Vickery auction method is usually used to allocate users' requests to volunteer computers [13]. This method has been used by Di et al. [12]. Feng et al. [40] proposed a method inspiring double auction. Interested readers can refer to [14][15] [16][17] [18] [41] to see more works on using a double auction.
In the context of non-cooperative game methods, Guan and Melodia [19] presented a model with several brokers possessing cloud resources such as computing resources and network bandwidth. Teng et al. [20] proposed a policy to allocate resources to buyers in proportion to their paid price. In another work by Niu et al. [21][22], a market model was presented in which the broker's price is considered.
Regarding CWMSN, Nan et al. [24] [42] have examined the issue of bandwidth sharing between desktop and mobile users. Brokers decide on bandwidth volume and the related prices of shared bandwidth. Then, each mobile user chooses a broker to connect to. The conversation between them is formulated by the Stackelberg game, in which brokers play the role of leaders and mobile users are followers. To study more on applications of non-cooperative games, refer to [43] [44]. Contrary to the market models described above, the models presented in articles [29] and [30] have considered several providers (cloud tenants). Also, Mukherjee et al. [45] have used the price-based maximum profit to determine the cost to be paid by volunteer users. Tavakolisomeh and Rezvani [32] [46] proposed a metaheuristic method based on NSGA-II algorithm to optimize utilization. Similarly, in [33] a hedonic pricing model is proposed which considers both service cost and the tendency of customers. Also, Dabbagh et al. [34] proposed a budgetoriented method to maximize utility. Ramsey pricing method [35] is a strategy that regulates price monopolies to maximize social welfare, despite the present limitations on profits. Ramsey Pricing has been used in [47] to adjust the bandwidth request by the cloud's tenants. Also, Divakaran et al. [36] applied the "differential pricing" approach to share bandwidth in the cloud network.

Non-game-theoretic pricing approaches
The demand-based method has been used in [12][25] [26][45] [48]. Here, the price is practically adjusted by some service providers such as CloudTweaks [49]. Also, some works such as [22] [41] have proposed other architectures. For example, in [22], the broker will reserve the real bandwidth from cloud providers and sells the bandwidth of services to tenants. Mohammadi and Rezvani [27] [28] are the first who applied producer-consumer theory to model the interactions between VMs and the physical hosts. In their modeling, users are nonstrategic rational nodes, i.e. their movements do not affect the other's movements. Interested readers can refer to [50][51] [52][53] [54][55] to see other researches in the context of cloud pricing schemes. We again urge that our research in this paper falls into the category of demandbased pricing method.

Pareto efficiency and contract curve
We use one of the most significant theories in the "competitive markets" of microeconomics, namely "exchange economy theory". Fig. 1-b shows the architecture of the proposed method. Desktop users obtain services from the cloud network directly and then, mobile users contact desktop users to get services from them. The SDN controller acts as a rendezvous point in the system. This architecture has been used by Nan et al. [24] [42]. In our modeling, the bandwidth of services is chosen as an exchangeable commodity. Also, mobile users play the role of consumers. Each mobile user, upon joining the system, contacts the SDN controller and sends the list of his/her desired services to it. Then, the SDN controller negotiates with desktop users to find a proper one as the provider of service to the applicant mobile user. Eventually, the SDN controller introduces the best desktop user(s) to the mobile node. Now, the mobile node gets those services freely from a designated desktop user(s). Note that the interactions between desktop users and cloud networks (especially, the broker of cloud network) are not relevant to the scope of this paper. We have investigated that part of the problem, known as VM placement, in our previous works in [27] [28][32] [46]. From the microeconomics point of view, for each mobile user, the allocated bandwidth of each service is referred to as "endowment" (or equivalently budget). With this endowment at hand, later, if a mobile user wishes to attain better levels of QoS, he/she will, at first, submit his/her request to the coordinator node (here, the SDN controller), and if the resources are allocable to the endowment, the SDN controller will fulfill his/her requests. Otherwise, from a set of present mobile users already using the service, some users are selected as candidates, and finally, the best one will be picked out for exchanging the required service with the applicant mobile node. In other words, each mobile user could exchange a portion of its service rate with another mobile user. excess demand for service ( ),1 ≤ ≤ excess demand for service at Walrasian equilibrium price ( * ) the marginal rate of substitution for the mobile user subject to services 1 and 2 1 2 To clarify the issue that is investigated in this paper, we just assume that there does not exist any production! In other words, we merely assume each mobile user is "endowed" by desktop users with a certain amount of service bandwidth rates as commodities. Mobile users may consume their endowment of commodities or may engage in barter exchange with other mobile users. At the moment, our question is that, where might this system come to balance through the process of voluntary exchange? We shall refer to such balance states as barter equilibria. For the sake of clarity, we just assume that there are two mobile nodes called 1 and 2 , and also only two commodities (services) called 1 and 2 . The vector 12 11 1 () , Increasing quantities of service 1 for the mobile user 1 , i.e. 1 1 are measured rightwards from 0 1 along the bottom side, and increasing quantities of service 1 for the mobile user 2 , i.e. 2 1 are measured leftwards from 0 2 along the top side. Similarly, the amount of service e .
All other points in the box refer to other methods of resource allocation among mobile users and all possible methods of allocation among them. Thus, the box provides a complete picture of all possible methods to distribute services between mobile users. To complete the description of a two-service two-user exchange ecosystem, it is assumed that each mobile user has priorities represented by an indifference convex map. In Fig. 2-b, the indifference map of the mobile user 1 increases upwards to the top right, and for mobile user 2 it increases downward to the bottom left. The indifference curve of each mobile user runs through each point inside the box. The CC line (red color) is one of the subset allocations that is tangent on the indifference curve of mobile users at one point. This curve is known as the "contract curve". At any point in the contract curve, the consumers' indifference curves should cut each other at that point.
Considering the initial quantities given at point e , an important question is which allocations lead us to exchange equilibrium state? Specifically, the first requirement is that allocations can be anywhere in the box, but we have to keep in mind that some of these feasible allocations do not lead to exchange equilibrium! For example, suppose that redistribution is proposed from point e to point A. In this case, the mobile user 2 reaches a better state while the mobile user 1 is clearly in a worse situation. Because this ecosystem is based on optional exchanges and mobile users participate in this exchange ecosystem based on their interests, redistribution to point A by the mobile user 1 will be rejected or blocked. On the basis of this argument, all allocations that tend to the left side of the indifference curve of the mobile user 1 through point e will be blocked by the mobile user 1 . By the same reasoning, all allocations that tend to the right of the indifference curve of the mobile user 2 will be blocked by the mobile user 2 . All allocations of two distinct indifference curves of mobile users are formed only inside or over the lens-shaped space. At any point outside this border, one of the mobile users will achieve a better state and the other will have a worse situation than the point e . Each allocation in the lens-shaped space will lead to a state where both mobile users will find a better state than the point e . To achieve this goal, mobile users need to trade together.
The mobile user 1 should ignore some quantity of service 1 in order to have access to some quantity of service 2 of the mobile user 2 . Also, the mobile user 2 should ignore some quantity of service 2 in order to exchange with some amount of service 1 of the mobile user 1 . Now, we are ready to answer the first question. "Are all the allocations that are present inside the lens-shaped space in equilibrium exchange state?" Suppose that redistribution occurs toward point B. Because B is within the contract curve, two curves of indifference that pass through it should cut each other. Now consider a point like D on CC line of the contract curve.
Moving from point e to such points leads to a better state. In addition, as mobile users move toward D, there will be no other transaction leading to a bilateral profit. Hence, when we reach point D, no other transaction takes place; that is, D is an exchange equilibrium point. Each point on CC is in an exchange equilibrium state. Mobile users should agree with this transaction and should also find themselves in any allocation on this section. Therefore, players agree to do their transactions on any point on CC and suggest that they stop any other allocation in the box and redistribute it toward CC. When, of other feasible allocations, we choose a point on CC, we will be sure that the chosen allocation will move on CC and that it is a better movement compared to other points other than those located on CC.
Consider now the case of many mobile users and many services. Each mobile user ∈ is endowed with a vector of the services, user 's allocation vector. The set of feasible allocations in this ecosystem is as follows: The first requirement imposed by a barter equilibrium is that ∈ ( ). Recall from the twoconsumer case, that if both mobile users could achieve a better state by trading with one another, then we could not yet be at a barter equilibrium. Generally speaking, at a barter equilibrium, no Pareto improvements were possible. Before we proceed to formalize this, let us start with a definition.
Definition 1 Pareto-optimal Allocations: A feasible allocation, ∈ ( ), is Pareto efficient if there is no other feasible allocation, ∈ ( ), such that i i m m  y X for all mobile users, ∈ . Therefore, an optimal allocation is Pareto if one user's state gets better without another one's getting worse. Also, if ∈ ( ) is not a Pareto efficient, there is a feasible allocation y whereby one's state improves and no one gets worse. Subsequently, a mobile user whose state could become better can do a transaction with others; He/She says "I give every mobile user an allocation such i m y in exchange for an allocation i m X ". Because two allocations of X and y are possible, this exchange is also possible. Keep in mind that not all Pareto efficient allocations were in equilibrium. That is, the only allocations created by indifference curves on the contract curve and inside the lens-shaped space consist of the initial points that could have been in equilibrium. The reason for this is that other Pareto efficiency allocations (those that were on the contract curve but not outside the lens-shaped space) would at least have enhanced one user's state compared with other users who were using the initial entity. Thus, each such Pareto-optimal allocation was "blocked" by one of the mobile users.
Definition 2 Blocking coalitions: Let ⊂ denote a coalition of mobile users. We say that blocks ∈ ( ) if there is an allocation y such that: Simply speaking, the above definition says that the mobile users in must be able to hold what service quantity they own and distribute it among themselves in such a way that none of them get worse and at least one is better off than with their allocation under X . The necessary condition for an allocation to be in equilibrium is that it is unblocked. In the voluntary exchange, the set of equilibria is known as the "core" of which the definition is as follows: Definition 3 The core of exchange economy: The set of all unblocked feasible allocations is known as the core of the exchange economy and is denoted by ( ). As we shall show in the future, the exchange economy has at least one feasible and unblocked allocation.
The main characteristic of the competitive economy is that the behaviors of players are affected by their selfishness. Also, the market players are price-takers, not price-setters, i.e. they accept the price of each service as it is. In other words, market players cannot change the prices themselves. We now proceed to define assumptions under which there does exist at least one vector of prices that simultaneously clears all markets. As is the case in microeconomics, for each mobile user we define a function, , known as a utility function. This function captures the utility of mobile user concerning its demanded services. The domain of the function is ℝ + and meets the following condition. Assumption 1 (mobile user utility): function is continuous, strictly increasing and quasiconcave.
Later, in Eq. (13), we will elaborate on this assumption, deeper. In this paper, we have used an exponential utility function, known as the Cobb-Douglas function, which satisfies the conditions in Assumption (1).
If ≡ ( 1 , 2 , … , ) ≫ 0 is the vector of market prices, then the optimization problem for each mobile user is . This is a non-linear optimization problem that could be solved using Kahn-Tucker conditions. Since mobile users' demand for each service depends on the prices of all services, we say that there exists interdependency among services! In other words, any change in a given service market affecting and being affected by other service markets. To capture these interdependencies; we define an n-dimensional excess demand vector, each of whose elements is the excess demand function concerning one of the n services markets.
Definition 4 (Excess demand): The aggregate excess demand function for service is, The aggregate excess demand function is, If ( ) > 0, the aggregate demand for service exceeds the aggregate endowment of service and so we have excess demand for service . If ( ) < 0, we have an excess supply of service .
Theorem 1 (Walras law): if for each mobile user , satisfies the conditions of Assumption 1, then for all >> the value of aggregate excess demand will always be zero, i.e. Walras' law has some remarkable conclusions. For example, if we revisit the two-service barter exchange economy of [ Figure 2-a], we have Another interesting implication is that if the service market 1 is in equilibrium, so that 1 ( ) = 0, then the service market 2 is also in equilibrium with 2 ( ) = 0. Both of these implications generalize to the case of service markets. Generally speaking, any excess demand in the cloud economy of Fig. 2-a must be exactly equated with the same amount of excess supply somewhere else in the system. If in all service markets, demand equates supply, i.e. ( ) = 0, then we would say that the system is in general equilibrium. Such a price vector is called the Walrasian equilibrium price and is denoted by * .
Definition 5 (Walrasian equilibrium): A vector * ∈ ℝ ++ is called a Walrasian equilibrium if ( * ) = . Now, the most important question which arises is what are the necessary conditions for the existence of such a market-clearing price vector. In our recently published paper [28] we have proved that if the utility function meets Assumption (1) there exists at least one price vector * . Also, in Theorem 3 of that paper, we have proved that every Walrasian equilibrium allocation is Pareto efficient. The major difference between present research and [28] is that, here, we have no production in the system! In other words, mobile users do not generate the service; instead, they download each service from relevant desktop users freely, and then, in the next times, they exchange it with other mobile users voluntarily based on the barter economy. Note that in our modeling in [28], the cloud network is considered as producer and users should pay the cloud provider to download the content. In that setting, we used the producer-consumer theory, which is also based on Walrasian equilibrium, but with a different mechanism. Figure 3. Walrasian equilibrium in the Edgeworth box for two mobile users and two services Now that we have been familiar with the concept of Walrasian equilibrium, again go through the case of the two-user two-service Edgeworth box to make our understanding deeper. [ Figure  3] shows a barter exchange economy where all the above-mentioned assumptions are met. We suppose that the initial endowments of mobile users 1 and 2 are . Similarly, the mobile user 2 's demanded bandwidth with income equal to the value of his/her endowment is ( 2 1 , 2 2 ) . Since the total demand must be equal to the total supply, attaining the equilibrium point for service 1 requires 1 1 + 2 1 = 1 1 + 2 1 . On the other hand, the mobile user 2 's net demand is equal to the mobile user 1 's net supply of service 1 . This requires that 2 1 − 2 1 = 1 1 − 1 1 . We, of course, can give similar reasoning of equilibrium in the market subject to service 2 .
As is evident in [ Figure 3], since equilibrium requires the demanded allocations to coincide, it is clear that equilibrium will involve tangency between the two mobile users' indifference curves through their demanded allocations.
For all points located on the consumption contract curve, the marginal rate of substitution (MRS) for a user must be equal to that of another user. In microeconomics, MRS specifies the amount of a good that a consumer is willing to give up for another good. For example, notation Rahman Mansoury, Mohammad Hossein Rezvani 1 1 2 = 2 says that for the mobile user 1 , the MRS of service 1 for service 2 is 2. It means that a mobile user 1 would be willing to give up 2 bandwidth units of service 2 to obtain 1 extra bandwidth unit of service 1 . Since the points located on the consumption contract curve possess Pareto efficiency property, it must be that 1 1 2 = 2 1 2 . We will use this property, later, in Eq. (21).

Utility possibilities curve
In the previous section, we introduced the consumption contract curve, which is pictured in the space of two services 1 and 2 . We stated that the points on the consumption contract curve are, in fact, Pareto efficient. According to the Edgeworth box, it is clear that each of the points on the consumption contract curve corresponds to a certain level of utility for mobile users 1 and 2 . In other words, at each point on the consumption contract curve, the quantity of the utility that each of the mobile users 1 and 2 can have is predetermined. If we change the space of these points and transfer them to a coordinate system (where the horizontal coordinate of 1 indicates the level of utility of mobile user 1 and the vertical coordinate of 2 demonstrates the level of utility of mobile user 2 , we will have a utility-possibility curve. Fig.  4-a shows a utility-possibility curve. It can be said that the utility-possibility curve is the geometric location of the combination of utilities of mobile users 1 and 2 which corresponds to an efficiently distributed combination of certain quantities of services 1 and 2 . Therefore, all points on the utility-possibility curve (like A, B, and C) have the property of Pareto efficiency. But apart from these points on the curve, two other regions can also be identified: The points on the left side of the curve (like point D) indicate a non-optimal state because as they move toward utility-possibility curve, both users' utility will increase, or at least, the utility of one of them will rise without diminishing another's utility. The points on the right side of the utility-possibility curve are inaccessible. For example, although points like E (on the right side of the curve) can increase both users' utility, given the assumption that the values of services 1 and 2 at the levels of initial endowments 1 and 2 are constant, they are not accessible. a) A typical utility possibilities curve b) a two-user two-service barter exchange economy Since we have considered two services 1 and 2 , according to conditions of Assumption (1), the utility of mobile user 1 can be shown as follows: Where 1 is a constant coefficient defined by the mobile user 1 . The parameters of 1 1 and 1 2 respectively represent the quantity of bandwidth of services 1 and 2 reserved by the mobile user 1 . Coefficients 1 and 2 , respectively, indicate the importance of services 1 and 2 for the user. Similarly, the utility of another user, 2 , can be represented by the following function: The total amount of bandwidth of service 1 is obtained from the following equation: Moreover, the total amount of bandwidth of service 2 is obtained based on the following equation: Furthermore, given that the total amount of bandwidth is fixed, one can write: Now we are going to obtain the consumption contract curve in the space of 1 1 and 1 2 . To this end, we can solve the following problem: In the above relation, ̄2 is a fixed value. As stated before, Pareto efficiency implies that Appling deviations regarding Eqs. (13)- (14), we can write: Due to space limitations, we omit the details. The final relation is as follows: If we choose the weights 1 and 2 so that 1 + 2 = 1, the latter equation will be converted to a simpler form, and finally, the utility-possibility curve between two mobile users 1 and 2 can be written thus: The latter equation provides a linear relationship between the utility of two mobile users 1 is the slope of the line and 2 .
( 2 ) 2 is the y-intercept. Therefore, we can draw the utility possibility curve as [ Figure 4-b]. [ Figure 5] shows the sequence diagram (workflow) for the proposed algorithm. Also, [ Table 2] contains the names and specifications of messages.  The SDN controller forwards the request of the desktop user along with the identifier of his/her desired services to the cloud broker.
The cloud broker inspects the availability of requested services. If it is capable to serve the desired services, it responds to the SDN controller with a CSC message along with the address of the physical host which is responsible for providing those services; otherwise responds with a CSD message.

Service Initiation Disconfirm
The mobile user establishes a connection with a designated desktop user to download his/her desired services.

Rate Allocation Request
The designated desktop user accepts bandwidth sharing with the requester mobile user. < > RAC

Rate Allocation Confirm
Once the service allocation is completed, the mobile user sends managerial information back to the SDN controller. These contain information such as total uploading capacity, , the rate of services, 1 , 2 , the remaining uploading capacity, , etc.

Information of mobile user
The mobile user requests an extra bandwidth rate concerning his/her ongoing service, ∈ { 1 , 2 }. This message is sent to the SDN controller.

Resource Request
The SDN controller looks up the list of active mobile users which is sorted in descending order based on their utility value. Then, the SDN controller contacts the most appropriate mobile user, i.e., the one that has more utility value. This mobile user is named "donor". The SDN controller sends the ID of extra requested service, , to the donor node.

Rae Modification Request
The donor node confirms that he/she agrees to do a barter exchange with the requesting mobile user. < > RMC

Rae Modification Confirm
Upon receiving the RMC message from the donor node, the SDN controller calculates new Walrasian equilibrium allocations regarding both the requester node, , and the donor node, based on Eqs. (15)- (18). Then, the SDN controller sends each node a new share concerning each service. This includes parameters like 1 , 2 , 1 , and 2 . Also, the SDN controller calculates the utility of both requester and donor nodes using Eq. (33) and stores it for future interactions.

Performance evaluation
In this section, the performance evaluation of the proposed barter exchange economy is explained using the well-known CloudSim tool (version 3.03) running on a 64-bit Intel® Core™ i5-8269U Processor with 6 MB Cache, 4 Cores, 4.20 GHz CPU frequency, and 8 GB RAM. The CPU processing rate of each VM has a uniform distribution in the interval (900, 1100) MIPS. The required RAM is chosen as 512 MB. The physical hosts of the cloud are considered heterogeneous and uniformly distributed in the interval (9000, 10000) MIPS. Also, the provided bandwidth of physical hosts is considered uniformly distributed in the interval (8000, 12000) bps.
One of the parameters to be evaluated is delivering messages per number of users. To calculate this parameter, we first ought to examine the probability of sending messages to different entities in various states. According to [ Figure 5], all mobile users initially need to send a SIR message to the SDN controller to inform and register their desirable services. It can be concluded that for all mobile users in the first stage, the total number of SIR messages is . In the next step, after a desktop user is selected for mobile users' requests, the SDN controller sends an SRA message and mutually receives an RAA message to the selected desktop user so that the applicant mobile user's request can be met. The probability of the case where the SDN controller finds a desktop user for the mobile user's request and sends a message to it is displayed by . Since every SRA message is followed by an RAA message, it can be inferred that for the probability of , the total number of messages handled by the SDN controller is 2 . . Also, since every SIR message is followed by a SIC message, in this case, we have . SIC messages. Eventually, for pairs of RAR/RAC messages, we need 2 . messages. The probability of the SDN controller not finding a desktop user for the mobile user's received request is denoted by 1 − . If no desktop user is found, the SDN controller will notify the applicant mobile user by delivering a SID message specifying that at the time of his/her request, no desktop user could currently provide the required service. The probability value of this item is represented by . (1 − ). Note that since ≫ , we did not take into account in our computations! Based on the above explanations, the total number of required messages for connecting mobile users to desktop users is as follows: Now, we proceed to calculate the number of required messages in a case in which mobile users request extra resources from the SDN controller to enhance their QoS level. The probability of the mobile user's requesting additional resources is represented by ′ . Since every ERR message is followed by an ERA/ERD message, it can be inferred that the total number of messages handled by the SDN controller is 2 . ′ . In the proposed method, after the submission of a request for additional resources to the SDN controller, it must find the most proper mobile user to do an exchange with. The probability of finding this mobile user is represented by ″ . Also, in the case of finding a user suitable for doing the exchange, the SDN controller handles three pairs of messages including one pair of RMR/RMC messages and two pairs of SRM/RMP messages between the applicant mobile user and the donor entities. So, here, we need 6 ′ . ″ . messages. Based on the above explanations, the total number of required messages for barter exchange is as follows:  Figure  6] shows the number of messages in the system for different numbers of mobile users. As demonstrated in [ Figure 6], as the number of mobile users increases, the number of messages sent by them to receive service bandwidth rises in a relatively linear manner. It is expected that the more resources are available for the desktop user, the more mobile users it can provide services to. As is evident in [Figure 7], the rise in the server's capacity leads to an increased percentage of users' aggregate social welfare. This is because the server's capacity directly impacts users' aggregate welfare. Certainly, one of the most crucial parameters in cloud servicing is users' satisfaction. The purpose of this parameter is to examine the effect of increasing the number of mobile users on their satisfaction with the services. As shown in [ Figure 8], with the increase in the number of users, their level of satisfaction with service increases, as well. It is due to the presence of more users on the network which increases the chance for doing barter exchange operations. As suggested in the proposed method, if no suitable user is found to perform the exchange operation, the SDN controller will have to reject the applicant's request. However, if the number of users is, for example, 100, the SDN controller can negotiate with 100 users. This will increase the likelihood of finding a user for the exchange operation. The result of the above discussions is shown in [ Figure 8].
[ Figure 9] shows the percentage of users who have succeeded in receiving at least one service subject to their average initial endowment (or equivalently their first request). To make things clear, consider that a desktop user has a limited quantity of resources. If there is a user who at his/her first request has the required budget for receiving the desktop user's resources, he/she can purchase them at the first request. This causes other users not to be able to receive any service from that server for their future requests. To bring the simulator closer to the real world, we assume the quantity of users' initial endowment as a normal distribution. We also consider the total number of users 200 to explore how many of them will succeed in receiving the service at the first endowment. [ Figure 9] suggests that the higher the average initial endowment to users is, the lower the number of users who will receive the first service from the network will be. The reason is that as users' initial endowments become higher, their dependence on budget constraints will be reduced and a major part of the limitation will incline towards network constraints. Therefore, the server will be able to respond positively to the demands of the users who have made their requests sooner. This will lead to starvation for upcoming users; as a result, the remaining capacity of the server will be emptied more quickly . A significant practical The parameter to be studied here is the percentage of blocked users based on the system's capacity. We will also consider the number of users 100 with the request of random endowment varying between 70 and 100 bps. As is evident in Fig. 10, the larger the server's capacity, the lower the percentage of blocked users who send their first request to the server to receive resources. The test shows that if the desktop user's capacity is 8,000 units, no user is blocked because the desktop user's capacity is greater than the total requests for the initial endowment. Eventually, we study the impact of initial endowment on mobile users' second requests in [ Figure 11]; when the mobile user sends a second request to the system to receive higher bandwidth rates. For the sake of simplicity, we assume there exists only one desktop user in the system. At first, the desktop user is required to respond to the mobile user's request using its internal resources without employing barter exchange. The desktop user's capacity is considered 1000 and the number of mobile users 100. Also, suppose that the initial endowment is uniformly distributed in [0,5 ]. For example, if all mobile users' first requests are 5 , the consumed bandwidth rate will be 100 * 5 = 500 and, also, the remaining capacity of the desktop user will be 1000 − 500 = 500 . Given that for simulating the mobile users' second requests, we have utilized the same uniform distribution of the first requests, the desktop user will be able to respond to all mobile users' second requests to be received in the future. As is shown in [Figure 11], if the initial endowment value is 25 , the system will able to respond to 30% of the received second requests; thus, after a while, its resources will be depleted. Here, mobile users should enter the barter exchange to receive additional resources. If the mobile users' initial endowment is 30 , the desktop user's resources will be depleted at the initial requests and all of the mobile users' second requests will enter the general exchange.
As [ Figure 11] indicates, the more the mobile users' initial endowments are, the lower the percentage of users accepted by the server will be. Given that in the exchange economy, a service is provided by the system's current mobile users, it is evident that the share of the participating mobile users declines. Figure 11. The percentage of the server's response to the users' second requests (without barter exchange) subject to initial endowments

Result of Study
Looking at the diagram we notice that the proposed method, has provided a higher degree of user satisfaction in terms of the fair distribution of resources and the reason for that mainly is because the users have access to their requested resources in the system. Moreover, the diagram shows that if there is an adequate infrastructure to provide service to more users with no connection issue, the users' satisfaction level increases even more since there is a greater possibility to access their requested resources.

Conclusion and Future Trends
In this paper, we targeted one of the most practical concepts of Cloud-based Wireless Multimedia Social Networks (CWMSNs), namely bandwidth sharing. We modeled and formulated the bandwidth sharing problem using the barter exchange theory of microeconomics. In our modeling, bandwidth is chosen as the exchangeable commodity and mobile users and desktop users act as players. In this model, the allocated bandwidth of each service plays the role of "endowment" (budget) for players. We also proved that by applying the barter exchange economy, users' social welfare could reach to global maximum, known as Pareto efficiency. In our modeling, all information about the number of services provided to users is available to an SDN controller, as a rendezvous point. We provided a sequence diagram (workflow) concerning the proposed algorithm. The simulation results revealed the superiority of our proposed approach, in terms of significant criteria such as aggregate social welfare of users, acceptance ratio, the number of initial users' endowments, and so on.
One of the possible lines of research is to consider other pricing mechanisms of microeconomics. Another important field of research in the future is attention to the type of resources. This will lead to more realistic modeling of the cloud network. Also, consumption contract curves and utility functions can be predicted and regressed accurately based on the analysis of previous network data. These predictions can be used in the practical implementation of the cloud network.