Hello,

I've been working on this patch to make apr and httpd work with SCTP streams.

Stream Control Transmission Protocol (SCTP - RFC2960) is a transport layer
protocol capable of providing reliable (in-order, no loss, no duplicates,
 no error) message oriented service to application.
Other interesting features of SCTP include multistreaming (many logical pipes
in 1 SCTP association to transfer independent data like web objects without
head of line blocking problem) and multihoming (ability to support more than
1 interface/IP address at a SCTP endpoint).

The idea was to enable httpd to receive HTTP request on a particular SCTP stream and send the HTTP response on the same stream. Using different SCTP streams for independent objects might improve performance (preventing HOL as mentioned above).

apr-0.9.2 included recognition and support for SCTP from Randall Stewart.
I did my changes on top of this.

To give an outline of the implementation with the files involved:

APR:

o I created apr_socket_send_sctp and apr_socket_recv_sctp which take an extra parameter - SCTP stream id. The recv function uses recvmsg function call and gets the SCTP stream id on which the request came in. Similarly, sendmsg call is used in apr_socket_send_sctp (sendrecv.c in network_io/unix). o I didnt want to change the signature of any other function so I decided to use buckets to pass the stream id info to and fro. The socket bucket read puts the stream id (from socket recv) in a heap bucket and the caller takes the responsibility of retrieving this. (apr_buckets_socket.c, apr_brigade.c).

HTTPD:

o core_input_filter retrieves and stores the stream id in a field in the core_net_rec, which is used by core_output_filter->APR while sending response.
o Also, I changed Listen directive to take the transport layer protocol
as an extra argument so that web admin can choose SCTP or TCP.

Currently, I have this patch working for httpd-2.0.55/apr-0.9.6.

Would appreciate any feedback,
Preethi

PS: Should I send this mail to apr dev mailing list as well or will that be spamming?

Reply via email to