DISTRIBUTED ASSIGNMENTOFCODES FORMULTIHOPPACKET-RADIONETWORKS J.J.Garcia-Luna-Aceves andJyotiRaju ComputerEngineeringDepartment School ofEngineering UniversityofCalifornia Santa Cruz,CA95064 jj,[email protected] Abstract—Thispaperdescribesandanalyzesadistributedalgorithmfor discussedbyChlamtacandKutten[4]; thedistributedversionof assigning codes ina dynamic, multihop wireless radio network. The algo- theprotocolusesatravellingtoken,whichincursmoreoverhead rithm does notrequire any form of synchronization andis completely dis- traffic on the network. Chlamtac and Kutten also show that de- tributed. Thealgorithm canbeusedforboththetransmitter orientedand receiverorientedcodeassignment.Thealgorithmisproventobecorrectand signing a protocol such that the least amount of channel band- itscomplexityisanalyzed. Theimplementationofthecodeassignmentalgo- widthisusedforbroadcastisNP-complete. Adifferentapproach rithmaspartofthemediumaccesscontrol(MAC)androutingprotocolsofa tothetoken-basedschemeconsistsofusingcontrolsegmentsdur- multihoppacket-radionetworkisdiscussed. ing which the schedulefor the transmission segmentsis decided [5]. The transmitter-oriented code assignment is introduced in I. INTRODUCTION [11].Here,quasiorthogonalcodesareassignedtotransmittersina Using code division multiple access (CDMA) in packet-radio packet-radionetworkinsuchawaythathiddenterminalinterfer- networks permits multiple stations within range of the same re- enceiseliminated. Therearemanyapproachesbasedonthefact ceivers to transmit concurrently, without interference. Several that the node needs to know the information of nodes two-hops multiaccess protocols have been proposed and commercial sys- away[6],[3],[9]. temshavebeendeployedthattakeadvantageof CDMA [1]. An This paper presents a distributed code assignment algorithm. important design consideration in a multihop packet-radio net- This algorithm assigns a code to each node in a way that no in- work using CDMA is the assignment of transmission codes to terferenceoccursafterthealgorithmconverges,providedthatthe network nodes. In a large network, the number of transmission numberofcodesavailableforassignmentisatleast , codes is smaller than the number of nodes, and senders and re- where isthemaximumnumberofone-hopneighbdo(rds(cid:0)an1y)n+od2e ceivers must agree on which transmission code to use in a way can havde. This is because the algorithm assigns a transmission thatavoidsinterferenceasmuchaspossible. code to a nodethat is differentthan the codesassigned to nodes Interference in a CDMA network can be of two kinds. Di- two hops away from the node. The algorithm is designed to be rect interference consists of two neighboring nodes transmitting partoftheMACandroutingprotocolsofamultihoppacket-radio to each other at the same time. This can be avoided by using a network.Itisbasedontheasynchronousexchangeofcontrolmes- randomaccessprotocolthatschedulestransmissionstotheneigh- sagesthatarepartoftheregularMACandroutingmessages,and bornodesintimetoavoidcollisions(e.g.,FAMA[8]). Secondary theinformationgeneratedbyanyonenodepropagatesuptotwo interference consists of two senders transmitting to receivers in hopsawayfromthenode. away thatthe senders’ transmissionsinterfereatat leastonere- ceiver. Thistypeofinterferencecanoccurin two scenarios.Two A 1 stationsunawareofeachother’sexistencecantransmittothesame receiveratthesametime;thisgivesrisetothetransmitter-oriented 2 1 codeassignmentproblemshowninFig.1. Here, and ,which C aretwohopsawayfromeachotherneedtohaveAdiffereCntcodes. B Thesecondcaseofsecondaryinterferenceoccurswhenastation Fig.1. Interferencewhentwotransmitterstwo-hopsawayhavethesamecode is transmitting to its neighbor and a third station’s transmission to somestation otherthanthe stationsinvolvedin thefirsttrans- mission causes an interference with the first transmission. This C leadstothereceiver-orientedcodeassignmentproblemillustrated 1 D inFig.2. Here, istransmittingto butcausesinterferenceat , because anCd which are twoDhops away share the same 1 cBode. AscanBbeseeDnfromtheearliertwoexamples,thecodeas- A B signment problem requires that no set of stations which are two Fig.2. Interferencewhentworeceiverstwo-hopsawayhavethesamecode hopsawayhavethesamecode. Several approaches have been proposed in the past for chan- Section II describesthealgorithmin detail. Section III shows nel/code assignments. A tree-based protocolfor broadcasting is thatthealgorithmguaranteescorrectcodeassignmentsaftercon- vergence, provided that enough codes are available. Section IV ThisworkwassupportedinpartbytheDefenseAdvancedResearch Projects Agency(DARPA)undergrantDAAB07-95-C-D157. addressesthealgorithm’scomplexity. 1 Report Documentation Page Form Approved OMB No. 0704-0188 Public reporting burden for the collection of information is estimated to average 1 hour per response, including the time for reviewing instructions, searching existing data sources, gathering and maintaining the data needed, and completing and reviewing the collection of information. Send comments regarding this burden estimate or any other aspect of this collection of information, including suggestions for reducing this burden, to Washington Headquarters Services, Directorate for Information Operations and Reports, 1215 Jefferson Davis Highway, Suite 1204, Arlington VA 22202-4302. Respondents should be aware that notwithstanding any other provision of law, no person shall be subject to a penalty for failing to comply with a collection of information if it does not display a currently valid OMB control number. 1. REPORT DATE 3. DATES COVERED 1997 2. REPORT TYPE 00-00-1997 to 00-00-1997 4. TITLE AND SUBTITLE 5a. CONTRACT NUMBER Distributed Assignment of Codes for Multihop Packet-Radio Networks 5b. GRANT NUMBER 5c. PROGRAM ELEMENT NUMBER 6. AUTHOR(S) 5d. PROJECT NUMBER 5e. TASK NUMBER 5f. WORK UNIT NUMBER 7. PERFORMING ORGANIZATION NAME(S) AND ADDRESS(ES) 8. PERFORMING ORGANIZATION University of California at Santa Cruz,Department of Computer REPORT NUMBER Engineering,Santa Cruz,CA,95064 9. SPONSORING/MONITORING AGENCY NAME(S) AND ADDRESS(ES) 10. SPONSOR/MONITOR’S ACRONYM(S) 11. SPONSOR/MONITOR’S REPORT NUMBER(S) 12. DISTRIBUTION/AVAILABILITY STATEMENT Approved for public release; distribution unlimited 13. SUPPLEMENTARY NOTES 14. ABSTRACT 15. SUBJECT TERMS 16. SECURITY CLASSIFICATION OF: 17. LIMITATION OF 18. NUMBER 19a. NAME OF ABSTRACT OF PAGES RESPONSIBLE PERSON a. REPORT b. ABSTRACT c. THIS PAGE 5 unclassified unclassified unclassified Standard Form 298 (Rev. 8-98) Prescribed by ANSI Std Z39-18 II. THEALGORITHM C. InformationatEachNode A. NetworkModelandProtocolAssumptions Thefollowingstructuresareneededforcodeassignmentateach node. To describe our code assignment algorithm, we model a mul- Priority List: Each node has a unique priority number as- tihop packet-radio network as an undirected graph (cid:15) where isthesetofnodesand isthesetofedgesG. E=ach(Vn;oEde) signedtoit. Thisprioritynumberallowstwo-hopneighbors consistVsofatransceiverandaroEuter. Alinkbetweentwonodes withthesamecodetodecidewhichoneofthemshouldkeep and in meansthat canhear ’stransmissionand canheair the code and which must look for new codes. We decided ’s trjansmGission. Eachinodeusesjan omnidirectionalajntennafor to use the addressof a nodeas its prioritynumber,because itransmissionand the networkworksin half-duplexmode, which addressesareunique. Theprioritylistcontainstheprioritynumbersofthenode,its meansthat a nodecannottransmit and receiveat the same time. one-hop and two-hop neighbors sorted in increasing order. Aroutingprotocolisassumedtocreateandupdatetheroutingta- Eachentryinthelisthasaflagwhichissetto1iftheneigh- bleusedateachnode.Thisroutingprotocolprovidesinformation bor is one-hop or 2 if the neighbor is two-hop. The codes aboutwhothenode’sactiveneighborsare;thisinvolvesaddingto assignedtothenodeanditsneighborsarealsolistedinhere. theneighborlistnewneighborswhentheycomeupanddeleting Neighbor List : This is a list of all the node’s immediate neighborswhicharenolongeractive. Theroutingprotocolisas- (cid:15) neighbors,i.e. allitsone-hopneighbors. sumedtohavesomeformofneighbordiscoverymechanismsuch Code Assignment Message Retransmission List (CAMRL): asaHELLOexchange[12].Nodesprocessmessagestheyreceive (cid:15) This list has one or more retransmission entries, where an andlinkstransmitpacketsintheFIFOorder. entryisofthefollowingnature. WealsoassumeaMACprotocolthatallowsstationstosched- – ThesequencenumberoftheCAM. uletheirtransmissionstothesamereceiverinawaythatcollisions – Aretransmissioncounterthatisdecrementedeverytimethe ofdatapacketstothereceiversareavoided. Theflooracquisition nodesendsaCAM. multipleaccess(FAMA)familyofprotocols[8]isanexampleof – An ACK-requiredflag thatis actuallya field of thesize of such a MAC protocol. According to FAMA, a sender transmits the neighborlist. The bit correspondingto a neighbor is a request-to-send (RTS) to the receiver, which in turn transmits setiftheCAMisyettobeacknowledgedbytheneighbor. a clear-to-send (CTS) if it obtains the RTS free of errors. The TheCAMRLpermitsanodetoknowwhichCAMisnotac- RTSlastslongerthanthepropagationdelayandtheCTSmustbe knowledgedby some of theneighborsand needs to besent larger than size of RTS + maximum round trip propagation de- again. The node retransmits a CAM when its retransmis- lay + transmit-to-receiveturnaround time, so that collisions due sion entry in the CAMRL reaches zero. The retransmission tohiddenterminalsareeliminatedintheabsenceoferasuresdue counterofanewentryintheCAMRLissetequaltoasmall to drastic node mobility. When the network is first brought up, number(e.g.,3or4). alltransmissionstakeplaceoveracommonsignalingcodeusing UnassignedCodeList(UCL):Thislistcontainsallthecodes FAMA.Asthestationsdecideontheircodes,thestationsusedif- (cid:15) whichareavailable,i.e.theyarenotbeingusedbyanyofthe ferentcodesfordatatransmissions. node’stwo-hopneighbors. A link is assumed to exist between two nodes only if there is good radio connectivity and the update messages of the routing D. InformationExchangedamongNodes protocol can be sent reliably. Node failures are modelled as all links incident on the node failing at the same time. A moving TheCAM’spropagateonlyfromanodetoitsneighborsandno nodeisconsideredattachedtoallnodeswithwhichthenodecan further.EachCAMcontains exchangemessageswithacertainprobabilityofsuccess;amoving TheaddressofthenodewhichissendingtheCAMalongwith (cid:15) nodebecomesdetachedfromnodeswithwhichitcannotexchange itscode. messages with this probability of success. The codeassignment The addresses of the node’s one-hop neighbors along with (cid:15) algorithmrunsinconjunctionwiththeroutingprotocol,whichin theircodes. turnrunsontopoftheMACprotocol. ACK’sto earlierCAM’s. AnACKentryspecifiesthesource (cid:15) andthesequencenumberoftheCAMbeingacknowledged. B. PrinciplesofOperation Aresponselistofzeroormorenodeswhichneedtosendan (cid:15) The messages of the code-assignment protocol are called the ACKforthisCAM. Code Assignment Messages (CAM). These messages are sent as IfasingleCAMisnotlargeenoughtoholdallthecodesand partofthemessagesexchangedinthenetwork’sroutingprotocol. addresses,theinformationcanbesplitupintomorethanone These messages could be lost due to changes in radio connec- CAM. tivity. Reliable transmissions of CAM’s is donewith the help of CAM’saresentinthefollowingsituations. retransmissions. After receivinga CAM, the receiveris required 1. A new node comes up. Its priority list only consists of its to acknowledge it to the node which sent it, by sending an ex- own address and its own code. It broadcasts this to all its plicit ACK message indicating that the CAM has been received neighbors. andprocessed. Since,thenetworklayerassumesthelinktobeof 2. When a node detectsa changeof codeby any of its one- a broadcastnature, a node can send a messageonceand assume hop neighbors,i makes the required changes in its priority tohavesentittoalltheneighbors;however,eachneighborneeds list andsendsaiCAM to allitsone-hopneighborsincluding toACKthemessageindividually. theonethatchangedthecode. 2 3. Whenanode findsthatacertainone-hopneighbor isno G. ProcessinganACK longeractive,iitdrops fromtheprioritylist. Thisinfjorma- The ACK entry bears the sequence number of the CAM it ac- tionisthenconveyedtjoallitsone-hopneighborsbyaCAM knowledges. AssoonasanACKisreceivedbyanode,thenode whichreflectsthechanges. searchesitsCAMRLtofindtheentrywiththerequiredsequence E. UpdatingthePriorityList number.IfamatchisfoundthenoderesetstheACKrequiredflag fortheneighborwhichsenttheACK. A nodeupdates its priority list either after detecting a change AnodemayreceiveanACKforanentrywhichhasbeendeleted ofcodeinoneofitsone-hopneighborsorafterreceivingaCAM due to more recent CAM’s to the same neighbor or for an entry whichcontainsinformationaboutachangeofcodebyitstwo-hop which has undergonea changein sequencenumberdue to more neighbors. recentretransmissions. Inthatcase, the nodesimply ignoresthe When a node notices a change of code in any of its one-hop ACK. neighbors, it makes a change in its own priority list and sends a CAM with its own address and the address of all its one-hop H. EmbeddingCodeAssignmentAlgorithminMACandRouting neighbors along with their respective codes. This is sent to all Protocols itsone-hopneighbors. Ifatwo-hopneighborhaschangedacode Theproposedcodeassignmentalgorithmcanbeusedasanin- thenanyofthefollowingthreesituationsmightarise. tegralpartoftheMACandroutingprotocolofapacket-radionet- 1. Ifthenewcodeofthetwo-hopneighborisnotthesameas work. ’scode,thenthenewcodeinenteredintotheprioritylistin itheentrycorrespondingtothetwo-hopneighbor. In our model, all stations have a common signaling code on whichtheyimplementanRTS-CTSexchangesimilartothe802.11 2. If the new codeof the two-hop neighboris the same as ’s codeandtheaddressof thetwo-hopneighboris lesser thian protocol[10].Thedatatransfercanbedoneonthereceiver’scode forROCAoronthetransmitter’scodeforTOCA.Theadvantageof ’scode, then picksupanewcode. The newcodesof the itwo-hopneighiborand areenteredintotheprioritylist. someformofcodeassignmentisthatanode’sone-hopneighbor 3. If the new codeof theitwo-hop neighboris the same as ’s canreceiveadatatransmissionatthesametimeasthenode. codeandtheaddressofthetwo-hopneighborisgreaterthian ’scode,then retainsitscodeandthereisatemporarycon- RTS fliicttillthetwoi-hopneighborchangesitscode.Thetwo-hop I Sender(Signalling Code) neighbor will get to know of ’s code because of the CAM sentbytheone-hopneighboroif .Thisconflictdoesnotstop CTS the data transfer in the networki. It merely increases colli- J Receiver(Signalling Code) sions. Data Train 1 Data Train 2 In the first two cases the UCL has to be updated. All the codes DATA DATA 1 2 used by the two-hop neighborsare marked as unavailable in the I Sender(Receiver’s Data Code) Interval Time UCL. Fig.3. HandshakeandDataTransferusingReceiver’sCode F. SendingNewandRetransmittedCAM’s Wheneveranode sendsanewCAM,itmustdothefollowing Weinvestigatethecaseforthereceiverorientedapproach(Fig. steps i 3). Considertwo nodes and which areimmediateneighbors 1. Decrementtheretransmissioncounterofallthenewentries of each other. The nodeI neeJds to transmit data to . sends intheCAMRL. anRTSto inwhichitspIecifiesthecodeitexpects JtohIave. It 2. Delete the entries which correspond to entries in the new alsospecifiJesthenumberofdatapacketsitplanstosJend. send CAM. backaCTSwhichcontainsitscodeandthemaximumnumJberof 3. AddanentryintheCAMRLforthenewCAM. data packets it can allow. After successfully receiving the CTS, If a certain CAM in the CAMRL has all its entries covered be a thenode transmitsitsdatausingthecode. newCAMtransmission,theoldCAMisdeletedfromtheCAMRL. AfterthIespecifiednumberofdatapacketshavebeentransmit- WhentheretransmissioncounterforaCAMretransmissionen- tedandreceived, and switchbacktothesignalingcode.Ifthe try expires, node sends a new CAM which has the same data RTS-CTS exchangIe alsoJspecifies the interval time between two as the old CAM. Hiowever, it has a new sequence number and a packetbursts, thenafteran initialhandshake canswitch to ’s newresponselist. Thisnewresponselistspecifiestheneighbors data code automatically without an interveniIng RTS-CTS hanJd- whichdidnotacknowledgetheCAMearlier. Theoldentryinthe shake. The last packet of a data burst can contain control data CAMRLisdeletedandanewentrycreatedforthenewretransmis- which specifies if there are more data bursts following. If node sion. gets any requests which would require it to receive data from Usingtheaboveretransmissionstrategy,anodecankeepsend- Janynodeotherthan duringthetimeithasreservedfor ,itwill ingCAM’stillallitsone-hopneighborsacknowledgeit. However, refusetherequests.AIlso,anyRTSarriving(onthesignalinIgcode) aftersometimeifanodegetsnoresponsefromaneighbor,itcon- at whileitisreceivingdatafrom (on ’sdatacode)wouldnot siderstheneighbordeadanddoesnotsenditanyCAM’sandresets deJstroythedata.ThistakescareofIthemJultihopproblem. bitswhichcorrespondtothisneighborintheresponselistsofall Now,withtheavailabilityofassuredtimefordatatransmission, theentriesinthe . acertainratefordatatransmissioncanbeguaranteed.Thisisuse- CAMRL 3 fulforreal-timedatatrafficwhichrequiresconstantdelay. How- hopandtwo-hopneighbors. Thisallowsthemtocalculateacode ever,onehastokeepinmindthatifthetopologygetsconstantly forthemselveswhichisdifferentfromthecodesofalltheirtwo- rearranged,sucharatecannotbesustained. hopneighbors. Asimilartreatmentcanbedoneforthetransmitterorientedap- Definition1: Therearetwodifferentwaysanodecanchange proach.Here,theRTS-CTSwillexchangethesender’scode. itscode. CAM’s need to contain information about a node’s one-hop 1. Thenodecanchangeitscodetoanyoftheunusedtwo-hop neighborsandtheir codes. If thedistancemetricin aroutingal- codes(thisincludescodesofone-hopneighbors). gorithmishop-count,thenreadingaroutingupdatemessagefrom 2. Thenodecanchangetoacodethatisalreadybeingusedby a node is enough for the code assignment algorithm to deduce atwo-hopneighborwithanaddressgreaterthanitself. anode’sone-hopneighbors. However,thecodesassignedto the Definition2: Anodeissaid tohaveconsistentinformationin neighborsarenotpresentintheroutingupdates.Withtheaddition its priority table if it has the most recent information about the ofthisfieldtheroutingupdatescanbeusedasCAM’s. changeofcodesofitsone-hopandtwo-hopneighbors. Theorem1: Afinitetimeafter ,allnodeshaveconsistentin- III. CORRECTNESS OFTHEALGORITHM formationintheirprioritytablesat0ndthecodestheydecidebased Thissectionshowsthatthecode-assignmentprotocoliscorrect onthisinformationarecorrect. undertheassumptionthatanunderlyingprotocolassuresthefol- Toprovetheabovestatementweneedtoshowthatthefollow- lowingconditions. ingconditionsaresatisfied: 1. A node detects within a finite time the existence of a new 1. Allnodeseventuallystopupdatingtheirprioritylistandstop neighbororthelossofconnectivitywithaneighbor.Anode sendingupdatemessagestotheirneighbors. alsodetectswithinafinitetimeachangeinthecodeusedby 2. All nodes must have consistent code information in their aneighbor. topologydatabaseswithinafiniteamountoftimeafter . 2. Allmessagestransmittedoveraradiolinkarereceivedcor- 3. Iftheinformationinthenodeisconsistentandmostretc0ent, rectlyandinthepropersequencewithinafinitetime. a nodeonly makes a valid changeof code and there are no 3. Allmessagesandcodechangesareprocessedoneatatime deadlocks. within a finite time and in the order in which they are de- 4. Ifallnodesmakeonlyvalidchangeofcodes,thenwehavea tected. correctcodeassignment,suchthatnopairoftwo-hopneigh- borshavethesamecode. Lemma1:Allnodeseventuallystopupdatingtheirprioritylist D-1 andstopsendingupdatemessagestotheirneighbors. Proof: First,notethatthereareafinitenumberofnodesinthe D-1 network,andthatbyassumptionafinitenumberofcodechanges can occur upto time , after which no more changes in codes D-1 D occur. Alsobyassumpt0tion,achangeofcodebyacertainnodeis detectedwithinafiniteamountoftimebytheneighboringnodes. These neighboring nodes, in turn update their priority lists and D-1 sendoutatmostone toeachoftheirneighbors.Therefore, Fig.4. Theconnectivityofanodeinanetworkamaximumdegreed forany changeof coCdeA, tMherecanbeat most messages sent. d(d(cid:0)1) Another assumption we make is that we have a minimum of Anodewhichdoesnotallowtheprotocoltoterminatemustbe codes, where is the maximumdegreeof thenet- generating an infinite amount of ’s. This is only possible dw(odrk(cid:0).O1)ne+c2odeisrequiredfdorsignalingandtheuseoftherestof if oneofits neighborsischangingCiAtsMcodeaninfinitenumberof themcanbeexplainedusingFig. 4. Anodecanhaveamaximum times. Since,weassumethattherearenochangesafter ,thisis of neighbors.Eachoftheseneighborscaninturnhave neigh- notpossible. Therefore,theprotocolproducesonlyafinti0tenum- bords. Considerthecentralnode . Ithas one-hopneighbdorsand berof ’sandthemessagetransfermuststopwithinafinite two-hopneighbors. Thienodesdhouldnothaveacodein timeafCteAr M. dco(dm(cid:0)mo1n)withanyofitstwo-hopneighbors. Thus,itisclearthat Lemmat02: Allnodesmusthaveconsistentcodeinformationin we require codes. This is a sufficientconditionto theirtopologydatabaseswithinafiniteamountoftimeafter . obtainvaliddc(odd(cid:0)ea1s)si+gn1ments[9]. Thenetworkcanstill operate Proof:Consistentcodeinformationmeansthatthenodeknto0ws withfewerthan ,eventhoughsometwo-hopneigh- about all the recent code changes in its one-hop and two-hop borswillhavethed(sdam(cid:0)e1c)o+des2.However,fortheproof,weassume neighbors. Consider some node . A lower level protocolguar- that codesexist. antees that will detect a changei of code in any of its one-hop Addd(diti(cid:0)on1a)l+ass2umptions are that there are a finite number of neighborswiithinafinitetime. codechangesuptotime , andthatnomorechangesoccurafter Consider the case of a node whose two-hop neighbor that time, and that nodets0can correctly determine which CAM’s changes its code. This two hop nieighbor is the one-hop neighk- aremorerecentthantheothers. borofoneof ’sone-hopneighbors( ). Weareguaranteedthat Correctness for this algorithm means that within a finite time detectsachanigein ’scodeinafinitejtime. Thisdetectioncausejs after ,allnodesobtaininformationaboutthecodesoftheirone- achangein ’spriokritylist,whichinturncauses tosendaCAM t0 j j 4 toallitsone-hopneighborswhichinclude and . Since,weas- B. ComplexityofComputationattheNodes sume that node processes ’s in a fiinite tkime, we always In the worst case there are entries in the . This havethelatestcojdechangeiCnfAorMmationatanodeinafinitetime includes new entries which diddn+ot1exist in the prioCriAtyMlist ear- afterthelastchange,i.e. after . lier. The entries in the are presumed to be in the sorted t0 Lemma3: Iftheinformationinthenodeisconsistentandmost order. AscanoftheprioCritAyMlistisdoneandthenewcodesadded recent,anodeonlymakesavalidchangeofcodeandthereareno to it. While doing the scan we can check if any of the two-hop deadlocks. neighborshave the same code and also update the . There Proof: When a nodegets a CAM, it makeschangesin its pri- are entriesintheprioritylist. AlinUeaCrLscanwill ority tableandchecksto seeif anyof its two-hopneighborsuse takedt(hde(cid:0)or1d)er+odf +1 whichis . 2 the same code as it does. If no two-hop neighbor has the same d(d(cid:0)1)+d+1 O(d ) code,thenodedoesnothing. Ifatwo-hopneighborhasthesame C. StorageComplexity code, then thenodechecksthe addressof thetwo-hopneighbor. Theprioritylisthas entries. The can Ifthetwo-hopneighborhasalargeraddress,thenthenodekeeps haveaspecified maximdu(md(cid:0)nu1m)b+erdo+f e1ntrieswhich isMprResLumed itsowncode. Ifthetwo-hopneighborwiththesamecodehasan tobeaconstant.The hastohaveaminimumof addresssmallerthanthenode,thenthenodehastopickupanew entries. ThusthestoraUgCeLcomplexityis . d(d(cid:0)1)+2 2 codefromthe . Ifthereare codes,therewillal- O(d ) waysbesomeUcoCdeLavailabletopdic(kd.(cid:0)Th1u)s+,t2hereisalwaysavalid V. CONCLUSIONS changeofcode.Itcanbeseenthattherearenopossiblesituations Wehavepresentedanalgorithmfordistributed,dynamicchan- where a node has to wait for any event to occur and therefore, nelassignmentinmultihoppacketradionetworks. Thisprotocol thereexistnodeadlocks. is based on obtaining information about the transmission codes Lemma4: Ifallnodesmakeonlyvalidchangesofcodes,then used by nodes one-hop and two-hops away. The algorithm was wehaveacorrectcodeassignmentinwhichnotwo-hopneighbors shown to be correct and its complexitywas analyzed. This pro- havethesamecode. tocol fits in nicely with existing MAC and routing protocolsde- Proof:Considerasetoftwo-hopneighbors sorted signed for multihop packet-radio networks. At UCSC, we are with respect to their addresses. Under theac1o;nad2i:t:i:o:n;aonf valid implementing the proposed algorithm as part of the FAMA [8] change of codes, no node can have the same code as a two-hop andWirelessInternetRoutingProtocol[12]whichareusedinthe neighbor with lesser address, i.e cannot have the same code WirelessInternetGateways[2],[7]. as , cannothavethesame coad2eas and . If thecondi- tiona1ofav3alid change of codes is true fora1all nodae2s, any node REFERENCES cannot have the same code as . If we continuaei [1] RicochetWirelessNetwork. http://www.ricochet.net/netoverview.html. this argumenttill , we see thaait(cid:0)1;aci(cid:0)an2n;o::t:;haa1vethe same code [2] Wireless Internet Gateways. http://www.cse.ucsc.edu/research/ccrg /projects/wings.html. as a.nFrom this weansee that for a set of two-hop [3] A.A.BertossiandM.A.Bonuccelli. CodeAssignmentforHiddenTerminal neiagnh(cid:0)bo1r;sanw(cid:0)it2h:::aa1bounded number of nodes, no two nodes have InterferenceAvoidanceinMultihopRadioNetworks. IEEE/ACMTrans.on Networking,3(4):441–449,August1995. thesamecode. Oneoftheassumptionswemadeisthatwehave [4] I.ChlamtacandS.Kutten.Tree-BasedBroadcastinginMultihopRadioNet- afinitenetwork,i.e. aboundednumberofnodes. Therefore,we works.IEEETrans.Computers,Oct1987. have a correct code assignment in which no two-hop neighbors [5] I. Cidon and M. Sidi. Distributed Assignment algorithms for Multihop Packet-RadioNetworks.Proc.IEEEInfocom,pages1110–1118,1988. havethesamecode. [6] A.EphremidesandT.V.Truong. SchedulingBroadcastsinMultihopRadio Networks. IEEETrans.Computers,38(4):456–460,April1990. [7] J.J.Garcia-Luna-Aceves et.al. Wireless Internet Gateways (WINGS). In IV. COMPLEXITYOFTHE CODE ASSIGNMENTALGORITHM Proc.IEEEMILCOM97,,Monterey,CA,1997. [8] C.L.Fullmer and J.J.Garcia-Luna-Aceves. FAMA-PJ:AChannel Access This section gives results about the communication complex- ProtocolforWirelessLANs.Proc.ACMMobileComputingandNetworking, ity(i.e. the numberof messagesneededin theworstcase), com- 1995. putation complexity and storage complexity after a single code [9] L.Hu. Distributed CodeAssignmentforCDMAPacketRadioNetworks. IEEE/ACMTrans.onNetworking,1(6):668–677,Dec1993. change. [10] IEEE. P802.11-Unapproved Draft. Wireless LAN Medium Access Con- trol(MAC)andPhysicalSpecifications,Nov1991. A. CommunicationComplexity [11] T.Makansi. Trasmitter-OrientedCodeAssignmentforMultihopRadioNet- works.IEEETrans.Computers,COM-35(12):1379–1382,Dec1987. [12] S. Murthy and J.J. Garcia-Luna-Aceves. An Efficient Routing Protocol Therecanbetworesultsofanodechangingitscode. forWireless Networks. ACMMobile Networks andApplications Journal, 1. Thenode’snewcodeis notthe same as anyofits two-hop 1(2):183–197,Oct1996. neighbors’codes.Inthiscase,thereareonly messages 2 exchanged. O(d ) 2. Thenode’snewcodeisthesameasoneofitstwo-hopneigh- bors’code. Inthiscase,thetwo-hopneighbormighthaveto changecodewhichinturncouldcause ’stobesent. In apathologicalcase,anode’schangeofCcAodMemightcauseall thenodesinthenetworktochangetheircodes. From the above, it follows that the number of messages is boundedby . 2 O(jVj:d ) 5