[go: nahoru, domu]

Jump to content

Stateless protocol: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Line 17: Line 17:
There can be complex interactions between stateful and stateless protocols among different protocol layers. For example, HTTP, a stateless protocol, is layered on top of [[Transmission Control Protocol|TCP]], a stateful protocol, which is layered on top of [[Internet Protocol|IP]], another stateless protocol, which is routed on a network that employs [[BGP]], another stateful protocol, to direct the IP packets riding on the network.
There can be complex interactions between stateful and stateless protocols among different protocol layers. For example, HTTP, a stateless protocol, is layered on top of [[Transmission Control Protocol|TCP]], a stateful protocol, which is layered on top of [[Internet Protocol|IP]], another stateless protocol, which is routed on a network that employs [[BGP]], 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 session layer in HTTP, HTTP servers implement various [[Hypertext Transfer Protocol#HTTP session|session management]] methods,<ref>{{cite web |title=session management methods reviewed |url=http://cookiebits.com/htm/tech.htm |work=C cookie bits |location=Toronto|url-status=live |archive-url=https://web.archive.org/web/20190213015423/http://cookiebits.com/htm/tech.htm |archive-date=2019-02-13 |access-date=2011-04-12 |quote=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. […]}}</ref> typically utilizing a unique identifier in the [[HTTP cookie|cookie]] or parameter that allows the server to track requests originating from the same client, and effectively creating a stateful protocol on top of HTTP.<ref name="statefulvstateless">{{cite news |title=Stateful vs Stateless Architecture |last=Dwyer |first=Gareth |work=Virtasant |date=18 November 2020 |url=https://virtasant.com/blog/stateful-vs-stateless-architecture-why-stateless-won/}}</ref>
This stacking of layers continues even above HTTP. As a workaround for the lack of a retained session state, HTTP servers implement various [[Hypertext Transfer Protocol#HTTP session|session management]] methods,<ref>{{cite web |title=session management methods reviewed |url=http://cookiebits.com/htm/tech.htm |work=C cookie bits |location=Toronto|url-status=live |archive-url=https://web.archive.org/web/20190213015423/http://cookiebits.com/htm/tech.htm |archive-date=2019-02-13 |access-date=2011-04-12 |quote=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. […]}}</ref> typically utilizing a unique identifier in the [[HTTP cookie|cookie]] or parameter that allows the server to track requests originating from the same client, and effectively creating a stateful protocol on top of HTTP.<ref name="statefulvstateless">{{cite news |title=Stateful vs Stateless Architecture |last=Dwyer |first=Gareth |work=Virtasant |date=18 November 2020 |url=https://virtasant.com/blog/stateful-vs-stateless-architecture-why-stateless-won/}}</ref>


== See also ==
== See also ==

Revision as of 09:43, 18 May 2021

A stateless protocol is a communication protocol in which the receiver does not retain any session information for the duration of multiple requests. The sender transfers relevant session information to the receiver in such a way that every request can be understood in isolation, that is without reference to session information from previous requests retained by the receiver.

In contrast, a stateful protocol is a communication protocol that requires the receiver to retain session information for the duration of multiple requests.

In computer networks, examples of stateless protocols include the Internet Protocol (IP), which is the foundation for the Internet, and the Hypertext Transfer Protocol (HTTP), which is the foundation of the World Wide Web. Examples of stateful protocols include the Transmission Control Protocol (TCP) and the File Transfer Protocol (FTP).

Stateless protocols are ideal in high volume applications, increasing performance by removing server load caused by retention of session information. A disadvantage of statelessness is that it may require including session information in every request, and this extra information will need to be interpreted by the server.

Examples

An HTTP server can understand each request in isolation.[1]

Contrast this with a traditional FTP 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.

Stacking of stateless and stateful protocol layers

There can be complex interactions between stateful and stateless protocols among different protocol layers. For example, HTTP, a stateless protocol, is layered on top of TCP, a stateful protocol, which is layered on top of IP, another stateless protocol, which is routed on a network that employs BGP, 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 various session management methods,[2] typically utilizing a unique identifier in the cookie or parameter that allows the server to track requests originating from the same client, and effectively creating a stateful protocol on top of HTTP.[3]

See also

References

  1. ^ "RFC 7230 - Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing". ietf.org. Retrieved 20 August 2015.
  2. ^ "session management methods reviewed". C cookie bits. Toronto. Archived from the original on 2019-02-13. Retrieved 2011-04-12. 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. […]
  3. ^ Dwyer, Gareth (18 November 2020). "Stateful vs Stateless Architecture". Virtasant.