Skip to main content
. 2019 Dec 6;19(24):5394. doi: 10.3390/s19245394
Algorithm 1 Proposed new channel access mechanism.
 Require: NB=0,CW=CW0,BE=BEmin,RT=0,σ=20symbol,TCCA=8symbol, average packet duration time TD.
 Ensure: Transmission success/failure.
  •  1:

    if Beacon is not received in the control channel then

  •  2:

        Wait for the beacon in the control channel;

  •  3:

    else

  •  4:

        Switch to data channel and generate a random backoff Rb = random(0, CW)×σ duration;

  •  5:

        if (RCAP)(Rb+TCCA+TD) then

  •  6:

            Wait for next superframe and go to step 1;

  •  7:

        else

  •  8:

            Performs CCA after Rb duration and receives signal Y during this CCA;

  •  9:

            if Channel found busy then

  • 10:

               if C(KS1,Y,p)Sth then

  • 11:

                   Switch to sleep state for TD+TA duration;

  • 12:

               else if C(KS2,Y,p)Sth then

  • 13:

                   Switch to sleep state for TA duration;

  • 14:

               else if C(KS3,Y,p)Sth then

  • 15:

                   Switch to sleep state for RA duration;

  • 16:

               else

  • 17:

                   Switch to sleep state for Random(0,TD);

  • 18:

               end if

  • 19:

               NB=NB+1, BE=min(BE+1,BEmin);

  • 20:

               if NB>MAXNB) then

  • 21:

                   Channel access failure;

  • 22:

               else

  • 23:

                   Go to step 4;

  • 24:

               end if

  • 25:

            else

  • 26:

               Start transmission in the data channel;

  • 27:

               if ACK is not received then

  • 28:

                   RT=RT+1;

  • 29:

                   if RTMAXRT then

  • 30:

                       Go to step 4;

  • 31:

                   else

  • 32:

                       Transmission failure;

  • 33:

                   end if

  • 34:

               end if

  • 35:

            end if

  • 36:

        end if

  • 37:

    end if