Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set MQTT max packet size #7091

Merged
merged 2 commits into from Jan 29, 2023
Merged

Set MQTT max packet size #7091

merged 2 commits into from Jan 29, 2023

Conversation

ansd
Copy link
Member

@ansd ansd commented Jan 29, 2023

Set default max size of 65,536 for CONNECT packet.

In MQTT 3.1.1, the CONNECT packet consists of

  1. 10 bytes variable header
  2. ClientId (up to 23 bytes must be supported)
  3. Will Topic
  4. Will Message (maximum length 2^16 bytes)
  5. User Name
  6. Password

Restricting the CONNECT packet size to 2^16 = 65,536 bytes seems to be a reasonalbe default.

The value is configurable via advanced.config.

In MQTT 3.1.1, the CONNECT packet consists of
1. 10 bytes variable header
2. ClientId (up to 23 bytes must be supported)
3. Will Topic
4. Will Message (maximum length 2^16 bytes)
5. User Name
6. Password

Restricting the CONNECT packet size to 2^16 = 65,536 bytes
seems to be a reasonalbe default.

The value is configurable via the MQTT app parameter
`max_packet_size_unauthenticated`.

(Instead of being called `max_packet_size_connect`) the
name `max_packet_size_unauthenticated` is generic
because MQTT 5 introduces an AUTH packet type.
@michaelklishin michaelklishin merged commit 5dc2d9b into main Jan 29, 2023
@michaelklishin michaelklishin deleted the mqtt-max-size-connect-packet branch January 29, 2023 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants