Media handover with SCTP
The SCTP protocol is a relatively new protocol that is an alternative to UDP and TCP. It has a couple of really interesting capabilities:
-
support for multiple streams that run in parallel
-
support for acknowledgement and replay quality ranging from UDP’s just-drop-it to TCP’s block-until-it-gets-through
-
support for multi-homed endpoints, even supporting a mixture of IPv4 and IPv6 addresses
Now imagine using SCTP for the next connection to your favourite media website. You’d reserve a TCP-quality stream to exchange HTTP, and another over which you’d receive media, perhaps in an RTP flow, with UDP style (if it needs to be interactive) or a maximum resend attempt timer (if it isn’t live and can suffer the delay of buffering). And imagine that the web frontend relays your request over SCTP to a media server in its backend. Then, if the backend can find what you are looking for, the web portal connects you directly to the backend and you can enjoy the media without the hickups that would occur if the media was served over HTTP with full-blown TCP connection quality.
What we would like to see verified is if the following is possible, and if so, a bit of C code to demonstrate this fact:
-
Setup an SCTP session from party A to B
-
Setup an SCTP session from party B to C
-
Let B add the address of C to the session between A and B
-
Let B add the address of A to the session between B and C
-
Figure out what it takes to get one of the streams between A and C to communicate directly
-
B should ask C to make this switch for one stream only; it may need to sync stream sequence numbers, perhaps through the Partial Reliability extension
-
The code on A and C that runs over that one stream may explicitly mention the target socket in
sendmsg()
and/ofrecvmsg()
-
Look for race conditions where B sends sequence numbers to C (or A) while C (or A) is just sending a new message
-
Demonstrate that other streams between A and B continue as before, as well as between B and C
-
Demonstrate that this is compatible with the SCTP RFCs
-
If this is not possible, then explain the conflict based on the RFCs — and be sure to ask us if we see a way out
Please understand that this assignment cannot be done without some experience in network stack programming in C. The socket interface should be addressed directly to get the best out of it. Another requirement for students undertaking this assignment is the ability to understand RFCs.