0

How I can set a size of PDU dynamically for Californium server?

Context:

1) I have a device with implemented coap-client functionality. This device is constrained by RAM, about 200 free bytes for rx/tx buffers.

In the request the device can sent a prefer PDU size. But I don't understand how to configure server responses with this PDU size. Is it possible?

2) Will be work a blockwise-functionality for this case?

Serge Maslyakov
  • 1,410
  • 1
  • 17
  • 23

1 Answers1

0

Ok, I found how to do it.

It is not a Californium responsibility. The management of the PDU-size works via block-wise option Block2.

See the CoAP block-wise RFC Section 3.1:

In the second example (Figure 3), the client anticipates the block- wise transfer (e.g., because of a size indication in the link-format description [RFC6690]) and sends a block size proposal. All ACK messages except for the last carry 64 bytes of payload; the last one carries between 1 and 64 bytes.

Client                                                   Server
|                                                          |
| CON [MID=1234], GET, /status, 2:0/0/64           ------> |
|                                                          |
| <------   ACK [MID=1234], 2.05 Content, 2:0/1/64         |
|                                                          |
| CON [MID=1235], GET, /status, 2:1/0/64           ------> |
|                                                          |
| <------   ACK [MID=1235], 2.05 Content, 2:1/1/64         |
:                                                          :
:                          ...                             :
:                                                          :
| CON [MID=1238], GET, /status, 2:4/0/64           ------> |
|                                                          |
| <------   ACK [MID=1238], 2.05 Content, 2:4/1/64         |
|                                                          |
| CON [MID=1239], GET, /status, 2:5/0/64           ------> |
|                                                          |
| <------   ACK [MID=1239], 2.05 Content, 2:5/0/64         |

    Figure 3: Block-Wise GET with Early Negotiation
Community
  • 1
  • 1
Serge Maslyakov
  • 1,410
  • 1
  • 17
  • 23