Subject: [core] CoAP over TCP

From: Guido Moritz <[email-masked]>
Date: Thu, 15 Mar 2012 10:40:09 +0100

Dear WG,

as stated in the current CoAP draft TCP as transport is out of scope.
Nevertheless, has anybody ever tried to use CoAP over TCP? We would be very
interested in the experiences and problems!

We have to use CoAP over TCP, because TCP and TLS are required by a specific
security profile we are implementing. The security profile is independent
from CoAP itself, but TCP and TLS are mandatory. So what we are trying to
realize is a persistent TCP connection to have the handshakes etc. only one
time at the startup of the connection. 

At a first glance, the major issue we identified is the missing length
information for the packet size when using TCP instead of UDP. The solutions
we came up with are either (1) a new length option for CoAP similar to HTTP
or (2) use blocking to indicate if for this request more payload will be
send or if this is the last packet. At (2) we are not sure if a sender can
indicate for small payload which fits into one packet that the first block
is also the last.

Has anybody on the list comments or further experiences. It might already
have been discussed somewhere, but then I have missed this discussion.

Regards,
Guido

---

From: Carsten Bormann <[email-masked]>
Date: Thu, 15 Mar 2012 10:54:01 +0100

> interested in the experiences and problems!

We never said that aloud, but in designing CoAP we have paid specific attention to making sure it works well over TCP.

There are lots of applications where intermediaries can talk to each other over a nice flow-/congestion-controlled, auto-aggregating transport much better than over a stream of UDP packets.

> indicate for small payload which fits into one packet that the first block

Essentially, you don't need the MID, because TCP already takes care of ACKs and duplicate detection.  So you can steal the field for a length field.  (Or add a new one.  There is no need for the TCP header to look exactly the same as the UDP 4-byte header.)
That little piece of design should be done at an appropriate time.

Klaus, I think we may need to write up the TCP header format...
Guido: To minimize confusion, can we wait for that until after the WGLC of the current documents? :-)

Grüße, Carsten

---

From: Guido Moritz <[email-masked]>
Date: Thu, 15 Mar 2012 11:01:40 +0100

Thanks for the fast reply. Of course, we can wait. But I am happy that this
issue already has been taken care of. 

See you in Paris,
Guido

> -----Ursprüngliche Nachricht-----
> Von: Carsten Bormann [mailto:[email-masked]]
> Gesendet: Donnerstag, 15. März 2012 10:54
> An: Guido Moritz
> Cc: 'core'
> Betreff: Re: [core] CoAP over TCP
> 
> 
> We never said that aloud, but in designing CoAP we have paid specific
attention
> to making sure it works well over TCP.
> 
> There are lots of applications where intermediaries can talk to each other
over
> a nice flow-/congestion-controlled, auto-aggregating transport much better
> than over a stream of UDP packets.
> 
> Essentially, you don't need the MID, because TCP already takes care of
ACKs
> and duplicate detection.  So you can steal the field for a length field.
(Or add a
> new one.  There is no need for the TCP header to look exactly the same as
the
> UDP 4-byte header.)
> Guido: To minimize confusion, can we wait for that until after the WGLC of
the
> current documents? :-)