Comments (6)
I guess, this occurs, if the request is sent after a quite phase.
Californium tracks the requests, but with a quite phase that times out.
A new request is then not longer processed "transparent" but instead passed to the application layer as "random access".
Where ever "block2 option" is added to the response, but that doesn't match the requested one. If you want to get rid of it, please investigate, if "ThingsBoard" is adding that block2 option.
from californium.
I guess, this occurs, if the request is sent after a quite phase.
Californium tracks the requests, but with a quite phase that times out. A new request is then not longer processed "transparent" but instead passed to the application layer as "random access". Where ever "block2 option" is added to the response, but that doesn't match the requested one. If you want to get rid of it, please investigate, if "ThingsBoard" is adding that block2 option.
Thanks, that would explain the behavior, especially with coap clients that take longer between requesting blocks (due to packet loss).
Is there a default value for this quiet phase and can you hint me where/how it can be set?
from californium.
The implementation idea to distinguish between a transparent (Californium handles the blockwise) and random/non-transparent (Californium may still handle a part of the blockwise, but enables the application layer to care on this as well by forwarding all block-request), is pretty old and "before my time". I already started to consider to change that with the next major update to Cf 4. At least add the possibility to resume.
from californium.
BlockwiseLayer - receiveRequest
Without status (timed out), the request is forwarded to the application layer.
BlockwiseLayer - sendResponse.
If a block2 option is provided, it must match the requested block. I assume, the ThingsBoard application layer provides that wrong block2 option.
from californium.
Indeed, thingsboard doesn't seem to be setting the block2 option correctly.
For some reason the timeout seems to be much shorter than 5 minutes. With pauses of around 90-160s I can reliably produce the timed out state. Even though the default of 5 minutes seems to be set...
2024-03-23 09:56:18,261 [main] INFO o.e.c.c.network.stack.BlockwiseLayer - coap BlockwiseLayer uses MAX_MESSAGE_SIZE=1024, PREFERRED_BLOCK_SIZE=1024, BLOCKWISE_STATUS_LIFETIME=300000, MAX_RESOURCE_BODY_SIZE=268435456, BLOCKWISE_STRICT_BLOCK2_OPTION=true
We have a workaround in place to re-request blocks more often, so that even with a couple of missed packets, we don't run into pauses of 90s or more.
The correct fix would be for thingsboard to simply set the block2 offset correctly, then we can also perform random access without having to worry about timed out transparent sessions.
from californium.
For some reason the timeout seems to be much shorter than 5 minutes.
There is a second source of that issue: an ip-address change, maybe caused by a NAT.
Are you using plain CoAP or CoAP/DTLS 1.2?
For plain CoAP, if the address is changing, the transfer could not be tracked with 3x or earlier versions. (I plan to adapt that in 4. Tracking will not be possible, but it should be possible to resume an transfer.)
If you use CoAP/DTLS 1.2 CID, then it requires an update to the most recent version of Californium 3.11 and it requires to configure CoapConfig.RESPONSE_MATCHING to PRINCIPAL_IDENTITY.
from californium.
Related Issues (20)
- Californium Deployment issues HOT 12
- ignoring ACK, possible MID reuse before lifetime end for token HOT 4
- Resource /msr not found HOT 9
- Can I use simple file server with DTLS using X.509 Certificates? HOT 2
- DTLS Handshake failure using Quectel BG77 module as a client HOT 10
- BasicForwardingProxy2 with DTLS HOT 2
- How to listen observe relation lifecycle ? HOT 4
- OSCORE setRecipientSeq() is not visible HOT 9
- Notification on CoapResource removal HOT 6
- Java 7 - no more direct support by the Eclipse CI HOT 11
- Minor Release 3.11.0 - Available HOT 1
- Californium initiates a DTLS handshake when running on server side HOT 8
- Enabling github Discussions?
- How to clear ongoing observe notifications from transit on CoapEndpoint stop? HOT 16
- lwm2m-service deployu in k8s๏ผcan not return client message HOT 4
- [Firmware Update][Blockwise] - Is it possible transfer a firmware more than 300MB using Blockwise? HOT 5
- Minor Release 3.12.0 - Available HOT 1
- Growing Memory Utilisation - CF-Secure server implementation with CustomPskStore HOT 7
- Question about Key ID Context CBOR coding in OSCORE HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from californium.