Hi,
I'm currently writing my dissertation for my MSc in Computer Science and as subject of my paper I came up with the idea to extend Go with the SCTP protocol. As suggested on the Go website I'm posting this mail to discuss the idea before jumping in the deep.
First a little bit of background; SCTP is a protocol in the same layer as TCP and UDP and can be seen as an improvement on these protocols. SCTP has message boundaries, is reliable, can have multiple data streams and much more. One of the main advantages is that with SCTP it is much easier to build a client-server app than with TCP because a lot of the complexity doesn't have to be resolved in the application layer anymore. (I do admit I'm generalizing a bit here because a lot depends on what type of application you build).
With this in my mind I started reading about Go and soon discovered it also tries to make writing software less complicated. This got me to thinking: simple + simple = 'more simple' ;-) So why not combine the two?
To see if this plan is feasible I did a bit of research and did some coding to see how difficult it would be, here are my findings so far:
- On of the main things to keep in mind is that SCTP only has a native implementation on FreeBSD, Solaris and Linux. For Mac OS X and Windows drivers are available but must ne installed manually.
- SCTP works with two models, one-to-one and one-to-many. The one-to-one model is for easy migration of existing TCP application, it maps one-to-one to the system calls TCP does to do a connection but doesn't have all the (cool) features of SCTP. One-to-many model is full on SCTP, significantly different from TCP/UDP implementations.
- I created some C TCP/SCTP echo client server apps, rewrote them in GO (the TCP bit) and as a next step I checked out the release branch of Go and extended it far enough to be able to write an SCTP Go server (one to one model, very similar to TCP). And hooray! I got the SCTP Go server working in less than a day :-)
The first issue (no native windows/osx support) can be tackled by implementing SCTP on top of UDP. An example implementation of this has been written by Randy Stewart (the main driver behind the protocol) and published in one of his books. The second and third findings made me conclude that the one-to-one model is very easy to implement in Go, the TCP is an excellent template. The one-to-many model is more work and needs some extra thinking because of different way connections get established etc. But I don't think it would be to hard to do this.
So what do you think, is this an idea worth implementing. If so what is the best way forward? Shall I integrate it in the language or separate it out a bit more? Are there other areas within Go which can benefit from this, e.g. channels?
Olivier