Q1. We have discussed the non-persistent HTTP and rdt FSMs, and please try to draw
two HTTP finite state machines (one for HTTP client and one for HTTP server).
Assume we only consider a simplified HTTP that only defines the following five
messages (i.e., events): GET, 200 OK, 301 Moved Permanently, 404 Not Found, and
500 Internal Server Error. I provide an example of HTTP FSMs as following that have
only two events (i.e., ‘GET’ and ‘200 OK’) for your reference. You may extend them to
make your own version of FSMs (that support all five messages), and you can add any
function in your FSMs (as long as the function name is easy for TA to understand).
Note that we assume the underlying TCP is reliable so no HTTP message will be lost
or corrupted. You may ignore regular HTTP headers (except for Location header in
301 response message).


Q2. Considering the two FSMs that you proposed in Q1, and add a timer for the HTTP
client FSM just in case the server may not respond (for example, the server has a bug
and the server may crash randomly). Draw your two improved FSMs with a timer.