Truthful Channel Sharing for Self Coexistence of Overlapping Medical Body Area Networks

As defined by IEEE 802.15.6 standard, channel sharing is a potential method to coordinate inter-network interference among Medical Body Area Networks (MBANs) that are close to one another. However, channel sharing opens up new vulnerabilities as selfish MBANs may manipulate their online channel requests to gain unfair advantage over others. In this paper, we address this issue by proposing a truthful online channel sharing algorithm and a companion protocol that allocates channel efficiently and truthfully by punishing MBANs for misreporting their channel request parameters such as time, duration and bid for the channel. We first present an online channel sharing scheme for unit-length channel requests and prove that it is truthful. We then generalize our model to settings with variable-length channel requests, where we propose a critical value based channel pricing and preemption scheme. A bid adjustment procedure prevents unbeneficial preemption by artificially raising the ongoing winner’s bid controlled by a penalty factor λ. Our scheme can efficiently detect selfish behaviors by monitoring a trust parameter α of each MBAN and punish MBANs from cheating by suspending their requests. Our extensive simulation results show our scheme can achieve a total profit that is more than 85% of the offline optimum method in the typical MBAN settings.


Introduction
Medical Body Area Networks (MBANs) are key technology to facilitate ubiquitous healthcare services for patient management such as remote patient monitoring, disability management and remote control of wireless devices. MBANs can be used to monitor vital body signs such as heart rate, temperature, blood pressure, electrocardiogram (ECG), electroencephalogram (EEG) and pH level of patients. By replacing cables with wireless links, MBANs can provide less invasive and more comfortable ways to monitor a patient, both in and outside the hospital environment and are efficient since MBANs pose minimal infection risks.
Unlike cellular networks, MBANs are randomly distributed networks where two or more of them may deeply overlap and interfere with each other due to the limited available frequency bands. For example in a crowded bus more than 10 people could sit close to each other, such that each person's MBAN may severely interfere with the other MBANs in the vicinity. Such severe interference will decrease the Signal to Interference and Noise Ratio (SINR) potentially risking patients' lives.
To mitigate the severe inter-network interference among overlapping MBANs, IEEE 802.15.6 standard [1] proposed several interference mitigation schemes such as beacon shifting, channel hopping and channel sharing (i.e., active superframe interleaving), but has not described the underlying details that relate to a specific protocol and algorithm to achieve low or no interference. In this paper, we explore the problem of channel sharing for the self coexistence of multiple and deeply overlapping MBANs.
Channel sharing among MBANs introduces significant design challenges because of the mobility and safety requirements of MBANs. First, the channel sharing scheme must be on demand, so that MBANs can request channel access frame by frame. Second, unlike the previous studies on channel assignment (e.g., [2,3]), the channel access scheme has to make decisions on-the-fly, i.e., without the knowledge of future events such as which networks will subsequently join or leave the channel sharing spectrum. Third, channel sharing must be self enforcing so that each MBAN will benefit from sharing the channel with other MBANs instead of operating uncooperatively and causing interference to others. Finally, the channel sharing scheme must enforce truthfulness so that no single MBAN can gain unfair advantage by manipulating its channel request parameters and thereby denying access to other legitimate MBANs.
In this paper, we model the channel sharing problem as an online channel access auction, wherein the participating users (i.e., MBANs) will request channel access whenever channel bandwidth is needed to support the communications in the networks. According to the online auction theory [4,5], each request consists of a monetary bid and channel access information which includes the start time, end time and channel access length that could be utilized in the channel sharing problem. One user in the network takes the role of an auctioneer. The auctioneer processes the requests on-the-fly, and forwards appropriate channel access grant messages to all the users. By decoding the channel access grants, each user can access the channel that is granted to him. In this way, users can request and share the channel with their neighbours thereby avoiding collisions which may lead to severe inter-network interference.
Although the online auction based channel access scheme seems to address the problem on inter MBAN interference in an efficient way, it opens up vulnerabilities for selfish users who could try to gain an unfair advantage over others by manipulating their request parameters. For example, a user can falsely report its channel request in terms of the channel access duration, start time and end time, or bid to get more channel bandwidth at a lower cost. Manipulation of channel access requests can result in the blocking of other users from transmitting their packets. Therefore, an efficient online channel access auction design for MBANs' coexistence needs to address this critical problem so that misbehaving users will be punished and as a result, channel bandwidth can be fairly shared among users.
To discourage users from manipulating their channel access requests, we propose an online truthful channel sharing scheme that maximizes users' profit if and only if users truthfully report their channel requests. To the best of our knowledge, this is the first study to address both the network coexistence issue of MBANs (defined in IEEE 802.15.6 standard) as well as truthful channel sharing problem simultaneously.
Our proposed scheme combines a monotone channel allocation rule with a payment mechanism. The monotone channel allocation rule allocates the channel to the user with the highest bid who has so far not been allocated the channel in the current frame. Apart from the channel allocation rule, we propose a payment mechanism that computes the payment for each successful bidder of each frame. The central idea with payments is that a user that is allocated a channel pays the smallest satisfaction value it could have reported and still received an allocation. We prove that the proposed channel sharing scheme is truthful and can achieve the overall high competitive ratio and profit.
The main contributions of this paper are summarized as follows: • We analyse the truthful practical channel sharing problem in MBANs. We find that the channel allocation monotonicity is necessary for achieving truthfulness and also show that payment must be bid-independent and satisfy monotonicity requirements with respect to the start-time and end-time, channel access length and bid.
• Driven by the monotonic allocation methodology, we design efficient online channel sharing schemes for both unit-length and variable-length request cases. We apply a trust factor α to monitor the selfish behaviour of users and a penalty factor λ based bid adjustment to prevent unbeneficial preemption thereby maximizing the overall profit. We prove that our proposed methods are indeed truthful.
• We design a practical channel sharing protocol for IEEE 802.15.6 MBANs based on the truthful channel sharing schemes proposed above. In the protocol, we define a self CO-existence Period (COPE) based frame structure together with the request and grant schemes to facilitate channel sharing among multiple MBANs.
• Finally, we conduct extensive simulation based experiments to analyze the performance of the proposed truthful channel sharing algorithm and the companion protocol to show that our proposed scheme maintains fairness while achieving a total profit that is more than 85% of the offline optimum.
The rest of the paper is organized as follows. The Methods section first defines the channel sharing problem for the coexistence for multiple overlapping MBANs. We then propose a channel sharing scheme that is truthful along with a channel allocation and payment rule set to solve the channel sharing problem. A practical channel sharing protocol is developed based on the IEEE 802.15.6 standard. In the Results Section, the performance of the protocol is analyzed using simulation based experiments. In the Discussion section, we contrast our approach to the channel sharing problem with the existing works and conclude with a brief discussion of future work.

Channel Sharing Problem Model
We consider n users, i.e., MBANs sharing a unique channel frame by frame, and each frame is identical for all the users. A central authority, for example, one of the MBANs together with other management entities, decides the allocation of each frame to n users. The decision and nomination of the central authority is outside the scope of the paper. In other words, we assume that each user will trust the central authority and is satisfied by the outcome of the auction. Upon detecting a need for channel bandwidth from the application layer of a node, users send requests to the central authority to access the channel for a specific time period. Each request of the user i is characterized by a tuple v i = (a i , d i , l i , w i ). We refer to a i and d i as the request start time and end time respectively, and refer to l i and w i as channel length and bid accordingly. Time is slotted frame by frame. In our design, we require that the maximum channel length of each request is Δ frames. All the requests arrive in the channel sharing window and have a channel length between [1, Δ], i.e., l i 2 [1, Δ] indicating the number of frames required. We have a i d i , 0 < l i (d i − a i ) and 0 w i < 1. Each user can participate in the channel sharing procedure by simply sending its request v i to the central authority. Upon receiving the requests, the central authority allocates each user a subset of the frames so that users are assigned disjoint subsets, during which the communication within that MBAN can take place according to the IEEE 802.15.6 standard for MBANs. In this paper, we assume a simple scenario where there is only one channel available. We leave it as a future work to extend the proposed channel sharing and auction schemes to the case where multiple channels are available.
In this paper, we model the above channel sharing problem as an online auction where each user (bidder) submits requests v i to the auctioneer (central authority) which allocates the underlying channel to users. The online auction procedure is triggered by the arrival of a new request or the departure of the current winner. The online channel sharing scheme needs to make decisions on-the-fly, i.e., without the knowledge of oncoming future requests. As a result, the overall performance of online channel sharing can be largely degraded if users deliberately try to manipulate their requests. We use v = (v 1 , v 2 , . . ., v n ) to denote the requests from n users. The auction based online channel sharing scheme includes a channel allocation rule q and a payment rule p, where q(v) = (q 1 , q 2 , . . ., q n ) represents the channel allocation result, and p(v) = (p 1 , p 2 , . . ., p n ) represents the amount user i needs to pay. Since we consider one channel in this paper, we have P n i a i ¼ 1. We will assume that users have a quasi-linear profit function, so the profit of user i for To evaluate the performance of an online algorithm, we usually compare its performance with that of an offline optimal algorithm. We define the performance of the online channel sharing problem A as the competitive ratio r A ð Þ ¼ min s

AðsÞ
OPTðsÞ , where s represents any possible sequence of requests. OPT(s) is the profit produced by the optimum offline method and AðsÞ is the profit produced by the online channel sharing scheme. Our design goal is to maximize the competitive ratio while maintaining the truthfulness, i.e., malicious users can't improve their profits.
The flexibility of the online auction method makes the channel sharing design procedure difficult and challenging. Selfish and malicious users can utilize this flexibility to manipulate their requests to control the auction outcome so as to gain an unfair advantage over others. In online channel sharing, users can cheat by not only rigging their channel length and their bids for accessing the channel, but also by falsely reporting their start and end times for accessing the channel. A good online channel access design needs to be resistant to these selfish and malicious behaviors. One well-known solution is to make the online auction truthful, i.e., no user can improve its profit by misreporting the request.
It has been shown that it is impossible to achieve a bounded competitive ratio on the efficiency of the truthful scheme without any restriction being imposed upon the types of misreporting [6]. In this paper, we assume that users are selfish; as a result a user will not report channel request that has a start-time earlier than its true start-time and an end-time later than its true end-time. This is a practical and reasonable assumption for MBAN channel sharing problem, because each user will not benefit if it reports the channel usage time to be earlier than it really needs it. In addition, delaying its channel usage will be disadvantageous to the user. Since each user is selfish, it will only misreport its channel request with no earlier starttime and no later end-time.
In this paper, we propose a truthful online channel scheme. If we use v . ., v n ), i.e., the profit of user i is maximized if and only if it submits the request for the channel access truthfully.
The truthfulness requirement makes the online channel sharing problem described above significantly difficult. Users may be selfish and seek to manipulate their channel access requests to control the channel allocation result. Since the channel access request is time based, a selfish user can not only rig its channel length, satisfaction value, but also its start and end time. This makes the design of a truthful payment rule that is resistant to all possible misreports extremely difficult. A truthful mechanism might suffer severe degradation in efficiency in order to balance the tradeoff between the truthfulness and efficiency.

Truthful Channel Sharing Scheme
We propose a truthful channel sharing scheme for the coexistence of multiple MBANs. The truthful channel sharing scheme can enforce users to send their true channel access requests by properly defining the channel allocation and payment rules. We now describe our design in detail. We first look at the scenario where channel access length for each request is unit-length, and then we present the solution for the variable length case. We then design the protocol to support the channel sharing methods based on IEEE 802.15.6 architecture. We derive the following definition of the truthfulness property based on the model given above: represent user i's true request based on the current bandwidth request of its applications. A channel sharing scheme is (a i , d i , l i , w i )-truthful if and only if no user i can improve its profit by submitting a false request v The general design guideline to enforce truthfulness is to make the channel access allocation monotonic and to apply critical-value based pricing by charging each winner the minimum bid required to win the auction [6]. The monotonic allocation makes sure that a user can only win the channel access auction by bidding higher than a threshold bid so as to resist bid cheating. We allow a preemption feature to do a tradeoff between users' profit and the channel efficiency. Now we give a formal definition of monotonic channel allocation: Unit-length Channel Access. In this section, we consider the unit-length case where each time a user requests only one frame, i.e., l i = 1. We can then simplify the channel access request by defining it as v i = (a i , d i , w i ). In the online channel sharing process, each user submits its request for channel accessto the auctioneer whenever it finds that its MBAN requires some bandwidth for access to the communication between its coordinator and the MBAN end devices. This triggers the channel allocation decision process. This decision process commences at the beginning of each superframe wherein new user requests arrive for channel bandwidth, or when a previous winner finishes its usage of the channel. We call this type of a frame a critical frame in this paper.
Driven by the monotonic allocation methodology above, we apply the following channel allocation rule q (HIGHEST BID FIRST) to allocate frames to users: for each critical frame t, we allocate frame t to user i with the pending request that satifies the following requirement: w i = max{w j : a j t d j }, i.e., the highest bid user for the current frame will be served first. We now show that allocation rule q has the monotonicity property as below: Theorem 1 The HIGHEST BID FIRST channel allocation scheme q is monotonic, i.e., For the truthful property to be implementable, the pricing scheme has to be bid independent and monotonic. Otherwise, users can increase their profit by cheating. In online channel auction, a user's price, when winning the auction, depends on other pending users and their bids. Since the set of pending users depends on time, we need to design a pricing scheme that can remove the time dependency and still be monotonic. This means the price charged when a user cheats is no less than that when it reports the same truthfully. Taking the above into account, we define the payment rule p as: In other words, a user will only have to pay the smallest value it could have reported in order to receive an allocation. The above mentioned payment rule p can be equivalently expressed as follows: The payment rule p defined by Eq (2) depends only on a i , d i and v −i so it is value independent. It is also monotonic in that it is non-decreasing in a i and non-increasing in d i . We now show that the HIGHEST BID FIRST allocation rule q combined with the pricing rule in Eq (2) constitutes a truthful channel sharing mechanism as defined in theorem 2 below: Theorem 2 Let q: v n ! {0, 1} n be the HIGHEST BID FIRST channel allocation rule above, and p be the payment rule defined by Eq (1), then the channel sharing scheme (q, p) is truthful.
PROOF. Let's assume the channel sharing scheme (q, p) is not truthful, i.e., there is a user i, a request vector v of true types with v i = (a i , d i , w i ) and a non-truthful request v i , such that the profit of user i if it derives from being truthful is strictly greater than the profit if it submits request truthfully, i.e., q i ðv The pricing scheme defined in Eq (1), can be written as follows: Since we have w 0 i < w i and the monotonicity property of allocation q in THEOREM 1, we have . This contradiction establishes the truthfulness of the mechanism (q, p).
Based on the discussion above, we now propose the overall unit-length truthful channel sharing algorithm κ. Each user i has a trust parameter α which is updated each time a frame is allocated to the user. If the user i is allocated to the current frame t, its trust will be updated by where m À i is user i's money left before the allocation, γ is the aggressive factor which determines how rapidly its trust will decrease as a function of its current money left, and M i is the money that user i is allocated by the central authority. The penalty factor λ is a parameter to decide whether a high bid request can preempt the current low bid request but with unfinished pre-allocated frames. A high penalty factor λ means that the auctioneer will assign a higher priority to the current winner. Algorithm 1 provides the steps to share of channels of unit length in detail.

Algorithm 1 Unit Length Truthful Online Channel Sharing κ
Input: A set of requests v from n users for current frame t; current payment state m i for user i. Output: user k that is allocated to the current frame t 1: k = ; 2: list = SortBidInNonInceasingOrder(n, t); 3: list = DeleteExpiredRequest(n, t); break; 9: end if 10: end for 11: Variable-length Channel Access. In this section, we consider the scenario where users submit requests with a variable number of frames each time. As a result, a request now can be expressed as v i = (a i , d i , l i , w i ), where l i is the number of frames that user i requests. User i will gain value w i if its request is met, i.e., it is allocated at least l i number of frames between (a i , b i ). Note that the number of frames l i do not have to be continues.
The allocation q needs to be monotonic as well, i.e., given the start time and end time of user i, the higher the user i bids, the higher likehood that user i wins. To achieve monotonicity, we apply the same allocation policy as that in the unit length case, i.e., for each frame the auctioneer chooses the qualified user with the highest bid as the winner. It is obvious that if there is no new request coming, the current winner i will win the auction repeatedly until it uses up all of its allocated l i frames and leaves the auction. This means allocation decision occurs only when a winner finishes its channel usage and releases the currently occupied channel, or when a new request arrives.
Since the allocated frames do not have to be contiguous and preemption can increase the overall auction profit, we allow preemption, i.e., if the newly arrived request has a higher bid, we may consider to allocate the current frame to it, so that the overall profit can be improved. This however introduces the risk that the current winner may not be able to obtain its requested frames. This implies that in the end this user will get zero profit although it has been allocated some frames already. Considering this negative effect of preemption, the auctioneer should preempt a winner only if the newly arrived user offers a significantly higher bid.
To prevent unbeneficial preemption, we introduce a bid adjustment procedure to control the preemption frequency by artificially raising the ongoing winner's bid to raise its priority.
For a winning user i with request v i = (a i , d i , l i , w i ) and the current frame t, suppose user i has totally been allocated l À i frames since the start time a i , then we will treat user i's bid at time t as: indicates the current state of allocation. Since we would like to raise the priority of user i when it is close to getting the total number of requested frames, we let λ ! 1, which will determine the auctioneer's preemption aggressiveness. When λ = 1, it becomes a conventional preemption case. By increasing λ, the auctioneer will assign a higher priority to the current winner since it will add more bids to the winner to protect it from being preempted by the newly arrived user. When λ ! 1, w t i ¼ 1, then the winner will never be preempted until its current request is met. In this case, there is no preemption.
We charge the users who have gained partial access to the requested channel as well. The pricing for user i takes place after the allocation, i.e., when t > d i . Let p t i denote the price for winning frame t. We apply the same policy as in the unit length case to price each frame, i.e., for frame t we charge user p t i ðvÞ ¼ minfw . . . ; ða n ; d n ; l n ; w t n Þ Þ. Let S d i denote the set of the frames allocated to user i, l d i be the number of the allocated frames after end time d i . We call p i the minimum per-frame price, then we have  To resist users' selfish tendency of reporting a larger number of frames than what is required, we introduce a request reject scheme, for a newly arrived request then the request will be rejected, where N is the number of users and β i decides how user i's request can be dependant on user i's financial state indicated by m i . For example β i can be calculated as: Now we summarize the channel sharing scheme described above as follows. We call a frame t critical frame if a newly arrived request starts at frame t, or a previous allocation completes at frame t − 1. For a new request, if l i d i Àw i > b i N , it will be rejected. For the current frame t, we calculate user i's frame bid by w t i ¼ w i l i λ φ i , and then apply the HIGHEST BID FIRST allocation policy to allocate the frame to user i with the highest bid w t i that still has enough money to pay for the usage of this frame. For each user i that has been allocated S d i number of frames from the request v i = (a i , d i , l i , w i ), we apply the minimum per-frame price scheme, i.e., p t i ¼ min t2S d i p t i ðvÞ to charge it for each frame allocated, so that the overall price user i has to pay is p t i L i . Algorithm 2 lists the detailed steps of channel sharing for variable length case. It consists of allocation and pricing algorithms as depicted above together with the related protocols.

Algorithm 2 Variable Length Truthful Online Channel Sharing ω
Input: A set of requests v from n users for l i ; current payment state m i for user i. Output: user k that is allocated to the current frame t 1: k = ; 2: list = DeleteExpiredRequest(n, t); 3: for i = HeadOfRequestList(list) do 4: if user i is a new user and l i d i Àw i > b i N then

5:
DeleteRequestFromList(list, i); 6: end if 7: calculate user' s bid for frame t by w i ¼ w t i ¼ w i l i λ φ i ; 8: end for 9: SortBidInNonInceasingOrder(list, t); 10: for i = HeadOfRequestList(list) do 11: p t i ¼ minfw We now prove that the channel sharing scheme for variable length described above is truthful by means of the following theorem: Theorem 3 The channel sharing scheme for the variable length case is (a, d, l, w)-truthful, i.e., no user i can improve its profit by submitting a manipulated request v i > l i . We now show that user i cannot benefit from rigging its bid w i . For frame t, Theorem 1 ensures that there exists a critical value such that user i wins only if it bids no less than this value. The proof of truthfulness is similar to that in the unit length case. We do not discuss the details of the proof.
We now consider the arrival time and end time. The monotonicity of the allocation rule makes sure that if user i wins with request v i > l i . Based on the above, we prove that the channel sharing scheme above is indeed truthful in its implementation.

Truthful On Demand Self Coexistence Protocol
Self coexistence is critical for the safety of MBAN. Driven by the above channel allocation and pricing methods, we now design the Truthful On Demand Self Coexistence(TODEC) protocol in detail based on the framework of IEEE 802.15.6 standard. TODEC is used to achieve efficient and adaptive self coexistence among overlapping IEEE 802.15.6 MBANs. The superframe structure in the self coexistence mode is shown in Fig 1. In addition to the fields of the conventional frame, TODEC defines a self coexistence period (COPE), which consists of coexistence beacon (COB) and coexistence window (COW). During the COB and COW period, no communication within MBAN should happen which is indicated by the conventional beacon (B). The coordinator of the central authority MBAN (CA_MBAN) broadcasts COB to notify other coordinators of MBANs that it works in the self coexistence mode and is ready to take other MBANs requests to share the channel. COB also provides the synchronization information for all MBANs in the channel sharing scenario through CS Preamble, Superframe Number and other CS IE fields. COW period is based on CSMA/CA which allows coordinators of MBANs to send joint requests to CA_MBAN coordinator, the channel request, i.e., v i = (a i , d i , l i , w i ) for MBAN i, and channel grant that tells the channel allocation result. Each MBAN in the coexistence mode transmits its allocated number of frames after decoding the broadcast channel grant message during the COW period. The details of the COB, such as CS Preamble and CS IEs are omitted because of space limitations. Note: For the frame definition, please refer to IEEE 802.15.6 standard [1].
A channel sharing based self coexistence mode is trigged by events such as a node or a coordinator detecting severe interference based on the received SINR from the medium as shown in Fig 2. In order to participate in the online channel access auction described in the previous sections, each MBAN (user) needs to get synchronized to the auctioneer, i.e., CA_MBAN. When a MBAN decides to enter into the self coexistence mode, its coordinator firstly searches for nearby CA_MBAN by decoding COB. During the COW period, the coordinator can send a CS joint message to the CA_MBAN to join the channel sharing process. Requests will then be sent to the auctioneer during the COW from the coordinator of MBAN to that of CA_MBAN based on CSMA/CA media access scheme. CA_MBAN will run the truthful channel allocation method proposed above to allow multiple MBANs to share the underlying channel on a frame by frame basis. The CA_MBAN will broadcast the channel access grants to users as part of the COB or in the grant message during COW period. This message indicates which frame has been allocated to which user. Fig 2 shows the above process. There are four types of messages needed to support the channel sharing process: Channel Sharing Joint (CS Joint), Channel Sharing grant (CS Grant), Channel Request and Grant as shown in Fig 2. CS Joint message is transmitted by the MBAN coordinator to CA_MBAN coordinator to initiate the channel sharing process. CS Grant contains the jointing request acknowledgement information. Grant message contains the confirmation of the channel allocation result. Based on this framework, more flexible schemes may be added, for example, a MBAN can be granted periodical frames and it can ask for more frames or cancel previously allocated frames. The details are omitted here because of space limitations.
The channel allocation decision takes place after the COW period where users submit requests to the auctioneer. The allocation decision algorithm will be trigged only if there is at least one new request arrival or a winner finishes its channel usage and releases the channel. When joining the channel sharing process, user i will be assigned a trust parameter by the auctioneer. The auctioneer does this based on the overall QoS requirements of the concerned MBAN and its explanation is beyond the scope of this paper. Each time the allocation algorithm first deletes the expired requests according to the timing information, i.e., a i and d i , it will apply the HIGHEST BID FIRST allocation policy to allocate the next frame to user i with the highest bid that still has a high trust to pay for the usage of the this frame, i.e., m i − p i ! 0.

Complexity Analysis
We now analyze time and space complexity of our proposed online channel sharing algorithm. As is known, time complexity is a function describing the amount of time an algorithm takes while space complexity describes the amount of memory (space) an algorithm takes, in terms of the amount of inputs to the algorithm. In our algorithm, the amount of inputs is the number of users n for the unit length channel sharing scheme and the number of users n and the number of frames Δ each user requests for the variable length channel sharing scheme.
The main component of the unit length channel sharing scheme, as described in Algorithm 1, is to find the highest bid user and the second highest bid user. The algorithm consists of one sorting algorithm and two for loops. For time complexity analysis of the algorithm, a comparison sorting algorithm requires linearithmic time O(n log n), and the number of repeated times Truthful Channel Sharing for Medical Body Area Networks of each loop is O(n). In the first for loop, a variable, v −i , in the min{.} function has (n − 1) elements; then, the complexity of this min{.} function is O(n). So, the complexity of this loop is O(n 2 ). The second loop's complexity is O(n). Therefore, the time complexity of Algorithm 1 is O(n log n) + O(n 2 ) + O(n) = O(n 2 ). For space complexity, the algorithm needs space to save the request list which has n elements. Other parts of the algorithm, such as the sorting algorithm and for loops, perform operations on the request list. For each element in the request list, the memory consumed by these operations is constant. The memory consumption increases when there are more users. Hence, its space complexity is linear O(n).
Similarly complexity analysis on the variable length channel sharing scheme, as described in Algorithm 2, is presented as below. Algorithm 2 has one sorting algorithm as well as three for loops. For time complexity analysis, a comparison sorting algorithm is O(n log n) while each loop repeats O(n) times. The complexity of the first and the third loop is O(n) and O(Δn), respectively, where Δ is the number of requested frames. However, the complexity of the second loop is O(n 2 ) because the min{.} function in the loop has operations of O(n). Therefore, the time complexity of Algorithm 2 is O(n log n) + O(Δn) + O(n 2 ) = O(n 2 ). For space complexity, the main part of memory is for saving the request list with n elements. Likewise, its space complexity is O(n).
In the next section, we conduct simulations to study the profit trends. In terms of the overall profit performance, we compare it against the earliest deadline first (EDF) and Weighted Fair Queue (WFQ) algorithms.

Results
In this section, we discuss the result of extensive simulations to study the performance of our algorithm ω, specifically, in terms of the competitive ratio and network profit in typical settings of MBANs. In our simulations, we generate n MBANs that are randomly placed in a 4 × 4 square meter area and the coverage of each MBAN is 5 meters. We assume any transmission within 4 meters will conflict with each other if the transmitters request the same channel and the same time frames. We generate random channel requests with random bid values and time requirements for truthful MBANs. For a request (a, d, l, w), bid w is uniformly distributed in [0, π], the time gap between two successive requests is uniformly distributed in [1, δ] and duration d − a is uniformly distributed in [l, φ]. The duration is uniformly distributed in [1, ρ], where selfish users can manipulate π, δ, φ and ρ. We take the total service time as 10000 time frames which is large enough compared to the time requirements of each request.
The average load of an MBAN in our simulation is (K.J)/(T.n), where K is the total number of requests, J is the average duration of a request and n is the total number of MBANs, thus we have J = ρ/2 and T = 10000 frames in our setting. Considering the typical applications of MBANs, we expect the number of MBANs in a unit square meter area to be around 3 so that the total number of MBANs in a 4 × 4 square meter area is 50.

Competitive Ratio of Algorithm ω
When calculating the competitive radio of algorithm ω, various parameters, such as penalty factor λ and aggressive factor γ may affect performnce. To see how these parameters affect performance, we first fix penalty factor λ and study the competitive ratios of ω while aggressive factor γ varies. Then we fix the aggressive factor γ and study the competitive ratios of ω while penalty factor λ changes. Fig 3(a) shows the competitive ratios of ω for various algorithms as a function of penalty factor λ while aggressive factor γ is fixed . Fig 3(b) shows the competitive ratios of algorithm ω for various algorithms as a function of aggressive factor γ while penalty factor λ is fixed. By configuring π, δ, φ and ρ properly, we can have a different total number of requests. We run 3 cases: 1000 requests, 5000 requests and 10,000 requests. In most cases, algorithm ω makes a total profit that is more than 85% of the optimum offline method.
The competitive ratio decreases when penalty factor λ increases. This is because penalty factor λ is a parameter to decide whether a high bid request can preempt the current low bid request but with unfinished pre-allocated frames. A high penalty factor λ means that the auctioneer will assign a higher priority to the current winner since it will add more bids to the winner to protect it from being preempted by the newly arrived user, and as a result, the overall profit decreases. The competitive ratio decreases as aggressive factor γ increases. This is because aggressive factor γ is a parameter that affects how a user's trust parameter will be updated: a high γ means a user will be punished severely and may lose trust completely, and as a result, it may miss the chance to send its bid because of it being suspended.
The total number of requests also affects the performance of ω. We observe that the competitive ratio decreases when the total number of requests increases. This is because ω is conservative: the weak preemption in ω just tries to satisfy the theoretical bound which may potentially lose some profit. Thus, when there are more requests, the optimal offline algorithm will make a higher profit but the profit made by ω will not increase so much.

Truthfulness of Algorithm ω
Truthfulness is the most important characteristic of algorithm ω. To study the truthfulness, we introduce selfish users who manipulate their requests by controlling the π, δ, φ and ρ parameters to increase their priority. We compare algorithm ω to two classic scheduling algorithms based on the earliest deadline first (EDF) and weighted fair queuing (WFQ). EDF always serves user k with the earliest deadline, i.e., k ¼ arg min  Truthful Channel Sharing for Medical Body Area Networks coming, WFQ will terminate the current assignment with a smaller bid value if necessary. When a request with an earlier deadline is coming, EDF will terminate the current assignment with a smaller bid value if necessary. The competitive ratio and fairness of these two algorithms could be theoretically arbitrarily bad. We conduct simulations to compare them with algorithm ω which is theoretically truthful.
In Fig 4(a) and 4(b), we plot the channel allocation result of algorithms ω, EDF and WFQ to compare their performance. In Fig 5(a), we define users 2, 8, 10, 13 and 17 as selfish users. Users 2 and 8 manipulate their requests by raising the bids of their requests. Users 10, 13 and 17 decrease the duration of the requests to gain channel resources. EDF and WFQ cannot detect the selfish behaviors of users, so the selfish users benefit from manipulating their requests. Our algorithm ω, however, maintains the trust parameter of each user and can detect selfish users and punish them when users' trust is low. As a result, selfish users 2, 8, 10, 13 and 17 do not obtain extra channel resources but on the contrary obtained lower channel resources than the other truthful users as shown in Fig 6(a). Fig 6(b) shows how penalty factor λ will affect the results.
In Fig 5(a) and 5(b), we plot the overall user profit. Our proposed algorithm ω has a high and constant sum of profit when the number of selfish users increases. This is because the selfish users will be detected and some of their requests will be ignored when their trusts are low. The EDF and the WFQ however do not have a trust monitoring scheme so that some selfish users can gain more resources by selfishly manipulating their channel requests, and as a result other honest users will lose channel resources and their overall utilities decrease.
In Fig 6, we plot the users' trust. We show how the trust parameter of different type of users, i. e,. truthful and selfish users, will behave as a function of time, i.e., as a function of the index of the frame. In Fig 6, we manipulate users' requests by controlling π, δ, φ and ρ, so that users 1 and 2 are selfish users and user 1 is more offensive than user 2. User 1 basically decreases duration   Truthful Channel Sharing for Medical Body Area Networks and increases bids dramatically in order to have a higher priority. User 2 however employs a tryand-stop policy, i.e., each time it tries to be selfish, it will monitor if it is benefiting. If it believes it is suffering, it will try to be truthful. As a result, from Fig 6, we can see User 1's trust is almost zero all the time, i.e., it has a bad reputation and will not be allocated any resource. User 2 is randomly trying to manipulate its request parameters and its trust is quite random as well. The truthful user has a good reputation and has a trust value of more than 0.8 in this setting.

Discussion
In this paper, we have studied online channel sharing problem for medical body area networks (MBANs) where a set of MBANs will bid for leasing a channel for a certain time duration in different locations. We model the channel sharing problem as an online auction for channel access. Our proposed scheme combines a monotonic channel allocation rule and a payment mechanism. We have proposed truthful channel sharing methods for both the unit length and variable length cases. Based on the methods, we designed a flexible and practical self coexistence protocol based on IEEE 802.15.6 standard for MBANs. For a number of variants, we have experimentally shown that the competitive ratios of our methods are within small constant factors of the optimum. Our algorithm results in a profit that is almost optimum and can maintain fairness by detecting and punishing selfish MBANs. Our extensive simulation results show that our scheme can achieve a total profit that is close to that of the offline optimum method in the typical MBAN settings. Truthfulness of our scheme helps to achieve fair channel sharing when there are selfish users, as a result it can achieve a higher total profit than that of other algorithms.
We now discuss related work on allocating channels and highlight similarities as well differences between our work and the existing works. Efficient and truthful mechanisms for various dynamic spectrum assignment problems were proposed [7,8], as well as double spectrum auctions with provable performance [9,10]. All these proposals are based on offline models. For the online models, spectrum allocation and truthful schemes in situations where secondary users could bid arbitrarily were proposed [11,12].
In our work, we use an online model which is similar to the online job scheduling problems [13] to solve channel sharing among MBANs. Various online scheduling problems focus on optimizing different objective functions. The most common objective function is makespan, which is the length of the schedule. Suppose that we are given m identical machines, jobs arrive one by one and no preemption is allowed for this scenario. A number of results have been reported in the literature to improve the upper bounds [6,10,14] and lower bounds [15]. Closing the gap between the best lower bound [15] and the upper bound [6] is an open problem. The case where preemption is allowed without penalty has also been investigated [16].
When jobs have deadlines, however, it is usually impossible to finish all the jobs. Thus, another model aims to maximize the profit or the number of completed jobs. There are different variants: preemption-restart, preemption-resume, and preemption-discard. An algorithm was proposed [17], matching the lower bound given in [2]. An online model of maximizing the profit of finished jobs was studied [18] where there is some relationship between the weight and length of a job. A 4-competitive algorithm was proposed for the tight deadline case, and a matching lower bound was given [7]. In this algorithm, it is assumed that preemption is allowed while no penalties will be charged. It was proven that a suitable choice of channel sharing and incentive schemes can reduce collusion incentives among participating nodes [12]. A channel selection algorithm was proposed that optimally selects a channel by minimizing queuing delay [19]. A channel allocation scheme was combined with the routing framework with a view to maximizing the profit in the network [20]. The scheme proposed is decentralized and is restricted to cognitive mesh topologies. A 2 way bargaining scheme was proposed to force selfish SUs to cooperate with PUs so as to guarantee the PU's QoS requirement [21]. The scheme goes further by offering a mechanism to coordinate the available spectrum among SUs. However, none of the studies discussed above consider the 'truthfulness' issue in channel sharing.
A model for spectrum sharing based on truthful mechanisms and virtual currency was proposed [22]. The model is dynamic in which SUs access opportunistically those channels not temporarily used by PUs. It considers a particular case in which every SU estimates capacity of a free channel according to its local information, and sends the valuation (i.e., estimated capacity) to the centralized spectrum manager. This model is somewhat similar to our model, however, the proposed credit based mechanism restricts truthfulness guarantees to a single run where a 'run' represents a spectrum usage opportunity. Several recent studies [23][24][25][26] investigated various mechanisms of evolutionary game theory to explain the cooperation among selfish individuals, e.g. the prisoner's dilemma game model and the public goods game model.
A power control algorithm that uses the Signal to interference ratio (SIR) as a cost function has been proposed [27]. The proposed algorithm achieves optimal exploitation of the spectrum with least amount on interference. It achieves fairness by enabling all users to meet their SIR constraints without the need to transmit at high power levels. However, this scheme lacks a pricing scheme to manage interference. A scheme which is suitable for 802.11 wireless LANs that operate in unsupervised contention mode was proposed [28]. Upon winning a channel, this scheme enables the winning node to dynamically adjust its transmission opportunity (in which a node can transmit multiple frames without releasing the channel) leading to better bandwidth utilization and QoS provisioning. This scheme is based on the principles of game theory. Although this scheme improves overall network performance, this scheme does not explain how to bid for a channel successfully.
Truthful spectrum bidding was proposed based on the principles of auction theory [29]. The proposal presents an online version of truthful double auctions for spectrum allocation where the requests arrive in an online fashion. The limitation of this scheme is that it does not facilitate pre-empting existing spectrum usage. A neighbor centric approach for coordinating spectrum sharing among secondary users was proposed [30]. Unlike our approach, wherein all bidders are competing against each other, this approach restricts competing bidders (SUs) of a node to be its immediate neighbors. By considering only the neighbors, it allows for spatial reuse since if a primary user (PU) is using a channel then this channel becomes unavailable for a SU that happens to be its neighbor. Other bidders not in the immediate vicinity of this PU remain unaffected. Extending this concept a bit further, the number of channels won by a bidder in this scheme is a function of the cumulative demand of this bidding node's conflicting neighbors. If there are a several competing bidders for a set of channels then this becomes a case of 'excessive demand' and the auction process proceeds to subsequent rounds with price being incremented at each round. Furthermore, each channel that is bid has some sort of a preference number. The approach makes available for selection only that channel that has the least preference number of the winning bidder's neighbors, thereby reducing the overall number of bidders. However, unlike our approach, it does not examine specific issues such as the overlapping channel allocation scenario and allocating channels of variable length.
In our future work, we will be dealing with the selection of the central authority without the infrastructure, and the interference from other legacy wireless systems working at the same frequency as MBANs. Our model can also be potentially used in many other application areas, where dynamic spectrum sharing is required, such as cognitive radio networks, wireless industrial control systems, TV white space spectrum management, bandwidth allocation management for cellular phone and vehicular networks and other futuristic mobile broadband systems.