Web posted: April 20, 23:45 hrs
Due: May 12, 17:00hrs
VIP/NTU students: Due 3 weeks from when you receive this assignment
The goal of this mini-project is to design an RTSP server and client. The mini-project will require you to:
Having understood the basics of socket programming, implement a client-server application based on TCP. Your server should listen for client requests on a well-known port (say 9000). Your client should connect to the server at this port. Once a connection between the client and server is established, your server should fork a child process and have the child handle all future communication with the client. To test your client-server application, your client should send two integers to the server, the server should add the two integers and send back the result to the client. Both the client and server should then close the connection, and the child process at the server should then exit.
Additional Notes:
In this part, we will use the client and server application from Part I to implement the RTSP protocol. First read about the RTSP protocol. RTSP is described in RFC 2326 (you don't need to understand every single detail in the RFC, just be sure that you understand the basics). RTSP is also described in Chapter 6 of the Kurose-Ross text. A good online reference on RTSP is available here (this page also includes sample code for RTSP, you can look at the code as a reference, but do not use any of this code for your assignment---write your own code!).
Implement an RTSP server that understands a few RTSP methods (you should at least implement four methods: DESCRIBE, PLAY, SETUP, TEARDOWN). Your server should be able to accept RTSP requests from the client, parse them and send back a valid RTSP response (read the RFC for examples of different types requests and responses). Be sure to send back the "551: option not supported" error code for the options you have not implemented. Again, you do NOT need to implement every single detail in the RTSP protocol, just be sure to implement all the basic stuff needed to support the about four methods.
Implement an RTSP client that accepts an RTSP request from the user. Your client should connect to the RTSP server specified in the request, send the actual request and print the response received from the server.
Note that RTSP is a control protocol. It allows a client and server to exchange control messages. The actual streaming of the data is done through a different protocol such as RTP; so you need not worry about streaming the actual data.