Device communication protocols - AWS IoT Core

「翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。」

Device communication protocols

AWS IoT Core supports devices and clients that use the MQTT and the MQTT over WebSocket Secure (WSS) protocols to publish and subscribe to messages, and devices and clients that use the HTTPS protocol to publish messages. All protocols support IPv4 and IPv6. This section describes the different connection options for devices and clients.

TLS v1.2

AWS IoT Core uses TLS version 1.2 to encrypt all communication. Clients must also send the Server Name Indication (SNI) TLS extension. Connection attempts that don't include the SNI are refused. 詳細については、「AWS IoT のトランスポートセキュリティ」を参照してください。

The AWS IoTDevice SDKs support MQTT and MQTT over WSS and support the security requirements of client connections. We recommend using the AWS IoTDevice SDKs to connect clients to AWS IoT.

プロトコル、ポートマッピング、認証

How a device or client connects to the message broker by using a device endpoint depends on the protocol it uses. The following table lists the protocols that the AWS IoT device endpoints support and the authentication methods and ports they use.

プロトコル、認証、ポートマッピング
プロトコル Operations supported 認証 ポート ALPN プロトコル名

MQTT over WebSocket

Publish, Subscribe 署名バージョン 4 443

該当なし

MQTT over WebSocket

Publish, Subscribe カスタム認証 443

該当なし

MQTT

Publish, Subscribe

X.509 クライアント証明書

443

x-amzn-mqtt-ca

MQTT Publish, Subscribe X.509 クライアント証明書 8883 該当なし

MQTT

Publish, Subscribe

カスタム認証

443

mqtt

HTTPS

Publish only

署名バージョン 4

443

該当なし

HTTPS

Publish only

X.509 クライアント証明書

443

x-amzn-http-ca

HTTPS Publish only X.509 クライアント証明書 8443 該当なし
HTTPS Publish only カスタム認証 443 該当なし
Application Layer Protocol Negotiation (ALPN)

Clients that connect on port 443 with X.509 client certificate authentication must implement the Application Layer Protocol Negotiation (ALPN) TLS extension and use the ALPN protocol name listed in the ALPN ProtocolNameList sent by the client as part of the ClientHello message.

On port 443, the IoT:Data-ATS endpoint supports ALPN x-amzn-http-ca HTTP, but the IoT:Jobs endpoint does not.

On port 8443 HTTPS and port 443 MQTT with ALPN x-amzn-mqtt-ca, custom authentication can't be used.

Clients connect to their AWS account's device endpoints. See AWS IoT device data and service endpoints for information about how to find your account's device endpoints.

AWS IoT Core に接続する

プロトコル

Endpoint or URL

MQTT

iot-endpoint

MQTT over WSS

wss://iot-endpoint/mqtt

HTTPS

https://iot-endpoint/topics

Choosing a protocol for your device communication

For most IoT device communication through the device endpoints, you'll want to use the MQTT or MQTT over WSS protocols; however, the device endpoints also support HTTPS. The following table compares how AWS IoT Core uses the two protocols for device communication.

AWS IoT device protocols side-by-side

機能

MQTT

HTTPS

Publish/Subscribe support

Publish and subscribe

Publish only

SDK サポート

AWS Device SDKs support MQTT and WSS protocols

No SDK support, but you can use language-specific methods to make HTTPS requests

Quality of Service support

MQTT QoS levels 0 and 1

No QoS support

Can receive messages missed while device was offline あり なし

clientId field support

あり

なし

Device disconnection detection

あり

なし

Secure communications

はい。「プロトコル、ポートマッピング、認証」を参照してください。

はい。「プロトコル、ポートマッピング、認証」を参照してください。

Duration of connection Up to several weeks Up to 24 hours

Topic definitions

Application defined

Application defined

Message data format

Application defined

Application defined

Protocol overhead Lower Higher
消費電力 Lower Higher