# A Statistical Approach to Detect Jamming Attacks in Wireless Sensor Networks
## 4 Detection Metrics for Jamming Attack  
To detect the different forms of jamming attacks that has been described above, the metrics and indicators to achieve this must be defined. These metrics will therefore be closely monitored and captured during a normal traffic flow to detect the malicious node during a jamming attack. Common among these metrics are packet delivery ratio (PDR), packet sending ratio (PSR), bad packet ratio (BPR), bit error rate (BER), energy consumption amount (ECA), signal-to-noise ratio (SNR) [15] and packet IAT. Packet Delivery Ratio (PDR)PDR is the ratio of the number of packets that has been successfully delivered and acknowledged by the destination node to the number of packets sent by the transmitting node. The transmitting node only confirms the successful delivery of packets upon receiving an acknowledgment (ACK) packet from the destination node. This process involves a 4-way handshaking (RTS/CTS/DATA/ACK) where PDR is determined by comparing the RTS/DATA packets transmitted with the CTS/ACK packet received [23]. [PERSON] et al. [15] in their work described two types of PDR; the one obtained at the transmitter (source) and the other obtained at the receiver (sink). The former can only be possible if the network follows a reliable protocol like the TCP, where acknowledgment exist for every successfully delivered packet. PDR is a good metric to detect the different forms of jamming attacks at the MAC layer without much computational overhead [15], however when it involves TCP, where acknowledgment of packet is involved, PDR might not be appropriate for resource constrained sensor nodes. Packet Sending Ratio (PSR)PSR is the ratio of the number of packets that has been sent during a given time to the number of packets intended to be sent by the transmitting node during that given period. The number of packets intended to be sent can be obtained during a given period by first determining the time of the channel availability to the node at that given period and multiplying it by the transmission rate [15]. PSR can be used to determine how effective the jamming attack is on a transmitter using carrier sensing as its medium access policy. A typical scenario where PSR metric can be used to quantify jamming attack is in a situation where jamming signals render the medium busy as a result of carrier sensing which leads to transmission queue, therefore forcing the newly received packets on the full queue to be dropped [7]. Bad Packet Ratio (BPR)BPR is the ratio of the number of damaged packets received by a node to the total number of packets received in a given period. The sensor nodes often determine this by using cyclic redundancy check (CRC) to check for damaged packets [23]. Any damaged packet is dropped and a negative result is returned while the good packets are received or queued for transmission. BPR has proven to be a very effective metric to detect different forms of jamming attack due to its ease to calculate. It can be easily adapted to resource constrained WSN environments where acknowledgement is not required. Bit Error Rate (BER)_: BER in WSN can be determined by computing the ratio of the number of corrupt bits to the entire bits received during a transmission session by a node. BER can be effective in detecting reactive jamming attacks, however, calculating BER can be very tasking, especially in situations where the nodes have to keep track of the BER for the entire radio links that are one-hop away [15]. Energy Consumption Amount (ECA)_: ECA is the measure of the approximate amount of energy consumed by a sensor node over a period of time. This can be obtained by measuring the voltage drop of the battery component of a sensor node and multiplying its squared value with the time duration before finally dividing the result with the average electrical load of the node [15].