Research Article

Fuzzy Based PC-PUSH in CR-MANETs

Pseudocode 1

Require: , ,   , LFHREP:= , CSA =
(1) check the ;
(2) if    then
(3)  go to (42)   //for checking the
(4) end if
(5) if there is no data to send then
(6)  go back to (2)   //for checking the
(7) end if
(8) start scanning radio
(9)
(10) if    then
(11)  defer for
(12)  for go to (24)
(13)  
(14)  go back to (5)   //to check the availability of data for sending
(15) end if
(16) if    then
(17)  Send notification to upper layers for spectrum handoff
(18)  adapt channel parameters
(19)  
(20) end if
(21) start operation timer
(22) transmit data till expires
(23) go back to (2)
(24) for    do
(25)  if    then
(26)   
(27)   
(28)  end if
(29) end for
(30) if    then
(31) send RERR packet to the source node
(32) else  
(33)  sending   //sending PU-HREQ
(34)  go to (36)
(35) end if
(36) upon receiving   then
(37) if    then
(38)  switch to the selected channel
(39)  
(40)  go to (16)
(41) end if
(42) calculate the
(43) if    then
(44)  Start the LFHREQ timer, broadcast the LFHREQ and go to (49)
(45) else  
(46)  go to (24)   //for making a decision on the next channel
(47) end if
(48) upon the LFHREQ timer was expired then
(49) if    then
(50)  broadcast the RERR to the source node
(51) else  
(52)  find the best candidate node with the
(53)  send the Local route HR to the local source through the best candidate intermediate node
(54)  send the to the candidate intermediate node
(55)  go back to (36)
(56) end if
(57) end