Skip to content

Commit cc206a6

Browse files
progress
1 parent 6fd223e commit cc206a6

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

doc/dev/adr/0020-large-message-chunking.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ We will implement sdk-level message chunking as part of the Protocol layer to tr
2020
"chunkIndex": 0,
2121
"timeout" : "00:00:10",
2222
"totalChunks": 5,
23-
"checksum": "optional-message-hash"
23+
"checksum": "message-hash"
2424
}
2525
```
2626
- `messageId, chunkIndex, timeout` - present for every chunk; `totalChunks, checksum` - present only for the first chunk.
@@ -55,13 +55,13 @@ We will implement sdk-level message chunking as part of the Protocol layer to tr
5555
5656
### Implementation Considerations
5757
- **Error Handling:**
58-
- Chunk timeout mechanisms, fixed or sliding timeout window approaches can be used (see Chunk Timeout Mechanism Options in Appendix)
58+
- Chunk timeout mechanisms (see Chunk Timeout Mechanism Options in the Appendix)
5959
- Error propagation to application code
6060
- **Performance Optimization:**
6161
- Concurrent chunk transmission
6262
- Efficient memory usage during reassembly
6363
- **Security:**
64-
- Validate message integrity across chunks and prevent chunk injection attacks (covered if checksumm implemented)
64+
- Validate message integrity across chunks and prevent chunk injection attacks (see Checksum Algorithm Options for MQTT Message Chunking in the Appendix)
6565
6666
# Appendix
6767
@@ -77,4 +77,24 @@ We will implement sdk-level message chunking as part of the Protocol layer to tr
7777
- Reset the timeout each time a new chunk arrives
7878
- Only expire the chunked message if there's a long gap between chunks
7979
- **Pros**: Tolerates varying network conditions and delivery rates
80-
- **Cons**: Could keep resources allocated for extended periods
80+
- **Cons**: Could keep resources allocated for extended periods
81+
82+
## Checksum Algorithm Options for MQTT Message Chunking
83+
84+
1. MD5
85+
- **Description**: 128-bit hash function
86+
- **Pros**: Good performance, reasonable size (16 bytes), widely implemented
87+
- **Cons**: No longer considered cryptographically secure
88+
- **Best for**: Basic integrity verification without security requirements
89+
90+
2. SHA-256
91+
- **Description**: Secure hash algorithm producing 256-bit output
92+
- **Pros**: Cryptographically secure, widely supported in all target languages
93+
- **Cons**: Larger output size (32 bytes), more computation required
94+
- **Best for**: Applications requiring message security and tamper protection
95+
96+
3. BLAKE2b
97+
- **Description**: Modern cryptographic hash function
98+
- **Pros**: Faster than MD5 but with security comparable to SHA-3
99+
- **Cons**: May not be as universally available in standard libraries
100+
- **Best for**: Performance-critical applications that still need security

0 commit comments

Comments
 (0)