Skip to contentSkip to conversation

one-to-many question

DISCUSSION xiong wei 5 participants 7 messages Aug 15, 2013 SCTP protocol

lore
Share & tools
lore

xiong wei

author
#0 lore raw

Hi, experts

For one-to-many mode. Suppose I have a socket which contain several associations in it. that means there are several clients connect with server.

If I use sendmsg(...) function to send msg from server, How does sctp identify which association will receive the data? Does all clients will receive the msg?

And, Does sctp provide a way for server to send msg to all associations in one syscall ?

Thanks.

#1 lore raw
Quoted 6 lines · xiong wei

Hi, experts

For one-to-many mode. Suppose I have a socket which contain several associations in it. that means there are several clients connect with server.

Quoted 6 lines

If I use sendmsg(...) function to send msg from server, How does sctp identify which association will receive the data? Does all clients will receive the msg?

And, Does sctp provide a way for server to send msg to all associations in one syscall ?

Neil Horman wrote:

The receiving association is specified in either the msg_name field of the message header or the association id field of the sndrcv_info cmsg header in the datagram. IIRC there is no was to send to all associations at once in a single syscall, unless you want to marshall up all the data and pass it down via the sendmmsg syscall, which I don't think lksctp-tools supports yet (though that would be a nice feature).
Neil

#2 lore raw
In reply to xiong wei
Quoted 9 lines · xiong wei

Hi, experts

For one-to-many mode. Suppose I have a socket which contain several associations in it. that means there are several clients connect with server.

If I use sendmsg(...) function to send msg from server, How does sctp identify which association will receive the data? Does all clients will receive the msg?

You can use the deprecated cmsg SCTP_SNDRCV and specify the association id. See http://tools.ietf.org/html/rfc6458#section-5.3.2
I'm not sure if Linux supports the newer cmsg SCTP_SNDINFO yet. See http://tools.ietf.org/html/rfc6458#section-5.3.4

Quoted 3 lines

And, Does sctp provide a way for server to send msg to all associations in one syscall ?

To send the message on all associations, you can set the SCTP_SENDALL flags. See the above references. I'm not sure if this flag is supported by Linux or not.

Best regards
Michael

Quoted 7 lines

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

#3 lore raw
In reply to xiong wei
Quoted 11 lines · Daniel Borkmann
Quoted 10 lines · xiong wei

Hi, experts

For one-to-many mode. Suppose I have a socket which contain several associations in it. that means there are several clients connect with server.

If I use sendmsg(...) function to send msg from server, How does sctp identify which association will receive the data? Does all clients will receive the msg?

Quoted 6 lines
Quoted 2 lines

And, Does sctp provide a way for server to send msg to all associations in one syscall ?

Neil Horman wrote:

The receiving association is specified in either the msg_name field of the

Can you specify on Linux an sctp_assoc_t? Or would you specify one of the remote IP addresses? Specifying an sctp_assoc_t would be Linux specific, I guess. At least this isn't covered by
http://tools.ietf.org/html/rfc6458
as far as I know.

Best regards
Michael

Quoted 11 lines

message header or the association id field of the sndrcv_info cmsg header in the datagram. IIRC there is no was to send to all associations at once in a single syscall, unless you want to marshall up all the data and pass it down via the sendmmsg syscall, which I don't think lksctp-tools supports yet (though that would be a nice feature).
Neil
--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw
In reply to xiong wei
Quoted 16 lines · Michael Tuexen
Quoted 14 lines · Daniel Borkmann
Quoted 12 lines · xiong wei

Hi, experts

For one-to-many mode. Suppose I have a socket which contain several associations in it. that means there are several clients connect with server.

If I use sendmsg(...) function to send msg from server, How does sctp identify which association will receive the data? Does all clients will receive the msg?

And, Does sctp provide a way for server to send msg to all associations in one syscall ?

Quoted 9 lines
Quoted 3 lines

Neil Horman wrote:

The receiving association is specified in either the msg_name field of the

Can you specify on Linux an sctp_assoc_t? Or would you specify one of the remote IP addresses? Specifying an sctp_assoc_t would be Linux specific, I guess. At least this isn't covered by
http://tools.ietf.org/html/rfc6458
as far as I know.

Its a sockaddr structure that is used in the lookup of sctp_sendmsg, so It should be a peer ip address (either v4 or v6)
Neil

Quoted 19 lines

Best regards
Michael

Quoted 11 lines

message header or the association id field of the sndrcv_info cmsg header in the datagram. IIRC there is no was to send to all associations at once in a single syscall, unless you want to marshall up all the data and pass it down via the sendmmsg syscall, which I don't think lksctp-tools supports yet (though that would be a nice feature).
Neil
--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

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

#5 lore raw
In reply to xiong wei
Quoted 16 lines · Michael Tuexen
Quoted 14 lines · Daniel Borkmann
Quoted 12 lines · xiong wei

Hi, experts

For one-to-many mode. Suppose I have a socket which contain several associations in it. that means there are several clients connect with server.

If I use sendmsg(...) function to send msg from server, How does sctp identify which association will receive the data? Does all clients will receive the msg?

And, Does sctp provide a way for server to send msg to all associations in one syscall ?

Quoted 8 lines
Quoted 3 lines

Neil Horman wrote:

The receiving association is specified in either the msg_name field of the

Can you specify on Linux an sctp_assoc_t? Or would you specify one of the remote IP addresses? Specifying an sctp_assoc_t would be Linux specific, I guess. At least this isn't covered by
http://tools.ietf.org/html/rfc6458
as far as I know.

msg_name would contain the address, not the association id.

-vlad

Quoted 20 lines

Best regards
Michael

Quoted 11 lines

message header or the association id field of the sndrcv_info cmsg header in the datagram. IIRC there is no was to send to all associations at once in a single syscall, unless you want to marshall up all the data and pass it down via the sendmmsg syscall, which I don't think lksctp-tools supports yet (though that would be a nice feature).
Neil
--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

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

#6 lore raw
In reply to xiong wei
Quoted 19 lines · Vlad Yasevich
Quoted 18 lines · Michael Tuexen
Quoted 16 lines · Daniel Borkmann
Quoted 6 lines · xiong wei

Hi, experts

For one-to-many mode. Suppose I have a socket which contain several associations in it. that means there are several clients connect with server.

Quoted 6 lines

If I use sendmsg(...) function to send msg from server, How does sctp identify which association will receive the data? Does all clients will receive the msg?

And, Does sctp provide a way for server to send msg to all associations in one syscall ?

Neil Horman wrote:

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

The receiving association is specified in either the msg_name field of the

Can you specify on Linux an sctp_assoc_t? Or would you specify one of the remote IP addresses? Specifying an sctp_assoc_t would be Linux specific, I guess. At least this isn't covered by
http://tools.ietf.org/html/rfc6458
as far as I know.

msg_name would contain the address, not the association id.

Thanks for the clarification. Makes perfect sense. We do the same in FreeBSD...

Best regards
Michael

Quoted 24 lines

-vlad

Quoted 20 lines

Best regards
Michael

Quoted 11 lines

message header or the association id field of the sndrcv_info cmsg header in the datagram. IIRC there is no was to send to all associations at once in a single syscall, unless you want to marshall up all the data and pass it down via the sendmmsg syscall, which I don't think lksctp-tools supports yet (though that would be a nice feature).
Neil
--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

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