Research Article

Priority Based Congestion Control Dynamic Clustering Protocol in Mobile Wireless Sensor Networks

Algorithm 1

Algorithm for processing packets in CM and CH node.
   (a) Algorithm for queue model in CM
Input: - incoming packet
Output: queue in which packet to be stored
Variables:
   -Lower queue threshold
    - Upper queue threshold
   - Current queue length
For each CM node
  For every packet to queue in
  Check the current queue length aginst and
        If
           Queue in both and , Queue act as FCFS
        Else if   &&  
           Queue in and drop randomly
        Else
           Drop both and
        Endif
(b) Algorithm for queue model in CH
For each CH node
  Check the current queue length aginst and
        If
           Queue in at tail selectively,
           Queue in at the head
           Queue act as priority queue
        Else if   &&  
           Queue in selectively and drop randomly
        Else
           Drop both and
Endif End