public inbox for linux-sctp@vger.kernel.org
 help / color / mirror / Atom feed
* MSG_EOR flag in conjunction with SOCK_STREAM
@ 2014-08-07 21:08 Butler, Peter
  2014-08-07 21:20 ` Michael Tuexen
  2014-08-08 14:05 ` Vlad Yasevich
  0 siblings, 2 replies; 3+ messages in thread
From: Butler, Peter @ 2014-08-07 21:08 UTC (permalink / raw)
  To: linux-sctp

A question about using a SOCK_STREAM socket (one-to-one TCP-style) and checking for the MSG_EOR flag.

If, on a given association (i.e. a single file descriptor, as per the one-to-one TCP-style SOCK_STREAM socket semantics), a message is received via sctp_recvmsg() with the MSG_EOR flag *not* set (such that more of the message is yet to be retrieved), does LKSCTP guarantee that the subsequent call to sctp_recvmsg() will still pertain to the same message (i.e. record)?

That is, could the following message sequence (as returned by sctp_recvmsg(); not necessarily in this order on the wire) ever occur in subsequent calls to sctp_recvmsg() on the aforementioned file descriptor?

MSG A, part 1
MSG A, part 2
MSG A, part 3
MSG B
MSG A, part 4
MSG A, part 5 (EOR)
.
.
.

Or will the kernel always guarantee the following:

MSG A, part 1
MSG A, part 2
MSG A, part 3
MSG A, part 4
MSG A, part 5 (EOR)
MSG B
.
.
.

If the former is indeed possible, can the 'interleaving' only occur within separate streams of the association?  Or can it also occur within a single given stream?

Can unordered data ever cause this to occur?


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: MSG_EOR flag in conjunction with SOCK_STREAM
  2014-08-07 21:08 MSG_EOR flag in conjunction with SOCK_STREAM Butler, Peter
@ 2014-08-07 21:20 ` Michael Tuexen
  2014-08-08 14:05 ` Vlad Yasevich
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Tuexen @ 2014-08-07 21:20 UTC (permalink / raw)
  To: linux-sctp

On 07 Aug 2014, at 23:08, Butler, Peter <pbutler@sonusnet.com> wrote:

> A question about using a SOCK_STREAM socket (one-to-one TCP-style) and checking for the MSG_EOR flag.
> 
> If, on a given association (i.e. a single file descriptor, as per the one-to-one TCP-style SOCK_STREAM socket semantics), a message is received via sctp_recvmsg() with the MSG_EOR flag *not* set (such that more of the message is yet to be retrieved), does LKSCTP guarantee that the subsequent call to sctp_recvmsg() will still pertain to the same message (i.e. record)?
> 
> That is, could the following message sequence (as returned by sctp_recvmsg(); not necessarily in this order on the wire) ever occur in subsequent calls to sctp_recvmsg() on the aforementioned file descriptor?
> 
> MSG A, part 1
> MSG A, part 2
> MSG A, part 3
> MSG B
> MSG A, part 4
> MSG A, part 5 (EOR)
> .
> .
> .
That would mean that you use the interleaving level 2 as specified in
http://tools.ietf.org/html/rfc6458#section-8.1.20
> 
> Or will the kernel always guarantee the following:
> 
> MSG A, part 1
> MSG A, part 2
> MSG A, part 3
> MSG A, part 4
> MSG A, part 5 (EOR)
> MSG B
> .
> .
> .
That would be interleaving level 0 or 1, which are identical for SOCK_STREAM sockets.
This should be the default.
> 
> If the former is indeed possible, can the 'interleaving' only occur within separate streams of the association?  Or can it also occur within a single given stream?
Interleaving level 2 would allow this.

Best regards
Michael
> 
> Can unordered data ever cause this to occur?
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: MSG_EOR flag in conjunction with SOCK_STREAM
  2014-08-07 21:08 MSG_EOR flag in conjunction with SOCK_STREAM Butler, Peter
  2014-08-07 21:20 ` Michael Tuexen
@ 2014-08-08 14:05 ` Vlad Yasevich
  1 sibling, 0 replies; 3+ messages in thread
From: Vlad Yasevich @ 2014-08-08 14:05 UTC (permalink / raw)
  To: linux-sctp

On 08/07/2014 05:08 PM, Butler, Peter wrote:
> A question about using a SOCK_STREAM socket (one-to-one TCP-style) and checking for the MSG_EOR flag.
> 
> If, on a given association (i.e. a single file descriptor, as per the one-to-one TCP-style SOCK_STREAM socket semantics), a message is received via sctp_recvmsg() with the MSG_EOR flag *not* set (such that more of the message is yet to be retrieved), does LKSCTP guarantee that the subsequent call to sctp_recvmsg() will still pertain to the same message (i.e. record)?
> 
> That is, could the following message sequence (as returned by sctp_recvmsg(); not necessarily in this order on the wire) ever occur in subsequent calls to sctp_recvmsg() on the aforementioned file descriptor?
> 
> MSG A, part 1
> MSG A, part 2
> MSG A, part 3
> MSG B
> MSG A, part 4
> MSG A, part 5 (EOR)
> .
> .
> .
> 
> Or will the kernel always guarantee the following:
> 
> MSG A, part 1
> MSG A, part 2
> MSG A, part 3
> MSG A, part 4
> MSG A, part 5 (EOR)
> MSG B
> .
> .
> .
> 

On Linux,  I believe that the above is guaranteed on a SOCK_STREAM socket.  Linux
doesn't currently implement interleaving level 2.  The default is level 0 (no
interleaving). Level 1 is supported (association interleaving), but it only really
functions on 1-many sockets.  Level 2 (inter-stream interleaving) is not supported
yet.

> If the former is indeed possible, can the 'interleaving' only occur within separate streams of the association?  Or can it also occur within a single given stream?
> 
> Can unordered data ever cause this to occur?
> 

Not currently on linux.

-vlad


> --
> To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-08-08 14:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-07 21:08 MSG_EOR flag in conjunction with SOCK_STREAM Butler, Peter
2014-08-07 21:20 ` Michael Tuexen
2014-08-08 14:05 ` Vlad Yasevich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox