Skip to content

Commit 61b0535

Browse files
authored
Merge pull request #219206 from KennedyDMSFT/T2010340
November freshness review (6/8)
2 parents 19d6463 + f931ef4 commit 61b0535

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed
Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
---
22
title: Azure IoT Hub communication protocols and ports | Microsoft Docs
3-
description: This article describes the supported communication protocols for device-to-cloud and cloud-to-device communications and the port numbers that must be open.
3+
description: This article describes the supported communication protocols for device-to-cloud and cloud-to-device communications and the port numbers that must be open for those protocols.
44
author: kgremban
5-
65
ms.author: kgremban
76
ms.service: iot-hub
87
services: iot-hub
98
ms.topic: conceptual
10-
ms.date: 01/29/2018
9+
ms.date: 11/21/2022
1110
ms.custom: [amqp, mqtt,'Role: Cloud Development','Role: IoT Device']
1211
---
1312

@@ -17,7 +16,7 @@ IoT Hub allows devices to use the following protocols for device-side communicat
1716

1817
* [MQTT](https://docs.oasis-open.org/mqtt/mqtt/v3.1.1/mqtt-v3.1.1.pdf)
1918
* MQTT over WebSockets
20-
* [AMQP](https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-complete-v1.0-os.pdf)
19+
* [Advanced Message Queuing Protocol (AMQP)](https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-complete-v1.0-os.pdf)
2120
* AMQP over WebSockets
2221
* HTTPS
2322

@@ -27,17 +26,17 @@ The following table provides the high-level recommendations for your choice of p
2726

2827
| Protocol | When you should choose this protocol |
2928
| --- | --- |
30-
| MQTT <br> MQTT over WebSocket |Use on all devices that do not require to connect multiple devices (each with its own per-device credentials) over the same TLS connection. |
31-
| AMQP <br> AMQP over WebSocket |Use on field and cloud gateways to take advantage of connection multiplexing across devices. |
32-
| HTTPS |Use for devices that cannot support other protocols. |
29+
| MQTT <br> MQTT over WebSockets | Use on all devices that don't require connection to multiple devices, each with its own per-device credentials, over the same TLS connection. |
30+
| AMQP <br> AMQP over WebSockets | Use on field and cloud gateways to take advantage of connection multiplexing across devices. |
31+
| HTTPS | Use for devices that can't support other protocols. |
3332

3433
Consider the following points when you choose your protocol for device-side communications:
3534

36-
* **Cloud-to-device pattern**. HTTPS does not have an efficient way to implement server push. As such, when you are using HTTPS, devices poll IoT Hub for cloud-to-device messages. This approach is inefficient for both the device and IoT Hub. Under current HTTPS guidelines, each device should poll for messages every 25 minutes or more. Issuing more HTTPS receives results in IoT Hub throttling the requests. MQTT and AMQP support server push when receiving cloud-to-device messages. They enable immediate pushes of messages from IoT Hub to the device. If delivery latency is a concern, MQTT or AMQP are the best protocols to use. For rarely connected devices, HTTPS works as well.
35+
* **Cloud-to-device pattern**. HTTPS doesn't have an efficient way to implement server push. As such, when you're using HTTPS, devices poll IoT Hub for cloud-to-device messages. This approach is inefficient for both the device and IoT Hub. Under current HTTPS guidelines, each device should poll for messages every 25 minutes or more. Issuing more HTTPS receives results in IoT Hub throttling the requests. MQTT and AMQP support server push when receiving cloud-to-device messages. They enable immediate pushes of messages from IoT Hub to the device. If delivery latency is a concern, MQTT or AMQP are the best protocols to use. For rarely connected devices, HTTPS works as well.
3736

38-
* **Field gateways**. MQTT and HTTPS support only a single device identity (device ID plus credentials) per TLS connection. For this reason, these protocols are not supported for [field gateway scenarios](iot-hub-devguide-endpoints.md#field-gateways) that require multiplexing messages using multiple device identities across a single or a pool of upstream connections to IoT Hub. Such gateways can use a protocol that supports multiple device identities per connection, like AMQP, for their upstream traffic.
37+
* **Field gateways**. MQTT and HTTPS support only a single device identity (device ID plus credentials) per TLS connection. For this reason, these protocols aren't supported for [field gateway scenarios](iot-hub-devguide-endpoints.md#field-gateways) that require multiplexing messages, using multiple device identities, across either a single connection or a pool of upstream connections to IoT Hub. Such gateways can use a protocol that supports multiple device identities per connection, like AMQP, for their upstream traffic.
3938

40-
* **Low resource devices**. The MQTT and HTTPS libraries have a smaller footprint than the AMQP libraries. As such, if the device has limited resources (for example, less than 1-MB RAM), these protocols might be the only protocol implementation available.
39+
* **Low resource devices**. The MQTT and HTTPS libraries have a smaller footprint than the AMQP libraries. As such, if the device has limited resources (for example, less than 1 MB of RAM), these protocols might be the only protocol implementation available.
4140

4241
* **Network traversal**. The standard AMQP protocol uses port 5671, and MQTT listens on port 8883. Use of these ports could cause problems in networks that are closed to non-HTTPS protocols. Use MQTT over WebSockets, AMQP over WebSockets, or HTTPS in this scenario.
4342

@@ -54,14 +53,14 @@ Devices can communicate with IoT Hub in Azure using various protocols. Typically
5453

5554
| Protocol | Port |
5655
| --- | --- |
57-
| MQTT |8883 |
58-
| MQTT over WebSockets |443 |
59-
| AMQP |5671 |
60-
| AMQP over WebSockets |443 |
61-
| HTTPS |443 |
56+
| MQTT | 8883 |
57+
| MQTT over WebSockets | 443 |
58+
| AMQP | 5671 |
59+
| AMQP over WebSockets | 443 |
60+
| HTTPS | 443 |
6261

63-
The IP address of an IoT hub is subject to change without notice. To learn how to mitigate the effects of IoT hub IP address changes on your IoT solution and devices, see [IoT Hub IP address best practices](iot-hub-understand-ip-address.md#best-practices).
62+
The IP address of an IoT hub is subject to change without notice. To learn how to mitigate the effects of IoT hub IP address changes on your IoT solution and devices, see the [Best practices](iot-hub-understand-ip-address.md#best-practices) section of [IoT Hub IP addresses](iot-hub-understand-ip-address.md).
6463

6564
## Next steps
6665

67-
To learn more about how IoT Hub implements the MQTT protocol, see [Communicate with your IoT hub using the MQTT protocol](iot-hub-mqtt-support.md).
66+
For more information about how IoT Hub implements the MQTT protocol, see [Communicate with your IoT hub using the MQTT protocol](iot-hub-mqtt-support.md).

0 commit comments

Comments
 (0)