Research Article

Efficient Payload Compression in IP-based Wireless Sensor Network: Algorithmic Analysis and Implementation

Algorithm 3

Algorithm for compression at sensor node level.
Procedure Compressdata
   ThresholdValue ← maximum tolerated value during a natural disaster assigned to sensors
   → if a sensed data exceeds this value then we must take that into consideration
   waitValue ← amount of time to wait before sending the compressed value
   While TRUE do
       SensedData ← sensing the environment
       If sensedData is greater than ThresholdValue then
           collectedDatasensedDataadd the sensed data to the collection
           of data that are greater than the threshold
       end If
       If startSensingTime is greater or equal to waitValue
          compressedData ← ArithmeticEncoding(collectedData)
          CompressdataSink (compressedData)
       end If
   end while
end Procedure