1 Dec 2005 01:51
Re: SCTP Partial delivery / SOCK_SEQPACKET ambiguity
Mark Butler <butlerm <at> middle.net>
2005-12-01 00:51:36 GMT
2005-12-01 00:51:36 GMT
Brian F. G. Bidulock wrote:
Regrettably, the Posix documentation for SOCK_SEQPACKET is inconsistent. This is the description from section 2.10.6:
However the documentation for recvmsg() implies that records and messages are different:
End-of-record was received (if supported by the protocol).
MSG_EOR
End-of-record was received (if supported by the protocol).
MSG_EOR
End-of-record was received (if supported by the protocol).
This is a complete contradiction. It only makes sense if there are protocols that support two sets of boundaries, lower level message boundaries embedded in higher level record boundaries. Are there any?
More likely there are two conceptions of SOCK_SEQPACKET that made their way into the standard - One is SOCK_DGRAM with ordering and reliability added. The other is a byte stream with occasional boundary markers. The draft api uses the latter conception, consistent with Posix XSH 2.10.6. Which conception do existing SOCK_SEQPACKET protocols use?
I guess I can't say standard SOCK_SEQPACKET semantics anymore. Sigh.
- Mark
POSIX references:
http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_10.html
http://www.opengroup.org/onlinepubs/009695399/functions/recvmsg.html
LKSCTP is vulnerable as implemented. Partial delivery locks one-to-many sockets by association.Yes, standard Posix SOCK_SEQPACKET semantics. The serious problem, is with partial deliveries on a one-to-many socket, because they serialize communication from all other associations, potentially hanging the socket for a very long time. Lksctp is currently vulnerable to this problem.Well, no. POSIX SOCK_SEQPACKET sets MSG_TRUNC if the message (not the record) is larger that the supplied buffer, just as does SOCK_DGRAM.
Regrettably, the Posix documentation for SOCK_SEQPACKET is inconsistent. This is the description from section 2.10.6:
The SOCK_SEQPACKET socket type is similar to the SOCK_STREAM type, and is also connection-oriented. The only difference between these types is that record boundaries are maintained using the SOCK_SEQPACKET type. A record can be sent using one or more output operations and received using one or more input operations, but a single operation never transfers parts of more than one record. Record boundaries are visible to the receiver via the MSG_EOR flag in the received message flags returned by the recvmsg() function. It is protocol-specific whether a maximum record size is imposed.No difference from SOCK_STREAM except record boundaries, means that message boundaries are either invisible or identical with record boundaries. Not two independent sets of boundaries.
However the documentation for recvmsg() implies that records and messages are different:
The recvmsg() function shall return the total length of the message. For message-based sockets, such as SOCK_DGRAM and SOCK_SEQPACKET, the entire message shall be read in a single operation. If a message is too long to fit in the supplied buffers, and MSG_PEEK is not set in the flags argument, the excess bytes shall be discarded, and MSG_TRUNC shall be set in the msg_flags member of the msghdr structure. For stream-based sockets, such as SOCK_STREAM, message boundaries shall be ignored. In this case, data shall be returned to the user as soon as it becomes available, and no data shall be discarded.MSG_EOR
...MSG_EOR
End-of-record was received (if supported by the protocol).
MSG_EOR
End-of-record was received (if supported by the protocol).
End-of-record was received (if supported by the protocol).
MSG_EOR
End-of-record was received (if supported by the protocol).
MSG_EOR
End-of-record was received (if supported by the protocol).
This is a complete contradiction. It only makes sense if there are protocols that support two sets of boundaries, lower level message boundaries embedded in higher level record boundaries. Are there any?
More likely there are two conceptions of SOCK_SEQPACKET that made their way into the standard - One is SOCK_DGRAM with ordering and reliability added. The other is a byte stream with occasional boundary markers. The draft api uses the latter conception, consistent with Posix XSH 2.10.6. Which conception do existing SOCK_SEQPACKET protocols use?
I guess I can't say standard SOCK_SEQPACKET semantics anymore. Sigh.
- Mark
POSIX references:
http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_10.html
http://www.opengroup.org/onlinepubs/009695399/functions/recvmsg.html
_______________________________________________ tsvwg mailing list tsvwg <at> ietf.org https://www1.ietf.org/mailman/listinfo/tsvwg
RSS Feed