Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 23 Advanced SCTP Sockets. SCTP Sockets, recall ● Stream Control Transmission Protocol ● Multi-homed ● Association, instead of connection ● IPV4.

Similar presentations


Presentation on theme: "Chapter 23 Advanced SCTP Sockets. SCTP Sockets, recall ● Stream Control Transmission Protocol ● Multi-homed ● Association, instead of connection ● IPV4."— Presentation transcript:

1 Chapter 23 Advanced SCTP Sockets

2 SCTP Sockets, recall ● Stream Control Transmission Protocol ● Multi-homed ● Association, instead of connection ● IPV4 & IPV6 simultaneously in association ● Message oriented, ordered ● Provides reliability for multi-homed servers

3 Contents ● Control of failure detection ● Unordered data ● Notifications ● Complete/partial messages ● Iterative/Concurrent servers using SCTP ● Extracting associations

4 Autoclosing ● Client closes association with close(), or server with MSG_EOF or MSG_ABORT flag ● If client opens connection, association is left to the server until client closes ● Server can timeout to close the association Setsockopt(sock_fd, IPPROTO_SCTP, SCTP_AUTOCLOSE, &close_time, sizeof(close_time);

5 Partial Delivery ● SCTP uses partial delivery only if the message is too large – Message requires buffer space exceeding threshold ● E.g. half of buffer size – Message can be delivered only from the beginning sequentially up to the first missing piece – PD API prevents other messages (also in other streams) from being transmitted

6 Notifications ● Seven notifications ● When message is received, msg_flags is checked for notifications ● Notification tells about: – Process association change, Peer address change, Remote error, Failed message, Adaption layer indication, Partial delivery notification, Shutdown notification

7 Unordered Data ● Sctp_sendmsg flag MSG_UNORDERED ● Reliably transmits data ● Received out-of-order, depending on the order of arrival

8 Binding ● sctp_bindx() can bind several IP's to one socket ● All addresses must use the same port number ● Addresses can be IPV4 or IPV6 ● Enough storage must be allocated

9 Address Information ● Functionality to determine which addresses are used by multi-home clients/servers ● Addresses can be obtained from associations by signing to notifications. At the start of connection: – SCTP_COMM_UP notification – sctp_getpaddrs – sctp_getladdrs ● Association ID from peer address using sctp_opt_info on the socket

10 Heartbeating ● Similar to TCP keep-alive ● Applications can change the delay or turn off heartbeating – Disabling prevents SCTP from knowing when peer address becomes active ● Error threshold: Missed heartbeats or retransmission timeouts

11 int heartbeat_action(int sock_fd, SA *sa, socklen_t salen, uint value) { struct sctp_paddrparams sp; int siz; bzero(&sp, sizeof(sp)); sp.spp_hbinterval = value; memcpy((caddr_t) & sp.spp_address, sa, salen): Setsockopt(sock_fd, IPPROTO_SCTP, SCTP_PEER_ADDR_PARAMS, &sp, sizeof(sp); return(0); }

12 Peeling off Associations ● One-to-many associations to one-to-one ● Many-to-one association advantages – Only one file descriptor – Simple iterative servers – Applications can send date on 3 rd and 4 th packet in four-way handshakes – Not necessary to call connect or accept, just a receive call on the socket descriptor is enough

13 Concurrent servers ● Concurrent servers can be done using sctp_peeloff() – Returns a new socket descriptor with just one association – This socket can be given to a new thread or child process

14 Controlling Timing ● Socket options ● Seven controls ● How quickly SCTP will detect failure or make retransmissions ● Either in attempting connection or noticing that one endpoint is down ● One should carefully think whether to change these values (Useful maybe in private networks)

15 When to use SCTP ● Multihome servers ● Muliple data elements, no head-of-line blocking ● Messages, no need for user to mark start and end of message ● Message order is unrelevant ● Messages may timeout, dropped if no need anymore ● Easy to migrate from TCP, and many good points of TCP implemented (Except half-close, urgent data)


Download ppt "Chapter 23 Advanced SCTP Sockets. SCTP Sockets, recall ● Stream Control Transmission Protocol ● Multi-homed ● Association, instead of connection ● IPV4."

Similar presentations


Ads by Google