eclipse-leshan / leshan

Java Library for LWM2M
https://www.eclipse.org/leshan/
BSD 3-Clause "New" or "Revised" License
645 stars 406 forks source link

Did leshan bootstrap server support BLOCKWISE in CoAP #1568

Closed Bradymu closed 8 months ago

Bradymu commented 8 months ago

Question

we use Leshan bootstrap server in NO security, client connect to Leshan bootstrap server and bootstrap send the DM server information and certificate information to client. but client receive block, but from the log, the two blocks in CoAP packets didn't match for the token being different and so error 4.08 is returned.

wireshark package: image tcpdump1221.zip bootstrap server log below

Send WRITE request on /0/1 using TLV(11542) /0/1/0 : "coaps://leshan.eclipseprojects.io:5684" /0/1/1 : false /0/1/2 : 2 /0/1/3 : 425 Bytes /0/1/4 : 556 Bytes /0/1/5 : 138 Bytes /0/1/6 : 3 /0/1/7 : 0 Bytes

/0/1/8 : 0 Bytes /0/1/9 : "" /0/1/10 : 123 /0/1/11 : 1 /0/1/12 : 0 /0/1/15 : 3 Dec 21, 6:08:00.038 PM receive error response Receive REQUEST_ENTITY_INCOMPLETE(408) Dec 21, 6:08:00.638 PM send write Send WRITE request on /1/0 using TLV(11542) /1/0/0 : 123 /1/0/1 : 300 /1/0/2 : 1 /1/0/6 : true /1/0/7 : "U" Dec 21, 6:08:00.638 PM receive success response Receive CHANGED(204)

jvermillard commented 8 months ago

the two blocks in CoAP packets didn't match for the token being different and so error 4.08 is returned.

It's a common mistake: two blocks should not share the same token; see: https://github.com/eclipse-californium/californium/pull/2088