5/7/11

Stateless Protocols

    • In networking the concept of "stateful" and "stateless" is almost identical to the concept of "connection-oriented" and "connectionless." A connectionless protocol treats each packet transmission as an isolated event. The server receiving that packet also retains no record of the transaction once it is completed. This is stateless. The opposite scenario, stateful, requires the receiver to keep track of each transaction received from a source and relate each transmission to previous receipts.

    Transport Protocols

    • Whether a transmission will be carried out over an established connection is a decision made at the Transport Layer. Networking protocols are grouped by function and each group is represented as a layer in a stack. In TCP/IP (Transmission Control Protocol/Internet Protocol) the Transport Layer contains two basic alternatives for transmission: Transmission Control Protocol (TCP) and the User Datagram Protocol (UDP). TCP establishes a connection and performs integrity checks. It is stateful. UDP treats each data packet as an isolated transaction. It is stateless.

    Internet Protocol

    • Given that "stateful" equates to "connection-oriented" and connections are dealt with at the Transport Layer, anything below the Transport Layer is stateless. The Internet Layer, implemented by the Internet Protocol, provides services to the Transport Layer but does not manage a connection or check data. It sends out each packet to an address and receives packets and passes them to the Transport Layer without checking the data or recording their relationship. The Internet Protocol is stateless.

    Applications

    • There are very few stateless applications. For an application to perform a meaningful service it usually performs an action on data or is provoked by data. The end state of that data will be different to the start state of that data, otherwise there would be no point invoking the application. Those applications that sit on top of TCP inherit TCP's stateful status. TCP is stateful on behalf of the applications it serves. Those applications that sit on top of UDP rarely remain stateless, but call on other protocols to create a stateful process. UDP is used by multimedia applications. For example, Voice over IP (VoIP) uses the Session Initiation Protocol to create a connection and so become stateful. Video streaming applications use the Real-time Streaming Protocol to create a connection.

    HTTP

    • There is one notable application that is stateless: the Hypertext Transfer Protocol (HTTP). There are two main versions of HTTP: 1.0 and 1.1. Version 1.1 includes the ability to establish a connection, but version 1.0, which is still widely used, treats each transmission as a complete transaction. A web page may contain many elements, like text and pictures. Each element is held in a separate file. The client requests a page and the server sends the main file. While that file is loading in the client web browser, the embedded files are automatically called. Each transfer is stateless.

  • No comments: