Subject: Re: [core] Block Transfer issue

From: Sharad Holani <[email-masked]>
Date: Fri, 30 Jan 2015 09:56:26 +0000 (GMT)

Hi,

Still I am not clear with answer .

Let  me put with more details

My objective is to how to use the block transfer if the header option value is more than the BLOCK size fixed .

Below is the scenario:

Header

Value

Type

NON (1)

Code

POST (2)

Message ID

0x7d13

Token

0x43

Option

Uri-Path: “/.well-know/core”, (13bytes)

Content-Format: 40(application/link-format)(1 byte)

UUID: “device-uuid” (38 byte length)

Location: “Device resource Location” (40 byte length)

Payload

Device info (link-format)(150 bytes)

The above information provided by my application to CoAP API, I need to fill this information  CoAP format and send to other device .

Since I am using 802.15.4 the block size I set for the CoAP entity  is 64 byte.

After putting the above information in CoAP Message format, the total size of COAP message is coming  around  ~250 bytes ,so I can’t send directly , I need to send through block transfer .

Note: Here may header option (Uri-Path + UUID + Location) = 91 bytes and Payload is 150 bytes .. both are more than my block size 64.

Since CoAP block transfer  has not defined how to handle the message which are having large header option value .

I followed the below method

So transferred the entire payload to block transfer .

Take the entire COAP message as payload and send using CoAP block transfer .Like below

Header

Value

Type

NON (1)

Code

POST (2)

Message ID

0x7d19

Token

0x45

Option

Block1 :  Szx

Payload

Entire COAP message (Including header and payload )

Is it the right way to use block transfer , if not please suggest how to handle the cases where the header optional value is more than my BLOCK SIZE ..

Regards

Sharad.

------- Original Message -------

Sender : Olaf Bergmann<[email-masked]>

Date : Jan 29, 2015 16:53 (GMT+09:00)

Title : Re: [core] Block Transfer issue

Sharad,

Sharad Holani writes:

> Block size of 64 bytes mean that the MTU of the network is 64 bytes ,
> right? That's why the size has been sent to 64 bytes.

No. If either the server or the client is aware of that limitation, it
should pick a smaller block size to ensure that the message fits into
the (path) MTU. The block size option is about the payload size only.

> If only the payload itself is of 64 bytes and the size of the header
> is additional 50 bytes then the total coap message size is (64 + 50 =
> 114 bytes) .
>
> So wont it be wrong to send a message of size 114 bytes when the
> maximum limit is 64 bytes?

Right, but that's up to the coap entities to detect and handle by
adjusting the value of the block size option.

Regards
Olaf