Briefly explain what are the possible purpose of states in a
Solution
a) Possible purpose of states in application layer protocol is it requires the state information to be passed on from one request to the next. So, since HTTP is stateless, some techniques are followed to maintain the state across mutiple HTTP requests. Similarly, FTP is stateful protocol as it needs to conduct interactive session with the user. That is why, during the session, a user is provided a means to be authenticated and set various variable, all stored as part of user\'s state.
b) List of Application Layer protocol that keeps states
-> FTP
-> POP3
c) Since HTTP is a stateless protocol. The few techniques used to maintain state information accross multiple HTTP requests are as below:-
-> Cookie
-> Hidden fields of the HTML form
-> URL rewriting
d) From both of the protocols, i.e. TCP and UDP.
TCP is connection oriented, reliable, slow, provides guaranteed delivery and preserves order of messages. While UDP is connection less, unreliable, no ordering guarantee, but fast delivery of messages. TCP overhead is also much higher than UDP.
So, I will prefer to go with TCP because for me not loosing a message is more preferred than high speed transmission.
