Algorithm 3. BENS Algorithm For Reservation (BENS-R). |
Input: N number of available channels in the CRN, Nnp Number of PU-occupied channels in Unreserved CRN Nns Number of SU-occupied channels in Unreserved CRN Nrp Number of PU-occupied channels in Reserved CRN Nrs Number of SU-occupied channels in Reserved CRN fa number of failed channels in the CRN maxres number of maximum reserved channels values Ki such that Ka+1 < Ka < Ka − 1 < Ka − 2...< Ki <...<K0; i = 1 to a, where Ka and Ka+1 = 0 Output: M number of reserved channels in the CRN, Step 1: Calculate β = (pn + qn + pr + qr)/(Q − e) Step 2: Find MAvailable = Q − (pn + qn + pr + qr + e) Step 3: Find RN = pr + qr Step 4: while(k > 0) do if (ki + 1 ≤ β < ki) thentraffic_threshold_level = j; k = k − 1; repeat Step 5: do break; Step 6: end Step 7: Switch to operating mode:
Step 9: M’ = maxres − traffic_threshold_level Step10: end Step 11: if selected Operating mode = 1 then Step 12: M’ = maxres − (a-traffic_threshold_level) Step 13: end |