A Wireless TDMA-Based MAC for Distributed Real-Time Applications

Embed Size (px)

DESCRIPTION

Many existing applications rely in wireless communication,including a subset of the real-time distributed systems, wheremobile/autonomous nodes interact within certain time lim-its to reach their goal. For the wireless communication net-work to provide a timely delivery service, a fundamentalcomponent is a deterministic Medium-Access-Control (MAC)protocol. /*While other works have partially tackled this is-sue, none of them considered nodes deployed in a completelyad-hoc manner.*/ To solve this problem, the present paperintroduces a TDMA-based MAC with slot assignment withcompetition between nodes, specially designed to work inad-hoc network organized in clusters. Our proposal may beused for providing bounded communication in both insideand outside the clusters. In this paper the proposed MAC ispresented, including an analytical analysis of the expectedperformance of the protocol. Moreover, experimental resultsobtained by simulation are also shown.

Citation preview

  • A Wireless Hybrid Contention/TDMA-based MAC forReal-Time Mobile Applications

    ABSTRACTWireless communication has been successfully used in a va-riety of mobile applications, including those with real-timerequirements. In such systems, timing guarantees are nor-mally obtained by using a TDMA-based Medium AccessControl (MAC) protocol, relying in a coordinator node incharge of time-slots allocation. However, certain applica-tions cannot make use of such coordinator because it simplydoes not exist, normally due to restrictions in the operationenvironment. To solve this problem we present in this papera MAC protocol that operates without a central coordinatorand also without any global information, with no previousassignments of roles to nodes nor resource reservations. Ourproposed Hybrid Contention/TDMA-based (HCT) MAC isspecially designed to work with ad-hoc wireless networks or-ganized in clusters. The HCTMAC is designed for providingtimely bounded communication both inside and outside theclusters. This paper presents a detailed description of HCT,including an analytical analysis of the expected performanceof the protocol. Moreover, experimental results obtained bysimulation are also shown.

    Categories and Subject DescriptorsC.2.5 [Computer Systems Organization]: Computer-Communication NetworksLocal and Wide Area Networks ;C.3 [Computer Systems Organization]: Special Pur-pose and Application-Based SystemsReal-time and embed-ded systems

    KeywordsWireless communication networks, real-time communication,medium access control, mobile systems

    1. INTRODUCTIONCurrently there is an increasing interest on applications com-posed by autonomous and cooperative mobile devices, suchas ad-hoc car-to-car systems [2]. These applications areformed by a variable number of mobile nodes with dynamic

    topology, which interact through a wireless communicationnetwork to exchange control, status, and possibly streammessages. Most of these messages have real-time and qualityof service (QoS) requirements, such as time limits to delivermessages, temporal validity of data, and synchronization re-quirements (delay variation limits) [7]. Since they work inan unknown and possibly inhospit environment, no infras-tructure exists to support connectivity among the nodes,therefore communications must rely on an ad-hoc wirelessnetwork. In such scenarios it is a common approach to clus-terize the nodes, allowing to hierarchize the network [1].Moreover, mobility of the nodes establish and disrupt linksdynamically, changing the topology of the network alongtime, what demands frequent updates of routes. Unpre-dictable or unacceptable long delays for transmitting mes-sages can happen in this case, because lost messages mustbe retransmitted or discarded.

    The medium access control (MAC) protocol is the most basiclayer in a communication infrastructure, being responsible toreceive and transmit messages through the shared medium.All the communication services in the infrastructure, imple-mented in the upper layers, are influenced by the MAC withrespect to the accomplishment of their timing requirements.As pointed by [3], to enable the correct timing behavior ofsuch communication services, the MAC must transmit mes-sages within predictable time intervals. Therefore, a typicalsolution is the use o a TDMA-based MAC. In such proto-col time is divided in slots, which are partitioned amongthe interested nodes according to a given criteria. Here nocollisions occur, since each node transmits only within its al-located slots. It is desirable that each node acquires enoughslots to satisfy its bandwidth needs. This class of protocol iswell known, and a lot of variants can be found in the litera-ture [5] [4]. In existing implementations, it is common thata certain node coordinate the slot allocations.

    This paper presents the Hybrid Contention/TDMA-based(HCT) MAC for providing a time bounded medium accesscontrol to mobile nodes that communicate through an ad-hoc wireless network and that are self-organized in clusters.The number of nodes, their geographical distribution, andtheir identities must not impose restrictions to the protocol,due to the fact that the nodes do not know their neigh-bors, which can vary over time. Our proposal assumes asbasic requirement that the assignment of slots must be donein a global manner, in a way that a consensus must bereached among the nodes. Therefore a competition strat-

  • egy is adopted, without the need of a global coordinator norscheduler, in such a way that time-slots are iteratively allo-cated by the nodes. An analytical evaluation is presented inthe paper to demonstrate the expected performance of thisstrategy, under some pre-defined conditions.

    The allocation of time-slots by means of competition be-tween nodes is a strategy present in other protocols, for in-stance in PRMA, D-TDMA, RAMA, and DRMA [6]. Never-theless, these protocols were proposed to conciliate mainlydata and voice traffic, where messages are sent in bursts,without taking into account the recurrence of transmissions.These conditions are not suited for the periodic nature of thecontrol messages exchanged by autonomous mobile nodes.

    The reminder of this paper is structured as follows: section2 introduces the HCT protocol, detailing how to divide themedium access time among nodes. Section 3 performs ananalytical analysis of the expected time for slot assignmentand demonstrates the feasibility of the method. Finally,section 4 concludes the paper and points out some futuredirections for our work.

    2. DISTRIBUTED SLOT ASSIGNMENT BYCOMPETITION

    A TDMA-based MAC protocol segments time in so-calledtime-slots, being further responsible to assign one or moretime-slots to each node. A critical issue of this kind of MACis how to assign these time-slots to interested nodes, spe-cially if there is no global coordinator to decide which nodesuse which slots. In this case, the nodes must reach a consen-sus about their allocations. This implies a conflict resolutionstrategy to allocate time-slots, which must not interfere thealready allocated ones. Once this is done, the network entersa steady state, where each node uses its slots to transmit.

    As an example of distributed MAC without coordinator,CSMA/CA provides transmission of frames in a probabilis-tic manner. There is no time reservation nor time segmen-tation. Every time a node wants to transmit it waits themedium to be idle, then delays for a random time (back-off) and, if the medium is still idle, it transmits, otherwiseit repeats this procedure. Thus, a node must always sufferrandom delays to transmit each frame, because this MACaims to provide access to the medium with best effort, andtries to avoid collisions by means of random delays. Clearlyit is not predictable, and thus would hardly be efficient toimplement a time bounded transmission service. However,as a positive characteristic, it was designed for operationon networks with unknown number of nodes, and unknowntopology. This medium access by competition concept is ex-ploited for the design of the proposed HCT MAC.

    To solve the problem of slot assignment our proposal usesrandom selections of slots: if a node knows which slots areidle, it can try to use some of them, chosen randomly, andafterwards verifies if any collision has occurred. For eachchosen slot, if there was no collision, the node may assumethat the slot is allocated. For the remaining slots, it canrepeat the procedure until all the needed slots are allocatedor, in the worst case, no slots are available anymore. Thisassignment algorithm works in a distributed manner, andhas a random stage. It aims to assign the time slots itera-

    Figure 1: A round composed by R superframes

    Figure 2: Structure of a single superframe

    tively until the allocation stabilizes -, i.e. the nodes allocateall needed slots.

    We assume the wireless network is organized in clusters, be-cause this simplifies the task of discovery of idle slots andthe feedback about successful transmissions. The proposedMAC works in two levels, as follows: i) transmissions in-side a cluster, and ii) transmissions among clusters. TheMAC for case i) relies on the cluster-head node, both toreport idle slots to member nodes and to acknowledge thesuccessful transmissions within time slots. For case ii), thesefunctions must rely on the intersection of informations fromthe neighbor clusters. In an extreme case, if there is onlyone cluster-head in the range of all other nodes - i.e. a singlecell, the protocol resumes to case i). In the opposite extremecase, if all nodes are cluster-heads, the protocol resumes tocase ii), and consequently there are no benefits of the clusterorganization.

    The HCT MAC contains a set of key parameters, whichare: i) time-slot duration (parameter tslot), which indicatesthe interval of time that a node can use to transmit, ii)superframe size (parameter n), which indicates the num-ber of contained time-slots within a cluster, and iii) roundlength (parameter R), given by the number of contained su-perframes. The round is the base period for transmissions,thus it works like a time unit for the protocol. It is an inter-val of time that is common to all clusters, and is divided insuperframes, as seen in figure 1, which are assigned to theclusters. Superframes are all equal in size, what means thatthey contain the same number of time slots; the structureof a superframe is shown in figure 2.

    2.1 Transmissions inside a clusterWe assume that each cluster has a special node called cluster-head. It is the single node allowed to transmit and receivemessages outside the cluster. In the proposed MAC, it hasthe important role to help the allocation of slots, to synchro-nize the other nodes transmissions, and to put the wholecluster in transmission or waiting (silence) mode.

    The cluster remains in silence until its cluster-head startsa superframe. The superframe is delimited by two specialframes sent by the cluster-head, as shown in figure 2: a startbeacon (SB), and a finish beacon (FB). The start beaconcontains a map with the allocation states of the time slotsof the superframe, and thus reports which slots are idle. Thefinish beacon contains an acknowledge map to report whichtime-slots contained valid frames, according to the cluster-

  • head.

    A node that needs to allocate a time-slot must wait for thestart beacon to become aware of which slots are idle. After-wards, it chooses randomly a slot among the available ones,and uses it to transmit a frame. Then it waits for the finishbeacon and looks in the acknowledge map if the cluster-headrecognized a valid transmission in that slot. If this holds,it is because no other node tried to use it, meaning it allo-cated the time-slot. Otherwise there would be a collision,and no valid frame would be seen by the cluster-head. If thecluster-head did not acknowledge that time-slot, the nodemust repeat the procedure in the next superframe. The re-lease of a time-slot can be performed explicitly, when itsowner node sends a control frame within it, or implicitly,when the cluster-head detects it has not being used for acertain number of rounds. In both cases, as soon as thetime-slot is released, the cluster-head reports it as idle inthe next round.

    Clock synchronization is needed to identify time-slots withacceptable precision. Therefore, the start of a superframeis used by the nodes to synchronize their clocks. Actually,the reception of the SB frame resets the TDMA clock in anode, assuring that the related timer will fire at the correcttimes. The uncertainty t on the local clock of each node isgiven by the delay for reception of the SB frame (D

    c), plus its

    processing time (tproc) and the local clock resolution (ttick).This can be seen in equation 1 (considering that the nodesare homogeneous, thus tproc and ttick are the same for everynode):

    t =D

    c+ tproc + ttick (1)

    D: cluster radiusc: speed of lighttproc: processing time at reception

    Therefore, the duration of a time slot (tslot) must includethis maximum uncertainty, expressed in equation 1:

    tslot =LmaxB

    + tmax (2)

    Lmax: maximum frame legthB: transmission rate

    As a consequence, the bandwidth utilization depends on thenumber of time slots of a superframe (parameter n of theprotocol), the maximum frame length, and the clock uncer-tainty, as shown in equation 3. As it can be seen, increasingthe clock uncertainty (what can happen if, for instance, thecluster radius increases) decreases the utilization, and in-creasing the frame length increases the utilization. Increas-ing the parameter n potentially decreases the utilization, be-cause it becomes more probable that a superframe may benot fully used (i.e. internal fragmentation of superframes).

    U =k.Lmax

    B

    (n+ 2).tslot=

    k

    n+ 2.

    1

    1 + BLmax

    .t(3)

    k: time slots used by the nodesn: number of time slots in a superframe

    2.2 Transmissions among clustersAs reported in the previous subsection, the MAC for trans-missions inside the cluster relies on the cluster-head both toreport idle slots to member stations and to acknowledge thesuccessful allocation of time-slots. For this reason, the pre-vious analysis ignored possible neighbor clusters. However,when there is more than one cluster in the range of trans-missions, what could be the case in the transmissions amongclusters, the problem of interference becomes eminent. Twoclusters can not transmit at the same time if they are reach-able from each other, or if there is a third cluster in reachof both of them. But if transmissions from two clusters donot collide, there is no reason to forbid their simultaneoustransmissions.

    In this scenario, the MAC for transmissions among clustersis mainly responsible for allocating superframes to clusters inan efficient manner. There are some key details that differsit from the intra-cluster case, as follows: i) the clock syn-chronization is expected to be rougher; and ii) there is nosingle cluster-head to acknowledge transmissions. Regard-ing issue i), the time frames allocated to clusters (calledsuperframes in the protocol) are significantly bigger thanthe time-slots allocated to nodes. Therefore the delimita-tion of these superframes can tolerate a longer jitter causedby a rougher clock synchronization (parameter ttick). Onthe other hand, issue ii) states that each cluster must dis-cover by himself which are the idle superframes (as it needsto do an allocation), and if its neighbors are aware of its su-perframe allocation. This is also a kind of consensus prob-lem, because the cluster relies on its neighbors to detect idlesupreframes and also to acknowledge its allocation. Never-theless, the main problem here is to find out the intersectionof the views from the neighbors clusters, working as follows.When an idle superframe is needed, the cluster looks forsuperframes reported to be idle by all neighbors, along oneround. Afterwards it tries to allocate an idle superframeby sending a message and then waiting for the acknowledg-ments from all neighbors, which must be received within oneround. Information about idle superframes and acknowledg-ments are piggybacked in the beacons of superframes. Thisprotocol forbids that two potentially interfering clusters allo-cate the same superframes but, on the other hand, it allowstwo non-interfering clusters to share superframes, enhancingtheir performance.

    3. PERFORMANCE EVALUATIONGiven that both time-slot and superframe allocation are per-formed by an algorithm with a random stage, it is necessaryto investigate the convergence of this allocation procedure.Therefore, we derived a formulation that allows to calcu-late the probability distribution of the number of roundsnecessary for an allocation to stabilize. To calculate thisdistribution, one must know the probability of each numberof time slots to be allocated in one round. If n is the numberof idle slots, and k is the number of needed slots, one mustdetermine the probability of j slots being allocated in oneround, given by Pj(n, k),j [0, k].

    To calculate these probabilities, firstly it is needed a com-binatorial analysis of the n idle time slots and k slots toallocate. Equation 4 gives the number Nj(n, k) of possiblecombinations of k independent selections inside the set of n

  • idle slots, with j distinct ones, corresponding to j slots thatare successfully used (that means, do not suffer collisions).

    Nj(n, k) =P (k, j)

    j!(k j)! .P (n, j).A(nj, kj)kX

    i=j+1

    i

    j

    !.Ni(n, k)

    (4)

    with: P (n, k) = n!(nk)!

    A(n, k) = nk

    Equation 4 is suitable for a scenario where k nodes try eachto allocate one slot. Once collisions are possible betweenany pair of slot selections, this equation represents the worstcase scenario for allocating k slots. However, if a node triesto allocate more than one slot than the total number ofpossible collisions decreases. But even in such situation, theiterations trend to converge to the scenario where each nodetries to allocate only one slot. This happens due to thepartial allocations of the required slots for each node duringthe iterations (e.g. a node needs three slots, but a collisionoccurs for one of them, then in the next round it will try toallocate only one slot).

    The probabilities for allocating j slots in one round can becalculated according to equation 5.

    Pj(n, k) =Nj(n, k)

    A(n, k),j [0, k] (5)

    To obtain the probabilities of the number of rounds to al-locate all k slots, all possible sequences of results must beenumerated. Each sequence represents the results of consec-utive rounds, until all k slots are allocated. Let Sm(n, k) bea sequence of results, obtained by successive rounds whennodes try to allocate k slots, defined by equation 6.

    Sm(n, k) = {Pji(ni, ki)} (6)

    (i, ji) N2 ji [0, ki]ki = ki1 ji1 ki > 0ni = ni1 ji1n0 = n, k0 = k

    The set S of all possible sequences Sm can de stated as:

    S = {Sm(n, k)/m N Sr 6= Ss,(r, s) N2 r 6= s} (7)

    Therefore, the probability PRj of k slots being allocated inj rounds is:

    PRj =X

    SmQj

    YpSm

    pQj = {Sm S/Sm = j} (8)

    Figure 3 shows the results on applying equation 4 to obtainthe number of rounds necessary to allocate all the slots onfour superframes sizes, ranging from 10 to 512 slots. Animportant property shown in the plot is the relation betweenthe progression of the time taken to allocate the slots andthe size of the superframe. It is clear that this time-increaseprogress slower than the size of the superframe. This ismore evident in figure 4, which plots the number of rounds

    Figure 3: Accumulated probabilities for number ofrounds to stabilize the allocation

    Figure 4: Number of rounds to stabilize the alloca-tion, with confidence degree of 99%

    Figure 5: Accumulated probabilities for number ofrounds to allocate k-1 slots under overload

  • for complete allocation of the superframe, with confidencedegree of 99%.

    Using the predicted results for the number of rounds to al-locate a certain number of time slots or superframes, it ispossible to predict also how responsive is the protocol totopology changes. A new topology raises when the set ofmembers of a cluster changes, or when the neighborhood ofa cluster varies. In both cases, a modification in the alloca-tion of time-slots or superframes is needed. The time takento modify the allocation (i.e., to adapt to a new topology)can be calculated as the number of rounds it will take, giventhe number k of time slots or superframes to allocate, and n(remaining available slots or superframes). The integrationof equation 8 can yield this maximum time to adaptation,with a given confidence.

    Equations 6 through 8 can also be used during overloadscenarios, i.e. when the required number of time slots isgreater than the available ones (i.e: k > n). An impor-tant information is how long it takes, with a defined confi-dence, to allocate part of the required time-slots. In figure5, four plots illustrate the change of the accumulated prob-ability when overload becomes more intense, for n = 32and k {32, 40, 48, 64}. The plots show that the allocationtakes more time to reach the maximum possible number ofslots (in this case, 31 slots), getting worse as the overloadincreases. But, it is important to highlight that in the samesituation, a smaller number of slots k < k is allocated faster,what can be calculated if k0 = k

    in equation 6. This meansthat even under a significant overload, a reasonable numberof slots can be allocated in acceptable time.

    4. CONCLUSIONS AND FUTURE WORKThis paper presented the Hybrid Contention/TDMA-based(HCT) MAC protocol, which is able to transmit messagesin bounded time for autonomous mobile nodes communicat-ing through an ad-hoc wireless network organized in clus-ters, and deals with the problem of exclusive access to themedium inside the cluster and among clusters. The proto-col provides a mechanism for time intervals reservations tonodes and clusters. It is assumed that the nodes do notnecessarily know their neighbors, and that the topology canchange along the time. In this scenario, it is not possible tobuild a schedule table a priori, thus the protocol constructsit at run-time by means of competition: nodes inside a clus-ter must compete for time-slots, and clusters must competefor superframes (sets of contigual time-slots). The competi-tion continues until all nodes allocate the needed time-slots,or all clusters allocate the needed superframes. In otherwords, the protocol has a contention stage, when a modifi-cation in the reservation of time intervals to nodes or clustersis needed, and a TDMA stage, when nodes and clusters usethe allocated time intervals. The discovery of idle time-slotsor superframes, and the notification of transmission errors,rely on the cluster-heads.

    An analytical evaluation was performed to demonstrate thefeasibility of the time-slot allocation procedure. It was shownthat the time to allocate all the required time-slots has anacceptable upper limit. This result applies to a worst casescenario, where all nodes try to allocate time-slots simul-taneously, and each transmission may collide with all the

    others. If nodes ingress the clusters in a smooth manner,instead of simultaneously, the time-slot allocation should beconsiderably faster. These results applies also to the alloca-tion of superframes by clusters, because the allocation pro-cedure works in the same manner. In this case, the protocolallows two non-interfering clusters to share superframes.

    An important feature of HCT is that it assumes no globalinformation, except the parameters n and R. Both impacton the performance of the protocol, because R defines theperiod of superframes cycles and, therefore, the minimumperiod of messages. Parameter n defines the size of su-perframes, thus imposing a minimum time-interval that acluster must allocate, and impacting on the bandwidth uti-lization.

    Several simulations were also performed to test the HCT op-eration, with obtained results confirming the analytical anal-ysis presented in the paper. As a proof of concept, our groupis currently working on an implementation of the protocol.This implementation relies on RF modems as the physicallayer, and provides all the needed MAC services like fram-ing, synchronization, and error detection, plus the specificservices of the protocol. These services are the cluster-heador node operation modes, the delimitation of time-slots andsuperframes, and the allocation and release of time-slots andsuperframes.

    5. REFERENCES[1] I. e. a. Akyldiz. Wireless mesh networks: a survey.

    Computer Networks, 47(4):445487, March 2005.

    [2] W. Chen and S. Cai. Ad hoc peer-to-peer networkarchitecture for vehicle safety communications.Communications Magazine, IEEE, 43(4):100107, 2005.

    [3] R. Cunningham and V. Cahill. Time bounded mediumaccess control for ad hoc networks. In POMC 02:Proceedings of the second ACM international workshopon Principles of mobile computing, pages 18, NewYork, NY, USA, 2002. ACM Press.

    [4] B. Huber and W. Elmenreich. Wireless time-triggeredreal-time communication. In Proceedings of the 2ndWorkshop on Intelligent Solutions in EmbeddedSystems, Graz, Austria, Jun. 2004.

    [5] S. Kumar, V. S. Raghavan, and J. Deng. Mediumaccess control protocols for ad hoc wireless networks: Asurvey. Ad Hoc Networks, 4(3):326358, 2006.

    [6] X. Qiu and V. O. K. Li. Dynamic reservation multipleaccess (drma): a new multiple access scheme forpersonal communication systems (pcs). Wirel. Netw.,2(2):117128, 1996.

    [7] H.-J. R. Reumerman and M. M. Ruffini. Theapplication-based clustering concept and requirementsfor intervehicle networks. Communications Magazine,IEEE, 43(4):108113, 2005.