Not receiving ACKs when connection to IoT Hub through an edge device

Karim Walid Abdelazim Elhammady 16 Reputation points
2022-05-12T02:58:12.807+00:00

Hello,

I am connecting to the IoT Hub through an edge device. I am sending some telemetry data to the edge. The packets send are processed on the IoT Edge and stored somewhere. The issue that I am currently having is not getting some ACK packets from the server sometimes which causes a connection reset.

Their are 3 different cases:

1) the device is sending telemetary packet and receiving the ACK from the server after each packet
2) The device send few packets without getting any response from the server, and after a while the server send successive ACK packets.
3) Case number 2 trigger a reset. so the device send a TCP RST flag and then attempt to re-connect to the server.

What happens after triggering the RST flag depends on the version of QOS that I am currently using.

When using QOS 1, the device never recovers from this state and keep going in a loop trying to send RST and re-connect, until it eventually stops any further attempts and it gets stuck somewhere in the code.
When using QOS 0, the device recovers normally after sending the RST flag. However, the issue might happen again after some time.

I am attaching screenshots of the wireshark capture for the three different cases that I described.

my question is, what might be the reason that the server is not responding with ACK packets? Also, what makes the board gets stuck when using QOS1?

Thanks,
Karim

201263-3.jpeg
201236-1.jpeg
201237-2.jpeg

Azure IoT
Azure IoT
A category of Azure services for internet of things devices.
377 questions
Azure IoT Edge
Azure IoT Edge
An Azure service that is used to deploy cloud workloads to run on internet of things (IoT) edge devices via standard containers.
530 questions
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,111 questions
{count} vote

2 answers

Sort by: Most helpful
  1. risolis 8,701 Reputation points
    2022-05-12T07:47:53.22+00:00

    Hi @Karim Walid Abdelazim Elhammady

    Please take a look at this:

    201299-image.png

    Here is the article where you can get mode details about it.

    https://learn.microsoft.com/en-us/azure/iot-dps/iot-dps-mqtt-support

    BR,

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    1 person found this answer helpful.

  2. risolis 8,701 Reputation points
    2022-05-13T06:59:00.277+00:00

    @Karim Walid Abdelazim Elhammady

    Thanks for your patience on this.

    I would like to comment you that is expected as well as per design that QoS2 shall be dropped. The SDK version should be either 5.0 version or later.

    If you want to double check my answer please go thought this explanation below:

    NetX Duo MQTT Basic Operation
    MQTT (Message Queue Telemetry Transport) is based on publisher-subscriber model. A client can publish information to other clients through a broker. A client, if interested in a topic, can subscribe to the topic through the broker. A broker is responsible for delivering published messages to its clients who subscribe to the topic. In this publisher-subscriber model, multiple clients may publish data with the same topic. A client will receive a message it publishes if the client subscribes to the same topic.

    Depending on the use case, a client may choose one of the 3 QoS levels when publishing a message:
    QoS 0: The message is delivered at most once. Messages sent with QoS 0 may be lost.
    QoS 1: The message is delivered at least once. Messages sent with QoS 1 may be delivered more than once.
    QoS 2: The message is delivered exactly once. Messages sent with QoS 2 is guaranteed to be delivered, with no duplication.
    Note

    This implementation of MQTT client does not support QoS level 2 messages.

    I am hoping that those details were enough to realize for what you have seen on your packet captures. Now you know what to expect or what should be the normal behavior.

    Cheers!

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    1 person found this answer helpful.