TELKOM NIKA , Vol.11, No .3, March 2 0 1 3 , pp. 1328 ~ 1337   ISSN: 2302-4 046           1328      Re cei v ed O c t ober 1 6 , 201 2; Revi se d Ja nuar y 1, 201 3 ;  Accepte d  Ja nuary 23, 20 1 3   B-MAC Design and Analysis for Embedded Sensor  Networks      Liu Yumin* 1 , Sun  Yonghe 1 , Xu Fengming 2 , Wang T a o 2   1 School of Elec trical Eng i ne eri ng & Informatio n , Northeast P e trole u m Univ e r sit y ,   2 Daqi ng Oilfie l d  Comp an y,  De ve lo p m en Street 199 # , Gao xi District, 16 331 8   *Corres p o ndi n g  author, e-ma i l : liu yumi n3 30 @16 3 .com       A b st r a ct   T h is paper pr esents medi u m  access con t rol (MA C) protocol desi g n e d  for embe dde d sens o r   netw o rks. I start w i th a pro t ocol cal l e d  M A CAW ,  RT S-CT S-DS-DAT A data p a cket  excha n g e . T hen I  ana ly z e  the pr operti es of some MAC prot o c ols, incl u d i ng  S-MAC, B-MA C and IEEE 80 2.15.4. Accordi ng to   the un dersta n d in g of S-MA C, some  a d v antag es ar e s u mmari z e d ,  such as  ener g y  savin g , late ncy  reducti on, etc.  how ever, the r e are sti ll so me  dis adva n tages, i n clu d i n g data  pack e t lost, unfair n e ss,   synchro ni z a ti o n . And then the simi lariti es a nd differe nces betw een the m  are discuss ed.  S-MAC is a n o v e l   techni qu e to reduc e ener gy consu m pt ion,  but B-MAC is mor e  efficient   w i th long pre a m b l e. Usin g lo ng  prea mble, B-M A C achi eves c o llis io n avoi da nce an d hig h   chan nel uti l i z a t i on rate. B-MAC can mini mi ze idl e   listeni ng, b u t it nee ds bi- d irecti ona l co mmu n ic ation. F i n a lly, t he p a p e r pres e n ts B-MAC des ign  process  an d   imple m entati o n  result on MSP 430.     Ke y w ords :   B-MAC protoco l , Emb e d d e d  Se nsor Netw orks, MSP430         Copy right  ©  2013 Un ive r sita s Ah mad  Dah l an . All rig h t s r ese rved .       1. Introduc tion  Embedd ed sensor net work is a network of  embed d ed com puters placed in the  physical   worl d that intera cts  with the enviro n men t [1] . Sensor n e tworks have  challe nge s i n  two key are a s.   First, en ergy  con s um ption  is a  comm on  probl em in  se nso r  net wo rk  desi gn. Mo st of sen s o r ge power  sup p ly by batterie s ,  and n eed to   comm uni cate  with remote  serve r ; secon d , how  se nso r intera ct with its neig hbo ring  node s within  co mm uni cati on ran ge effe ctively is anot her issu e.  Media A c cess Control is an imp o rta n t com pone n t  in embe dd ed sen s or n e tworks  comm uni cati on process. Traditional st rategy fo r dealing  with packet  collisi on avoidance is  CSMA/CD- al l nodes  can t e ll betwee n  idle and bu sy  link and the y  share the li nk. Some no de   listen a s  it transmit s  a nd  can  dete c t when  colli si on  occurs. O n ce  the collisi o n  detectio n  fai l s,  they cann ot detect colli sio n  and data pa cket will be  lo st. Thus, the  cha nnel b and width is  wa sted   and en ergy u t ilization rate is very low. B a se d on the  above con s id eration, the n e w MAC m o d e is prop osed. In this paper,  I describ e desig of B-MAC with MSP430  microcontrolle r se n s or  node, and p r ese n t the basic id ea of communi catio n  pro c e ss b e t ween  sen s o r  node s. I discu ss  simulatio n  p r oce s s in d e ta ils, incl uding  transmitter p a rt, re ceiver  part an d othe r implem entat ion  issues.       2. Related Work  MAC is a wid e  field workin g in embedd ed sen s o r  ne twork and wi reless com m u n icatio n   field. In this part, I will introdu ce the  b a si c i dea of  MAC, the propertie s  of M A C proto c ol  with   energy savin g -Sen so r-MA C  (S-MA C ) a nd Berkeley-MAC (B-MA C -a versatile low po we r MAC  protocol for  sensor network. While  som e   com pari s on between B - MA C and IEEE 802.15.4  is  done.     2.1. Multiple Access  w i th Collision Avoidance (MACAW)  MAC is  a technolo g y to co ntrol when to  sen d   a p a cke t  and when to  listen for a p a cket i n   wirel e ss net work. However, the idle  waiting  wa stes am ount s of energy. How to imp r ov e this  techn o logy is a new chall enge in emb edde d se n s o r  netwo rks. Base d on re se arch on ad -h oc  netwo rk, MA CA protocol  [2 ]  is propo se d ,  which i s  RT S-CTS - DATA  schem e. To  some  de gre e , it  Evaluation Warning : The document was created with Spire.PDF for Python.
              ISSN: 23 02-4 046   TELKOM NIKA  Vol. 11, No . 3, March 20 13 :  1328 – 1 337   1329 solve s  the collision avoida nce  and coordinate s  the sensors comm unication. Ho wever, for so me   compli cate d ca se, it still  cannot  get better energy utilization. In  [3] a novel techn o logy- MACA W   is proposed.  It is a RTS-CTS-DS - DAT A  scheme. T he technique details will be discussed  as  followin g , including the communi catio n  problem s and how to solve them applying to new  MACAW te ch nique.    (1)  Hidd en Te rminal Scena rio           Figure 1. Hid den teminal p r oble m       Hidd en temin a l pro b lem  sh own  as  Figu re 1.No de A  wants to tran smit messag to node  B, while C ca nnot hear n o de A, so C transmit s  data to B at the same time. In  this ca se, colli sio n   happ en s at B. A and C are  hidden fro m  each other.    (2) Expo sed  Termin al Sce nario            Figure 2. Expose d  teminal  probl em       Exposed te m i nal problem  sho w as Fi g u re 2. Nod e  B  sen d s to  no de A, while  n ode  C   sen d s to  oth e r no de, no d e  D n o t node  B. When  C i s  re ady to se nd, it detect s  B is tran smit tin g   somethi ng, so C defers its transmissio n. Howeve r, there is no reason to defer tran smissi on   becau se A is out of range  of C. This pr o b lem is called  expose d  terminal proble m 3 Req u e s tToSend/Cl ea rToSen d (RT S /CTS)    The problem s de scribe d a bove ca n be  solved  wi th an algorithm called Multiple Access  with Collisi o n  Avoidance (MACA). Thi s   idea i s  for th e se nde r an d  re ceiver to  e x chan ge  cont rol  frame with ea ch othe r befo r e the sen der actually  tran smits any dat a. This excha nge inform s all  neigh bori ng  node s that  a tran smi ssi on will  star t .  Specifically , the send e r  tran smits  a   Req u e s ttose nd (RTS) to t he re ceive r ; then the  re cei v er re plies  wi th a Clea rto s end (CTS ). Any  node that se es the CTS knows that  it is clo s e to the receiver an d  therefore ca nnot transmit for   the period of  time it takes to send data. Any  node  that sees the  RTS but not the CTS is  not  clo s e en oug h  to the receiv er to interfe r e with it. So it  i s  free to transmit.          Figure3. Usa ge of RTS/CT     Whe n  node A wishe s  to  sen d  to node B as sho w n in figure 3, it  sen d s RTS to B. If B  receives  RTS ,  it  immediate l y replies with  CTS.  Upon  A receive s  CTS, it immediately send s d a ta.  Evaluation Warning : The document was created with Spire.PDF for Python.
TELKOM NIKA   ISSN:  2302-4 046     B-MAC Desi g n  and Anal ysi s for Em bedd ed Sensor  Ne tworks  (Liu Y u m i n)  1330 Any  station overhe ari ng RTS  defe r tran smi ssi on  until CTS h a s  be en fini sh ed. Any stati o n   overhe ari ng  CTS defe r s u n til data transmissi on is fini she d RTS/CTS av oid colli sion a t  the receive r , not  send er. If station doe not receive CTS, it  will eventuall y  be time out, which means a collisi on occurs.   (4) DS          Figure 4. Coll ision Scena ri o for DS       DS is used to avoid the collision in exposed  terminal scenari o . For example,  there are  four nod es a s  follows:   Nod e  B and  C are in each other’s ran ge. So  when B is transmitting data to A, A is  the  receiver. So theoretically a t  this time C can tr an smit to D, since A and D will n o t interfere  with  each other. Howeve r, in the traditional  RTS - CTS  - DATA mecha n ism C is n o t likely to hear  the   CTS from D, sin c e B is transmitting dat a to A and in terferes with  C. Thus C ca n’t get CTS fr om  D, and may think that a co llision h appe n s . So C will b a ck off and select a rando m time to rest art  sen d ing  RTS to D.  Gene rally sp eaki ng data p a ckets a r e m u ch la rg e r  tha n  cont rol pa ckets. So the randomly   sele cted retra n smi ssi on tim e  of C is unli k ely to fall in the free time span s of B. In  this way, whil B is tran smitting data to A,  C proba bly wi ll increa se its  back-off time greatly, and  maybe will l o se   synchro n ization with D.   To solve this pro b lem, B  can t r an smit  a DS  p a cket  before it tra n smits data,  as the   followin g  figure 5 sho w s.         Figure 5. Usa ge of DS       In this case, when C hears the DS packet,  it will know that B will be transmitti ng data ,   and it also wi ll know the a pproxim ate time it w ill take B to  transmit the data.  And C can try  to   transmit RTS to D after B  finis hes  its  trans m i ssi on of the curren t data packet, so that it can   comp ete for  media with B  in the corre c t conte n tion st age.   (5) RRTS   RRTS i s  pro posed to sol v e the unfairness  in a certain  sce na rio of media  acce ss  conte n tion. The appli c atio n scena rio is   sho w n in the  followin g  figure 6:  Evaluation Warning : The document was created with Spire.PDF for Python.
              ISSN: 23 02-4 046   TELKOM NIKA  Vol. 11, No . 3, March 20 13 :  1328 – 1 337   1331     Figure 6. Coll ision Scena ri o for RRTS       In this scen ario Nod e s B a nd C a r with in ea ch othe r’ s ra nge. A tri e s to  send  da ta to B,  and D tri e s t o  sen d  data  to C. And the data pa cke t s from any  singl e link  ca n satu rate the   netwo rk. If in the first place  A and B win the c onte n tio n , and begin s  the data tran smissio n , the n   node s C a n d  D will li kel y  be fully denied a c cess  to the media .  This will h appe n like t h is:  whe never  D tran smits a  RTS to C, C wi ll not re spon d  with a CTS,  becau se C  wi ll overhe ar th e   CTS from B  and defer its transmi ssi on  for B.  Unless D happe ns to  transmit the RTS in th relatively sh o r t time pe riod  betwe en the  com p letion  o f  one data  pa cket and th transmissio of  CTS from B, otherwise C  will not reply  a CTS to D.  To solve this problem the  RRTS is ad opt ed. Whe n e ver C re cei v es a RTS it can’t  respon d due  to deferral, it will co ntend  durin g t he ne xt period an d  send  a RRT S  to D. Once  D  receives a RRTS it will im mediately se nd a RTS to  C, and hen ce  C can reply with a CTS.  And   other no de s o v erhea r a RRTS shoul d de fer for two sl o t  times to hear wheth e r a succe ssful  RT S- CTS ha s hap pene d.          Figure 7. Usa ge of RRTS      In this way, the unfai rne s s in this scen a r io  can be  sol v ed. However, RRTS can’t work in   other  scena ri os, for  exam ple in the  ab ove figure  7.The A is t r an smitting to B, and  C trie to  transmit to D. Once  C su cceed s in tra n smi tting to  D, the tran smissi on bet ween A and B  is   unlikely to start, since at this time B can’ t  hear RTS fro m  A due to C’s data tra n sm issi on.     2.2. S-MAC (Sensor - MAC)  The core ide a  of S-MAC  [4 ]  is peri odi listen a nd sl e ep in ea ch  n ode. Each n ode  will  kee p  a  sche d u le of p e rio d i c  liste n a nd  sleep, an it tri e s to  get syn c hroni zed  wit h  its n e igh bors.  Duri ng the listen perio d, the node can p e rform d a ta  tran smi ssi on and re ce ptio n if require d. In   slee p perio d the node ca n save energy by avoidi ng idle listen i ng. In order to decrea s e  the  latency caused by unsychron o u s  liste n and sle ep  sched ule s  be tween nei ghb or nod es, ea ch   node  will try to get syn c h r o n ize d  with its  neigh bors.  In  this way a pa ttern of co ordinated  sleepi n g   is created a m ong the n e ighb orh ood  of each no de.  Active listenin g  is in trodu ced to  this   mech ani sm t o  red u ce the  latency in  dat a tran smi ssi o n . And me ssage p a ssing i s  intro d u c ed  to   redu ce the m e ssag e-level  transmissio n latency.   S-MAC is  energy -effic i ent,  [5 ]  in  that it can redu ce  the energy con s um ption  in idle   listenin g , overhea rin g , con t rol packet overhea d and co lli sion. At the same time the sacrifi c e in   latency is mit i gated by the  active listeni ng  and me ssage pa ssing.  Thoug h pe r-n ode fairn e ss i s   also  sa crifice d , it’s claimed  to be not very  important in  WSN ap plica t ion scena rio s .   Thoug h S-M A C ha s m a ny merits  [6] , it doe s ha ve som e  in here n t di sad v antage introdu ce d by the periodi c listen and sl e ep. A nd som e  assumption s and clai ms  may not see m   very soun d.  First of all, per-nod e laten c y is inevitab ly  introduced  by the perio dic liste n an d slee mech ani sm. If one nod e wants to tra n smit some d a ta to its neig h bor n ode  whi c h i s  still sl ee ping,   the data tran smissio n  will  fail, and it has to wait for the neigh bo r node to wake up in ord e r to   transmit data .  In this way  the pe r-n ode  latency  exist s Tho ugh active  listening can re du ce  t he  latency, it ca n’t be compl e tely removed,  since  at least there mayb e some  cha n c e s  that not a ll  Evaluation Warning : The document was created with Spire.PDF for Python.
TELKOM NIKA   ISSN:  2302-4 046     B-MAC Desi g n  and Anal ysi s for Em bedd ed Sensor  Ne tworks  (Liu Y u m i n)  1332 neigh bor no d e s ca n overh ear the RTS/ CTS packet s , or the timing for active listening do es n o match the a c t ual data tran smissi on.   Secon d ly, by using m e ssage pa ssing  the per -no d e  fairne ss i s  sa crificed. T houg h in  most  WSN a pplication  sce nario fai r n e ss is not  so  important, in some speci a l scenarios it’s  very   importa nt. For example, if two nodes  separatel y detect som e  different event s and they both   have to transmit messa ge s (one (A ) will transmi t big message s and the other (B) transmit a  small me ssa ge for example an alarm  messa ge via a commo n node (C). In this case,   if  unfortun a tely A gets control of media a c cess in C  first, it will occupy it for a l ong time. At  the  same time B only need a fraction of med i a acce ss to  tran smit the alarm me ssage . This is one  of  the ca se s in WSN a pplications  whe r e fa irne ss i s  very importa nt.   So, the extent of harm o n  pe r-n ode f a irne ss intro duced by S - MAC shoul be furth e investigate d . And if it’s possible, some b ound ar y sh ou ld be set o n  the dete r ioration of per-no d e   fairne ss in S-MAC. Otherwise the sacrifi c e of  per-n od e fairness may make S-M A C unsuita bl e   for som e  sp e c ial ap plicatio n scena rio s Thirdly, in S-MAC the nodes  still need to synchronize thei r sl eep schedule  with their  local  neigh bo rs. SYNC pa ckets  have to  be tran smitte d to rea c h thi s  aim, an d thi s  ad ds u p  to the  overall co ntro l packet overhead. And after slee sche dule synchro n izatio n, som e  nodes in the   boun dari e s of  the virtual cl usters may h a ve to adopt  more tha n  on e sched ule, a nd thus h a ve  to   con s um e more energy tha n  other n ode s ado pting  on ly one sched ule. This  ca se may redu ce  the  lifetime of some frequ entl y -use d nod e s , and the s e  node s tend to be in the critical topolo g paths.   Fourthly, the fixed period o f  listening, together   with the overhe arin g of data and  control   packet s , still  con s um es en ergy. In active list en stag e, one node may stay active for a fi xed  perio d witho u t  any data transmi ssi on or  reception.  Thi s  is a wa ste of energy. At  the same tim e though ove r h earin g is re d u ce d, it has not been co mpletely rem o ved. Overhe aring of RTS/ CTS  packet s   and some data  packets still  will consum energy. And this  means that  something  more   can b e  don e in orde r to furt her redu ce e nergy con s u m ption.    2.3. B-M AC vs. IEEE 802.15.4  As we  kn ow,  B-MAC i s  a  flexible ben chmark MA proto c ol  [7]  propo sed to  provide a  small  core o f  media a c cess fun c tion ality, based  on whi c h va riable m e cha n ism s  can b e   impleme n ted  to provid prop er  MAC function alitie s for va rio u s Embedd ed  Senso r   Network  appli c ation s . It’s a test-b ed  proto c ol for rese arch on  WSN.   At the sam e  time IEEE 802.15.4 i s  a set  of protocols targeted at com m ercial  appli c ation s   of low rate WPAN  [8] . It con t ains p r oto c ol s for b o th PHY and MAC l a yers. T o  ma ke  the com p arison bet ween  B-MAC and IEEE 802.15. 4 reasonabl e and meaningful, here  onl y the  MAC functionalities in both  will be compared  [9] Several simil a rities exi s t between B-MA C and IEEE 802.15.4:   (1) Bea c o n  frames in 8 02. 15.4 se rves t he si mila r ai m as the Pre a mble in B-MAC. In   802.15.4 th e  sup e r frame  can  be opti onally ena bl e d , whi c con t ains a  bea con fram e in the  begin n ing. When net work  device s  want  to communi ca te with the coo r din a tor, they will first get  synchro n ized  with the coordinat e by list ening to the  bea con fr am e. And in B-MAC when a  node   wakes up from the  sleep i t  will listen to the  channel.  If it gets the preamble, it  will prepare  to   receive data frame s .   (2) In 802.1 5 .4, either b eacon ena bl ed or  not, the netwo rk d e vice s use  CSMA/CD  mech ani sm to conte nd for the chan nel re so u r ce s. And in B-MAC, the  Clea r Ch a nnel   Asse ssme nt (CCA ) is al so  kind of CS MA/CD me ch anism.    (3) 80 2.15.4 can choo se to use ACK in dat a transmissi on in order to provid e reliable   link. And B-M A C also u s e s  link-laye r ACK to enable reliable data transmi ssion.   At the same time, great differen c e s  al so  exist betwe en  B-MAC and  802.15.4:   (1) Bea c o n  frame in 802.1 5 .4 is an opti onal f eature. If it’s disable d  the netwo rk device s   in the network will use CSMA/CA to  conte nd c h a nnel re sou r ces. Ho wever,  in B-MAC, the   preamble is  a mus t.  (2) In 80 2.15 .4 beacon frame is very  sho r t, and in  B-MAC the  prea mble  sh ould be  longe r than t he active an d  sleep d u rati on in ord e r to  make  sure that the re cei v er node  can  get  the prea mble  sign al.  Evaluation Warning : The document was created with Spire.PDF for Python.
              ISSN: 23 02-4 046   TELKOM NIKA  Vol. 11, No . 3, March 20 13 :  1328 – 1 337   1333 (3) In 80 2.15. 4 wh en  bea con is en abled , the  full fun c tionality device (FF D ) can  use  GTS   to reserve some time slots for  their data transmi ssi on. And for the  other time slots they will use  CSSMA/CA to conte nd. Howeve r, in B-MAC  there i s   no su ch a reservation me chani sm.  (4)  Frame  se curity i s  p r ovi ded in  80 2.1 5 .4, wh ile   in B-MAC  n o  se curity con s id eration   is  provide d     3. B-M AC  De sign Ov er v i ew  In this pape r, B-MAC is imp l emented o n  MSP430 eZ4 30-RF2 500.T he eZ43 0-RF 2500 is  a complete  USB-ba se d MSP430 wireless develo p ment tool providing all the hard w a r e  and   softwa r e to evaluate the MSP430F22 74  micro c ontroll er, CC2 500 2 . 4-G H z wi rele ss tran sceive r,  and hig h ly integrate d , ultra - low-p o we r M SP430 MCU with 16-MHz  perfo rman ce  [ 5 The eZ43 0-RF25 00 u s e s  the IAR Embedd ed Workben ch Int egrate d  Dev e lopme n Environme n t (IDE) to write ,  downlo ad, a nd  deb ug an  appli c ation. T he deb ugge is uno btru sive allowin g  the  use r  to run a n  appli c ation  at full  spe ed  with both  hardwa r e b r ea kp oints a nd  sin g le   steppi ng avail able while co nsumi ng no e x tra hard w a r e  reso urce s.   The Simplici T I network protocol is de sign ed for easy impleme n tation with minimal  microcontroll er re so ur ce requireme nts.   B-MAC i s  a l o w p o we r o p e ration. T h ro ugh thi s  protocol, p o we can be  saved.  The key  con c e p t of th is p r oto c ol i s  that it doe not  nee syn c hroni zation.  Before the  transmitte r sen d s   messag es, it sho u ld se nd  a long pream ble to wake  u p  the receiver, and then act ual data is se nt.  Thus, the receiver does not wo rry about that it will miss some  messages.  When transm itter   prep ares to  send me ssag e ,  it has to ma ke  sure t hat the chan nel is clea r,  that is,  no othe r noi se   messag e is b e ing sent to the re ceiver i n  the  netwo rk. Such a proce s s is call e d  Clea r Ch an nel  A sse s s me nt  ( CCA ).    Whe n  on e transmitte r is  sen d ing m e ssag e to the receive r , anot her tran smitter ente r into the network. The cu rrent transmi ssion is not in terru pted, until  it goes to sleep. At this time,  anothe r tran smitter can  se nd data to the  receive r .       sl e e p CC A Se nd l o ng  pr eam bl e Se nd  da t a sl e e p CC A Tx Se n d  l ong  pr e a m b l e Send  dat a s l eep R ece i v e   pr ea m b l e R e ce i v dat a R e cei ve  p r eam bl e Re c e i v e   dat a Rx     Figure 8. Timeline of Com m unication Proce ss      From the Fi g u re 8 a bove, the relatio n sh ip betwe en th e tran smitter  and receiver  can b e   indicated cl ea rly.      4. Simulation Process     4.1. Transmitter Par t   Acco rdi ng to  the B-MAC proto c ol d e finition, before Tra n smitte r tries to  sen d  actu al   messag e, it  need s to sen d  long pre a m b le. Thus , when re ceive r  wa ke s up pe riodi cally, it can  kee p  awake so that it does  not  miss re ce iving the actu al messa ge.  And also, B-MAC u s e s  Cl ear  Cha nnel Assessment (CCA) to check whether the tr a n smi ssi on me dium busy or idle. In this la b,  this will be implemented in the simple way. T he implementation process will  be described in   details a s  foll ows.  (1)  Clea r Ch a nnel Asse ssment (CCA)  For exam ple,  a node, T1,  is mainly a  transmitte r. Whe n  T1 p r epares to  se nd the   messag e to the destin a tio n , node R, it  sho u ld fi rstly detect wh eth e r there i s  so me other no d e   sen d ing th messag e (Noise M e ssa g e ). If so, no de T1  sh oul d hold  a mo ment and  ke ep   detectin g  the cha nnel u n til it has bee n cl ear.    Evaluation Warning : The document was created with Spire.PDF for Python.
TELKOM NIKA   ISSN:  2302-4 046     B-MAC Desi g n  and Anal ysi s for Em bedd ed Sensor  Ne tworks  (Liu Y u m i n)  1334 As for transmitter side, whe n  the pushb utt on on node T1 is p r esse d, it will send a  messag e with  value 0 and it stops slee pi ng and star t s  to send message. It  firstly tries to re ceive   somethi ng. In this case, if  an indicator “Y” is re ceived  by Node T1, it means the cha nnel is  cle a at pre s ent an d com m uni ca tion betwe en  the Nod e  T1  and Node  R i s  safe and  cl ear. However,  whe n  the No de T1 re ceiv es “N” ove r  radio, even  if it send s me ssage, the colli sion  will occu r at   Node R. in this situation, bot h Red and  Green LEDs  on T1 di spla y  on. And it will have to be held  and check m edium after some ba ck off  delay. Once  the medium  gets clea r a gain, it will get  resou r ce and  start its o w n tran smi ssi on. The im plem e n tation flowch art is shown in Figure 9.  As for re ceiv er si de, on ce it receive s   some me ssage, it shoul d che c k wh a t  kind of  messag e it re ceived. If the  messag e con t ains va lue  0, it means  one  transmitter send s a requ e s for tran smi ssi on. In this ca se, the re ceiv er shoul d fu rther  che c k wh ether the me dium is b u sy  or  idle. If medium is bu sy, which in dicates that so me ot her tra n smitter is  sen d ing  data to me. And  then, the re ceiver se nd s “N” to indi cate  this sit uation .  Otherwi se,  sen d s “Y ” to indicate that the   medium i s  cle a r, the co rrespondi ng tran smitter can  se nd data to me         Figure 9. Flowchart of Tra n smi ssi on P r oce s s of  B - M A     (2) Sen d ing L ong Pre a mbl e   After CCA, long p r e a mbl e  is  used to  wa ke  up th e sle epin g  receive r . The  time of   prea mble  sh ould b e  g r ea ter than  re ce iver che cki ng  cha nnel  inte rval. He re, 5  times of  ch eck  cha nnel i n terval is set to m a ke  su re th at receiver   ca wa ke u p  in ti me to receive actual  me ssage   and mini mize  power  con s u m ption. Fo r l ong p r ea mbl e , con s tant v a lue ox3F i s   set to avoid  b e ing   Evaluation Warning : The document was created with Spire.PDF for Python.
              ISSN: 23 02-4 046   TELKOM NIKA  Vol. 11, No . 3, March 20 13 :  1328 – 1 337   1335 confu s e d  wit h  other a c tu al and mea n ing me ssag es. Wh en T r an smitter is sendin g  lo ng   prea mble, the  green LE D is on until actu al data is sen t (3) Sen d ing A c tual Me ssag Once long preamble en ds,  actual message is going  to be sent. T he sent data can be  any value ex cept 0x3F  (it is u s ed fo r lo ng pr eambl e). When  sen d i ng is d one  succe ssfully,  Red  LED on t r an smitter i s  on.  After sen d in g the a c tual  messag e, the tran smitter enters sl eep ing   state. The ne xt transmissio n cycle d o e s  not  start until  the pushbutto n is pre s sed  again.     4.2. Receiv i n g  a Messa ge   As for B-MAC proto c ol, re ceiver  wa ke s up peri odicall y, if no message is re ceiv ed, it will  go to sleep a gain. Ho weve r, once re ceiv er re ceive s  long prea mble,  it means a c tual messag e is  coming soon.  It will not go to sleep but  wait for accepti ng the messages.    For different messag e, re ceiver nee ds t o   take s different action s. Whe n  long p r eam ble   come s, the Green LE D on receivers will  be on. Bu t if actual data is received, Red LED will b e   on.   After actual  data is recei v ed, the receiver  go es t o  slee p ag ain and  waits  for later  messag e. Th e impleme n ta tion flowchart  is sho w n in F i gure 1 0         Figure 10. Flowcha r t of Recei p t Process of B-MAC      4.3. Anoth e Transmitter  Enters into the Ne t w o r k   Once anothe r tran smitter, T2, enters into the  network, when o r igi nal tran smitter, T1, is  slee ping, the new tran smitt e r will gain transmi ss ion ri ght and new  transmissio n cycle will sta r t.  At that time,  whe n  old tra n s mitter wakes up, it  cannot  sen d  any me ssage o u t, so  it has to hold   a   while until th e chan nel cl ear. The det ails have  be en describe d  in the implementation of CCA  part.   In conclusion,  if receiver is  receiving some  messa ge from any tran smitter, the other on will wait and also both of the LEDs di splay on to mark that channel is busy.       5. Experiment Re sult  Whe n  only one tran smitter occu rs in the network , the situation is ve ry simple. Rx wa ke up pe riodi call y and dete c ts wheth e som e  me ssage i s  comi ng. If so , receiver  re ceives the l o n g   Evaluation Warning : The document was created with Spire.PDF for Python.
TELKOM NIKA   ISSN:  2302-4 046     B-MAC Desi g n  and Anal ysi s for Em bedd ed Sensor  Ne tworks  (Liu Y u m i n)  1336 prea mble firstly, and then receive s  the a c tual me ssag e. The action  of LEDs on b o th Tran smitt e and re ceive r  i s  indi cated in  the followin g  table 1.       Table 1.Th e Action of LEDs on Both Tra n smitter a nd  Re ceiver  A c ti on  of  T 1   T 1   R x   Sleep   RED/GREEN off   Nothing   CC A   If channel is busy,  RED/GREEN on   Se n d  Lo ng   Preamble   G R EEN on   G R EEN on   Send A c t u al   Data   RED on   RED on       Whe n  anoth e r tran smitter T2, enters into the network, the grap h looks a little more  compl e x. The Timeline of  Comm uni cati on pro c e ss of  more than 1  transmitter is sho w n in Fig u re  11.Once  som e  transmitter  gains the transmission  ri ght , the other one will have to hold and keep   checking  the channel with  exponentially back off.       sle e p CCA Se nd l ong  pream b le S e nd  dat a sleep CCA T1 Receive  pr eamble R e ce i v dat a Receive  pr eamble R e ce i v data Rx sleep CCA L ong   pr e a mble sleep T2 CCA CCA Send  dat a CCA CCA Send l ong  pr eambl e Receive  pr e a mble Se nd  da ta Rece ive  da ta sle e p T2 Rx T1      Figure 1 1 T i meline of Co mmuni cation  pro c e ss of m o re than 1 tra n smitter      6. Conclusio n   With the dev elopme n t of compl e x com m unicati on n e twork, the requireme nt of stability  and effe ctiveness for th sen s o r  net wo rk i s  ri ssi ng.  This p ape r p r ese n ts the  b a si c ba ckgro und   about MAC  p r otocol, espe cially  MACA W, a ne w technolo g y to control  colli sio n  avoidan ce  and  effective co mmuni cation  derived f r o m  previo us   MACA proto c ol. S-MA C, an en ergy -saving   proto c ol for a d -ho c  net wo rks i s  also pre s ent e d . The  perio dical sle eping a nd wa king me ch ani sm  is the me rit of this proto c ol.  B-MAC, as a  new  mo del o u tperfo rms  other p r oto c ol,  has lo w p o we utilization.   In this pap er, B-MAC is i m pleme n ted  with  MSP430  sen s o r  nod e. We can  see the  simulatio n  re sult and ob se rve the performance of  B-MAC. The experim ent re su lt follows the rule   of B-MAC pro pertie s .   Evaluation Warning : The document was created with Spire.PDF for Python.
              ISSN: 23 02-4 046   TELKOM NIKA  Vol. 11, No . 3, March 20 13 :  1328 – 1 337   1337 MAC proto c ol  is an impo rta n t compo nent  in commu nication pro c e ss.  Any improvement  will ben efit for the future e m bedd ed sen s or n e two r k communi catio n  pro c e ss.       Referen ces   [1]    W e i Ye, John Heidem ann, Deb o rah Estri n . M edium Access Control w i t h  Coor din a ted Adaptiv e   Slee pin g  for W i reless Se nsor  Net w orks.  IEEE/ACM Transactions on Networking . 200 4.  [2]   Karn.  MACA—A New  Chann el Access Method for Packet Radio . Proc. Ninth ARR L  Computer   Net w orki ng C o nf. 1990.   [3]    Hen d ra Seti a w an, Yuh e i N a gao,  Mas a yuki  Kurosaki, H i r o shi Ochi.  IE EE 802.1 1n P h ysical  Lay er  Im plem entation On  Field Programm able Gate Array . 2012;  10(1).   [4]    GJ Pottie and W J  Kaiser. Embed din g  the in tern et: W i reless integr ated  net w o rk sens ors.  Commun.   ACM . 2000.   [5]    A El-Hoiy i , JD Deco tig n ie, a nd J Hern and ez.  Low  pow er MAC protocol s for infrastructure w i reles s   sensor n e tw orks . In Proceedi n g s of the F i fth  Europ e a n  W i reless Co nferenc e. 2004.   [6]    Xi ju n Yan,  Xi ang w e i M eng,  Yan Yan. A  W i re less Se nsor Net w o r k  in Precisi o n  Agricultur e.   T E LKOMNIKA Indon esi a  Jour nal of Electric al  Engin eeri n g . 2 012; 10( 4): 788 -797.   [7]    JP Monks, V  Bharg hav an, and W W  H w u. A Po w e r-C o n trolle d Multip le  Access Protocol for W i reless   Packet Net w or ks.  IEEE INFOCOM . 2001.   [8]    Joseph Polast re, Ja son Hil l,  David Cul l er.   Versatil e low  pow er med i a  access for w i reless se nsor   netw o rks . Proceed ings of the 2nd inter nati o n a l confere n ce on Embed de d net w o rk ed sen s or s y stems.   200 4.  [9]    Shih ong D u a n , Yadon g W an, Peng Men g , Qin W ang. Ha rd w a re- i n-th e-l oop a nd Par a ll el Simul a tio n   Architecture for  W i reless Sens or Net w ork. 20 13; 11(1).   [10]   MSP430F 2 2 x 2 ,  MSP430F 22 x4 Mixed  Si gna l  Microcontro lle r (Rev. D). 201 0.     Evaluation Warning : The document was created with Spire.PDF for Python.