| With the continuous improvement of information technology,the Internet of Things is also developing steadily.Faced with the rise of application scenarios,traditional wireless transmission technologies are gradually unable to meet the needs of coverage and power consumption when massive devices access.Low power wide area networks(LPWAN)came into being.LoRa technology has received extensive attention due to its long-distance transmission,ultra-low device power consumption,low cost,and easy networking.Based on LoRa's MAC layer protocol,this thesis studies the node adaptive data rate(ADR)and MAC layer control commands(MAC Command)in LoRa WAN(LoRa Wide Area Network)network,proposes a data rate adjustment strategy based on network packet loss rate and a downlink MAC Command queue mechanism,designs and implements a LoRa WAN network controller.Firstly,this thesis studies the adaptive data rate adjustment mechanism of nodes in LoRa network,studies the basic ADR algorithm,and proposes a data rate adjustment strategy based on network packet loss rate.The adjustment strategy proposed in this thesis adds the network packet loss rate calculation,and judges the link status of the node using the target spreading factor according to the feedback of the packet loss rate,thereby adjusting the node data rate.The adjustment strategy redistributes the spreading factor according to the feedback of the actual situation of the network,thereby reducing the collision probability of the data packets in the network and improving the overall data packet transmission efficiency of the network.Secondly,according to the MAC Command processing flow in LoRa WAN protocol,this thesis designs and proposes a downlink MAC Command queue mechanism for the processing flow control of the MAC Command and the data interaction between modules in the network server.The downlink queue mechanism proposed in this thesis establishes a request queue and a response queue for the downlink MAC Command,separates the processing logic of the application data and the MAC layer control command,reduces the coupling between the functional modules and uses the storage characteristics of FIFO(First Input First Ouput)to maintain consistency between the upstream and downstream MAC.Commands.Then,for the data rate adjustment strategy and the downlink MAC Command queue proposed in the thesis,the network controller module is designed and implemented in the LoRaWAN network server,which is mainly responsible for the processing of MAC Command and the data rate adjustment of the node in the LoRa network.Finally,a test environment was set up for performance testing.The test results show that the downlink MAC Command queue mechanism proposed in this thesis can deal with the transmission of MAC Command between nodes and server in an orderly manner.And the data rate adjustment strategy based on network packet loss rate can reasonably allocate the spreading factor of the node and obtain higher network data transmission efficiency than the basic ADR algorithm which only considers the node's own adjustment. |