Recently, sensor networks are usually applied on collecting remote sensing information. The deployed sensor nodes are separated and responsible for specific purposes, and act as an individual device. They cooperatively transmit sensed data to the base station, as shown in Fig.1. However, the transmitted data are exposed to open environments, and possibly contain confidential information. If malicious attacks interfere in the communication using huge packets to break the communication, thus the system can not work properly. In general, attackers exploit a broadcast storm or a Distributed Denial-of-Service (DDoS) attack to paralyze the entire network. Therefore, this study proposes a queuing theory based scheme to detect whether the system encounters malicious attacks. Our proposed scheme provides the arrival requests with a queuing service on the base station, which is responsible for dealing with transmitted jobs. Once the jammed traffic is anomalous for long periods, the system immediately detects the malicious attacks using our proposed approach.