| if i.slot = i.b_slot = null and ∉ (3 or 1) then | | With probability, do | | send REQ(, rx_ID, 2, ) | | rx_ID = | | End do | | end if | | if i.slot = or i.b_slot = then | | send REQ(, rx_ID, 2, nr) | | rx_ID = | | end if | | //perform channel listening | | if receives a REQ(, dest_ID, 2, state) then | | if REQ.dest_ID = then | | add REQ. in , | | send RES(, , 2, REQ.state) | | end if | | if and REQ.state = 0 then | | slot has been taken by node , add to 1 | | if add to 2 | | end if | | end if | | if or and REQ.state 0 then | | slot is blocked, add to 3 | | end if | | end if | | if receives a RES(, dest_ID, 2, state) | | if RES.dest_ID = then | | if nr = then i.b_slot = | | end if | | nr = nr − 1 | | if nr = 0 then i.slot = | | end if | | else | | if RES.state = 0 then | | slot is taken by RES.dest_ID, add s to 1 | | if RES.dest_ID ∈ add to 2 | | end if | | else | | slot is blocked, add to 3 | | end if | | end if | | end if | | if i.slot = null and not received the RES for transmitted REQ message then | | i.b_slot = null, nr = | | end if | | if ∈ 3 | | Remove from 3 if blocked duration has expired | | end if |
|