<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # 1.1 MQTT結構 整個規范由如下7個章節構成 * 1 介紹 * 2 MQTT控制包格式 * 3 MQTT控制包 * 4 操作行為 * 5 安全 * 6 使用WebSocket作為網絡傳輸 * 7 一致性 # 1.2 術語 關鍵字 “必須MUST”、“不應該MUST NO”,“要求REQUIRED”, “應當SHALL”、“不得SHALL NO”、“應該SHOULD”、“應該 不SHOULD NOT”、“建議RECOMMENDED”、“可能MAY”和“可選的OPTIONAL” 在本規范中描述將根據IETF RFC 2119(RFC2119)的定義來解釋。 #### 網絡連接: 一個由底層傳輸協議構筑的、被MQTT使用的傳輸。 * 它連接客戶端和服務器。 * 它能提供一個在兩個方向上發送有序、無損的字節流的方式。 實例請參見4.2節。 #### 應用程序消息: 應用所需要的由MQTT協議所攜帶的在網絡上傳輸的數據。當應用消息通過MQTT傳輸時,它們和服務質量和主題名稱相關。 #### 客戶機Client: 使用MQTT的程序或設備。客戶總是建立網絡連接到服務器。 它可以: * 發布 其他客戶可能感興趣的應用消息。 * 訂閱 感興趣的應用消息。 * 退訂 應用消息。 * 斷開連接。 #### 服務器Server: 程序或設備,充當那些發布和訂閱應用消息的客戶之間的中介。 一個服務器: * 接受 來自客戶機的網絡連接。 * 接受 客戶發布的應用消息。 * 處理 來自客戶的訂閱和退訂請求。 * 轉發 應用消息給到正確的訂閱者。 #### 訂閱Subscription: 訂閱包含一個主題過濾器和最大的QoS。一個訂閱與單個會話相關聯。但是一個會話可以包含多個訂閱。會話中的每個訂閱都有不同的主題過濾器。 #### 主題名稱Topic Name: 附加到應用消息的標簽,能匹配被服務器知道的訂閱。服務器會給每個匹配的訂閱客戶機發送一個應用消息的副本。 #### 主題過濾器Topic Filter: 一個訂閱中包含的表達式,表明一個或多個感興趣的主題。一個主題過濾器可以包含通配符。 #### 會話Session: 一個有狀態的客戶端和服務器之間的交互。一些會話只在一次網絡連接存在的情況下存在;也有會話可以跨越多個連續的網絡連接。 #### MQTT控制包: 通過網絡連接發送的信息包。 MQTT規范定義了14個不同類型的控制包,其中一個(PUBLISH包)用于傳達應用消息。 # 1.3 引用標準 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. http://www.ietf.org/rfc/rfc2119.txt [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 10646", STD 63, RFC 3629, November 2003 http://www.ietf.org/rfc/rfc3629.txt [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security (TLS) Protocol Version 1.2", RFC 5246, August 2008. http://www.ietf.org/rfc/rfc5246.txt [RFC6455] Fette, I. and A. Melnikov, "The WebSocket Protocol", RFC 6455, December 2011. http://www.ietf.org/rfc/rfc6455.txt [Unicode] The Unicode Consortium. The Unicode Standard. http://www.unicode.org/versions/latest/ # 1.4 非標準引用 [RFC793] Postel, J. Transmission Control Protocol. STD 7, IETF RFC 793, September 1981. http://www.ietf.org/rfc/rfc793.txt [AES] Advanced Encryption Standard (AES) (FIPS PUB 197). http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf [DES] Data Encryption Standard (DES). http://csrc.nist.gov/publications/fips/fips46-3/fips46-3.pdf [FIPS1402] Security Requirements for Cryptographic Modules (FIPS PUB 140-2) http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf [IEEE 802.1AR] IEEE Standard for Local and metropolitan area networks - Secure Device Identity http://standards.ieee.org/findstds/standard/802.1AR-2009.html [ISO29192] ISO/IEC 29192-1:2012 Information technology -- Security techniques -- Lightweight cryptography -- Part 1: General http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=56425 [MQTT NIST] MQTT supplemental publication, MQTT and the NIST Framework for Improving Critical Infrastructure Cybersecurity http://docs.oasis-open.org/mqtt/mqtt-nist-cybersecurity/v1.0/mqtt-nist-cybersecurity-v1.0.html [MQTTV31] MQTT V3.1 Protocol Specification. http://public.dhe.ibm.com/software/dw/webservices/ws-mqtt/mqtt-v3r1.html [NISTCSF] Improving Critical Infrastructure Cybersecurity Executive Order 13636 http://www.nist.gov/itl/upload/preliminary-cybersecurity-framework.pdf [NIST7628] NISTIR 7628 Guidelines for Smart Grid Cyber Security http://www.nist.gov/smartgrid/upload/nistir-7628_total.pdf [NSAB] NSA Suite B Cryptography http://www.nsa.gov/ia/programs/suiteb_cryptography/ [PCIDSS] PCI-DSS Payment Card Industry Data Security Standard https://www.pcisecuritystandards.org/security_standards/ [RFC1928] Leech, M., Ganis, M., Lee, Y., Kuris, R., Koblas, D., and L. Jones, "SOCKS Protocol Version 5", RFC 1928, March 1996. http://www.ietf.org/rfc/rfc1928.txt [RFC4511] Sermersheim, J., Ed., "Lightweight Directory Access Protocol (LDAP): The Protocol", RFC 4511, June 2006. http://www.ietf.org/rfc/rfc4511.txt [RFC5077] Salowey, J., Zhou, H., Eronen, P., and H. Tschofenig, "Transport Layer Security (TLS) Session Resumption without Server-Side State", RFC 5077, January 2008. http://www.ietf.org/rfc/rfc5077.txt [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., Housley, R., and W. Polk, "Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile", RFC 5280, May 2008. http://www.ietf.org/rfc/rfc5280.txt [RFC6066] Eastlake 3rd, D., "Transport Layer Security (TLS) Extensions: Extension Definitions", RFC 6066, January 2011. http://www.ietf.org/rfc/rfc6066.txt [RFC6749] Hardt, D., Ed., "The OAuth 2.0 Authorization Framework", RFC 6749, October 2012. http://www.ietf.org/rfc/rfc6749.txt [RFC6960] Santesson, S., Myers, M., Ankney, R., Malpani, A., Galperin, S., and C. Adams, "X.509 Internet Public Key Infrastructure Online Certificate Status Protocol - OCSP", RFC 6960, June 2013. http://www.ietf.org/rfc/rfc6960.txt [SARBANES] Sarbanes-Oxley Act of 2002. http://www.gpo.gov/fdsys/pkg/PLAW-107publ204/html/PLAW-107publ204.htm [USEUSAFEHARB] U.S.-EU Safe Harbor http://export.gov/safeharbor/eu/eg_main_018365.asp # 1.5 數據表示 ### 1.5.1 位Bit 把一個字節Byte的8位標記為Bit7到Bit0,其中Bit7是最高位(MSB),Bit0是最低位(LSB) ### 1.5.2 整數數據值 整數值是16位的,遵循高/大字節序(Big-Endian,高位在內存地址低位,而低位在內存地址高位,和TCP/IP的網絡序一致),這相當于一個16位的數字在網絡上的表示形式是一個MSB跟著一個LSB。 ### 1.5.3 UTF-8編碼的字符串 在下面章節會描述的控制包中的文本字段使用UTF-8編碼字符串。UTF-8[RFC3629]是一個高效的、為支持基于文本通訊而對ASCII編碼優化的Unicode編碼。 每一個這樣的字符串都會有兩個字節長度的前綴字段,這兩個字節的前綴字段會給出這個字符串UTF-8編碼的字節長度, 見圖1.1 UTF-8編碼字符串的結構。 因此,一個UTF-8編碼的字符串組件事實上是有長度限制的,最長不能超過65535字節。 除非另有聲明所有UTF-8編碼的字符串的長度范圍在0到65535字節之間。 圖1.1 UTF-8編碼的字符串的結構 ![](https://box.kancloud.cn/2015-11-29_565a768d4121c.PNG) **這里的UTF-8編碼格式的字符數據必須是定義完備的UTF-8編碼,由Unicode規范[Unicode]定義并在RFC3629[RFC3629]中重申。特別需要指出的是此數據不得包含任何在U+D800和U+DFFF之間的編碼,如果服務器或者客戶機收到包含非完備定義的UTF-8數據的控制包,將會導致網絡連接立刻關閉。[MQTT-1.5.3-1]** **同時一個UTF-8編碼字符串也不得包含U+0000這個空字符。如果接收方(服務器或者客戶機)收到一個包含U+0000的控制包,將會導致網絡連接立刻關閉。[MQTT-1.5.3-2]** 數據應該也不包含下面的Unicode,如果接收方(服務器或者客戶機)收到一個包含下面任何一個字符數據的控制包,可能會導致關閉網絡連接: U+0001...U+001F U+007F...U+009F 在Unicode規范中被定義為非字符的編碼,比如U+0FFFF **一個UTF-8編碼的字符流0xEF 0xBB 0xBF總是被解釋為U+FEFF(零寬度非中斷),只要它出現在字符串中,就不能被包接收者跳過或者剝離。[MQTT-1.5.3-3]** #### 1.5.3.1 非規范性案例 比如,拉丁(LATIN)大寫字符A及其后面的U+2A6D4(代表CJK IDEOGRAPH EXTENSION-CJK象形文字擴展B字符)可以被編碼成如下格式: 圖1.2 UTF-8編碼的字符串非規范性的例子 ![](https://box.kancloud.cn/2015-11-29_565a768d513e4.PNG) # 1.6 編輯約定 黑體是一致性描述。每個一致性描述都被分配[MQTT-x.x.x-y]這樣一個參考格式。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看