| 研究生: |
呂政勳 Lu, Cheng-Hsun |
|---|---|
| 論文名稱: |
建置基於MQTT協議之低耦合叢集式推播系統 Build a low-coupling cluster notification system based on the Mqtt Protocol |
| 指導教授: |
王宗一
Wang, Tzone-I |
| 學位類別: |
碩士 Master |
| 系所名稱: |
工學院 - 工程科學系碩士在職專班 Department of Engineering Science (on the job class) |
| 論文出版年: | 2018 |
| 畢業學年度: | 106 |
| 語文別: | 中文 |
| 論文頁數: | 55 |
| 中文關鍵詞: | 物聯網 、推播服務 、MQTT 、叢集架構 、平行處理 |
| 外文關鍵詞: | Internet Of Thing, Notification-Service, Mqtt, Cluster Structure, Parallel processing |
| 相關次數: | 點閱:121 下載:28 |
| 分享至: |
| 查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報 |
現今物聯網相關的通訊技術早已多元運用在我們日常多個層面,而物聯網所運到的網路協議不僅有過去傳統client/server形式的http,還包含各xmpp, coap, mqtt等其它各類通訊協議,其中mqtt協議是物聯網早期所制定的協議,公認適合在網路品質差,低電量環境下運行,常被應用於推播通知。 在以物聯物的網路環境中,隨著感測裝置的安裝數增加,其連線數亦隨之增加對於後端伺服主來說其負載壓力並不亞於過去傳統電子商務交易環境,其中訊息推播服務,接收端更須一天24小時與後端伺服器不間斷連線,才能隨時並即時接收感測裝置所偵測到的異常訊息,立即進行處理,在不中斷連線的情況下,隨著對外連接的裝置越多,連線數量也跟著提高的負載壓力,這對後端伺服器來說,著實是不小挑戰,但現行支援業集化的mqtt 伺服器仍在少數,否則即是收費昂高,一般中小企業實難以負擔。
本系統建置基於mqtt協議,利用Docker虛擬化技術隔離多台mqtt 伺服虛擬容器,再透過mosquitto_auth身份認證外掛套件合併前置資訊註冊系統,驗證外部連結裝置身份與ACL授權權限,最後藉由轉介器群協同轉介內部訊息流到對應目標mqtt 伺服器。實驗結果顯示,本系統確實可有效跨mqtt 伺服器完成訂閱/推播作業,以達到擴充mqtt 伺服器叢集環境與管理外部連結裝置連線之目的。
The technology of the internet of things(IoT) has be widely used in our life, and the internet communication protocols included is not only Http/Https, but also other new ones such as xmpp, coap, and mqtt. The requirements of internet of things(IoT) is that network communication jobs can work normally even in low-quality signal environments, and mqtt is recognized as one of the suitable protocol for message notification applications.
Generally, as the number of external sensing devices increase, the number of connections also increase, and the pressure on the server will also increase. In order to receive instant alarm messages from the server broker, clients must keep connected to the server broker all the time.
Both payloads from external devices and clients make it difficult for a single server to handle the large amount of messages, unless clustered servers are available. However, currently the mqtt-broker software suite that supports clustered server are either unsuitable or too expensive for small companies.
The research builds a message notification system based on the mqtt protocol that, by using docker container, supports multiple mqtt broker containers. A mqtt-broker, by using the registry database and the mosquitto_auth_plugin, authenticates an external device and its ACL authorization when it tries to establish a connection to the mqtt-broker. Verified clients will receive from the specific mqtt-broker its related messages retransmitted from the re-transmitters. Results show the system can indeed transfer messages across mqtt brokers to their destinations. It achieves the purpose of clustering mqtt brokers that can manage connections from clients and dispatch messages to them efficiently.
[1] MQTT Documents, http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html
[2] Mosquitto, https://mosquitto.org/
[3] Gaston C. Hillar, MQTT Essentials A Lightweight IoT Protocol, 2017-04-14出版
[4] Pratik Desai 著,Python x Arduino 物聯網整合開發實戰,2016-06-29出版
[5] JP Mens, Mosquitto_auth_plugin, https://github.com/jpmens/mosquitto-auth-plug
[6] 廖煜,Docker 容器實戰:原理、架構與應用,2016-11-01出版
[7] Srdjan Grubor/Packt Publishing,Deployment with Docker, 2017-11-22出版
[8] 進階加密標準,https://zh.wikipedia.org/zh-hk/高级加密标准
[9] Eclipse Paho project, https://www.eclipse.org/paho/
[10] Paho java MqttClient, https://www.eclipse.org/paho/files/javadoc/org/eclipse/paho/client/mqttv3/MqttClient.html
[11] M2mqtt, https://m2mqtt.wordpress.com/
[12] 楊尊一,Java Threads 深度探討 (Java Threads, 3/e),2005-03-14出版
[13] websocket, https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_client_applications
[14] 李智慧,從車庫的舊PC到百萬台伺服器-巨型網站成長從無到無限大,技術架構大揭祕-最棒的「秒殺」網站設計實例,2014-05-27出版
[15] WebSocket Spec, https://html.spec.whatwg.org/multipage/web-sockets.html
[16] Docker docs, https://docs.docker.com/engine/reference/builder/
[17] 周朝宜,張西亞,陳德民,鄭秀娟,循序遞迴平衡負載應用在 O(n 2 ) 時間複雜度,國家高速網路與計算中心 2007-06出版
[18] Veena Kondapalli,伺服器負載平衡器技術與架構探微,https://ctimes.com.tw/DispArt/tw/伺服器負載平衝器/Cypress/0412041151MQ.shtml
[19] 陳俊良 唐傳義 李家同,平行處理的計算方法,1986-10 出刊
[20] Arif Sari, Murat Akkaya,Fault Tolerance Mechanisms in Distributed Systems, Int. J. Communications, Network and System Sciences, 2015, 8, 471-482
[21] Binghua Ha, The Features and Evolution of Cluster Supply Chain Network, Open Journal of Business and Management, 2016, 4, 751-762
[22] Marco Gaviano, Daniela Lera, Elisabetta Mereu,A Parallel Algorithm for Global Optimization Problems in a Distribuited Computing Environment, Applied Mathematics, 2012, 3, 1380-1387
[23] Sarah Tasneem, Reda Ammar, Reda Ammar, Performance Study of a Distributed Web Server: An Analytical Approach,11, November 2012