異質資料流應用的MQTT雲代理設計
No Thumbnail Available
Date
2023
Authors
Journal Title
Journal ISSN
Volume Title
Publisher
Abstract
隨著科技的發展,物聯網(IoT)的應用越來越廣泛,這讓物聯網設備的數量飛速成長,同時他們之間所傳遞的訊息量更是不容小覷。訊息的類型小至溫度感測計資料,大至影像串流。MQTT這個通訊協定特別設計為輕量且高效來符合物聯網裝置的需求。但這樣的設計只適合用於小封包的傳輸,在傳輸較大的封包時會增加封包遺失的風險。由於原始的MQTT Broker缺乏網絡意識,無法偵測網路狀態的變化,也就無法辨識最適合的傳輸時機,這對於目前常使用的雲計算應用造成了顯著的影響。在雲計算中,資料傳輸通常需要跨越長距離,加上網路的不穩定性,大幅增加了訊息遺失和傳輸延遲的機率。這種情況使得Broker承擔了更多額外的負擔。另外,若MQTT代理者的實作不良,有可能會造成大量的訊息被推積在代理者端,使得代理者的記憶體使用量上升,嚴重的情況會使代理者無法正常執行工作。本論文觀察了在物聯網中可能出現的訊息類型,並調整了MQTT代理者的轉發策略,將訊息利用大小進行分類,並對於不同類別的訊息設計一個利用分析延遲時間來自適應改變傳輸策略的機制。實作在Mosquitto這個MQTT的實現上,最後將Broker架設於Amazon Web Service來進行實驗驗證。實驗結果表明,該設計加快了由於大型數據包傳輸而延遲的小型數據包的傳遞速度。本研究還發現Mosquitto代理者在高負載條件下,內存使用量顯著增加。本論文通過改變內存分配的時機來緩解這個問題,並以實驗證實改善是有效的。
With the rise in popularity of smart cities, the Internet-of-Things (IoT) has gained widespread application, leading to a rapid increase in the number of IoT devices. To accommodate the diverse scenarios in smart cities, there is a substantial exchange of data between devices, involving heterogeneous messages. These message types vary in size, ranging from small data packets, such as temperature sensor readings, to larger packets, such as image streaming. While the MQTT communication protocol is well-suited for lightweight and efficient IoT requirements, it is primarily designed for handling small packets. When larger packets are transmitted using this protocol, there is an increased risk of packet loss and the handling of the large packet may delay other packets.The original MQTT broker lacks network awareness, which refers to its inability to actively monitor and assess the current state of the network. This limitation makes it unable to identify suitable transmission timings and leads to potential packet loss or increased transmission latency. Additionally, handling lost packets imposes a further burden on the broker.This limitation significantly impacts cloud computing applications as they involve transmitting data over long distances. The combination of long-distance transmission and network instability greatly increases the probability of message loss and transmission delays. As a result, the broker faces an additional burden in handling these challenges.This thesis observes the types of messages that may appear in the Internet-of-Things, adjusts the forwarding strategy for MQTT broker, classify the incoming messages by size, and designs a mechanism that uses the analysis of delay time to change the transmission strategy. The design is implemented on Mosquitto, a widely used MQTT implementation. The experiment runs the broker on Amazon Web Service (AWS) to verify the performance. Experiment results demonstrated that this design could accelerate the delivery of small packets delayed by large packet transmission. This thesis also identifies a significant increase in memory usage under high-load conditions in the Mosquitto broker. The problem is mitigated by changing the timing of memory allocation.
With the rise in popularity of smart cities, the Internet-of-Things (IoT) has gained widespread application, leading to a rapid increase in the number of IoT devices. To accommodate the diverse scenarios in smart cities, there is a substantial exchange of data between devices, involving heterogeneous messages. These message types vary in size, ranging from small data packets, such as temperature sensor readings, to larger packets, such as image streaming. While the MQTT communication protocol is well-suited for lightweight and efficient IoT requirements, it is primarily designed for handling small packets. When larger packets are transmitted using this protocol, there is an increased risk of packet loss and the handling of the large packet may delay other packets.The original MQTT broker lacks network awareness, which refers to its inability to actively monitor and assess the current state of the network. This limitation makes it unable to identify suitable transmission timings and leads to potential packet loss or increased transmission latency. Additionally, handling lost packets imposes a further burden on the broker.This limitation significantly impacts cloud computing applications as they involve transmitting data over long distances. The combination of long-distance transmission and network instability greatly increases the probability of message loss and transmission delays. As a result, the broker faces an additional burden in handling these challenges.This thesis observes the types of messages that may appear in the Internet-of-Things, adjusts the forwarding strategy for MQTT broker, classify the incoming messages by size, and designs a mechanism that uses the analysis of delay time to change the transmission strategy. The design is implemented on Mosquitto, a widely used MQTT implementation. The experiment runs the broker on Amazon Web Service (AWS) to verify the performance. Experiment results demonstrated that this design could accelerate the delivery of small packets delayed by large packet transmission. This thesis also identifies a significant increase in memory usage under high-load conditions in the Mosquitto broker. The problem is mitigated by changing the timing of memory allocation.
Description
Keywords
物聯網, MQTT, Mosquitto, AWS, Industrial Internet-of-Things, Message Queue Telemetry Transport (MQTT), Mosquitto, Amazon Web Service (AWS)