Sunday 1 June 2014

Difference between stateless protocol and state-full protocol?


stateless Protocol:-
1).When stateless protocol is used between a server and the client, the server does not remember anything. It treats any message from a client as the client's first message and responds with the same effects every time
2). A stateless server does not keeps state between connections.
=>So,When you send a request to a stateless server, it does not create any objects that track information regarding your requests. If you "open" something on the server, the server retains no information at all that you have something open. A "close" operation would make no sense, since there would be nothing to close.
3). A stateless system can be seen as a box ,where at any point in time the value of the output(s) depends only on the value of the input(s) after a certain processing time.
4). A stateless protocol does not require the server to retain session information or status about each communications partner for the duration of multiple requests.
5). stateless sessinobean:can not maintain the state,cannot maintain the persistance(data base),onece sutdown machine,we cannot see that data,cannot have the passivate,activate states. ex:atm mini statements.
Example = UDP(User Datagram Protocol) , HTTP, NFS
Statefull Protocol :-
1). Stateful protocol means the server remembers what a client has done before.
2). .A stateful server keeps state between connections.
=> when you send a request to a stateful server, it may create some kind of connection object that tracks what information you request. When you send another request, that request operates on the state from the previous request. So you can send a request to "open" something. And then you can send a request to "close" it later. In-between the two requests, that thing is "open" on the server.
3). a stateful system is like a state machine with "memory" as the same set of input(s) value can generate different output(s) depending on the previous input(s) received by the system.
4). a protocol which requires the keeping of internal state is known as a stateful protocol.
5). statefull Protocol :- maintain the state,but cannot maintain the persistance,once we shutdown the system the values stored in local hard disc,can have the passivate and activate states. ex:shopping card
Example = SMB, FTP,Telnet
Ref:http://wiki.answers.com/Q/Difference_between_stateless_protocol_and_statefull_protocol