Skip to main content
. 2017 Jan 16;17(1):168. doi: 10.3390/s17010168
Algorithm 3 New channel access scheme.
Require: NB=0,BE=macMinBE,RT=0,σ=20symbols,TCCA=8symbols , CCB=0or1 and packet duration time TD.
Ensure: Transmission success/failure.
  • 1:

    Δ=2×TCCA+2×σ+TD

  • 2:

    if Beacon received then

  • 3:

     Calculate the CAPindex and wakeup at start of the CAPindex;

  • 4:

    else

  • 5:

     Wait for beacon;

  • 6:

    end if

  • 7:

    Generate a random backoff time Rb = random(0,2BE−1)×σ;

  • 8:

    if ((RCAP≤Δ) or CCB=0) then

  • 9:

     Wait for next superframe and go to step 2;

  • 10:

    else

  • 11:

     Perform CCA1 after Rb duration;

  • 12:

     if Channel found busy then

  • 13:

      Switch to sleep state for the random(0,TD) and go to step 30;

  • 14:

     else

  • 15:

      Wait for 2σ and perform CCA2;

  • 16:

      if Channel found busy then

  • 17:

       Switch to sleep state for TD and go to step 30;

  • 18:

      else

  • 19:

       Start transmission;

  • 20:

       if Transmission failure then

  • 21:

        RT=RT+1;

  • 22:

        if RT ≤ MAXRT then

  • 23:

         Go to step 7;

  • 24:

        else

  • 25:

         Transmission failure;

  • 26:

        end if

  • 27:

       end if

  • 28:

      end if

  • 29:

     end if

  • 30:

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

  • 31:

     if (NB>MAXNB) then

  • 32:

      Transmission failure;

  • 33:

     else

  • 34:

      Go to step 7;

  • 35:

     end if

  • 36:

    end if