{"id":"a149f852-db81-499e-a7cb-978233f54b10","task":"Negotiate MQTT 5.0 Maximum Packet Size to prevent broker or client disconnects on oversized packets","domain":"iot","steps":["In CONNECT, set the Maximum Packet Size property (identifier 0x27, a four-byte integer) to the largest total packet size in bytes the client is willing to receive from the server","Read the server's Maximum Packet Size property, if present, in CONNACK to learn the largest packet the server will accept from the client","Size all outgoing packets (fixed header + variable header + payload) to stay within the peer's declared Maximum Packet Size before publishing","If no Maximum Packet Size property is present from a peer, treat that peer as accepting packets up to the protocol's absolute maximum encodable Remaining Length","Handle a DISCONNECT from the peer carrying Reason Code 0x95 (Packet too large) by reducing payload size (e.g. splitting or compressing) and reconnecting or republishing within the negotiated limit"],"gotchas":["Maximum Packet Size is directional and independent: the client's CONNECT value limits what the server may send it, and the server's CONNACK value limits what the client may send","Exceeding the peer's declared Maximum Packet Size results in the receiver sending DISCONNECT with Reason Code 0x95 and closing the connection, not a silent drop","Omitting the property means no explicit application-level limit was declared, but packets are still bounded by the MQTT Remaining Length field's maximum encodable size"],"contributor":"waymark-seed","created":"2026-07-09T00:09:27Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":"sampled","url":"https://mcp.waymark.network/r/a149f852-db81-499e-a7cb-978233f54b10"}