Astateless protocol is acommunication protocol in which the receiver does not retainsession state from previous requests. The sender transfers relevant session state to the receiver in such a way that every request can be understood in isolation, withoutreference to session state from previous requests.[1]
In contrast, astateful protocol is a communication protocol in which the receiver may retain session state from previous requests.
Incomputer networks, examples of stateless protocols include theInternet Protocol (IP), which is the foundation for theInternet, and theHypertext Transfer Protocol (HTTP), which is the foundation of theWorld Wide Web. Examples of stateful protocols include theTransmission Control Protocol (TCP) and theFile Transfer Protocol (FTP).
Stateless protocols have superior visibility, reliability, and scalability properties. Visibility is improved because a monitoring system does not have to look beyond a single request in order to determine its full nature. Reliability is improved because it eases the task of recovering from failures such aspacket loss. Scalability is improved because not having to store session state between requests allows theserver to quickly free resources and further simplifies implementation. The disadvantage of stateless protocols is that they may decrease network performance by increasing the repetitive data sent in a series of requests, since that data is not retained or reused at the receiver.
AnHTTP server can understand each request in isolation.[2]
Contrast this with a traditionalFTP server that conducts an interactive session with the user. During the session, a user is provided a means to be authenticated and set various variables (working directory, transfer mode), all stored on the server as part of the session state.
There can be complex interactions between stateful and stateless protocols among different protocol layers. For example, HTTP, a stateless protocol, is layered on top ofTCP, a stateful protocol, which is layered on top ofIP, another stateless protocol, which is routed on a network that employsBGP, another stateful protocol, to direct the IP packets riding on the network.
This stacking of layers continues even above HTTP. As a workaround for the lack of a retained session state, HTTP servers implement varioussession management methods,[3] typically utilizing a session identifier in anHTTP cookie referencing a session state stored on the server, effectively creating a stateful protocol on top of HTTP.[4]
The following material is intended to introduce the reader to the various techniques that developers have used to implement session tracking on the Web. The main operational characteristics of each method are mentioned in addition to the shortcomings that have been observed in usage. Additional information on session management can be found by searching the Internet. […]