Abstract
Keywords
Introduction
As the monitoring of the environment has become increasingly complex, the simple data obtained by the traditional sensor networks cannot meet the demand of the people. Therefore, visual sensors are introduced into environmental monitoring activities on the basis of the wireless sensor network. Visual sensors can achieve fine-grained and environmental monitoring of accurate information. Wireless visual sensor networks (WVSNs) contain a number of distributed visual sensor nodes, that is, camera nodes, which are commonly used to collect, process, and transmit visual data including images or videos. 1 Besides, with the rapid development of Internet of Things, LoRa (Long Range) is widely concerned. LoRa combines digital spread spectrum, digital signal processing, and forward error-correcting coding technology, 2 which possesses a large number of characteristics, including wide coverage, low cost, and low power consumption. LoRa technology is widely applied in low-power wide area networks.3,4
At present, researchers have carried out a number of investigations and have already made some achievements in this respect. Aghdasi et al. 5 propose an energy-efficient and high-quality transmission architecture in WVSNs. Imran et al. 6 analyze an energy-efficient static random access memory (SRAM) field programmable gate array (FPGA)–based wireless vision sensor node. Li 7 researches on a quality of service (QoS)–supported transmission model of wireless visual video sensor networks. Bhuiyan et al. 8 propose quality-guaranteed event-sensitive data collection and monitoring based on quadrature amplitude modulation. However, these research achievements are unsuitable for long-distance communication or difficult to achieve by programming.
Considering the above situation and problems, this article puts forward a novel low-power wide area network protocol for WVSNs to overcome the shortcomings. This protocol adopts star topology and spread spectrum modulation. It has the advantages of low power consumption, wide coverage, good extensibility, and high security, which has a certain reference value in the WVSN field.
Network topology structure for WVSN
In this article, network topology structure can consist of a camera node, gateway, and a network server. Camera node can consist of a LoRa modulation module, camera sensor, and a microprocessor. Camera sensor takes photos when illegal workers invade the surveillance area. Subsequently, the image information is transmitted to the gateway by LoRa modulation. The gateway can consist of three LoRa modulation modules, a microprocessor, and some peripherals. The network server is responsible for protocol parsing and data processing.
The network topology architecture is typically laid out in a star-of-stars topology in which gateway acts as a transparent bridge relaying messages between the camera node and a central network server in the backend. Gateways are connected to the network server via standard IP connections, while the camera nodes use single-hop wireless communication to one or many gateways.9–11 All camera nodes’ communication is generally bidirectional, and it also supports operation such as multicast enabling software upgrade over the air or other mass distribution messages to reduce the on-air communication time. The network topology structure for WVSN is shown in Figure 1.

Network topology structure for WVSN.
LoRa modulation combines digital spread spectrum, digital signal processing, and forward error-correcting coding technology, which possesses a large number of characteristics, including wide coverage, low cost, and low power consumption. These features ensure that this protocol has the advantages of low power consumption and extensive coverage. It can implement intensive deployment of camera nodes. The data security of wireless sensor network is becoming more and more important in today’s society. Therefore, a lightweight symmetric encryption algorithm based on chaos theory is used to encrypt medium access control (MAC) and application layer data with the purpose of less resource use and safe communication.
Register process of camera node and data encryption
Register process of camera node
For register process based on this protocol, from a camera node’s point of view, the join procedure consists of two MAC messages exchanged with the server, namely, a join request and a join accept. The message structure of two MAC messages is shown in Figure 2.

Message structure of the register process.
The join procedure is always initiated from the camera node by sending a join request message. The DevEUI is a global device ID in the IEEE EUI64 address space that uniquely identifies the device address of the camera node. DevNonce is a random value. The join request message is not encrypted. The network server will respond to the join request with a join accept if the camera node is permitted to join a network. The join accept message contains an application AppNonce and a sensor node address (DevAdddr). The AppNonce is a random value or some form of unique ID provided by the network server and used by the camera node to derive the two session keys NwkSKey and AppSKey as follows
Two session keys and Rootkey are 32-bit integers. The join accept message itself is encrypted with the Rootkey as follows12–14
Frame payload encryption of camera node
If a data frame carries a payload, FRMPayload (frame payload) must be encrypted before the cyclic redundancy check (CRC) is calculated. By default, the encryption is done using the protocol. NwkSKey and AppSKey serve as the secret keys of MAC command and application data, respectively. For each data message, the algorithm defines a sequence of block Ai for i = 1, …, k with k = ceil(len(FRMPayload)/8) (Figure 3).

The sequence of block Ai
The Dir (direction field) is 0 for uplink frames and 1 for downlink frames. The blocks Ai are encrypted to get a sequence S of blocks Si. Encryption of the payload is done with the purpose of getting the ciphertext. The K in the equation represents a session key
Data transmission mode between camera nodes and gateway
Baseline mode
The three LoRa modules of the gateway provide three physical channels with the purpose of data transmission by air. Camera node of the baseline mode allows for bidirectional communications whereby each camera node’s uplink transmission is followed by two short downlink receiving windows.15–17 The camera node remains in sleep mode for a long time so that it consumes very little power. When the camera node needs to upload the video monitoring data, it randomly selects a channel to execute channel activity detection. If the channel is occupied, the node randomly withdraws and remains off for a period of time for next data delivery. If the channel is not occupied, the node can transmit video data frame to the gateway by LoRa modulation. The gateway remains the Rx mode for a long time so that it can realtimely receive the uplink data of the camera node. The first and second receiving windows of the camera node can receive ACK response data and MAC command. Baseline mode operation is the lowest power node system for applications that require only downlink communication from the gateway shortly after the node has sent an uplink transmission. Downlink communications from the gateway at any other time will have to wait until the next scheduled uplink. Interactive flow diagram of the baseline mode is shown in Figure 4.

Interactive flow diagram of baseline mode.
Continuous mode
Camera node of continuous mode has nearly continuously open receiving windows, which remain closed only when transmitting. Camera node of continuous mode will use more power to operate than the baseline mode but it offers the lowest latency for the gateway-to-camera node communication. Camera nodes implanting the continuous mode option are used for applications that have sufficient power available and thus do not need to minimize the reception time.
The continuous mode implements the same two receiving windows as the baseline mode, but they do not close the Rx2 window until they need to send again. Therefore, they may receive a downlink in the Rx2 window at nearly any time. The time series diagram of the continuous mode is shown in Figure 5.

Time series diagram of continuous mode.
Protocol message formats
All LoRa modulation uplink and downlink messages carry a physical payload starting with a single-octet MAC header, followed by a MAC payload, and ending with a 4-octet CRC. The physical payload structure is shown in Figure 6.

Physical payload structure.
MAC header
The MAC header specifies the message type (MType), and based on the major version of the frame format of the network protocol the frame has been encoded (Figure 7). 18

MAC header structure.
The network protocol for WVSN distinguishes the MAC message into six different types: join request, join accept, unconfirmed data up/down, and confirmed data up/down, which are shown in Table 1.
MAC message types.
MAC payload of data messages
The MAC payload of the data messages contains a short device address of the camera node, frame control, MAC command, packet total, packet number, application type, and payload (Figure 8).

MAC payload structure.
ACK is the message acknowledge bit. When receiving a confirmed data message, the receiver shall respond with a data frame that has the acknowledge bit set. Acknowledgments are only sent in response to the latest message received and are never retransmitted. The length of the MAC command denotes the actual length of the MACCmd included in the frame. If the value of the grouped data bit is 0, the field of packet total and number are absent. In some cases, too large packets cannot be transmitted through a single frame. Such packets need to be split up at the moment. The PackTotal field represents that a large packet is fragmented into the total number of frames. Furthermore, the PackNum field shows the serial number of the large packet partition. AppType denotes the data type of the application payload, such as monitoring information or heartbeat data. MAC command and application payload can be simultaneously present in the MAC payload.
Conclusion
Aiming at complexity of topology and limited network coverage for WVSNs so that partial application cannot be implemented. In this study, we designed a novel low-power wide area network protocol for WVSN, including network topology structure, register process of camera nodes and data security, protocol message formats, and data transmission mechanism. According to theoretical analysis, the protocol possesses the advantages of low cost, wide coverage, and simple topology structure. Besides, it is best applied to motion detection in intelligent video surveillance systems. There are also significant research and reference values for WVSNs.
