Subject: [core] Payload in CoAP

From: Kepeng Li <[email-masked]>
Date: Thu, 11 Nov 2010 14:55:59 +0800

Hi,

When I read draft-ietf-core-coap-03, I find no explanation about the
payload.

Do we need to have one field to specify the length of the payload? And also
how can the receiver know that it is the end of the whole message?

Should this be done by the UDP? I notice that there is a length field in
UDP.

   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

   |Ver| T |  OC   |      Code     |        Transaction ID         

   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

   |   Options (if any) ...

   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

   |   Payload (if any) ...

   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Thanks,

Cheers

Kepeng

---

From: Nathan Smith <[email-masked]>
Date: Thu, 11 Nov 2010 10:38:18 -0500

Hi Kepeng,

Your guess is the correct one -- since we know where the start of the payload is (since each CoAP header option has a length field), we can use the length field in the UDP header to determine where the CoAP payload ends.

Cheers,
Nate

On Nov 11, 2010, at 1:55 AM, Kepeng Li wrote:

> Hi,
>  
> When I read draft-ietf-core-coap-03, I find no explanation about the payload.
>  
> Do we need to have one field to specify the length of the payload? And also how can the receiver know that it is the end of the whole message?
>  
> Should this be done by the UDP? I notice that there is a length field in UDP.
>  
> _______________________________________________
> core mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/core

---

From: Linyi Tian <[email-masked]>
Date: Fri, 12 Nov 2010 09:39:05 +0800

Hi, Nate

Does CoAP layer aware with length field In the UDP layer? Is ‘\0’ used to
end the buffer for the CoAP payload instead?

Cheers,
Linyi

On 10-11-11 下午11:38, "Nathan Smith" <[email-masked]> wrote:

> Hi Kepeng,
> 
> Your guess is the correct one -- since we know where the start of the payload
> is (since each CoAP header option has a length field), we can use the length
> field in the UDP header to determine where the CoAP payload ends.
> 
> Cheers,
> Nate
>

---

From: Carsten Bormann <[email-masked]>
Date: Fri, 12 Nov 2010 09:51:09 +0800

On Nov 12, 2010, at 09:39, Linyi Tian wrote:

> Does CoAP layer aware with length field In the UDP layer? Is ‘\0’ used to end the buffer for the CoAP payload instead?

Due to the usual layering in the IP stack, the CoAP implementation gets UDP datagrams with a defined length (and, yes, this happens to be encoded in the UDP length field, but that wouldn't even have been necessary, as IP itself already delimits the end of the datagram).
So there is no further need to delimit the end of the payload.

Gruesse, Carsten