<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-392745368495742159</id><updated>2011-04-21T18:18:55.524-07:00</updated><title type='text'>PROTOCOL</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://aboutprotocol.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/392745368495742159/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://aboutprotocol.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>MP</name><uri>http://www.blogger.com/profile/02485863734608702367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>13</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-392745368495742159.post-8029462019430254544</id><published>2007-10-11T06:13:00.000-07:00</published><updated>2007-10-11T06:14:03.121-07:00</updated><title type='text'>TELNET</title><content type='html'>&lt;div align="justify"&gt;TELNET (TELecommunication NETwork) is a network protocol used on the Internet or local area network (LAN) connections. It was developed in 1969 beginning with RFC 15 and standardized as IETF STD 8, one of the first Internet standards. The term telnet also refers to software which implements the client part of the protocol. TELNET clients have been available on most Unix systems for many years and are available for virtually all platforms. Most network equipment and OSs with a TCP/IP stack support some kind of TELNET service server for their remote configuration (including ones based on Windows NT). Recently, Secure Shell has begun to dominate remote access for Unix-based machines. "To telnet" is also used as a verb meaning to establish or use a TELNET or other interactive TCP connection, as in, "To change your password, telnet to the server and run the passwd command". Most often, a user will be telneting to a Unix-like server system or a simple network device such as a switch. For example, a user might "telnet in from home to check his mail at school". In doing so, he would be using a telnet client to connect from his computer to one of his servers. Once the connection is established, he would then log in with his account information and execute operating system commands remotely on that computer, such as ls or cd. On many systems, the client may also be used to make interactive raw-TCP sessions, even when that option is not available, telnet sessions are equivalent to raw TCP as long as byte 255 never appears in the data. Protocol details TELNET is a client-server protocol, based on a reliable connection-oriented transport. Typically this is TCP port 23, although TELNET predates TCP/IP and was originally run on NCP. The protocol has many extensions, some of which have been adopted as Internet standards. IETF standards STD 27 through STD 32 define various extensions, most of which are extremely common. Other extensions are on the IETF standards track as proposed standards. Security When TELNET was initially developed in 1969, most users of networked computers were in the computer departments of academic institutions, or at large private and government research facilities. In this environment, security was not nearly as much of a concern as it became after the bandwidth explosion of the 1990s. The rise in the number of people with access to the Internet, and by extension, the number of people attempting to crack other people's servers made encrypted alternatives much more necessary. Experts in computer security, such as SANS Institute, and the members of the comp.os.linux.security newsgroup recommend that the use of TELNET for remote logins should be discontinued under all normal circumstances, for the following reasons: TELNET, by default, does not encrypt any data sent over the connection (including passwords), and so it is often practical to eavesdrop on the communications and use the password later for malicious purposes; anybody who has access to a router, switch, or gateway located on the network between the two hosts where TELNET is being used can intercept the packets passing by and obtain login and password information (and whatever else is typed) with any of several common utilities like tcpdump and Wireshark. Most implementations of TELNET lack an authentication scheme that makes it possible to ensure that communication is carried out between the two desired hosts, and not intercepted in the middle. Commonly used TELNET daemons have several vulnerabilities discovered over the years. These security-related shortcomings have seen the usage of the TELNET protocol drop rapidly, especially on the public Internet, in favor of a the ssh protocol, first released in 1995. SSH provides much functionality of telnet, with the addition of strong encryption to prevent sensitive data such as passwords from being intercepted, and public key authentication, to ensure that the remote computer is actually who it claims to be. As has happened with other early Internet protocols, extensions to the TELNET protocol provide TLS security and SASL authentication that address the above issues. However, most TELNET implementations do not support these extensions; and there has been relatively little interest in implementing these as SSH is adequate for most purposes. The main advantage of TLS-TELNET would be the ability to use certificate-authority signed server certificates to authenticate a server host to a client that does not yet have the server key stored. In SSH, there is a weakness in that the user must trust the first session to a host when it has not yet acquired the server key. Clients and servers designed to pass IBM 5250 data streams over Telnet generally do support SSL encryption, as SSH does not include 5250 emulation. Under OS/400, Port 992 is the default port for Secured Telnet. Current status As of the mid-2000s, while the TELNET protocol itself has been mostly superseded, TELNET clients are still used, often when diagnosing problems, to manually "talk" to other services without specialized client software. For example, it is sometimes used in debugging network services such as an SMTP, IRC or HTTP server, by serving as a simple way to send commands to the server and examine the responses. However, other software such as nc (netcat) or socat on Unix (or PuTTY on Windows) are finding greater favor with some system administrators for testing purposes, as they can be called with arguments to not send any terminal control handshaking data. Also netcat does not distort the \377 octet, which allows raw access to TCP socket, unlike any standard-compliant TELNET software. TELNET is still very popular in enterprise networks to access host applications, e.g. on IBM Mainframes. TELNET is still widely used for administration of network elements, e.g., in commissioning, integration and maintenance of core network elements in mobile communication networks. TELNET is also heavily used for MUD games played over the Internet, as well as talkers, MUSHes, MUCKs, MOOes, and the resurgent BBS community. In the 2007 Microsoft Windows release, Windows Vista, Telnet.exe is no longer installed by default, but is still included as an installable feature.&lt;br /&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/392745368495742159-8029462019430254544?l=aboutprotocol.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aboutprotocol.blogspot.com/feeds/8029462019430254544/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=392745368495742159&amp;postID=8029462019430254544' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/392745368495742159/posts/default/8029462019430254544'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/392745368495742159/posts/default/8029462019430254544'/><link rel='alternate' type='text/html' href='http://aboutprotocol.blogspot.com/2007/10/telnet_11.html' title='TELNET'/><author><name>MP</name><uri>http://www.blogger.com/profile/02485863734608702367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-392745368495742159.post-4511614959713418059</id><published>2007-10-11T06:12:00.001-07:00</published><updated>2007-10-11T06:12:55.540-07:00</updated><title type='text'>FTP and NAT devices</title><content type='html'>&lt;div align="justify"&gt;The representation of the IPs and ports in the PORT command and PASV reply poses another challenge for NAT devices in handling FTP. The NAT device must alter these values, so that they contain the IP of the NAT-ed client, and a port chosen by the NAT device for the data connection. The new IP and port will probably differ in length in their decimal representation from the original IP and port. This means that altering the values on the control connection by the NAT device must be done carefully, changing the TCP Sequence and Acknowledgment fields for all subsequent packets. For example: A client with an IP of 192.168.0.1, starting an active mode transfer on port 1025, will send the string "PORT 192,168,0,1,4,1". A NAT device masquerading this client with an IP of 192.168.15.5, with a chosen port of 2000 for the data connection, will need to replace the above string with "PORT 192,168,15,5,7,208". The new string is 23 characters long, compared to 20 characters in the original packet. The Acknowledgment field by the server to this packet will need to be decreased by 3 bytes by the NAT device for the client to correctly understand that the PORT command has arrived to the server. If the NAT device is not capable of correcting the Sequence and Acknowledgement fields, it will not be possible to use active mode FTP. Passive mode FTP will work in this case, because the information about the IP and port for the data connection is sent by the server, which doesn't need to be NATed. If NAT is performed on the server by the NAT device, then the exact opposite will happen. Active mode will work, but passive mode will fail. It should be noted that many NAT devices perform this protocol inspection and modify the PORT command without being explicitly told to do so by the user. This can lead to several problems. First of all, there is no guarantee that the used protocol really is FTP, or it might use some extension not understood by the NAT device. One example would be an SSL secured FTP connection. Due to the encryption, the NAT device will be unable to modify the address. As result, active mode transfers will fail only if encryption is used, much to the confusion of the user. The proper way to solve this is to tell the client which IP address and ports to use for active mode. Furthermore, the NAT device has to be configured to forward the selected range of ports to the client's machine. FTP over SSH FTP over SSH refers to the practice of tunneling a normal FTP session over an SSH connection. Because FTP uses multiple TCP connections (unusual for a TCP/IP protocol that is still in use), it is particularly difficult to tunnel over SSH. With many SSH clients, attempting to set up a tunnel for the control channel (the initial client-to-server connection on port 21) will protect only that channel; when data is transferred, the FTP software at either end will set up new TCP connections (data channels) which will bypass the SSH connection, and thus have no confidentiality, integrity protection, etc. If the FTP client is configured to use passive mode and to connect to a SOCKS server interface that many SSH clients can present for tunneling, it is possible to run all the FTP channels over the SSH connection. Otherwise, it is necessary for the SSH client software to have specific knowledge of the FTP protocol, and monitor and rewrite FTP control channel messages and autonomously open new forwardings for FTP data channels. Version 3 of SSH Communications Security's software suite, and the GPL licensed FONC are two software packages that support this mode. FTP over SSH is sometimes referred to as secure FTP; this should not be confused with other methods of securing FTP, such as with SSL/TLS (FTPS). Other methods of transferring files using SSH that are not related to FTP include SFTP and SCP; in each of these, the entire conversation (credentials and data) is always protected by the SSH protocol.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/392745368495742159-4511614959713418059?l=aboutprotocol.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aboutprotocol.blogspot.com/feeds/4511614959713418059/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=392745368495742159&amp;postID=4511614959713418059' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/392745368495742159/posts/default/4511614959713418059'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/392745368495742159/posts/default/4511614959713418059'/><link rel='alternate' type='text/html' href='http://aboutprotocol.blogspot.com/2007/10/ftp-and-nat-devices_11.html' title='FTP and NAT devices'/><author><name>MP</name><uri>http://www.blogger.com/profile/02485863734608702367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-392745368495742159.post-4491909298863708366</id><published>2007-10-11T06:10:00.000-07:00</published><updated>2007-10-11T06:11:46.201-07:00</updated><title type='text'>File Transfer Protocol</title><content type='html'>&lt;div align="justify"&gt;FTP or File Transfer Protocol is used to transfer data from one computer to another over the Internet, or through a network.&lt;br /&gt;Specifically, FTP is a commonly used protocol for exchanging files over any network that supports the &lt;a title="TCP/IP" href="http://en.wikipedia.org/wiki/TCP/IP"&gt;TCP/IP&lt;/a&gt; protocol (such as the &lt;a title="Internet" href="http://en.wikipedia.org/wiki/Internet"&gt;Internet&lt;/a&gt; or an &lt;a title="Intranet" href="http://en.wikipedia.org/wiki/Intranet"&gt;intranet&lt;/a&gt;). There are two &lt;a title="Computers" href="http://en.wikipedia.org/wiki/Computers"&gt;computers&lt;/a&gt; involved in an FTP transfer: a &lt;a title="Server (computing)" href="http://en.wikipedia.org/wiki/Server_(computing)"&gt;server&lt;/a&gt; and a &lt;a title="Client (computing)" href="http://en.wikipedia.org/wiki/Client_(computing)"&gt;client&lt;/a&gt;. The FTP server, running &lt;a title="Comparison of FTP servers" href="http://en.wikipedia.org/wiki/Comparison_of_FTP_servers"&gt;FTP server software&lt;/a&gt;, listens on the network for connection requests from other computers. The client computer, running &lt;a title="Comparison of FTP clients" href="http://en.wikipedia.org/wiki/Comparison_of_FTP_clients"&gt;FTP client software&lt;/a&gt;, initiates a connection to the server. Once connected, the client can do a number of file manipulation operations such as uploading files to the server, download files from the server, rename or delete files on the server and so on. Any &lt;a title="Software" href="http://en.wikipedia.org/wiki/Software"&gt;software&lt;/a&gt; company or individual programmer is able to create FTP server or client software because the protocol is an open standard. Virtually every computer platform supports the FTP protocol. This allows any computer connected to a TCP/IP based network to manipulate files on another computer on that network regardless of which &lt;a title="Operating systems" href="http://en.wikipedia.org/wiki/Operating_systems"&gt;operating systems&lt;/a&gt; are involved (if the computers permit FTP access). There are many existing FTP client and server programs. FTP servers can be set up anywhere between game servers, voice servers, internet hosts, and other physical servers.&lt;br /&gt;Connection Methods&lt;br /&gt;FTP runs exclusively over &lt;a title="Transmission control protocol" href="http://en.wikipedia.org/wiki/Transmission_control_protocol"&gt;TCP&lt;/a&gt;. FTP servers by default listen on &lt;a title="List of TCP and UDP port numbers" href="http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers"&gt;port 21&lt;/a&gt; for incoming connections from FTP clients. A connection to this port from the FTP Client forms the control stream on which commands are passed to the FTP server from the FTP client and on occasion from the FTP server to the FTP client. For the actual file transfer to take place, a different connection is required which is called the data stream. Depending on the transfer mode, the process of setting up the data stream is different.&lt;br /&gt;In active mode, the FTP client opens a &lt;a title="Ephemeral port" href="http://en.wikipedia.org/wiki/Ephemeral_port"&gt;random port&lt;/a&gt; (&gt; 1023), sends the FTP server the random port number on which it is listening over the control stream and waits for a connection from the FTP server. When the FTP server initiates the data connection to the FTP client it binds the source port to port 21 on the FTP server.&lt;br /&gt;In order to use active mode, the client sends a PORT command, with the IP and port as argument. The format for the IP and port is "h1,h2,h3,h4,p1,p2". Each field is a decimal representation of 8 bits of the host IP, followed by the chosen data port. For example, a client with an IP of 192.168.0.1, listening on port 1025 for the data connection will send the command "PORT 192,168,0,1,4,1". The port fields should be interpreted as p1×256 + p2 = port, or, in this example, 4×256 + 1 = 1025.&lt;br /&gt;In passive mode, the FTP server opens a random port (&gt; 1023), sends the FTP client the server's IP address to connect to and the port on which it is listening (a 16 bit value broken into a high and low byte, like explained before) over the control stream and waits for a connection from the FTP client. In this case the FTP client binds the source port of the connection to a random port greater than 1023.&lt;br /&gt;To use passive mode, the client sends the PASV command to which the server would reply with something similar to "227 Entering Passive Mode (127,0,0,1,78,52)". The syntax of the IP address and port are the same as for the argument to the PORT command.&lt;br /&gt;In extended passive mode, the FTP server operates exactly the same as passive mode, however it only transmits the port number (not broken into high and low bytes) and the client is to assume that it connects to the same IP address that was originally connected to. Extended passive mode was added by &lt;a title="http://tools.ietf.org/html/rfc2428" href="http://tools.ietf.org/html/rfc2428"&gt;RFC 2428&lt;/a&gt; in September 1998.&lt;br /&gt;While data is being transferred via the &lt;a title="Data stream" href="http://en.wikipedia.org/wiki/Data_stream"&gt;data stream&lt;/a&gt;, the control stream sits idle. This can cause problems with large data transfers through &lt;a title="Firewall (networking)" href="http://en.wikipedia.org/wiki/Firewall_(networking)"&gt;firewalls&lt;/a&gt; which time out sessions after lengthy periods of idleness. While the file may well be successfully transferred, the control session can be disconnected by the firewall, causing an error to be generated.&lt;br /&gt;The FTP protocol supports resuming of interrupted downloads using the REST command. The client passes the number of bytes it has already received as argument to the REST command and restarts the transfer. In some commandline clients for example, there is an often-ignored but valuable command, "reget" (meaning "get again") that will cause an interrupted "get" command to be continued, hopefully to completion, after a communications interruption.&lt;br /&gt;Resuming uploads is not as easy. Although the FTP protocol supports the APPE command to append data to a file on the server, the client does not know the exact position at which a transfer got interrupted. It has to obtain the size of the file some other way, for example over a directory listing or using the SIZE command.&lt;br /&gt;In ASCII mode (see below), resuming transfers can be troublesome if client and server use different &lt;a title="End of line" href="http://en.wikipedia.org/wiki/End_of_line"&gt;end of line&lt;/a&gt; characters.&lt;br /&gt;The objectives of FTP, as outlined by its &lt;a title="Request for Comments" href="http://en.wikipedia.org/wiki/Request_for_Comments"&gt;RFC&lt;/a&gt;, are:&lt;br /&gt;To promote sharing of files (computer programs and/or data).&lt;br /&gt;To encourage indirect or implicit use of &lt;a title="Remote computer" href="http://en.wikipedia.org/wiki/Remote_computer"&gt;remote computers&lt;/a&gt;.&lt;br /&gt;To shield a user from variations in file storage systems among different &lt;a title="Server (computing)" href="http://en.wikipedia.org/wiki/Server_(computing)"&gt;hosts&lt;/a&gt;.&lt;br /&gt;To transfer &lt;a title="Data" href="http://en.wikipedia.org/wiki/Data"&gt;data&lt;/a&gt; reliably, and efficiently.&lt;br /&gt;&lt;a name="Criticisms_of_FTP"&gt;&lt;/a&gt;Criticisms of FTP&lt;br /&gt;&lt;a title="Password" href="http://en.wikipedia.org/wiki/Password"&gt;Passwords&lt;/a&gt; and file contents are sent in &lt;a title="Cleartext" href="http://en.wikipedia.org/wiki/Cleartext"&gt;clear text&lt;/a&gt;, which can be intercepted by &lt;a title="Eavesdropping" href="http://en.wikipedia.org/wiki/Eavesdropping"&gt;eavesdroppers&lt;/a&gt;. There are protocol enhancements that circumvent this, for instance by using SSL or TLS.&lt;br /&gt;Multiple TCP/IP connections are used, one for the control connection, and one for each download, upload, or directory listing. Firewalls may need additional logic and or configuration changes to account for these connections.&lt;br /&gt;It is hard to filter active mode FTP traffic on the client side by using a &lt;a title="Firewall (networking)" href="http://en.wikipedia.org/wiki/Firewall_(networking)"&gt;firewall&lt;/a&gt;, since the client must open an arbitrary &lt;a title="TCP and UDP port" href="http://en.wikipedia.org/wiki/TCP_and_UDP_port"&gt;port&lt;/a&gt; in order to receive the connection. This problem is largely resolved by using passive mode FTP.&lt;br /&gt;It is possible to abuse the protocol's built-in proxy features to tell a &lt;a title="Server (computing)" href="http://en.wikipedia.org/wiki/Server_(computing)"&gt;server&lt;/a&gt; to send data to an arbitrary port of a third computer; see &lt;a title="FXP" href="http://en.wikipedia.org/wiki/FXP"&gt;FXP&lt;/a&gt;.&lt;br /&gt;FTP is a high latency protocol due to the number of commands needed to initiate a transfer.&lt;br /&gt;No integrity check on the receiver side. If a transfer is interrupted, the receiver has no way to know if the received file is complete or not. Some servers support extensions to calculate for example a file's &lt;a title="MD5" href="http://en.wikipedia.org/wiki/MD5"&gt;MD5&lt;/a&gt; sum (e.g. using the &lt;a title="http://www.castaglia.org/proftpd/modules/mod_md5.html#SITE_MD5" href="http://www.castaglia.org/proftpd/modules/mod_md5.html#SITE_MD5"&gt;SITE MD5 command&lt;/a&gt;) or &lt;a title="Cyclic redundancy check" href="http://en.wikipedia.org/wiki/Cyclic_redundancy_check"&gt;CRC checksum&lt;/a&gt;, however even then the client has to make explicit use of them. In the absence of such extensions, integrity checks have to be managed externally.&lt;br /&gt;No date/timestamp attribute transfer. Uploaded files are given a new current timestamp, unlike other file transfer protocols such as &lt;a title="SFTP" href="http://en.wikipedia.org/wiki/SFTP"&gt;SFTP&lt;/a&gt;, which allow attributes to be included. There is no way in the standard FTP protocol to set the time-last-modified (or time-created) datestamp that most modern filesystems preserve. There is a &lt;a title="https://datatracker.ietf.org/drafts/draft-somers-ftp-mfxx/" href="https://datatracker.ietf.org/drafts/draft-somers-ftp-mfxx/"&gt;draft&lt;/a&gt; of a proposed extension that adds new commands for this, but as of yet, most of the popular FTP servers do not support it.&lt;br /&gt;&lt;a name="Security_problems"&gt;&lt;/a&gt;Security problems&lt;br /&gt;The original FTP specification is an inherently insecure method of transferring files because there is no method specified for transferring data in an encrypted fashion. This means that under most network configurations, user names, passwords, FTP commands and transferred files can be "sniffed" or viewed by anyone on the same network using a &lt;a title="Packet sniffer" href="http://en.wikipedia.org/wiki/Packet_sniffer"&gt;packet sniffer&lt;/a&gt;. This is a problem common to many Internet protocol specifications written prior to the creation of &lt;a title="Secure Sockets Layer" href="http://en.wikipedia.org/wiki/Secure_Sockets_Layer"&gt;SSL&lt;/a&gt; such as &lt;a title="HTTP" href="http://en.wikipedia.org/wiki/HTTP"&gt;HTTP&lt;/a&gt;, &lt;a title="SMTP" href="http://en.wikipedia.org/wiki/SMTP"&gt;SMTP&lt;/a&gt; and &lt;a title="Telnet" href="http://en.wikipedia.org/wiki/Telnet"&gt;Telnet&lt;/a&gt;. The common solution to this problem is to use either &lt;a title="SSH file transfer protocol" href="http://en.wikipedia.org/wiki/SSH_file_transfer_protocol"&gt;SFTP&lt;/a&gt; (SSH File Transfer Protocol), or &lt;a title="FTPS" href="http://en.wikipedia.org/wiki/FTPS"&gt;FTPS&lt;/a&gt; (FTP over &lt;a title="Secure Sockets Layer" href="http://en.wikipedia.org/wiki/Secure_Sockets_Layer"&gt;SSL&lt;/a&gt;), which adds SSL or &lt;a title="Transport Layer Security" href="http://en.wikipedia.org/wiki/Transport_Layer_Security"&gt;TLS&lt;/a&gt; &lt;a title="Encryption" href="http://en.wikipedia.org/wiki/Encryption"&gt;encryption&lt;/a&gt; to FTP as specified in &lt;a title="http://tools.ietf.org/html/rfc4217" href="http://tools.ietf.org/html/rfc4217"&gt;RFC 4217&lt;/a&gt;.&lt;br /&gt;&lt;a name="FTP_return_codes"&gt;&lt;/a&gt;FTP return codes&lt;br /&gt;FTP server return codes indicate their status by the digits within them. A brief explanation of various digits' meanings are given below:&lt;br /&gt;1xx: Positive Preliminary reply. The action requested is being initiated but there will be another reply before it begins.&lt;br /&gt;2xx: Positive Completion reply. The action requested has been completed. The client may now issue a new command.&lt;br /&gt;3xx: Positive Intermediate reply. The command was successful, but a further command is required before the server can act upon the request.&lt;br /&gt;4xx: Transient Negative Completion reply. The command was not successful, but the client is free to try the command again as the failure is only temporary.&lt;br /&gt;5xx: Permanent Negative Completion reply. The command was not successful and the client should not attempt to repeat it again.&lt;br /&gt;x0x: The failure was due to a &lt;a title="Syntax" href="http://en.wikipedia.org/wiki/Syntax"&gt;syntax&lt;/a&gt; error.&lt;br /&gt;x1x: This response is a reply to a request for information.&lt;br /&gt;x2x: This response is a reply relating to connection information.&lt;br /&gt;x3x: This response is a reply relating to accounting and authorization.&lt;br /&gt;x4x: Unspecified as yet&lt;br /&gt;x5x: These responses indicate the status of the Server file system vis-a-vis the requested transfer or other file system action&lt;br /&gt;&lt;a name="Anonymous_FTP"&gt;&lt;/a&gt;Anonymous FTP&lt;br /&gt;Many sites that run &lt;a title="FTP server" href="http://en.wikipedia.org/wiki/FTP_server"&gt;FTP servers&lt;/a&gt; enable &lt;a title="Anonymous" href="http://en.wikipedia.org/wiki/Anonymous"&gt;anonymous&lt;/a&gt; ftp. Under this arrangement, users do not need an &lt;a title="Account (computing)" href="http://en.wikipedia.org/wiki/Account_(computing)"&gt;account&lt;/a&gt; on the server. The user name for anonymous access is typically 'anonymous'. This account does not need a password. Although users are commonly asked to send their &lt;a title="Email" href="http://en.wikipedia.org/wiki/Email"&gt;email&lt;/a&gt; addresses as their passwords for authentication, usually there is trivial or no verification, depending on the FTP server and its configuration. As modern FTP clients hide the login process from the user and usually don't know the user's email address, they supply dummy passwords, for example:&lt;br /&gt;&lt;a title="Mozilla" href="http://en.wikipedia.org/wiki/Mozilla"&gt;Mozilla&lt;/a&gt; Firefox (2.0) — mozilla@example.com&lt;br /&gt;KDE &lt;a title="Konqueror" href="http://en.wikipedia.org/wiki/Konqueror"&gt;Konqueror&lt;/a&gt; (3.5) — anonymous@&lt;br /&gt;wget (1.10.2) — -wget@&lt;br /&gt;lftp (3.4.4) — lftp@&lt;br /&gt;&lt;a title="Internet Gopher" href="http://en.wikipedia.org/wiki/Internet_Gopher"&gt;Internet Gopher&lt;/a&gt; has been suggested as an alternative to anonymous FTP, as well as &lt;a title="Trivial File Transfer Protocol" href="http://en.wikipedia.org/wiki/Trivial_File_Transfer_Protocol"&gt;Trivial File Transfer Protocol&lt;/a&gt; and &lt;a title="File Service Protocol" href="http://en.wikipedia.org/wiki/File_Service_Protocol"&gt;File Service Protocol&lt;/a&gt;.&lt;br /&gt;&lt;a name="Data_format"&gt;&lt;/a&gt;Data format&lt;br /&gt;While transferring data over the network, several data representations can be used. The two most common transfer modes are:&lt;br /&gt;&lt;a title="ASCII" href="http://en.wikipedia.org/wiki/ASCII"&gt;ASCII&lt;/a&gt; mode&lt;br /&gt;&lt;a title="Binary data" href="http://en.wikipedia.org/wiki/Binary_data"&gt;Binary&lt;/a&gt; mode: In "Binary mode", the sending machine sends each file &lt;a title="Bit" href="http://en.wikipedia.org/wiki/Bit"&gt;bit&lt;/a&gt; for bit and as such the recipient stores the bitstream as it receives it.&lt;br /&gt;In "ASCII mode", any form of data that is not plain text will be corrupted. When a file is sent using an ASCII-type transfer, the individual letters, numbers, and characters are sent using their ASCII character codes. The receiving machine saves these in a text file in the appropriate format (for example, a Unix machine saves it in a Unix format, a Windows machine saves it in a Windows format). Hence if an ASCII transfer is used it can be assumed &lt;a title="Plain text" href="http://en.wikipedia.org/wiki/Plain_text"&gt;plain text&lt;/a&gt; is sent, which is stored by the receiving computer in its own format. Translating between text formats entails substituting the &lt;a title="End of line" href="http://en.wikipedia.org/wiki/End_of_line"&gt;end of line&lt;/a&gt; and &lt;a title="End of file" href="http://en.wikipedia.org/wiki/End_of_file"&gt;end of file&lt;/a&gt; characters used on the source platform with those on the destination platform, e.g. a Windows machine receiving a file from a Unix machine will replace the &lt;a title="Line feed" href="http://en.wikipedia.org/wiki/Line_feed"&gt;line feeds&lt;/a&gt; with &lt;a title="Carriage return" href="http://en.wikipedia.org/wiki/Carriage_return"&gt;carriage return&lt;/a&gt;-line feed pairs.&lt;br /&gt;By default, most FTP clients use ASCII mode. Some clients try to determine the required transfer-mode by inspecting the file's name or contents.&lt;br /&gt;The FTP specifications also list the following transfer modes:&lt;br /&gt;&lt;a title="EBCDIC" href="http://en.wikipedia.org/wiki/EBCDIC"&gt;EBCDIC&lt;/a&gt; mode&lt;br /&gt;Local mode&lt;br /&gt;In practice, these additional transfer modes are rarely used. They are however still used by some &lt;a title="Legacy system" href="http://en.wikipedia.org/wiki/Legacy_system"&gt;legacy&lt;/a&gt; &lt;a title="Mainframe computer" href="http://en.wikipedia.org/wiki/Mainframe_computer"&gt;mainframe&lt;/a&gt; systems.&lt;br /&gt;&lt;a name="FTP_and_web_browsers"&gt;&lt;/a&gt;FTP and web browsers&lt;br /&gt;Most recent &lt;a title="Web browser" href="http://en.wikipedia.org/wiki/Web_browser"&gt;web browsers&lt;/a&gt; and &lt;a title="File manager" href="http://en.wikipedia.org/wiki/File_manager"&gt;file managers&lt;/a&gt; can connect to FTP servers, although they may lack the support for protocol extensions such as &lt;a title="FTPS" href="http://en.wikipedia.org/wiki/FTPS"&gt;FTPS&lt;/a&gt;. This allows manipulation of remote files over FTP through an interface similar to that used for local files. This is done via an FTP &lt;a title="URL" href="http://en.wikipedia.org/wiki/URL"&gt;URL&lt;/a&gt;, which takes the form ftp(s)://&lt;ftpserveraddress&gt; (e.g., &lt;a title="ftp://ftp.gimp.org/" href="ftp://ftp.gimp.org/"&gt;[1]&lt;/a&gt;). A password can optionally be given in the URL, e.g.: ftp(s)://&lt;login&gt;:&lt;password&gt;@&lt;ftpserveraddress&gt;:&lt;port&gt;. Most web-browsers require the use of passive mode FTP, which not all FTP servers are capable of handling. Some browsers allow only the downloading of files, but offer no way to upload files to the server.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/392745368495742159-4491909298863708366?l=aboutprotocol.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aboutprotocol.blogspot.com/feeds/4491909298863708366/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=392745368495742159&amp;postID=4491909298863708366' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/392745368495742159/posts/default/4491909298863708366'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/392745368495742159/posts/default/4491909298863708366'/><link rel='alternate' type='text/html' href='http://aboutprotocol.blogspot.com/2007/10/file-transfer-protocol_11.html' title='File Transfer Protocol'/><author><name>MP</name><uri>http://www.blogger.com/profile/02485863734608702367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-392745368495742159.post-9145775465201599638</id><published>2007-10-11T06:09:00.000-07:00</published><updated>2007-10-11T06:10:31.303-07:00</updated><title type='text'>Hypertext Transfer Protocol</title><content type='html'>&lt;div align="justify"&gt;Hypertext Transfer Protocol (HTTP) is a &lt;a title="Communications protocol" href="http://en.wikipedia.org/wiki/Communications_protocol"&gt;communications protocol&lt;/a&gt; used to transfer or convey information on the &lt;a title="World Wide Web" href="http://en.wikipedia.org/wiki/World_Wide_Web"&gt;World Wide Web&lt;/a&gt;. Its original purpose was to provide a way to publish and retrieve &lt;a title="HTML" href="http://en.wikipedia.org/wiki/HTML"&gt;HTML&lt;/a&gt; &lt;a title="Hypertext" href="http://en.wikipedia.org/wiki/Hypertext"&gt;hypertext&lt;/a&gt; pages. Development of HTTP was coordinated by the W3C (&lt;a title="World Wide Web Consortium" href="http://en.wikipedia.org/wiki/World_Wide_Web_Consortium"&gt;World Wide Web Consortium&lt;/a&gt;) and the IETF (&lt;a title="Internet Engineering Task Force" href="http://en.wikipedia.org/wiki/Internet_Engineering_Task_Force"&gt;Internet Engineering Task Force&lt;/a&gt;), culminating in the publication of a series of &lt;a title="Request for Comments" href="http://en.wikipedia.org/wiki/Request_for_Comments"&gt;RFCs&lt;/a&gt;, most notably &lt;a title="http://tools.ietf.org/html/rfc2616" href="http://tools.ietf.org/html/rfc2616"&gt;RFC 2616&lt;/a&gt; (&lt;a title="June 1999" href="http://en.wikipedia.org/wiki/June_1999"&gt;June 1999&lt;/a&gt;), which defines HTTP/1.1, the version of HTTP in common use today.&lt;br /&gt;HTTP is a request/response protocol between clients and servers. The client making an HTTP request - such as a &lt;a title="Web browser" href="http://en.wikipedia.org/wiki/Web_browser"&gt;web browser&lt;/a&gt;, &lt;a title="Web crawler" href="http://en.wikipedia.org/wiki/Web_crawler"&gt;spider&lt;/a&gt;, or other end-user tool - is referred to as the &lt;a title="User agent" href="http://en.wikipedia.org/wiki/User_agent"&gt;user agent&lt;/a&gt;. The responding &lt;a title="Web server" href="http://en.wikipedia.org/wiki/Web_server"&gt;server&lt;/a&gt; - which stores or creates resources such as HTML files and images - is called the origin server. In between the user agent and origin server may be several intermediaries, such as &lt;a title="Proxy server" href="http://en.wikipedia.org/wiki/Proxy_server"&gt;proxies&lt;/a&gt;, &lt;a title="Gateway (computer networking)" href="http://en.wikipedia.org/wiki/Gateway_(computer_networking)"&gt;gateways&lt;/a&gt;, and &lt;a title="Tunneling protocol" href="http://en.wikipedia.org/wiki/Tunneling_protocol"&gt;tunnels&lt;/a&gt;. It is useful to remember that HTTP does not need to use &lt;a title="Internet protocol suite" href="http://en.wikipedia.org/wiki/Internet_protocol_suite"&gt;TCP/IP&lt;/a&gt; or its supporting layers. Indeed HTTP can be "implemented on top of any other protocol on the Internet, or on other networks. HTTP only presumes a reliable transport; any protocol that provides such guarantees can be used."&lt;br /&gt;An HTTP client initiates a request by establishing a &lt;a title="Transmission Control Protocol" href="http://en.wikipedia.org/wiki/Transmission_Control_Protocol"&gt;Transmission Control Protocol&lt;/a&gt; (TCP) connection to a particular &lt;a title="TCP and UDP port" href="http://en.wikipedia.org/wiki/TCP_and_UDP_port"&gt;port&lt;/a&gt; on a host (port 80 by default; see &lt;a title="List of TCP and UDP port numbers" href="http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers"&gt;List of TCP and UDP port numbers&lt;/a&gt;). An HTTP server listening on that port waits for the client to send a request message.&lt;br /&gt;Upon receiving the request, the server sends back a status line, such as "HTTP/1.1 200 OK", and a message of its own, the body of which is perhaps the requested file, an error message, or some other information.&lt;br /&gt;&lt;a title="Resource (Web)" href="http://en.wikipedia.org/wiki/Resource_(Web)"&gt;Resources&lt;/a&gt; to be accessed by &lt;a title="HTTP" href="http://en.wikipedia.org/wiki/HTTP"&gt;HTTP&lt;/a&gt; are identified using &lt;a title="Uniform Resource Identifier" href="http://en.wikipedia.org/wiki/Uniform_Resource_Identifier"&gt;Uniform Resource Identifiers&lt;/a&gt; (URIs) (or, more specifically, &lt;a title="Uniform Resource Locator" href="http://en.wikipedia.org/wiki/Uniform_Resource_Locator"&gt;URLs&lt;/a&gt;) using the http: or &lt;a title="Https" href="http://en.wikipedia.org/wiki/Https"&gt;https&lt;/a&gt; &lt;a title="URI scheme" href="http://en.wikipedia.org/wiki/URI_scheme"&gt;URI schemes&lt;/a&gt;.&lt;br /&gt;Request message&lt;br /&gt;The request message consists of the following:&lt;br /&gt;Request line, such as GET /images/logo.gif HTTP/1.1, which requests the file logo.gif from the /images directory&lt;br /&gt;Headers, such as Accept-Language: en&lt;br /&gt;An empty line&lt;br /&gt;An optional message body&lt;br /&gt;The request line and headers must all end with CRLF (that is, a &lt;a title="Carriage return" href="http://en.wikipedia.org/wiki/Carriage_return"&gt;carriage return&lt;/a&gt; followed by a &lt;a title="Line feed" href="http://en.wikipedia.org/wiki/Line_feed"&gt;line feed&lt;/a&gt;). The empty line must consist of only CRLF and no other &lt;a title="Whitespace (computer science)" href="http://en.wikipedia.org/wiki/Whitespace_(computer_science)"&gt;whitespace&lt;/a&gt;. In the HTTP/1.1 protocol, all headers except Host are optional.&lt;br /&gt;&lt;a name="Request_methods"&gt;&lt;/a&gt;Request methods&lt;br /&gt;HTTP defines eight methods (sometimes referred to as "verbs") indicating the desired action to be performed on the identified resource.&lt;br /&gt;HEAD&lt;br /&gt;Asks for the response identical to the one that would correspond to a GET request, but without the response body. This is useful for retrieving meta-information written in response headers, without having to transport the entire content.&lt;br /&gt;GET&lt;br /&gt;Requests a representation of the specified resource. By far the most common method used on the Web today. Should not be used for operations that cause side-effects (using it for actions in &lt;a title="Web application" href="http://en.wikipedia.org/wiki/Web_application"&gt;web applications&lt;/a&gt; is a common misuse). See 'safe methods' below.&lt;br /&gt;POST&lt;br /&gt;Submits data to be processed (e.g. from an &lt;a title="HTML form" href="http://en.wikipedia.org/wiki/HTML_form"&gt;HTML form&lt;/a&gt;) to the identified resource. The data is included in the body of the request. This may result in the creation of a new resource or the updates of existing resources or both.&lt;br /&gt;PUT&lt;br /&gt;Uploads a representation of the specified resource.&lt;br /&gt;DELETE&lt;br /&gt;Deletes the specified resource.&lt;br /&gt;TRACE&lt;br /&gt;Echoes back the received request, so that a client can see what intermediate servers are adding or changing in the request.&lt;br /&gt;OPTIONS&lt;br /&gt;Returns the HTTP methods that the server supports. This can be used to check the functionality of a web server.&lt;br /&gt;CONNECT&lt;br /&gt;Converts the request connection to a transparent &lt;a title="Tunneling protocol" href="http://en.wikipedia.org/wiki/Tunneling_protocol"&gt;TCP/IP tunnel&lt;/a&gt;, usually to facilitate &lt;a title="Transport Layer Security" href="http://en.wikipedia.org/wiki/Transport_Layer_Security"&gt;SSL&lt;/a&gt;-encrypted communication (HTTPS) through an unencrypted HTTP &lt;a title="Proxy server" href="http://en.wikipedia.org/wiki/Proxy_server"&gt;proxy&lt;/a&gt;.&lt;a title="" href="http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#_note-0#_note-0"&gt;[1]&lt;/a&gt;&lt;br /&gt;HTTP servers are supposed to implement at least the GET and HEAD methods and, whenever possible, also the OPTIONS method.&lt;br /&gt;&lt;a name="Safe_methods"&gt;&lt;/a&gt;Safe methods&lt;br /&gt;Some methods (e.g. HEAD or GET) are defined as safe, which means they are intended only for information retrieval and should not change the state of the server (in other words, they should not have &lt;a title="Side effect (computer science)" href="http://en.wikipedia.org/wiki/Side_effect_(computer_science)"&gt;side effects&lt;/a&gt;). Unsafe methods (such as POST, PUT and DELETE) should be displayed to the user in a special way, typically as buttons rather than links, thus making the user aware of possible obligations (such as a button that causes a financial transaction).&lt;br /&gt;Despite the required safety of GET requests, in practice they can cause changes on the server. For example, a Web server may use the retrieval through a simple hyperlink to initiate deletion of a domain database record, thus causing a change of the server's state as a side-effect of a GET request. This is discouraged, because it can cause problems for &lt;a title="Web caching" href="http://en.wikipedia.org/wiki/Web_caching"&gt;Web caching&lt;/a&gt;, &lt;a title="Search engines" href="http://en.wikipedia.org/wiki/Search_engines"&gt;search engines&lt;/a&gt; and other automated agents, which can make unintended changes on the server. Another case is that a GET request may cause the server to create a cache space.&lt;br /&gt;&lt;a name="Idempotent_methods_and_Web_Applications"&gt;&lt;/a&gt;Idempotent methods and Web Applications&lt;br /&gt;Methods GET, HEAD, PUT and DELETE are defined to be &lt;a title="Idempotent" href="http://en.wikipedia.org/wiki/Idempotent"&gt;idempotent&lt;/a&gt;, meaning that multiple identical requests should have the same effect as a single request. Methods OPTIONS and TRACE, being safe, are inherently idempotent.&lt;br /&gt;The RFC allows a user-agent, such as a browser to assume that any idempotent request can be retried without informing the user. This is done to improve the user experience when connecting to unresponsive or heavily-loaded web servers.&lt;br /&gt;However, note that the idempotence is not assured by the protocol or web server. It is perfectly possible to write a web application in which (eg) a database insert or update is triggered by a GET request - this would be a very normal example of what the spec refers to as "a change in server state".&lt;br /&gt;This misuse of GET can combine with the retry behaviour above to produce erroneous transactions - and for this reason GET should be avoided for anything transactional - and used, as intended, for document retrieval only.&lt;br /&gt;&lt;a name="HTTP_versions"&gt;&lt;/a&gt;HTTP versions&lt;br /&gt;HTTP has evolved into multiple, mostly backwards-compatible protocol versions. &lt;a title="http://tools.ietf.org/html/rfc2145" href="http://tools.ietf.org/html/rfc2145"&gt;RFC 2145&lt;/a&gt; describes the use of HTTP version numbers. The client tells in the beginning of the request the version it uses, and the server uses the same or earlier version in the response.&lt;br /&gt;0.9&lt;br /&gt;Deprecated. Supports only one command, GET — which does not specify the HTTP version. Does not support headers. Since this version does not support POST, the client can't pass much information to the server.&lt;br /&gt;HTTP/1.0 (May 1996)&lt;br /&gt;This is the first protocol revision to specify its version in communications and is still in wide use, especially by proxy servers.&lt;br /&gt;HTTP/1.1 (June 1999)&lt;a title="" href="http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#_note-1#_note-1"&gt;[2]&lt;/a&gt;&lt;a title="" href="http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#_note-2#_note-2"&gt;[3]&lt;/a&gt;&lt;br /&gt;Current version; persistent connections enabled by default and works well with proxies. Also supports &lt;a title="HTTP pipelining" href="http://en.wikipedia.org/wiki/HTTP_pipelining"&gt;request pipelining&lt;/a&gt;, allowing multiple requests to be sent at the same time, allowing the server to prepare for the workload and potentially transfer the requested resources more quickly to the client.&lt;br /&gt;HTTP/1.2&lt;br /&gt;The initial 1995 working drafts of the document PEP — an Extension Mechanism for HTTP (which proposed the &lt;a title="Protocol Extension Protocol" href="http://en.wikipedia.org/w/index.php?title=Protocol_Extension_Protocol&amp;amp;action=edit"&gt;Protocol Extension Protocol&lt;/a&gt;, abbreviated PEP) were prepared by the &lt;a title="World Wide Web Consortium" href="http://en.wikipedia.org/wiki/World_Wide_Web_Consortium"&gt;World Wide Web Consortium&lt;/a&gt; and submitted to the &lt;a title="Internet Engineering Task Force" href="http://en.wikipedia.org/wiki/Internet_Engineering_Task_Force"&gt;Internet Engineering Task Force&lt;/a&gt;. PEP was originally intended to become a distinguishing feature of HTTP/1.2.&lt;a title="" href="http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#_note-3#_note-3"&gt;[4]&lt;/a&gt; In later &lt;a title="http://www.w3.org/TR/WD-http-pep" href="http://www.w3.org/TR/WD-http-pep"&gt;PEP working drafts&lt;/a&gt;, however, the reference to HTTP/1.2 was removed. The experimental &lt;a title="http://tools.ietf.org/html/rfc2774" href="http://tools.ietf.org/html/rfc2774"&gt;RFC 2774&lt;/a&gt;, HTTP Extension Framework, largely subsumed PEP. It was published in February 2000.&lt;br /&gt;&lt;a name="Status_codes"&gt;&lt;/a&gt;Status codes&lt;br /&gt;In HTTP/1.0 and since, the first line of the HTTP response is called the status line and includes a numeric status code (such as "&lt;a title="HTTP 404" href="http://en.wikipedia.org/wiki/HTTP_404"&gt;404&lt;/a&gt;") and a textual reason phrase (such as "Not Found"). The way the &lt;a title="User agent" href="http://en.wikipedia.org/wiki/User_agent"&gt;user agent&lt;/a&gt; handles the response primarily depends on the code and secondarily on the response headers. Custom status codes can be used since, if the user agent encounters a code it does not recognize, it can use the first digit of the code to determine the general class of the response.&lt;a title="" href="http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#_note-4#_note-4"&gt;[5]&lt;/a&gt;&lt;br /&gt;Also, the standard reason phrases are only recommendations and can be replaced with "local equivalents" at the &lt;a title="Web developer" href="http://en.wikipedia.org/wiki/Web_developer"&gt;web developer&lt;/a&gt;'s discretion. If the status code indicated a problem, the user agent might display the reason phrase to the user to provide further information about the nature of the problem. The standard also allows the user agent to attempt to interpret the reason phrase, though this might be unwise since the standard explicitly specifies that status codes are machine-readable and reason phrases are human-readable.&lt;br /&gt;&lt;a name="Persistent_connections"&gt;&lt;/a&gt;Persistent connections&lt;br /&gt;In HTTP/0.9 and 1.0, the connection is closed after a single request/response pair. In HTTP/1.1 a keep-alive-mechanism was introduced, where a connection could be reused for more than one request.&lt;br /&gt;Such persistent connections reduce &lt;a title="Lag" href="http://en.wikipedia.org/wiki/Lag"&gt;lag&lt;/a&gt; perceptibly, because the client does not need to re-negotiate the TCP connection after the first request has been sent.&lt;br /&gt;Version 1.1 of the protocol also introduced &lt;a title="Chunked transfer encoding" href="http://en.wikipedia.org/wiki/Chunked_transfer_encoding"&gt;chunked transfer encoding&lt;/a&gt; to allow content on persistent connections to be streamed, rather than buffered, and &lt;a title="HTTP pipelining" href="http://en.wikipedia.org/wiki/HTTP_pipelining"&gt;HTTP pipelining&lt;/a&gt;, which allows clients to send some types of requests before the previous response has been received, further reducing lag.&lt;br /&gt;&lt;a name="HTTP_session_state"&gt;&lt;/a&gt;HTTP session state&lt;br /&gt;HTTP can occasionally pose problems for Web developers (Web Applications), because HTTP is &lt;a title="Stateless server" href="http://en.wikipedia.org/wiki/Stateless_server"&gt;stateless&lt;/a&gt;. The advantage of a stateless protocol is that hosts do not need to retain information about users between requests, but this forces the use of alternative methods for maintaining users' state, for example, when a host would like to customize content for a user who has visited before. The common method for solving this problem involves the use of sending and requesting &lt;a title="HTTP cookie" href="http://en.wikipedia.org/wiki/HTTP_cookie"&gt;cookies&lt;/a&gt;. Other methods include server side sessions, hidden variables (when current page is a &lt;a title="Form (web)" href="http://en.wikipedia.org/wiki/Form_(web)"&gt;form&lt;/a&gt;), and &lt;a title="URL" href="http://en.wikipedia.org/wiki/URL"&gt;URL&lt;/a&gt; encoded parameters (such as /index.php?userid=3).&lt;br /&gt;&lt;a name="Secure_HTTP"&gt;&lt;/a&gt;Secure HTTP&lt;br /&gt;There are currently two methods of establishing a secure HTTP connection: the &lt;a title="Https" href="http://en.wikipedia.org/wiki/Https"&gt;https&lt;/a&gt; &lt;a title="Uniform Resource Identifier" href="http://en.wikipedia.org/wiki/Uniform_Resource_Identifier"&gt;URI&lt;/a&gt; scheme and the HTTP 1.1 Upgrade header, introduced by &lt;a title="http://tools.ietf.org/html/rfc2817" href="http://tools.ietf.org/html/rfc2817"&gt;RFC 2817&lt;/a&gt;. Browser support for the Upgrade header is, however, nearly non-existent, hence the &lt;a title="Https" href="http://en.wikipedia.org/wiki/Https"&gt;https&lt;/a&gt; &lt;a title="Uniform Resource Identifier" href="http://en.wikipedia.org/wiki/Uniform_Resource_Identifier"&gt;URI&lt;/a&gt; scheme is still the dominant method of establishing a secure HTTP connection.&lt;br /&gt;&lt;a name="https_URI_scheme"&gt;&lt;/a&gt;https URI scheme&lt;br /&gt;https: is a URI scheme syntactically identical to the http: scheme used for normal HTTP connections, but which signals the browser to use an added encryption layer of &lt;a title="Transport Layer Security" href="http://en.wikipedia.org/wiki/Transport_Layer_Security"&gt;SSL/TLS&lt;/a&gt; to protect the traffic. SSL is especially suited for HTTP since it can provide some protection even if only one side of the communication is authenticated. In the case of HTTP transactions over the Internet, typically, only the server side is authenticated.&lt;br /&gt;&lt;a name="HTTP_1.1_Upgrade_header"&gt;&lt;/a&gt;HTTP 1.1 Upgrade header&lt;br /&gt;HTTP 1.1 introduced support for the Upgrade header. In the exchange, the client begins by making a clear-text request, which is later upgraded to &lt;a title="Transport Layer Security" href="http://en.wikipedia.org/wiki/Transport_Layer_Security"&gt;TLS&lt;/a&gt;. Either the client or the server may request (or demand) that the connection be upgraded. The most common usage is a clear-text request by the client followed by a server demand to upgrade the connection, which looks like this:&lt;br /&gt;Client:GET /encrypted-area HTTP/1.1Host: www.example.com&lt;br /&gt;Server:HTTP/1.1 426 Upgrade RequiredUpgrade: TLS/1.0, HTTP/1.1Connection: Upgrade&lt;br /&gt;The server returns a 426 status-code because 400 level codes indicate a client failure (see &lt;a title="List of HTTP status codes" href="http://en.wikipedia.org/wiki/List_of_HTTP_status_codes"&gt;List of HTTP status codes&lt;/a&gt;), which correctly alerts legacy clients that the failure was client-related.&lt;br /&gt;The benefits of using this method for establishing a secure connection are:&lt;br /&gt;that it removes messy and problematic redirection and URL rewriting on the server side,&lt;br /&gt;it allows virtual hosting (single IP, multiple domain-names) of secured websites, and&lt;br /&gt;it reduces user confusion by providing a single way to access a particular resource.&lt;br /&gt;A weakness with this method is that the requirement for secure HTTP cannot be specified in the URI. In practice, the (untrusted) server will thus be responsible for enabling secure HTTP, not the (trusted) client.&lt;br /&gt;&lt;a name="Sample"&gt;&lt;/a&gt;Sample&lt;br /&gt;Below is a sample conversation between an HTTP client and an HTTP server running on &lt;a title="Example.com" href="http://en.wikipedia.org/wiki/Example.com"&gt;http://en.wikipedia.org/wiki/Example.com&lt;/a&gt;, port 80.&lt;br /&gt;Client request (followed by a blank line, so that request ends with a double &lt;a title="Newline" href="http://en.wikipedia.org/wiki/Newline"&gt;newline&lt;/a&gt;, each in the form of a &lt;a title="Carriage return" href="http://en.wikipedia.org/wiki/Carriage_return"&gt;carriage return&lt;/a&gt; followed by a &lt;a title="Line feed" href="http://en.wikipedia.org/wiki/Line_feed"&gt;line feed&lt;/a&gt;): GET /index.html HTTP/1.1 Host: www.example.com&lt;br /&gt;The "Host" header distinguishes between various &lt;a title="Domain Name System" href="http://en.wikipedia.org/wiki/Domain_Name_System"&gt;DNS&lt;/a&gt; names sharing a single &lt;a title="IP address" href="http://en.wikipedia.org/wiki/IP_address"&gt;IP address&lt;/a&gt;, allowing name-based &lt;a title="Virtual hosting" href="http://en.wikipedia.org/wiki/Virtual_hosting"&gt;virtual hosting&lt;/a&gt;. While optional in HTTP/1.0, it is mandatory in HTTP/1.1.&lt;br /&gt;Server response (followed by a blank line and text of the requested page): HTTP/1.1 200 OK Date: Mon, 23 May 2005 22:38:34 GMT Server: Apache/1.3.27 (Unix)  (Red-Hat/Linux) Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT Etag: "3f80f-1b6-3e1cb03b" Accept-Ranges: bytes Content-Length: 438 Connection: close Content-Type: text/html; charset=UTF-8&lt;br /&gt;The &lt;a title="HTTP ETag" href="http://en.wikipedia.org/wiki/HTTP_ETag"&gt;ETag&lt;/a&gt; (entity tag) header is used to determine if the URL cached is identical to the requested URL on the server. Content-Type specifies the &lt;a title="Internet media type" href="http://en.wikipedia.org/wiki/Internet_media_type"&gt;Internet media type&lt;/a&gt; of the data conveyed by the http message, while Content-Length indicates its length in bytes. The webserver publishes its ability to respond to requests for certain byte ranges of the document by setting the header Accept-Ranges: bytes. This is useful if the connection was interrupted before the data was completely transferred to the client.&lt;a title="" href="http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#_note-5#_note-5"&gt;[6]&lt;/a&gt; With Connection: close it is stated, that the webserver will close the TCP connection immediately after the transfer of this package.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/392745368495742159-9145775465201599638?l=aboutprotocol.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aboutprotocol.blogspot.com/feeds/9145775465201599638/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=392745368495742159&amp;postID=9145775465201599638' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/392745368495742159/posts/default/9145775465201599638'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/392745368495742159/posts/default/9145775465201599638'/><link rel='alternate' type='text/html' href='http://aboutprotocol.blogspot.com/2007/10/hypertext-transfer-protocol_11.html' title='Hypertext Transfer Protocol'/><author><name>MP</name><uri>http://www.blogger.com/profile/02485863734608702367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-392745368495742159.post-3898776498420645619</id><published>2007-10-11T06:08:00.000-07:00</published><updated>2007-10-11T06:09:15.970-07:00</updated><title type='text'>Dynamic Host Configuration Protocol</title><content type='html'>&lt;div align="justify"&gt;Dynamic Host Configuration Protocol (DHCP) is a protocol used by networked computers (clients) to obtain IP addresses and other parameters such as the &lt;a title="Default gateway" href="http://en.wikipedia.org/wiki/Default_gateway"&gt;default gateway&lt;/a&gt;, &lt;a title="Subnet mask" href="http://en.wikipedia.org/wiki/Subnet_mask"&gt;subnet mask&lt;/a&gt;, and IP addresses of &lt;a title="Domain name system" href="http://en.wikipedia.org/wiki/Domain_name_system"&gt;DNS&lt;/a&gt; servers from a DHCP server. The DHCP server ensures that all IP addresses are unique, e.g., no IP address is assigned to a second client while the first client's assignment is valid (its lease has not expired). Thus IP address pool management is done by the server and not by a human network administrator.&lt;br /&gt;DHCP emerged as a &lt;a title="Standardization" href="http://en.wikipedia.org/wiki/Standardization"&gt;standard protocol&lt;/a&gt; in October 1993. DHCP is a successor to the older &lt;a title="BOOTP" href="http://en.wikipedia.org/wiki/BOOTP"&gt;BOOTP&lt;/a&gt; protocol, whose leases were given for infinite time and did not support options. Due to the backward-compatibility of DHCP, very few networks continue to use pure BOOTP. &lt;a title="As of 2006" href="http://en.wikipedia.org/wiki/As_of_2006"&gt;As of 2006&lt;/a&gt;, &lt;a title="http://tools.ietf.org/html/rfc2131" href="http://tools.ietf.org/html/rfc2131"&gt;RFC 2131&lt;/a&gt; (dated March 1997) provides the latest DHCP definition. &lt;a title="As of 2004" href="http://en.wikipedia.org/wiki/As_of_2004"&gt;As of 2004&lt;/a&gt;, the latest non-standard of the protocol is &lt;a title="http://tools.ietf.org/html/rfc3315" href="http://tools.ietf.org/html/rfc3315"&gt;RFC 3315&lt;/a&gt; (dated July 2003), which describes &lt;a title="DHCPv6" href="http://en.wikipedia.org/wiki/DHCPv6"&gt;DHCPv6&lt;/a&gt; (DHCP in an &lt;a title="IPv6" href="http://en.wikipedia.org/wiki/IPv6"&gt;IPv6&lt;/a&gt; environment).&lt;br /&gt;Overview&lt;br /&gt;The Dynamic Host Configuration Protocol (DHCP) automates the assignment of IP addresses, subnet masks, default gateway, and other IP parameters.&lt;a title="" href="http://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol#_note-0#_note-0"&gt;[1]&lt;/a&gt; When a DHCP-configured machine boots up or regains connectivity after a network outage, its DHCP client sends a query requesting necessary information from a DHCP server. The DHCP server manages a pool of IP addresses and also has information about client configuration parameters such as the default gateway, the domain name, the DNS servers, other servers such as time servers, and so forth. The query is typically initiated immediately after &lt;a title="Booting" href="http://en.wikipedia.org/wiki/Booting"&gt;booting&lt;/a&gt; up and must be completed before the client can initiate &lt;a title="Internet Protocol" href="http://en.wikipedia.org/wiki/Internet_Protocol"&gt;IP&lt;/a&gt;-based communication with other hosts. The DHCP server replies to the client with an IP address, subnet mask, default gateway, and other requested information such as DNS server, etc.&lt;br /&gt;DHCP provides three modes for allocating IP addresses. The best-known mode is dynamic, in which the client is provided a "lease" on an IP address for a period of time. Depending on the stability of the network, this could range from hours (a wireless network at an airport) to months (for desktops in a wire line lab). At any time before the lease expires, the DHCP client can request renewal of the lease on the current IP address. A properly-functioning client will use the renewal mechanism to maintain the same IP address throughout its connection to a single network. Maintaining the same IP address is important to correct functioning of higher-layer protocols. However, if the lease actually expires, the client must initiate a new negotiation of an IP address from the server's pool of addresses. As part of the negotiation, it can request its expired IP address, but there is no guarantee that it will get it.&lt;br /&gt;The two other modes for allocation of IP addresses are automatic (also known as DHCP Reservation), in which the address is permanently assigned to a client, and manual, in which the address is selected at the client (manually by the user or any other means) and the DHCP protocol messages are used to inform the server that the address has been allocated.&lt;br /&gt;Configuring &lt;a title="Firewall (networking)" href="http://en.wikipedia.org/wiki/Firewall_(networking)"&gt;firewall&lt;/a&gt; rules to accommodate access from machines who receive their IP addresses via dynamic DHCP is problematic because the IP address can vary over time. If fine-grained control of access to an IP address is required, the automatic or manual mode should be used for allocating the address.&lt;br /&gt;The negotiation for an address is initiated by a client broadcast. If the DHCP server is not on the local area network and the router is not specially configured, the DHCP server will not receive the broadcast message because routers do not forward broadcasts. However, most routers can be configured as relay agents to forward messages to the DHCP server and to return the server replies to the client. This mode of operation occurs in large organizations using a single DHCP server to supply client configuration to many different networks. Home users should never need this functionality.&lt;br /&gt;&lt;a name="Extent_of_DHCP_usage"&gt;&lt;/a&gt;Extent of DHCP usage&lt;br /&gt;Most home routers and firewalls are configured in the factory to be DHCP servers for a home network. An alternative to a home router is to use a computer as a DHCP server. Releases of &lt;a title="Linux" href="http://en.wikipedia.org/wiki/Linux"&gt;Linux&lt;/a&gt; usually include a DHCP server and the &lt;a title="Internet Software Consortium" href="http://en.wikipedia.org/wiki/Internet_Software_Consortium"&gt;Internet Software Consortium&lt;/a&gt; provides free DHCP servers and clients that run on a variety of &lt;a title="Unix" href="http://en.wikipedia.org/wiki/Unix"&gt;Unix&lt;/a&gt;-based systems.&lt;br /&gt;Service providers, as well as large enterprise networks, may link DHCP to a dynamic DNS server, so a given user or access port can be associated with a more human-friendly name using RFC2136 conventions &lt;a title="" href="http://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol#_note-1#_note-1"&gt;[2]&lt;/a&gt;. When DHCP is linked to dynamic DNS, operations staff can ping a name, rather than laboriously look up a dynamically assigned address, to check connectivity.&lt;br /&gt;&lt;a title="Internet service provider" href="http://en.wikipedia.org/wiki/Internet_service_provider"&gt;ISPs&lt;/a&gt; &lt;a title="Cable modem" href="http://en.wikipedia.org/wiki/Cable_modem"&gt;cable internet&lt;/a&gt; and with broadband access generally use DHCP to assign customers individual IP addresses. Alternatively, especially for dialup, they may assign the address using the IP Control Protocol function in &lt;a title="Point-to-Point Protocol" href="http://en.wikipedia.org/wiki/Point-to-Point_Protocol"&gt;PPP&lt;/a&gt;. The PPP server may have a proxy relationship to dynamic DNS.&lt;br /&gt;In the &lt;a title="United Kingdom" href="http://en.wikipedia.org/wiki/United_Kingdom"&gt;UK&lt;/a&gt; many broad-band ISP networks use DHCP, but &lt;a title="XDSL" href="http://en.wikipedia.org/wiki/XDSL"&gt;xDSL&lt;/a&gt; providers make extensive use of "infinite lease", which amounts to assigning semi-static IPs.&lt;br /&gt;Gateway devices provide DHCP support for &lt;a title="Computer Network" href="http://en.wikipedia.org/wiki/Computer_Network"&gt;networks&lt;/a&gt; running many computers being assigned private IP addresses.&lt;br /&gt;Network administrators that are responsible for large networks involving many clients and many subnetworks also use DHCP to minimize manual configuration and avoid mistakes in configuring multiple clients. For example, most large organizations use DHCP for configuring desktop and laptop computers.&lt;br /&gt;Network routers and often &lt;a title="Multilayer switch" href="http://en.wikipedia.org/wiki/Multilayer_switch"&gt;multilayer switches&lt;/a&gt; employ a DHCP relay agent, which relays DHCP "Discover" broadcasts from a LAN which does not include a DHCP server to a network which does have one. These devices may sometimes be configured to append information about the port from which a DHCP request originates (also known as option 82). One example of such a relay agent is the &lt;a title="UDP Helper Address" href="http://en.wikipedia.org/wiki/UDP_Helper_Address"&gt;UDP Helper Address&lt;/a&gt; command employed by &lt;a title="Cisco" href="http://en.wikipedia.org/wiki/Cisco"&gt;Cisco&lt;/a&gt; routers.&lt;br /&gt;&lt;a name="Security"&gt;&lt;/a&gt;Security&lt;br /&gt;Since DHCP servers provide IP addresses and thus network connectivity to anyone who has physical network access, DHCP simplifies network intrusion. While seasoned attackers will have no trouble finding usable IP addresses and other settings manually, amateur intruders may be grateful for the service.&lt;br /&gt;If DHCP is used on an unprotected wireless LAN, anyone within range has access to the network, including use of internet connectivity and potentially access to data not otherwise protected. On a wired LAN, an attacker will need a physical connection which is more difficult to establish unnoticed.&lt;br /&gt;When DHCP and DNS are interconnected with &lt;a title="Dynamic DNS" href="http://en.wikipedia.org/wiki/Dynamic_DNS"&gt;Dynamic DNS&lt;/a&gt;, there are several methods of cryptographic authentication of the DNS update. Should a miscreant be trying to defeat security on DHCP, there will either be an authentication error if he tries to update DNS, or there will be a DHCP database entry matched by no DNS entry.&lt;br /&gt;&lt;a name="IP_address_allocation"&gt;&lt;/a&gt;IP address allocation&lt;br /&gt;Depending on implementation, the DHCP server has three methods of allocating IP-addresses:&lt;br /&gt;manual allocation, where the DHCP server performs the allocation based on a table with &lt;a title="MAC address" href="http://en.wikipedia.org/wiki/MAC_address"&gt;MAC address&lt;/a&gt; - IP address pairs manually filled by the &lt;a title="Server administrator" href="http://en.wikipedia.org/wiki/Server_administrator"&gt;server administrator&lt;/a&gt;. Only requesting clients with a MAC address listed in this table get the IP address according to the table.&lt;br /&gt;automatic allocation, where the DHCP server permanently assigns to a requesting client a free IP-address from a range given by the administrator.&lt;br /&gt;dynamic allocation, the only method which provides dynamic re-use of IP addresses. A &lt;a title="Network administrator" href="http://en.wikipedia.org/wiki/Network_administrator"&gt;network administrator&lt;/a&gt; assigns a range of IP addresses to DHCP, and each client computer on the LAN has its &lt;a title="TCP/IP" href="http://en.wikipedia.org/wiki/TCP/IP"&gt;TCP/IP&lt;/a&gt; software configured to request an IP address from the DHCP &lt;a title="Server (computing)" href="http://en.wikipedia.org/wiki/Server_(computing)"&gt;server&lt;/a&gt; when that client computer's &lt;a title="Network interface card" href="http://en.wikipedia.org/wiki/Network_interface_card"&gt;network interface card&lt;/a&gt; starts up. The request-and-grant process uses a lease concept with a controllable time period. This eases the network installation procedure on the client computer side considerably.&lt;br /&gt;This decision remains transparent to clients.&lt;br /&gt;Some DHCP server implementations can update the DNS name associated with the client hosts to reflect the new IP address. They make use of the DNS update protocol established with &lt;a title="http://tools.ietf.org/html/rfc2136" href="http://tools.ietf.org/html/rfc2136"&gt;RFC 2136&lt;/a&gt;.&lt;br /&gt;&lt;a name="DHCP_and_firewalls"&gt;&lt;/a&gt;DHCP and firewalls&lt;br /&gt;&lt;a title="Firewall (networking)" href="http://en.wikipedia.org/wiki/Firewall_(networking)"&gt;Firewalls&lt;/a&gt; usually have to permit DHCP traffic explicitly. Specification of the DHCP client-server protocol describes several cases when packets must have the source address of 0x00000000 or the destination address of 0xffffffff. Anti-&lt;a title="Spoofing attack" href="http://en.wikipedia.org/wiki/Spoofing_attack"&gt;spoofing&lt;/a&gt; policy rules and tight inclusive firewalls often stop such packets. &lt;a title="Multi-homed" href="http://en.wikipedia.org/wiki/Multi-homed"&gt;Multi-homed&lt;/a&gt; DHCP servers require special consideration and further complicate configuration.&lt;br /&gt;To allow DHCP, network administrators need to allow several types of packets through the server-side firewall. All DHCP packets travel as &lt;a title="User Datagram Protocol" href="http://en.wikipedia.org/wiki/User_Datagram_Protocol"&gt;UDP&lt;/a&gt; datagrams; all client-sent packets have source port 68 and destination port 67; all server-sent packets have source port 67 and destination port 68. For example, a server-side firewall should allow the following types of packets:&lt;br /&gt;Incoming packets from 0.0.0.0 or dhcp-pool to dhcp-ip&lt;br /&gt;Incoming packets from any address to 255.255.255.255&lt;br /&gt;Outgoing packets from dhcp-ip to dhcp-pool or 255.255.255.255&lt;br /&gt;where dhcp-ip represents any address configured on a DHCP server host and dhcp-pool stands for the pool from which a DHCP server assigns addresses to clients&lt;br /&gt;&lt;a name="Example_in_ipfw_firewall"&gt;&lt;/a&gt;Example in ipfw firewall&lt;br /&gt;To give an idea of how a configuration would look in production, the following rules for a server-side &lt;a title="Ipfirewall" href="http://en.wikipedia.org/wiki/Ipfirewall"&gt;ipfirewall&lt;/a&gt; to allow DHCP traffic through. Dhcpd operates on interface rl0 and assigns addresses from 192.168.0.0/24 :pass udp from 0.0.0.0,192.168.0.0/24 68 to me 67 in recv rl0pass udp from any 68 to 255.255.255.255 67 in recv rl0pass udp from me 67 to 192.168.0.0/24,255.255.255.255 68 out xmit rl0&lt;br /&gt;&lt;a name="Example_in_Cisco_IOS_Extended_ACL"&gt;&lt;/a&gt;Example in Cisco IOS Extended ACL&lt;br /&gt;The following entries are valid on a Cisco 3560 switch with enabled DHCP service. The &lt;a title="Access control list" href="http://en.wikipedia.org/wiki/Access_control_list"&gt;ACL&lt;/a&gt; is applied to a routed interface, 10.32.73.129, on input. The subnet is 10.32.73.128/26.10 permit udp host 0.0.0.0 eq bootpc host 10.32.73.129 eq bootps20 permit udp 10.32.73.128 0.0.0.63 eq bootpc host 10.32.73.129 eq bootps30 permit udp any eq bootpc host 255.255.255.255                eq bootps&lt;br /&gt;&lt;a name="Technical_details"&gt;&lt;/a&gt;Technical details&lt;br /&gt;Schema of a typical DHCP session&lt;br /&gt;DHCP uses the same two &lt;a title="Internet Assigned Numbers Authority" href="http://en.wikipedia.org/wiki/Internet_Assigned_Numbers_Authority"&gt;IANA&lt;/a&gt; assigned ports as &lt;a title="BOOTP" href="http://en.wikipedia.org/wiki/BOOTP"&gt;BOOTP&lt;/a&gt;: 67/udp for the &lt;a title="Server-side" href="http://en.wikipedia.org/wiki/Server-side"&gt;server side&lt;/a&gt;, and 68/udp for the &lt;a title="Client-side" href="http://en.wikipedia.org/wiki/Client-side"&gt;client side&lt;/a&gt;.&lt;br /&gt;DHCP operations fall into four basic phases. These phases are IP lease request, IP lease offer, IP lease selection, and IP lease acknowledgement.&lt;br /&gt;After the client obtained an IP address, the client may start an &lt;a title="Address Resolution Protocol" href="http://en.wikipedia.org/wiki/Address_Resolution_Protocol"&gt;address resolution query&lt;/a&gt; to prevent IP conflicts caused by address poll overlapping of DHCP servers.&lt;br /&gt;&lt;a name="DHCP_discovery"&gt;&lt;/a&gt;DHCP discovery&lt;br /&gt;The client broadcasts on the physical subnet to find available servers. Network administrators can configure a local router to forward DHCP packets to a DHCP server on a different subnet. This client-implementation creates a &lt;a title="User Datagram Protocol" href="http://en.wikipedia.org/wiki/User_Datagram_Protocol"&gt;UDP&lt;/a&gt; packet with the broadcast destination of 255.255.255.255 or subnet broadcast address.&lt;br /&gt;A client can also request its last-known IP address (in the example below, 192.168.1.100). If the client is still in a network where this IP is valid, the server might grant the request. Otherwise, it depends whether the server is set up as &lt;a title="http://www.isc.org/index.pl?/sw/dhcp/authoritative.php" href="http://www.isc.org/index.pl?/sw/dhcp/authoritative.php"&gt;authoritative&lt;/a&gt; or not. An authoritative server will deny the request, making the client ask for a new IP immediately. A non-authoritative server simply ignores the request, leading to an implementation dependent time out for the client to give up on the request and ask for a new IP.&lt;br /&gt;&lt;a name="DHCP_offers"&gt;&lt;/a&gt;DHCP offers&lt;br /&gt;When a DHCP server receives an IP lease request from a client, it extends an IP lease offer. This is done by reserving an IP address for the client and sending a DHCPOFFER message across the network to the client. This message contains the client's MAC address, followed by the IP address that the server is offering, the subnet mask, the lease duration, and the IP address of the DHCP server making the offer.&lt;br /&gt;The server determines the configuration, based on the client's hardware address as specified in the CHADDR field. Here the server, 192.168.1.1, specifies the IP address in the YIADDR field.&lt;br /&gt;&lt;a name="DHCP_requests"&gt;&lt;/a&gt;DHCP requests&lt;br /&gt;When the client PC receives an IP lease offer, it must tell all the other DHCP servers that it has accepted an offer. To do this, the client broadcasts a DHCPREQUEST message containing the IP address of the server that made the offer. When the other DHCP servers receive this message, they withdraw any offers that they might have made to the client. They then return the address that they had reserved for the client back to the pool of valid addresses that they can offer to another computer. Any number of DHCP servers can respond to an IP lease request, but the client can only accept one offer per network interface card.&lt;br /&gt;&lt;a name="DHCP_acknowledgement"&gt;&lt;/a&gt;DHCP acknowledgement&lt;br /&gt;When the DHCP server receives the DHCPREQUEST message from the client, it initiates the final phase of the configuration process. This acknowledgement phase involves sending a DHCPACK packet to the client. This packet includes the lease duration and any other configuration information that the client might have requested. At this point, the TCP/IP configuration process is complete.&lt;br /&gt;The server acknowledges the request and sends the acknowledgement to the client. The system as a whole expects the client to configure its network interface with the supplied options.&lt;br /&gt;&lt;a name="DHCP_information"&gt;&lt;/a&gt;DHCP information&lt;br /&gt;The client sends a request to the DHCP server: either to request more information than the server sent with the original DHCPACK; or to repeat data for a particular application - for example, browsers use DHCP Inform to obtain web proxy settings via &lt;a title="Web Proxy Autodiscovery Protocol" href="http://en.wikipedia.org/wiki/Web_Proxy_Autodiscovery_Protocol"&gt;WPAD&lt;/a&gt;. Such queries do not cause the DHCP server to refresh the IP expiry time in its database.&lt;br /&gt;&lt;a name="DHCP_releasing"&gt;&lt;/a&gt;DHCP releasing&lt;br /&gt;The client sends a request to the DHCP server to release the DHCP and the client unconfigures its IP address. As clients usually do not know when users may unplug them from the network, the protocol does not define the sending of DHCP Release as mandatory.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/392745368495742159-3898776498420645619?l=aboutprotocol.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aboutprotocol.blogspot.com/feeds/3898776498420645619/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=392745368495742159&amp;postID=3898776498420645619' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/392745368495742159/posts/default/3898776498420645619'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/392745368495742159/posts/default/3898776498420645619'/><link rel='alternate' type='text/html' href='http://aboutprotocol.blogspot.com/2007/10/dynamic-host-configuration-protocol_11.html' title='Dynamic Host Configuration Protocol'/><author><name>MP</name><uri>http://www.blogger.com/profile/02485863734608702367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-392745368495742159.post-8104633802260956574</id><published>2007-10-11T06:06:00.001-07:00</published><updated>2007-10-11T06:07:27.469-07:00</updated><title type='text'>Hardware TCP implementations</title><content type='html'>One way to overcome the processing power requirements of TCP is building hardware implementations of it, widely known as TCP Offload Engines (TOE). The main problem of TOEs is that they are hard to integrate into computing systems, requiring extensive changes in the operating system of the computer or device. The first company to develop such a device was Alacritech.&lt;br /&gt;&lt;a name="Debugging_TCP"&gt;&lt;/a&gt;Debugging TCP&lt;br /&gt;A packet sniffer, which intercepts TCP traffic on a network link, can be useful in debugging networks, network stacks and applications which use TCP by showing the user what packets are passing through a link. Some networking stacks support the SO_DEBUG socket option, which can be enabled on the socket using setsockopt. That option dumps all the packets, TCP states and events on that socket which will be helpful in debugging. netstat is another utility that can be used for debugging.&lt;br /&gt;&lt;a name="Alternatives_to_TCP"&gt;&lt;/a&gt;Alternatives to TCP&lt;br /&gt;For many applications TCP is not appropriate. One big problem (at least with normal implementations) is that the application cannot get at the packets coming after a lost packet until the retransmitted copy of the lost packet is received. This causes problems for real-time applications such as streaming multimedia (such as &lt;a title="Web radio" href="http://en.wikipedia.org/wiki/Web_radio"&gt;Internet radio&lt;/a&gt;), real-time multiplayer games and &lt;a title="Voice over IP" href="http://en.wikipedia.org/wiki/Voice_over_IP"&gt;voice over IP&lt;/a&gt; (VoIP) where it is sometimes more useful to get most of the data in a timely fashion than it is to get all of the data in order.&lt;br /&gt;Also for &lt;a title="Embedded systems" href="http://en.wikipedia.org/wiki/Embedded_systems"&gt;embedded systems&lt;/a&gt;, &lt;a title="Network booting" href="http://en.wikipedia.org/wiki/Network_booting"&gt;network booting&lt;/a&gt; and servers that serve simple requests from huge numbers of clients (e.g. &lt;a title="Domain name system" href="http://en.wikipedia.org/wiki/Domain_name_system"&gt;DNS&lt;/a&gt; servers) the complexity of TCP can be a problem. Finally some tricks such as transmitting data between two hosts that are both behind &lt;a title="Network address translation" href="http://en.wikipedia.org/wiki/Network_address_translation"&gt;NAT&lt;/a&gt; (using &lt;a title="STUN" href="http://en.wikipedia.org/wiki/STUN"&gt;STUN&lt;/a&gt; or similar systems) are far simpler without a relatively complex protocol like TCP in the way.&lt;br /&gt;Generally where TCP is unsuitable the &lt;a title="User Datagram Protocol" href="http://en.wikipedia.org/wiki/User_Datagram_Protocol"&gt;User Datagram Protocol&lt;/a&gt; (UDP) is used. This provides the application &lt;a title="Multiplexing" href="http://en.wikipedia.org/wiki/Multiplexing"&gt;multiplexing&lt;/a&gt; and checksums that TCP does, but does not handle building streams or retransmission giving the application developer the ability to code those in a way suitable for the situation and/or to replace them with other methods like &lt;a title="Forward error correction" href="http://en.wikipedia.org/wiki/Forward_error_correction"&gt;forward error correction&lt;/a&gt; or &lt;a title="Interpolation (computer programming)" href="http://en.wikipedia.org/wiki/Interpolation_(computer_programming)"&gt;interpolation&lt;/a&gt;.&lt;br /&gt;&lt;a title="Stream Control Transmission Protocol" href="http://en.wikipedia.org/wiki/Stream_Control_Transmission_Protocol"&gt;SCTP&lt;/a&gt; is another IP protocol that provides reliable stream oriented services not so dissimilar from TCP. It is newer and considerably more complex than TCP so has not yet seen widespread deployment, however it is especially designed to be used in situations where reliability and near-real-time considerations are important.&lt;br /&gt;&lt;a title="Venturi Transport Protocol" href="http://en.wikipedia.org/wiki/Venturi_Transport_Protocol"&gt;Venturi Transport Protocol&lt;/a&gt; (VTP) is a patented proprietary protocol that is designed to replace TCP transparently in order to overcome perceived inefficiencies related to wireless data transport.&lt;br /&gt;TCP also has some issues in high bandwidth utilization environments. The &lt;a title="TCP congestion avoidance algorithm" href="http://en.wikipedia.org/wiki/TCP_congestion_avoidance_algorithm"&gt;TCP congestion avoidance algorithm&lt;/a&gt; works very well for ad-hoc environments where it is not known who will be sending data, but if the environment is predictable, a timing based protocol such as &lt;a title="Asynchronous Transfer Mode" href="http://en.wikipedia.org/wiki/Asynchronous_Transfer_Mode"&gt;ATM&lt;/a&gt; can avoid the overhead of the retransmits that TCP needs.&lt;br /&gt;&lt;a name="TCP_segment_structure"&gt;&lt;/a&gt;TCP segment structure&lt;br /&gt;A TCP segment consists of two sections:&lt;br /&gt;header&lt;br /&gt;data&lt;br /&gt;The header consists of 11 fields, of which only 10 are required. The eleventh field is optional (pink background in table) and aptly named: options.&lt;br /&gt;&lt;a name="TCP_Header"&gt;&lt;/a&gt;TCP Header&lt;br /&gt;Source port – identifies the sending port&lt;br /&gt;Destination port – identifies the receiving port&lt;br /&gt;Sequence number – has a dual role&lt;br /&gt;If the SYN flag is present then this is the initial sequence number and the first data byte is the sequence number plus 1&lt;br /&gt;if the SYN flag is not present then the first data byte is the sequence number&lt;br /&gt;Acknowledgment number – if the ACK flag is set then the value of this field is the sequence number that the sender of the acknowledgment expects next.&lt;br /&gt;Data offset – specifies the size of the TCP header in 32-bit words. The minimum size header is 5 words and the maximum is 15 words thus giving the minimum size of 20 bytes and maximum of 60 bytes. This field gets its name from the fact that it is also the offset from the start of the TCP packet to the data.&lt;br /&gt;Reserved – for future use and should be set to zero&lt;br /&gt;Flags (aka Control bits) – contains 8 bit flags&lt;br /&gt;CWR – Congestion Window Reduced (CWR) flag is set by the sending host to indicate that it received a TCP segment with the ECE flag set (added to header by &lt;a title="http://tools.ietf.org/html/rfc3168" href="http://tools.ietf.org/html/rfc3168"&gt;RFC 3168&lt;/a&gt;).&lt;br /&gt;ECE (ECN-Echo) – indicate that the TCP peer is &lt;a title="Explicit Congestion Notification" href="http://en.wikipedia.org/wiki/Explicit_Congestion_Notification"&gt;ECN&lt;/a&gt; capable during 3-way handshake (added to header by &lt;a title="http://tools.ietf.org/html/rfc3168" href="http://tools.ietf.org/html/rfc3168"&gt;RFC 3168&lt;/a&gt;).&lt;br /&gt;URG – indicates that the URGent pointer field is significant&lt;br /&gt;ACK – indicates that the ACKnowledgment field is significant&lt;br /&gt;PSH – Push function&lt;br /&gt;RST – Reset the connection&lt;br /&gt;SYN – Synchronize sequence numbers&lt;br /&gt;FIN – No more data from sender&lt;br /&gt;Window – the number of bytes that may be received on the receiving side before being halted from sliding any further and receiving any more bytes as a result of a packet at the beginning of the sliding window not having been acknowledged or received. Starts at acknowledgement field.&lt;br /&gt;Checksum – The 16-bit &lt;a title="Checksum" href="http://en.wikipedia.org/wiki/Checksum"&gt;checksum&lt;/a&gt; field is used for error-checking of the header and data&lt;br /&gt;Urgent pointer – if the URG flag is set, then this 16-bit field is an offset from the sequence number indicating the last urgent data byte&lt;br /&gt;Options – the total length of the option field must be a multiple of a 32-bit word and the data offset field adjusted appropriately&lt;br /&gt;&lt;a name="Fields_used_to_compute_the_checksum"&gt;&lt;/a&gt;Fields used to compute the checksum&lt;br /&gt;&lt;a name="TCP_checksum_using_IPv4"&gt;&lt;/a&gt;TCP checksum using IPv4&lt;br /&gt;When TCP runs over &lt;a title="IPv4" href="http://en.wikipedia.org/wiki/IPv4"&gt;IPv4&lt;/a&gt;, the method used to compute the checksum is defined in &lt;a title="http://tools.ietf.org/html/rfc793" href="http://tools.ietf.org/html/rfc793"&gt;RFC 793&lt;/a&gt;:&lt;br /&gt;The checksum field is the 16 bit one's complement of the one's complement sum of all 16-bit words in the header and text. If a segment contains an odd number of header and text octets to be checksummed, the last octet is padded on the right with zeros to form a 16-bit word for checksum purposes. The pad is not transmitted as part of the segment. While computing the checksum, the checksum field itself is replaced with zeros.&lt;br /&gt;In other words, all 16-bit words are summed together using &lt;a title="One's complement" href="http://en.wikipedia.org/wiki/One"&gt;one's complement&lt;/a&gt; (with the checksum field set to zero). The sum is then one's complemented. This final value is then inserted as the checksum field. Algorithmically speaking, this is the same as for &lt;a title="IPv6" href="http://en.wikipedia.org/wiki/IPv6"&gt;IPv6&lt;/a&gt;. The difference is in the data used to make the checksum. When computing the checksum, a pseudo-header that mimics the IPv4 header is shown in the table below.&lt;br /&gt;The source and destination addresses are those in the IPv4 header. The protocol is that for TCP (see &lt;a title="List of IPv4 protocol numbers" href="http://en.wikipedia.org/wiki/List_of_IPv4_protocol_numbers"&gt;List of IPv4 protocol numbers&lt;/a&gt;): 6. The TCP length field is the length of the TCP header and data.&lt;br /&gt;&lt;a name="TCP_checksum_using_IPv6"&gt;&lt;/a&gt;TCP checksum using IPv6&lt;br /&gt;When TCP runs over &lt;a title="IPv6" href="http://en.wikipedia.org/wiki/IPv6"&gt;IPv6&lt;/a&gt;, the method used to compute the checksum is changed, as per &lt;a title="http://tools.ietf.org/html/rfc2460" href="http://tools.ietf.org/html/rfc2460"&gt;RFC 2460&lt;/a&gt;:&lt;br /&gt;Any transport or other upper-layer protocol that includes the addresses from the IP header in its checksum computation must be modified for use over IPv6, to include the 128-bit IPv6 addresses instead of 32-bit IPv4 addresses.&lt;br /&gt;Source address – the one in the IPv6 header&lt;br /&gt;Destination address – the final destination; if the IPv6 packet doesn't contain a Routing header, that will be the destination address in the IPv6 header, otherwise, at the originating node, it will be the address in the last element of the Routing header, and, at the receiving node, it will be the destination address in the IPv6 header.&lt;br /&gt;TCP length – the length of the TCP header and data;&lt;br /&gt;Next Header – the protocol value for TCP&lt;br /&gt;&lt;a name="Data"&gt;&lt;/a&gt;Data&lt;br /&gt;The last field is not a part of the header. The contents of this field are whatever the upper layer protocol wants but this protocol is not set in the header and is presumed based on the port selection.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/392745368495742159-8104633802260956574?l=aboutprotocol.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aboutprotocol.blogspot.com/feeds/8104633802260956574/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=392745368495742159&amp;postID=8104633802260956574' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/392745368495742159/posts/default/8104633802260956574'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/392745368495742159/posts/default/8104633802260956574'/><link rel='alternate' type='text/html' href='http://aboutprotocol.blogspot.com/2007/10/hardware-tcp-implementations_3888.html' title='Hardware TCP implementations'/><author><name>MP</name><uri>http://www.blogger.com/profile/02485863734608702367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-392745368495742159.post-4095003896200416546</id><published>2007-10-11T06:06:00.000-07:00</published><updated>2007-10-11T06:07:17.229-07:00</updated><title type='text'>Hardware TCP implementations</title><content type='html'>One way to overcome the processing power requirements of TCP is building hardware implementations of it, widely known as TCP Offload Engines (TOE). The main problem of TOEs is that they are hard to integrate into computing systems, requiring extensive changes in the operating system of the computer or device. The first company to develop such a device was Alacritech.&lt;br /&gt;&lt;a name="Debugging_TCP"&gt;&lt;/a&gt;Debugging TCP&lt;br /&gt;A packet sniffer, which intercepts TCP traffic on a network link, can be useful in debugging networks, network stacks and applications which use TCP by showing the user what packets are passing through a link. Some networking stacks support the SO_DEBUG socket option, which can be enabled on the socket using setsockopt. That option dumps all the packets, TCP states and events on that socket which will be helpful in debugging. netstat is another utility that can be used for debugging.&lt;br /&gt;&lt;a name="Alternatives_to_TCP"&gt;&lt;/a&gt;Alternatives to TCP&lt;br /&gt;For many applications TCP is not appropriate. One big problem (at least with normal implementations) is that the application cannot get at the packets coming after a lost packet until the retransmitted copy of the lost packet is received. This causes problems for real-time applications such as streaming multimedia (such as &lt;a title="Web radio" href="http://en.wikipedia.org/wiki/Web_radio"&gt;Internet radio&lt;/a&gt;), real-time multiplayer games and &lt;a title="Voice over IP" href="http://en.wikipedia.org/wiki/Voice_over_IP"&gt;voice over IP&lt;/a&gt; (VoIP) where it is sometimes more useful to get most of the data in a timely fashion than it is to get all of the data in order.&lt;br /&gt;Also for &lt;a title="Embedded systems" href="http://en.wikipedia.org/wiki/Embedded_systems"&gt;embedded systems&lt;/a&gt;, &lt;a title="Network booting" href="http://en.wikipedia.org/wiki/Network_booting"&gt;network booting&lt;/a&gt; and servers that serve simple requests from huge numbers of clients (e.g. &lt;a title="Domain name system" href="http://en.wikipedia.org/wiki/Domain_name_system"&gt;DNS&lt;/a&gt; servers) the complexity of TCP can be a problem. Finally some tricks such as transmitting data between two hosts that are both behind &lt;a title="Network address translation" href="http://en.wikipedia.org/wiki/Network_address_translation"&gt;NAT&lt;/a&gt; (using &lt;a title="STUN" href="http://en.wikipedia.org/wiki/STUN"&gt;STUN&lt;/a&gt; or similar systems) are far simpler without a relatively complex protocol like TCP in the way.&lt;br /&gt;Generally where TCP is unsuitable the &lt;a title="User Datagram Protocol" href="http://en.wikipedia.org/wiki/User_Datagram_Protocol"&gt;User Datagram Protocol&lt;/a&gt; (UDP) is used. This provides the application &lt;a title="Multiplexing" href="http://en.wikipedia.org/wiki/Multiplexing"&gt;multiplexing&lt;/a&gt; and checksums that TCP does, but does not handle building streams or retransmission giving the application developer the ability to code those in a way suitable for the situation and/or to replace them with other methods like &lt;a title="Forward error correction" href="http://en.wikipedia.org/wiki/Forward_error_correction"&gt;forward error correction&lt;/a&gt; or &lt;a title="Interpolation (computer programming)" href="http://en.wikipedia.org/wiki/Interpolation_(computer_programming)"&gt;interpolation&lt;/a&gt;.&lt;br /&gt;&lt;a title="Stream Control Transmission Protocol" href="http://en.wikipedia.org/wiki/Stream_Control_Transmission_Protocol"&gt;SCTP&lt;/a&gt; is another IP protocol that provides reliable stream oriented services not so dissimilar from TCP. It is newer and considerably more complex than TCP so has not yet seen widespread deployment, however it is especially designed to be used in situations where reliability and near-real-time considerations are important.&lt;br /&gt;&lt;a title="Venturi Transport Protocol" href="http://en.wikipedia.org/wiki/Venturi_Transport_Protocol"&gt;Venturi Transport Protocol&lt;/a&gt; (VTP) is a patented proprietary protocol that is designed to replace TCP transparently in order to overcome perceived inefficiencies related to wireless data transport.&lt;br /&gt;TCP also has some issues in high bandwidth utilization environments. The &lt;a title="TCP congestion avoidance algorithm" href="http://en.wikipedia.org/wiki/TCP_congestion_avoidance_algorithm"&gt;TCP congestion avoidance algorithm&lt;/a&gt; works very well for ad-hoc environments where it is not known who will be sending data, but if the environment is predictable, a timing based protocol such as &lt;a title="Asynchronous Transfer Mode" href="http://en.wikipedia.org/wiki/Asynchronous_Transfer_Mode"&gt;ATM&lt;/a&gt; can avoid the overhead of the retransmits that TCP needs.&lt;br /&gt;&lt;a name="TCP_segment_structure"&gt;&lt;/a&gt;TCP segment structure&lt;br /&gt;A TCP segment consists of two sections:&lt;br /&gt;header&lt;br /&gt;data&lt;br /&gt;The header consists of 11 fields, of which only 10 are required. The eleventh field is optional (pink background in table) and aptly named: options.&lt;br /&gt;&lt;a name="TCP_Header"&gt;&lt;/a&gt;TCP Header&lt;br /&gt;Source port – identifies the sending port&lt;br /&gt;Destination port – identifies the receiving port&lt;br /&gt;Sequence number – has a dual role&lt;br /&gt;If the SYN flag is present then this is the initial sequence number and the first data byte is the sequence number plus 1&lt;br /&gt;if the SYN flag is not present then the first data byte is the sequence number&lt;br /&gt;Acknowledgment number – if the ACK flag is set then the value of this field is the sequence number that the sender of the acknowledgment expects next.&lt;br /&gt;Data offset – specifies the size of the TCP header in 32-bit words. The minimum size header is 5 words and the maximum is 15 words thus giving the minimum size of 20 bytes and maximum of 60 bytes. This field gets its name from the fact that it is also the offset from the start of the TCP packet to the data.&lt;br /&gt;Reserved – for future use and should be set to zero&lt;br /&gt;Flags (aka Control bits) – contains 8 bit flags&lt;br /&gt;CWR – Congestion Window Reduced (CWR) flag is set by the sending host to indicate that it received a TCP segment with the ECE flag set (added to header by &lt;a title="http://tools.ietf.org/html/rfc3168" href="http://tools.ietf.org/html/rfc3168"&gt;RFC 3168&lt;/a&gt;).&lt;br /&gt;ECE (ECN-Echo) – indicate that the TCP peer is &lt;a title="Explicit Congestion Notification" href="http://en.wikipedia.org/wiki/Explicit_Congestion_Notification"&gt;ECN&lt;/a&gt; capable during 3-way handshake (added to header by &lt;a title="http://tools.ietf.org/html/rfc3168" href="http://tools.ietf.org/html/rfc3168"&gt;RFC 3168&lt;/a&gt;).&lt;br /&gt;URG – indicates that the URGent pointer field is significant&lt;br /&gt;ACK – indicates that the ACKnowledgment field is significant&lt;br /&gt;PSH – Push function&lt;br /&gt;RST – Reset the connection&lt;br /&gt;SYN – Synchronize sequence numbers&lt;br /&gt;FIN – No more data from sender&lt;br /&gt;Window – the number of bytes that may be received on the receiving side before being halted from sliding any further and receiving any more bytes as a result of a packet at the beginning of the sliding window not having been acknowledged or received. Starts at acknowledgement field.&lt;br /&gt;Checksum – The 16-bit &lt;a title="Checksum" href="http://en.wikipedia.org/wiki/Checksum"&gt;checksum&lt;/a&gt; field is used for error-checking of the header and data&lt;br /&gt;Urgent pointer – if the URG flag is set, then this 16-bit field is an offset from the sequence number indicating the last urgent data byte&lt;br /&gt;Options – the total length of the option field must be a multiple of a 32-bit word and the data offset field adjusted appropriately&lt;br /&gt;&lt;a name="Fields_used_to_compute_the_checksum"&gt;&lt;/a&gt;Fields used to compute the checksum&lt;br /&gt;&lt;a name="TCP_checksum_using_IPv4"&gt;&lt;/a&gt;TCP checksum using IPv4&lt;br /&gt;When TCP runs over &lt;a title="IPv4" href="http://en.wikipedia.org/wiki/IPv4"&gt;IPv4&lt;/a&gt;, the method used to compute the checksum is defined in &lt;a title="http://tools.ietf.org/html/rfc793" href="http://tools.ietf.org/html/rfc793"&gt;RFC 793&lt;/a&gt;:&lt;br /&gt;The checksum field is the 16 bit one's complement of the one's complement sum of all 16-bit words in the header and text. If a segment contains an odd number of header and text octets to be checksummed, the last octet is padded on the right with zeros to form a 16-bit word for checksum purposes. The pad is not transmitted as part of the segment. While computing the checksum, the checksum field itself is replaced with zeros.&lt;br /&gt;In other words, all 16-bit words are summed together using &lt;a title="One's complement" href="http://en.wikipedia.org/wiki/One"&gt;one's complement&lt;/a&gt; (with the checksum field set to zero). The sum is then one's complemented. This final value is then inserted as the checksum field. Algorithmically speaking, this is the same as for &lt;a title="IPv6" href="http://en.wikipedia.org/wiki/IPv6"&gt;IPv6&lt;/a&gt;. The difference is in the data used to make the checksum. When computing the checksum, a pseudo-header that mimics the IPv4 header is shown in the table below.&lt;br /&gt;The source and destination addresses are those in the IPv4 header. The protocol is that for TCP (see &lt;a title="List of IPv4 protocol numbers" href="http://en.wikipedia.org/wiki/List_of_IPv4_protocol_numbers"&gt;List of IPv4 protocol numbers&lt;/a&gt;): 6. The TCP length field is the length of the TCP header and data.&lt;br /&gt;&lt;a name="TCP_checksum_using_IPv6"&gt;&lt;/a&gt;TCP checksum using IPv6&lt;br /&gt;When TCP runs over &lt;a title="IPv6" href="http://en.wikipedia.org/wiki/IPv6"&gt;IPv6&lt;/a&gt;, the method used to compute the checksum is changed, as per &lt;a title="http://tools.ietf.org/html/rfc2460" href="http://tools.ietf.org/html/rfc2460"&gt;RFC 2460&lt;/a&gt;:&lt;br /&gt;Any transport or other upper-layer protocol that includes the addresses from the IP header in its checksum computation must be modified for use over IPv6, to include the 128-bit IPv6 addresses instead of 32-bit IPv4 addresses.&lt;br /&gt;Source address – the one in the IPv6 header&lt;br /&gt;Destination address – the final destination; if the IPv6 packet doesn't contain a Routing header, that will be the destination address in the IPv6 header, otherwise, at the originating node, it will be the address in the last element of the Routing header, and, at the receiving node, it will be the destination address in the IPv6 header.&lt;br /&gt;TCP length – the length of the TCP header and data;&lt;br /&gt;Next Header – the protocol value for TCP&lt;br /&gt;&lt;a name="Data"&gt;&lt;/a&gt;Data&lt;br /&gt;The last field is not a part of the header. The contents of this field are whatever the upper layer protocol wants but this protocol is not set in the header and is presumed based on the port selection.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/392745368495742159-4095003896200416546?l=aboutprotocol.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aboutprotocol.blogspot.com/feeds/4095003896200416546/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=392745368495742159&amp;postID=4095003896200416546' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/392745368495742159/posts/default/4095003896200416546'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/392745368495742159/posts/default/4095003896200416546'/><link rel='alternate' type='text/html' href='http://aboutprotocol.blogspot.com/2007/10/hardware-tcp-implementations_11.html' title='Hardware TCP implementations'/><author><name>MP</name><uri>http://www.blogger.com/profile/02485863734608702367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-392745368495742159.post-1986893138449343475</id><published>2007-10-11T06:04:00.000-07:00</published><updated>2007-10-11T06:06:16.503-07:00</updated><title type='text'>Error-free data transfer</title><content type='html'>&lt;div align="justify"&gt;Sequence numbers and acknowledgments cover discarding duplicate packets, retransmission of lost packets, and ordered-data transfer. To assure correctness a checksum field is included (see TCP segment structure for details on checksumming).&lt;br /&gt;The TCP checksum is a quite weak check by modern standards. Data Link Layers with a high probability of bit error rates may require additional link error correction/detection capabilities. If TCP were to be redesigned today, it would most probably have a 32-bit &lt;a title="Cyclic redundancy check" href="http://en.wikipedia.org/wiki/Cyclic_redundancy_check"&gt;cyclic redundancy check&lt;/a&gt; specified as an error check instead of the current checksum. The weak checksum is partially compensated for by the common use of a CRC or better integrity check at &lt;a title="Layer 2" href="http://en.wikipedia.org/wiki/Layer_2"&gt;layer 2&lt;/a&gt;, below both TCP and IP, such as is used in &lt;a title="Point-to-Point Protocol" href="http://en.wikipedia.org/wiki/Point-to-Point_Protocol"&gt;PPP&lt;/a&gt; or the &lt;a title="Ethernet" href="http://en.wikipedia.org/wiki/Ethernet"&gt;Ethernet&lt;/a&gt; frame. However, this does not mean that the 16-bit TCP checksum is redundant: remarkably, surveys of Internet traffic have shown that software and hardware errors that introduce errors in packets between CRC-protected hops are common, and that the &lt;a title="End-to-end principle" href="http://en.wikipedia.org/wiki/End-to-end_principle"&gt;end-to-end&lt;/a&gt; 16-bit TCP checksum catches most of these simple errors. This is the end-to-end principle at work.&lt;br /&gt;&lt;a name="Congestion_control"&gt;&lt;/a&gt;Congestion control&lt;br /&gt;The final part to TCP is &lt;a title="Congestion control" href="http://en.wikipedia.org/wiki/Congestion_control"&gt;congestion control&lt;/a&gt;. TCP uses a number of mechanisms to achieve high performance and avoid '&lt;a title="Congestive collapse" href="http://en.wikipedia.org/wiki/Congestive_collapse"&gt;congestion collapse&lt;/a&gt;', where network performance can fall by several orders of magnitude. These mechanisms control the rate of data entering the network, keeping the data flow below a rate that would trigger collapse.&lt;br /&gt;Acknowledgments for data sent, or lack of acknowledgments, are used by senders to implicitly interpret network conditions between the TCP sender and receiver. Coupled with timers, TCP senders and receivers can alter the behavior of the flow of data. This is more generally referred to as flow control, congestion control and/or network congestion avoidance.&lt;br /&gt;Modern implementations of TCP contain four intertwined algorithms: &lt;a title="Slow-start" href="http://en.wikipedia.org/wiki/Slow-start"&gt;Slow-start&lt;/a&gt;, &lt;a title="TCP congestion avoidance algorithm" href="http://en.wikipedia.org/wiki/TCP_congestion_avoidance_algorithm"&gt;congestion avoidance&lt;/a&gt;, &lt;a title="Fast retransmit" href="http://en.wikipedia.org/wiki/Fast_retransmit"&gt;fast retransmit&lt;/a&gt;, and &lt;a title="Slow-start" href="http://en.wikipedia.org/wiki/Slow-start#Fast_Recovery"&gt;fast recovery&lt;/a&gt; (&lt;a title="http://rfc.sunsite.dk/rfc/rfc2581.html" href="http://rfc.sunsite.dk/rfc/rfc2581.html"&gt;RFC2581&lt;/a&gt;).&lt;br /&gt;Enhancing TCP to reliably handle loss, minimize errors, manage congestion and go fast in very high-speed environments are ongoing areas of research and standards development.&lt;br /&gt;&lt;a name="TCP_window_size"&gt;&lt;/a&gt;TCP window size&lt;br /&gt;TCP sequence numbers and windows behave very much like a clock. The window, whose width (in bytes) is defined by the receiving host, shifts each time it receives and acks a segment of data. Once it runs out of sequence numbers, it loops back to 0.&lt;br /&gt;The TCP receive window size is the amount of received data (in bytes) that can be buffered during a connection. The sending host can send only up to that amount of data before it must wait for an acknowledgment and window update from the receiving host. When a receiver advertises the window size of 0, the sender stops sending data and starts the persist timer. The persist timer is used to protect TCP from the dead lock situation. The dead lock situation could be when the new window size update from the receiver is lost and the receiver has no more data to send while the sender is waiting for the new window size update. When the persist timer expires the TCP sender sends a small packet so that the receivers ACKs the packet with the new window size and TCP can recover from such situations.&lt;br /&gt;&lt;a name="Window_scaling"&gt;&lt;/a&gt;Window scaling&lt;br /&gt;For more efficient use of high bandwidth networks, a larger TCP window size may be used. The TCP window size field controls the flow of data and is limited to between 2 and 65,535 bytes.&lt;br /&gt;Since the size field cannot be expanded, a scaling factor is used. The &lt;a title="TCP window scale option" href="http://en.wikipedia.org/wiki/TCP_window_scale_option"&gt;TCP window scale option&lt;/a&gt;, as defined in &lt;a title="http://tools.ietf.org/html/rfc1323" href="http://tools.ietf.org/html/rfc1323"&gt;RFC 1323&lt;/a&gt;, is an option used to increase the maximum window size from 65,535 bytes to 1 Gigabyte. Scaling up to larger window sizes is a part of what is necessary for &lt;a title="TCP Tuning" href="http://en.wikipedia.org/wiki/TCP_Tuning"&gt;TCP Tuning&lt;/a&gt;.&lt;br /&gt;The window scale option is used only during the TCP 3-way handshake. The window scale value represents the number of bits to left-shift the 16-bit window size field. The window scale value can be set from 0 (no shift) to 14.&lt;br /&gt;Many routers and packet firewalls rewrite the window scaling factor during a transmission. This causes sending and receiving sides to assume different TCP window sizes. The result is non-stable traffic that is very slow. The problem is visible on some sending and receiving sites which are behind the path of broken routers.&lt;br /&gt;For more information on problems that may be caused, especially with Linux and Vista systems, please see main topic &lt;a title="TCP window scale option" href="http://en.wikipedia.org/wiki/TCP_window_scale_option"&gt;TCP window scale option&lt;/a&gt;.&lt;br /&gt;&lt;a name="Connection_termination"&gt;&lt;/a&gt;Connection termination&lt;br /&gt;The connection termination phase uses, at most, a four-way &lt;a title="Handshake (computing)" href="http://en.wikipedia.org/wiki/Handshake_(computing)"&gt;handshake&lt;/a&gt;, with each side of the connection terminating independently. When an endpoint wishes to stop its half of the connection, it transmits a FIN packet, which the other end acknowledges with an ACK. Therefore, a typical tear down requires a pair of FIN and ACK segments from each TCP endpoint.&lt;br /&gt;A connection can be "half-open", in which case one side has terminated its end, but the other has not. The side that has terminated can no longer send any data into the connection, but the other side can.&lt;br /&gt;It is also possible to terminate the connection by a 3-way handshake, when host A sends a FIN and host B replies with a FIN &amp;amp; ACK (merely combines 2 steps into one) and host A replies with an ACK. This is perhaps the most common method.&lt;br /&gt;It is possible for both hosts to send FINs simultaneously then both just have to ACK. This could possibly be considered a 2-way handshake since the FIN/ACK sequence is done in parallel for both directions.&lt;br /&gt;Some host TCP stacks may implement a "half-duplex" close sequence, as &lt;a title="Linux" href="http://en.wikipedia.org/wiki/Linux"&gt;Linux&lt;/a&gt; or &lt;a title="HP-UX" href="http://en.wikipedia.org/wiki/HP-UX"&gt;HP-UX&lt;/a&gt; do. If such a host actively closes a connection but still has not read all the incoming data the stack already received from the link, this host will send a RST instead of a FIN (Section 4.2.2.13 in &lt;a title="http://tools.ietf.org/html/rfc1122" href="http://tools.ietf.org/html/rfc1122"&gt;RFC 1122&lt;/a&gt;). This allows a TCP application to be sure that the remote application has read all the data the former sent - waiting the FIN from the remote side when it will actively close the connection. Unfortunatelly, the remote TCP stack cannot distinguish between a Connection Aborting RST and this Data Loss RST - both will make the remote stack to throw away all the data it received, but the application still didn't read.&lt;br /&gt;Some application protocols may violate the &lt;a title="OSI model" href="http://en.wikipedia.org/wiki/OSI_model"&gt;OSI model layers&lt;/a&gt;, using the TCP open/close handshaking for the application protocol open/close handshaking - these may find the RST problem on active close. As an example:s = connect(remote);send(s, data);close(s);&lt;br /&gt;For a usual program flow like above, a TCP/IP stack like that described above does not guarantee that all the data will arrive to the other application unless the programmer is sure that the remote side will not send anything.&lt;br /&gt;&lt;a name="TCP_ports"&gt;&lt;/a&gt;TCP ports&lt;br /&gt;TCP uses the notion of &lt;a title="TCP and UDP port" href="http://en.wikipedia.org/wiki/TCP_and_UDP_port"&gt;port numbers&lt;/a&gt; to identify sending and receiving application end-points on a host, or &lt;a title="Internet socket" href="http://en.wikipedia.org/wiki/Internet_socket"&gt;Internet sockets&lt;/a&gt;. Each side of a TCP connection has an associated 16-bit unsigned port number (1-65535) reserved by the sending or receiving application. Arriving TCP data packets are identified as belonging to a specific TCP connection by its sockets, that is, the combination of source host address, source port, destination host address, and destination port. This means that a server computer can provide several clients with several services simultaneously, as long as a client takes care of initiating any simultaneous connections to one destination port from different source ports.&lt;br /&gt;Port numbers are categorized into three basic categories: well-known, registered, and dynamic/private. The well-known ports are assigned by the &lt;a title="Internet Assigned Numbers Authority" href="http://en.wikipedia.org/wiki/Internet_Assigned_Numbers_Authority"&gt;Internet Assigned Numbers Authority&lt;/a&gt; (IANA) and are typically used by system-level or root processes. Well-known applications running as servers and passively listening for connections typically use these ports. Some examples include: &lt;a title="File Transfer Protocol" href="http://en.wikipedia.org/wiki/File_Transfer_Protocol"&gt;FTP&lt;/a&gt; (21), &lt;a title="Secure Shell" href="http://en.wikipedia.org/wiki/Secure_Shell"&gt;ssh&lt;/a&gt; (22), &lt;a title="TELNET" href="http://en.wikipedia.org/wiki/TELNET"&gt;TELNET&lt;/a&gt; (23), &lt;a title="SMTP" href="http://en.wikipedia.org/wiki/SMTP"&gt;SMTP&lt;/a&gt; (25) and &lt;a title="HTTP" href="http://en.wikipedia.org/wiki/HTTP"&gt;HTTP&lt;/a&gt; (80). Registered ports are typically used by end user applications as ephemeral source ports when contacting servers, but they can also identify named services that have been registered by a third party. Dynamic/private ports can also be used by end user applications, but are less commonly so. Dynamic/private ports do not contain any meaning outside of any particular TCP connection.&lt;br /&gt;&lt;a name="Development_of_TCP"&gt;&lt;/a&gt;Development of TCP&lt;br /&gt;TCP is a complex and evolving protocol. However, while significant enhancements have been made and proposed over the years, its most basic operation has not changed significantly since its first specification &lt;a title="http://www.ietf.org/rfc/rfc675.txt" href="http://www.ietf.org/rfc/rfc675.txt"&gt;RFC 675&lt;/a&gt; in 1974, and the v4 specification &lt;a title="http://tools.ietf.org/html/rfc793" href="http://tools.ietf.org/html/rfc793"&gt;RFC 793&lt;/a&gt;, published in &lt;a title="September 1981" href="http://en.wikipedia.org/wiki/September_1981"&gt;September 1981&lt;/a&gt;.&lt;a title="http://www.faqs.org/rfcs/rfc793.html" href="http://www.faqs.org/rfcs/rfc793.html"&gt;[1]&lt;/a&gt; &lt;a title="http://tools.ietf.org/html/rfc1122" href="http://tools.ietf.org/html/rfc1122"&gt;RFC 1122&lt;/a&gt;, Host Requirements for Internet Hosts, clarified a number of TCP protocol implementation requirements. &lt;a title="http://tools.ietf.org/html/rfc2581" href="http://tools.ietf.org/html/rfc2581"&gt;RFC 2581&lt;/a&gt;, TCP Congestion Control, one of the most important TCP related RFCs in recent years, describes updated algorithms to be used in order to avoid undue congestion. In 2001, &lt;a title="http://tools.ietf.org/html/rfc3168" href="http://tools.ietf.org/html/rfc3168"&gt;RFC 3168&lt;/a&gt; was written to describe &lt;a title="Explicit Congestion Notification" href="http://en.wikipedia.org/wiki/Explicit_Congestion_Notification"&gt;explicit congestion notification&lt;/a&gt; (&lt;a title="Explicit Congestion Notification" href="http://en.wikipedia.org/wiki/Explicit_Congestion_Notification"&gt;ECN&lt;/a&gt;), a congestion avoidance signalling mechanism. Common applications that use TCP include &lt;a title="HTTP" href="http://en.wikipedia.org/wiki/HTTP"&gt;HTTP&lt;/a&gt; (&lt;a title="World Wide Web" href="http://en.wikipedia.org/wiki/World_Wide_Web"&gt;World Wide Web&lt;/a&gt;), &lt;a title="SMTP" href="http://en.wikipedia.org/wiki/SMTP"&gt;SMTP&lt;/a&gt; (&lt;a title="E-mail" href="http://en.wikipedia.org/wiki/E-mail"&gt;e-mail&lt;/a&gt;) and &lt;a title="File Transfer Protocol" href="http://en.wikipedia.org/wiki/File_Transfer_Protocol"&gt;FTP&lt;/a&gt; (file transfer).&lt;br /&gt;The original TCP congestion control was called &lt;a title="TCP Tahoe" href="http://en.wikipedia.org/wiki/TCP_Tahoe"&gt;TCP Tahoe&lt;/a&gt;, several alternative &lt;a title="Congestion control" href="http://en.wikipedia.org/wiki/Congestion_control"&gt;congestion control&lt;/a&gt; algorithms have been proposed:&lt;br /&gt;&lt;a title="BIC TCP" href="http://en.wikipedia.org/wiki/BIC_TCP"&gt;BIC TCP&lt;/a&gt; by Lisong Xu, Khaled Harfoush, and Injong Rhee at &lt;a title="North Carolina State University" href="http://en.wikipedia.org/wiki/North_Carolina_State_University"&gt;North Carolina State University&lt;/a&gt;&lt;br /&gt;&lt;a title="Compound TCP" href="http://en.wikipedia.org/wiki/Compound_TCP"&gt;Compound TCP&lt;/a&gt; by K. Tan, J. Song, Q. Zhang, and M. Sridharan at &lt;a title="Microsoft Research" href="http://en.wikipedia.org/wiki/Microsoft_Research"&gt;Microsoft Research&lt;/a&gt;&lt;br /&gt;&lt;a title="http://www4.ncsu.edu/~rhee/export/bitcp/" href="http://www4.ncsu.edu/~rhee/export/bitcp/"&gt;CUBIC&lt;/a&gt; by Injong Rhee, and Lisong Xu&lt;br /&gt;&lt;a title="Fast TCP" href="http://en.wikipedia.org/wiki/Fast_TCP"&gt;Fast TCP&lt;/a&gt; by Cheng Jin, David X. Wei and Steven H. Low. at &lt;a title="Caltech" href="http://en.wikipedia.org/wiki/Caltech"&gt;Caltech&lt;/a&gt;.&lt;br /&gt;&lt;a title="H-TCP" href="http://en.wikipedia.org/wiki/H-TCP"&gt;H-TCP&lt;/a&gt; by D. Leithi, and R. Shorten at &lt;a title="Hamilton Institute" href="http://en.wikipedia.org/w/index.php?title=Hamilton_Institute&amp;amp;action=edit"&gt;Hamilton Institute&lt;/a&gt;&lt;br /&gt;&lt;a title="High Speed TCP" href="http://en.wikipedia.org/wiki/High_Speed_TCP"&gt;High Speed TCP&lt;/a&gt; proposed by S. Floyd in &lt;a title="http://tools.ietf.org/html/rfc3649" href="http://tools.ietf.org/html/rfc3649"&gt;RFC 3649&lt;/a&gt;&lt;br /&gt;&lt;a title="http://www.ece.rice.edu/networks/TCP-LP/" href="http://www.ece.rice.edu/networks/TCP-LP/"&gt;HSTCP-LP&lt;/a&gt; by A. Kuzmanovic, E. W. Knightly, and R. Les Cottrell&lt;br /&gt;&lt;a title="http://www.faqs.org/rfcs/rfc3782.html" href="http://www.faqs.org/rfcs/rfc3782.html"&gt;NewReno&lt;/a&gt;, proposed by S. Floyd, T. Henderson and A. Gurtov in &lt;a title="http://tools.ietf.org/html/rfc3782" href="http://tools.ietf.org/html/rfc3782"&gt;RFC 3782&lt;/a&gt;&lt;br /&gt;&lt;a title="http://www.deneholme.net/tom/scalable/" href="http://www.deneholme.net/tom/scalable/"&gt;Scalable TCP&lt;/a&gt; by Tom Kelly&lt;br /&gt;&lt;a title="http://hybla.deis.unibo.it/" href="http://hybla.deis.unibo.it/"&gt;TCP Hybla&lt;/a&gt; by Carlo Caini and Rosario Firrincieli at &lt;a title="University of Bologna" href="http://en.wikipedia.org/wiki/University_of_Bologna"&gt;University of Bologna&lt;/a&gt;&lt;br /&gt;&lt;a title="http://www.ews.uiuc.edu/~shaoliu/tcpillinois/" href="http://www.ews.uiuc.edu/~shaoliu/tcpillinois/"&gt;TCP-Illinois&lt;/a&gt; by Shao Liu, Tamer Basar and R. Srikant&lt;br /&gt;&lt;a title="http://www.ece.rice.edu/networks/TCP-LP/" href="http://www.ece.rice.edu/networks/TCP-LP/"&gt;TCP-LP&lt;/a&gt; by Aleksandar Kuzmanovic&lt;br /&gt;&lt;a title="TCP Reno" href="http://en.wikipedia.org/wiki/TCP_Reno"&gt;TCP Reno&lt;/a&gt; by &lt;a title="BSD" href="http://en.wikipedia.org/wiki/BSD#4.3BSD"&gt;BSD 4.3BSD&lt;/a&gt;&lt;br /&gt;&lt;a title="Retransmission (data networks)" href="http://en.wikipedia.org/wiki/Retransmission_(data_networks)#SACK"&gt;TCP SACK&lt;/a&gt;&lt;br /&gt;&lt;a title="TCP Vegas" href="http://en.wikipedia.org/wiki/TCP_Vegas"&gt;TCP Vegas&lt;/a&gt; by Lawrence S. Brakmo and Larry L. Peterson at &lt;a title="University of Arizona" href="http://en.wikipedia.org/wiki/University_of_Arizona"&gt;University of Arizona&lt;/a&gt;&lt;br /&gt;&lt;a title="http://www.ntu.edu.sg/home/ascpfu/veno/veno.html" href="http://www.ntu.edu.sg/home/ascpfu/veno/veno.html"&gt;TCP Veno&lt;/a&gt; by C. P. Fu, S. C. Liew&lt;br /&gt;&lt;a title="TCP Westwood" href="http://en.wikipedia.org/wiki/TCP_Westwood"&gt;TCP Westwood&lt;/a&gt; by Saverio Mascolo, Claudio Casetti, Mario Gerla, M. Y. Sanadidi, and Ren Wang&lt;br /&gt;&lt;a title="TCP Westwood plus" href="http://en.wikipedia.org/wiki/TCP_Westwood_plus"&gt;TCP Westwood+&lt;/a&gt; by A. Dell’Aera, L. A. Grieco, S. Mascolo&lt;br /&gt;&lt;a title="http://www.isi.edu/isi-xcp/" href="http://www.isi.edu/isi-xcp/"&gt;XCP&lt;/a&gt; by Aaron Falk, Dina Katabi&lt;br /&gt;&lt;a title="http://infocom.uniroma1.it/~vacirca/yeah/" href="http://infocom.uniroma1.it/~vacirca/yeah/"&gt;YeAH-TCP&lt;/a&gt; by Andrea Baiocchi, Angelo P. Castellani and Francesco Vacirca.&lt;br /&gt;Ensemble Flow Congestion Management (EFCM), Fuzzy Explicit Window Adaptation (FEWA), Enhanced TCP (ETCP)&lt;a title="" href="http://en.wikipedia.org/wiki/Transmission_Control_Protocol#_note-1#_note-1"&gt;[2]&lt;/a&gt;&lt;br /&gt;An extension mechanism &lt;a title="http://www.medianet.kent.edu/itcp/main.html" href="http://www.medianet.kent.edu/itcp/main.html"&gt;TCP Interactive (iTCP)&lt;/a&gt; allows applications to subscribe to TCP events and respond accordingly enabling various functional extensions to TCP including application assisted congestion control.&lt;br /&gt;&lt;a name="TCP_over_wireless"&gt;&lt;/a&gt;TCP over wireless&lt;br /&gt;TCP has been optimized for wired networks. Any &lt;a title="Packet loss" href="http://en.wikipedia.org/wiki/Packet_loss"&gt;packet loss&lt;/a&gt; is considered to be the result of congestion and the window size is reduced dramatically as a precaution. However, wireless links are known to experience sporadic and usually temporary losses due to fading, shadowing, hand off, etc. that cannot be considered congestion. Erroneous back-off of the window size due to wireless packet loss is followed by a congestion avoidance phase with a conservative decrease in window size which causes the radio link to be underutilized. Extensive research has been done on this subject on how to combat these harmful effects. Suggested solutions can be categorized as end-to-end solutions (which require modifications at the client and/or server), link layer solutions (such as &lt;a title="Radio Link Protocol" href="http://en.wikipedia.org/wiki/Radio_Link_Protocol"&gt;RLP&lt;/a&gt; in &lt;a title="CDMA2000" href="http://en.wikipedia.org/wiki/CDMA2000"&gt;CDMA2000&lt;/a&gt;), or proxy based solutions (which require some changes in the network without modifying end nodes).&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/392745368495742159-1986893138449343475?l=aboutprotocol.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aboutprotocol.blogspot.com/feeds/1986893138449343475/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=392745368495742159&amp;postID=1986893138449343475' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/392745368495742159/posts/default/1986893138449343475'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/392745368495742159/posts/default/1986893138449343475'/><link rel='alternate' type='text/html' href='http://aboutprotocol.blogspot.com/2007/10/error-free-data-transfer.html' title='Error-free data transfer'/><author><name>MP</name><uri>http://www.blogger.com/profile/02485863734608702367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-392745368495742159.post-1312539367516316380</id><published>2007-10-11T06:02:00.001-07:00</published><updated>2007-10-11T06:04:09.549-07:00</updated><title type='text'>Transmission Control Protocol</title><content type='html'>&lt;div align="justify"&gt;The Transmission Control Protocol (TCP) is one of the core protocols of the Internet protocol suite. TCP provides reliable, in-order delivery of a stream of bytes, making it suitable for applications like file transfer and e-mail. It is so important in the Internet protocol suite that sometimes the entire suite is referred to as "the TCP/IP protocol suite."&lt;br /&gt;Reason for TCP&lt;br /&gt;The Internet Protocol (IP) works by exchanging groups of information called packets. Packets are short sequences of bytes that contain a header and a body. The header describes the destination that the packet needs to arrive at, and the routers on the internet pass the packets along in generally the right direction until it arrives at the final destination; the body contains application data.&lt;br /&gt;The IP protocol can in cases of congestion, discard packets, and for efficiency reasons two consecutive packets on the internet can take different routes to the destination, and in that case, the packets can arrive at the destination in the wrong order.&lt;br /&gt;The TCP protocol's software libraries uses the IP protocol and provides to applications simpler interfaces, hides most of the underlying packet structure from applications, rearrange out-of-order packets, acts to minimize network congestion, and retransmits any packets that may have been discarded.&lt;br /&gt;Thus TCP very significantly simplifies the task of writing many applications.&lt;br /&gt;&lt;a name="Applicability_of_TCP"&gt;&lt;/a&gt;Applicability of TCP&lt;br /&gt;TCP is used extensively by many of the Internet's most popular application protocols and resulting applications, including the World Wide Web, E-mail, File Transfer Protocol, Secure Shell, and some streaming media applications.&lt;br /&gt;However, because TCP is optimized for accurate delivery rather than timely delivery, TCP sometimes incurs long delays while waiting for out-of-order messages or retransmissions of lost messages, and it is not particularly suitable for real-time applications such as Voice over IP. For such applications, protocols like the Real-time Transport Protocol (RTP) running over the User Datagram Protocol (UDP) are usually recommended instead[1].&lt;br /&gt;&lt;a name="Using_TCP"&gt;&lt;/a&gt;Using TCP&lt;br /&gt;Using TCP, applications on networked hosts can create connections to one another, over which they can exchange streams of data using Stream Sockets. TCP also distinguishes data for multiple connections by concurrent applications (e.g., Web server and e-mail server) running on the same host.&lt;br /&gt;In the Internet protocol suite, TCP is the intermediate layer between the Internet Protocol (IP) below it, and an application above it. Applications often need reliable pipe-like connections to each other, whereas the Internet Protocol does not provide such streams, but rather only best effort delivery (i.e., unreliable packets). TCP does the task of the transport layer in the simplified OSI model of computer networks. The other main transport-level Internet protocols are UDP and SCTP.&lt;br /&gt;Applications send streams of octets (8-bit bytes) to TCP for delivery through the network, and TCP divides the byte stream into appropriately sized &lt;a title="TCP segment" href="http://en.wikipedia.org/wiki/TCP_segment"&gt;segments&lt;/a&gt; (usually delineated by the maximum transmission unit (MTU) size of the &lt;a title="Data link layer" href="http://en.wikipedia.org/wiki/Data_link_layer"&gt;data link layer&lt;/a&gt; of the network to which the computer is attached). TCP then passes the resulting packets to the Internet Protocol, for delivery through a network to the TCP module of the entity at the other end. TCP checks to make sure that no packets are lost by giving each packet a sequence number, which is also used to make sure that the data is delivered to the entity at the other end in the correct order. The TCP module at the far end sends back an acknowledgment for packets which have been successfully received; a timer at the sending TCP will cause a timeout if an acknowledgment is not received within a reasonable &lt;a title="Round-trip time" href="http://en.wikipedia.org/wiki/Round-trip_time"&gt;round-trip time&lt;/a&gt; (or RTT), and the (presumably) lost data will then be re-transmitted. The TCP checks that no bytes are corrupted by using a &lt;a title="Checksum" href="http://en.wikipedia.org/wiki/Checksum"&gt;checksum&lt;/a&gt;; one is computed at the sender for each block of data before it is sent, and checked at the receiver.&lt;br /&gt;&lt;a name="Protocol_operation"&gt;&lt;/a&gt;Protocol operation&lt;br /&gt;Unlike TCP's traditional counterpart, &lt;a title="User Datagram Protocol" href="http://en.wikipedia.org/wiki/User_Datagram_Protocol"&gt;User Datagram Protocol&lt;/a&gt;, which can immediately start sending packets, TCP provides connections that need to be established before sending data. TCP connections have three phases. :&lt;br /&gt;connection establishment,&lt;br /&gt;data transfer,&lt;br /&gt;connection termination,&lt;br /&gt;Before describing these three phases, a note about the various &lt;a title="State (computer science)" href="http://en.wikipedia.org/wiki/State_(computer_science)"&gt;states&lt;/a&gt; of a connection end-point or &lt;a title="Internet socket" href="http://en.wikipedia.org/wiki/Internet_socket"&gt;Internet socket&lt;/a&gt;:&lt;br /&gt;LISTEN&lt;br /&gt;SYN-SENT&lt;br /&gt;SYN-RECEIVED&lt;br /&gt;ESTABLISHED&lt;br /&gt;FIN-WAIT-1&lt;br /&gt;FIN-WAIT-2&lt;br /&gt;CLOSE-WAIT&lt;br /&gt;CLOSING&lt;br /&gt;LAST-ACK&lt;br /&gt;TIME-WAIT&lt;br /&gt;CLOSED&lt;br /&gt;LISTEN&lt;br /&gt;represents waiting for a connection request from any remote TCP and port. (usually set by TCP servers)&lt;br /&gt;SYN-SENT&lt;br /&gt;represents waiting for the remote TCP to send back a TCP packet with the SYN and ACK flags set. (usually set by TCP clients)&lt;br /&gt;SYN-RECEIVED&lt;br /&gt;represents waiting for the remote TCP to send back an acknowledgment after having sent back a connection acknowledgment to the remote TCP. (usually set by TCP servers)&lt;br /&gt;ESTABLISHED&lt;br /&gt;represents that the port is ready to receive/send data from/to the remote TCP. (set by TCP clients and servers)&lt;br /&gt;TIME-WAIT&lt;br /&gt;represents waiting for enough time to pass to be sure the remote TCP received the acknowledgment of its connection termination request. According to &lt;a title="http://tools.ietf.org/html/rfc793" href="http://tools.ietf.org/html/rfc793"&gt;RFC 793&lt;/a&gt; a connection can stay in TIME-WAIT for a maximum of four minutes.&lt;br /&gt;&lt;a name="Connection_establishment"&gt;&lt;/a&gt;Connection establishment&lt;br /&gt;To establish a connection, TCP uses a three-way &lt;a title="Handshaking" href="http://en.wikipedia.org/wiki/Handshaking"&gt;handshake&lt;/a&gt;. Before a client attempts to connect with a server, the server must first bind to a port to open it up for connections: this is called a passive open. Once the passive open is established, a client may initiate an active open. To establish a connection, the three-way (or 3-step) handshake occurs:&lt;br /&gt;The active open is performed by the client sending a SYN to the server.&lt;br /&gt;In response, the server replies with a SYN-ACK.&lt;br /&gt;Finally the client sends an ACK back to the server.&lt;br /&gt;At this point, both the client and server have received an acknowledgment of the connection.&lt;br /&gt;Example:&lt;br /&gt;The initiating host (client) sends a synchronization (SYN flag set) packet to initiate a connection. Any SYN packet holds a Sequence Number. The Sequence Number is a 32-bit field in TCP segment header. Let the Sequence Number value for this session be x.&lt;br /&gt;The other host receives the packet, records the Sequence Number x from the client, and replies with an acknowledgment and synchronization (SYN-ACK). The Acknowledgment is a 32-bit field in TCP segment header. It contains the next sequence number that this host is expecting to receive (x + 1). The host also initiates a return session. This includes a TCP segment with its own initial Sequence Number of value y.&lt;br /&gt;The initiating host responds with the next Sequence Number (x + 1) and a simple Acknowledgment Number value of y + 1, which is the Sequence Number value of the other host + 1.&lt;br /&gt;Vulnerability to Denial of Service: By using a spoofed IP address and repeatedly sending SYN packets attackers can cause the server to consume large amounts of resources keeping track of the bogus connections. Proposed solutions to this problem include &lt;a title="SYN cookies" href="http://en.wikipedia.org/wiki/SYN_cookies"&gt;SYN cookies&lt;/a&gt; and Cryptographic puzzles&lt;br /&gt;&lt;a name="Data_transfer"&gt;&lt;/a&gt;Data transfer&lt;br /&gt;There are a few key features that set TCP apart from &lt;a title="User Datagram Protocol" href="http://en.wikipedia.org/wiki/User_Datagram_Protocol"&gt;User Datagram Protocol&lt;/a&gt;:&lt;br /&gt;Ordered data transfer&lt;br /&gt;Retransmission of lost packets&lt;br /&gt;Discarding duplicate packets&lt;br /&gt;Error-free data transfer&lt;br /&gt;Congestion/Flow control&lt;br /&gt;&lt;a name="Ordered_data_transfer.2C_retransmission_"&gt;&lt;/a&gt;Ordered data transfer, retransmission of lost packets and discarding duplicate packets&lt;br /&gt;In the first two steps of the 3-way handshaking, both computers exchange an initial sequence number (ISN). This number can be arbitrary. This sequence number identifies the order of the bytes sent from each computer so that the data transferred is in order regardless of any fragmentation or disordering that occurs during transmission. For every byte transmitted the sequence number must be incremented.&lt;br /&gt;Conceptually, each byte sent is assigned a sequence number and the receiver then sends an acknowledgment back to the sender that effectively states that they received it. What is done in practice is only the first data byte is assigned a sequence number which is inserted in the sequence number field and the receiver sends an acknowledgment value of the next byte they expect to receive.&lt;br /&gt;For example, if computer A sends 4 bytes with a sequence number of 100 (conceptually, the four bytes would have a sequence number of 100, 101, 102, &amp;amp; 103 assigned) then the receiver would send back an acknowledgment of 104 since that is the next byte it expects to receive in the next packet. By sending an acknowledgment of 104, the receiver is signaling that it received bytes 100, 101, 102, &amp;amp; 103 correctly. If, by some chance, the last two bytes were corrupted then an acknowledgment value of 102 would be sent since 100 &amp;amp; 101 were received successfully.&lt;br /&gt;However, a problem can occasionally arise when packets are lost. For example, 10,000 bytes are sent in 10 different TCP packets, and the first packet is lost during transmission. The sender would then have to resend all 10,000 bytes; the recipient cannot say that it received bytes 1,000 to 9,999 but only that it failed to receive the first packet, containing bytes 0 to 999. In order to solve this problem, an option of selective acknowledgment (SACK) has been added. This option allows the receiver to acknowledge isolated blocks of packets that were received correctly, rather than the sequence number of the last packet received successively, as in the basic TCP acknowledgment. Each block is conveyed by the starting and ending sequence numbers. In the example above, the receiver would send SACK with sequence numbers 1,000 and 10,000. The sender will thus retransmit only the first packet.&lt;br /&gt;The SACK option is not mandatory and it is used only if both parties support it. This is negotiated when connection is established. SACK uses the optional part of the TCP header. See &lt;a title="" href="http://en.wikipedia.org/wiki/Transmission_Control_Protocol#TCP_segment_structure#TCP_segment_structure"&gt;#TCP segment structure&lt;/a&gt;. The use of SACK is widespread - all popular TCP stacks support it. Selective acknowledgment is also used in &lt;a title="Stream Control Transmission Protocol" href="http://en.wikipedia.org/wiki/Stream_Control_Transmission_Protocol"&gt;SCTP&lt;/a&gt;.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/392745368495742159-1312539367516316380?l=aboutprotocol.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aboutprotocol.blogspot.com/feeds/1312539367516316380/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=392745368495742159&amp;postID=1312539367516316380' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/392745368495742159/posts/default/1312539367516316380'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/392745368495742159/posts/default/1312539367516316380'/><link rel='alternate' type='text/html' href='http://aboutprotocol.blogspot.com/2007/10/transmission-control-protocol_4093.html' title='Transmission Control Protocol'/><author><name>MP</name><uri>http://www.blogger.com/profile/02485863734608702367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-392745368495742159.post-8979190406299285836</id><published>2007-10-11T06:02:00.000-07:00</published><updated>2007-10-11T06:03:38.685-07:00</updated><title type='text'>Transmission Control Protocol</title><content type='html'>&lt;div align="justify"&gt;The Transmission Control Protocol (TCP) is one of the core protocols of the Internet protocol suite. TCP provides reliable, in-order delivery of a stream of bytes, making it suitable for applications like file transfer and e-mail. It is so important in the Internet protocol suite that sometimes the entire suite is referred to as "the TCP/IP protocol suite."&lt;br /&gt;Reason for TCP&lt;br /&gt;The Internet Protocol (IP) works by exchanging groups of information called packets. Packets are short sequences of bytes that contain a header and a body. The header describes the destination that the packet needs to arrive at, and the routers on the internet pass the packets along in generally the right direction until it arrives at the final destination; the body contains application data.&lt;br /&gt;The IP protocol can in cases of congestion, discard packets, and for efficiency reasons two consecutive packets on the internet can take different routes to the destination, and in that case, the packets can arrive at the destination in the wrong order.&lt;br /&gt;The TCP protocol's software libraries uses the IP protocol and provides to applications simpler interfaces, hides most of the underlying packet structure from applications, rearrange out-of-order packets, acts to minimize network congestion, and retransmits any packets that may have been discarded.&lt;br /&gt;Thus TCP very significantly simplifies the task of writing many applications.&lt;br /&gt;&lt;a name="Applicability_of_TCP"&gt;&lt;/a&gt;Applicability of TCP&lt;br /&gt;TCP is used extensively by many of the Internet's most popular application protocols and resulting applications, including the World Wide Web, E-mail, File Transfer Protocol, Secure Shell, and some streaming media applications.&lt;br /&gt;However, because TCP is optimized for accurate delivery rather than timely delivery, TCP sometimes incurs long delays while waiting for out-of-order messages or retransmissions of lost messages, and it is not particularly suitable for real-time applications such as Voice over IP. For such applications, protocols like the Real-time Transport Protocol (RTP) running over the User Datagram Protocol (UDP) are usually recommended instead[1].&lt;br /&gt;&lt;a name="Using_TCP"&gt;&lt;/a&gt;Using TCP&lt;br /&gt;Using TCP, applications on networked hosts can create connections to one another, over which they can exchange streams of data using Stream Sockets. TCP also distinguishes data for multiple connections by concurrent applications (e.g., Web server and e-mail server) running on the same host.&lt;br /&gt;In the Internet protocol suite, TCP is the intermediate layer between the Internet Protocol (IP) below it, and an application above it. Applications often need reliable pipe-like connections to each other, whereas the Internet Protocol does not provide such streams, but rather only best effort delivery (i.e., unreliable packets). TCP does the task of the transport layer in the simplified OSI model of computer networks. The other main transport-level Internet protocols are UDP and SCTP.&lt;br /&gt;Applications send streams of octets (8-bit bytes) to TCP for delivery through the network, and TCP divides the byte stream into appropriately sized &lt;a title="TCP segment" href="http://en.wikipedia.org/wiki/TCP_segment"&gt;segments&lt;/a&gt; (usually delineated by the maximum transmission unit (MTU) size of the &lt;a title="Data link layer" href="http://en.wikipedia.org/wiki/Data_link_layer"&gt;data link layer&lt;/a&gt; of the network to which the computer is attached). TCP then passes the resulting packets to the Internet Protocol, for delivery through a network to the TCP module of the entity at the other end. TCP checks to make sure that no packets are lost by giving each packet a sequence number, which is also used to make sure that the data is delivered to the entity at the other end in the correct order. The TCP module at the far end sends back an acknowledgment for packets which have been successfully received; a timer at the sending TCP will cause a timeout if an acknowledgment is not received within a reasonable &lt;a title="Round-trip time" href="http://en.wikipedia.org/wiki/Round-trip_time"&gt;round-trip time&lt;/a&gt; (or RTT), and the (presumably) lost data will then be re-transmitted. The TCP checks that no bytes are corrupted by using a &lt;a title="Checksum" href="http://en.wikipedia.org/wiki/Checksum"&gt;checksum&lt;/a&gt;; one is computed at the sender for each block of data before it is sent, and checked at the receiver.&lt;br /&gt;&lt;a name="Protocol_operation"&gt;&lt;/a&gt;Protocol operation&lt;br /&gt;Unlike TCP's traditional counterpart, &lt;a title="User Datagram Protocol" href="http://en.wikipedia.org/wiki/User_Datagram_Protocol"&gt;User Datagram Protocol&lt;/a&gt;, which can immediately start sending packets, TCP provides connections that need to be established before sending data. TCP connections have three phases. :&lt;br /&gt;connection establishment,&lt;br /&gt;data transfer,&lt;br /&gt;connection termination,&lt;br /&gt;Before describing these three phases, a note about the various &lt;a title="State (computer science)" href="http://en.wikipedia.org/wiki/State_(computer_science)"&gt;states&lt;/a&gt; of a connection end-point or &lt;a title="Internet socket" href="http://en.wikipedia.org/wiki/Internet_socket"&gt;Internet socket&lt;/a&gt;:&lt;br /&gt;LISTEN&lt;br /&gt;SYN-SENT&lt;br /&gt;SYN-RECEIVED&lt;br /&gt;ESTABLISHED&lt;br /&gt;FIN-WAIT-1&lt;br /&gt;FIN-WAIT-2&lt;br /&gt;CLOSE-WAIT&lt;br /&gt;CLOSING&lt;br /&gt;LAST-ACK&lt;br /&gt;TIME-WAIT&lt;br /&gt;CLOSED&lt;br /&gt;LISTEN&lt;br /&gt;represents waiting for a connection request from any remote TCP and port. (usually set by TCP servers)&lt;br /&gt;SYN-SENT&lt;br /&gt;represents waiting for the remote TCP to send back a TCP packet with the SYN and ACK flags set. (usually set by TCP clients)&lt;br /&gt;SYN-RECEIVED&lt;br /&gt;represents waiting for the remote TCP to send back an acknowledgment after having sent back a connection acknowledgment to the remote TCP. (usually set by TCP servers)&lt;br /&gt;ESTABLISHED&lt;br /&gt;represents that the port is ready to receive/send data from/to the remote TCP. (set by TCP clients and servers)&lt;br /&gt;TIME-WAIT&lt;br /&gt;represents waiting for enough time to pass to be sure the remote TCP received the acknowledgment of its connection termination request. According to &lt;a title="http://tools.ietf.org/html/rfc793" href="http://tools.ietf.org/html/rfc793"&gt;RFC 793&lt;/a&gt; a connection can stay in TIME-WAIT for a maximum of four minutes.&lt;br /&gt;&lt;a name="Connection_establishment"&gt;&lt;/a&gt;Connection establishment&lt;br /&gt;To establish a connection, TCP uses a three-way &lt;a title="Handshaking" href="http://en.wikipedia.org/wiki/Handshaking"&gt;handshake&lt;/a&gt;. Before a client attempts to connect with a server, the server must first bind to a port to open it up for connections: this is called a passive open. Once the passive open is established, a client may initiate an active open. To establish a connection, the three-way (or 3-step) handshake occurs:&lt;br /&gt;The active open is performed by the client sending a SYN to the server.&lt;br /&gt;In response, the server replies with a SYN-ACK.&lt;br /&gt;Finally the client sends an ACK back to the server.&lt;br /&gt;At this point, both the client and server have received an acknowledgment of the connection.&lt;br /&gt;Example:&lt;br /&gt;The initiating host (client) sends a synchronization (SYN flag set) packet to initiate a connection. Any SYN packet holds a Sequence Number. The Sequence Number is a 32-bit field in TCP segment header. Let the Sequence Number value for this session be x.&lt;br /&gt;The other host receives the packet, records the Sequence Number x from the client, and replies with an acknowledgment and synchronization (SYN-ACK). The Acknowledgment is a 32-bit field in TCP segment header. It contains the next sequence number that this host is expecting to receive (x + 1). The host also initiates a return session. This includes a TCP segment with its own initial Sequence Number of value y.&lt;br /&gt;The initiating host responds with the next Sequence Number (x + 1) and a simple Acknowledgment Number value of y + 1, which is the Sequence Number value of the other host + 1.&lt;br /&gt;Vulnerability to Denial of Service: By using a spoofed IP address and repeatedly sending SYN packets attackers can cause the server to consume large amounts of resources keeping track of the bogus connections. Proposed solutions to this problem include &lt;a title="SYN cookies" href="http://en.wikipedia.org/wiki/SYN_cookies"&gt;SYN cookies&lt;/a&gt; and Cryptographic puzzles&lt;br /&gt;&lt;a name="Data_transfer"&gt;&lt;/a&gt;Data transfer&lt;br /&gt;There are a few key features that set TCP apart from &lt;a title="User Datagram Protocol" href="http://en.wikipedia.org/wiki/User_Datagram_Protocol"&gt;User Datagram Protocol&lt;/a&gt;:&lt;br /&gt;Ordered data transfer&lt;br /&gt;Retransmission of lost packets&lt;br /&gt;Discarding duplicate packets&lt;br /&gt;Error-free data transfer&lt;br /&gt;Congestion/Flow control&lt;br /&gt;&lt;a name="Ordered_data_transfer.2C_retransmission_"&gt;&lt;/a&gt;Ordered data transfer, retransmission of lost packets and discarding duplicate packets&lt;br /&gt;In the first two steps of the 3-way handshaking, both computers exchange an initial sequence number (ISN). This number can be arbitrary. This sequence number identifies the order of the bytes sent from each computer so that the data transferred is in order regardless of any fragmentation or disordering that occurs during transmission. For every byte transmitted the sequence number must be incremented.&lt;br /&gt;Conceptually, each byte sent is assigned a sequence number and the receiver then sends an acknowledgment back to the sender that effectively states that they received it. What is done in practice is only the first data byte is assigned a sequence number which is inserted in the sequence number field and the receiver sends an acknowledgment value of the next byte they expect to receive.&lt;br /&gt;For example, if computer A sends 4 bytes with a sequence number of 100 (conceptually, the four bytes would have a sequence number of 100, 101, 102, &amp;amp; 103 assigned) then the receiver would send back an acknowledgment of 104 since that is the next byte it expects to receive in the next packet. By sending an acknowledgment of 104, the receiver is signaling that it received bytes 100, 101, 102, &amp;amp; 103 correctly. If, by some chance, the last two bytes were corrupted then an acknowledgment value of 102 would be sent since 100 &amp;amp; 101 were received successfully.&lt;br /&gt;However, a problem can occasionally arise when packets are lost. For example, 10,000 bytes are sent in 10 different TCP packets, and the first packet is lost during transmission. The sender would then have to resend all 10,000 bytes; the recipient cannot say that it received bytes 1,000 to 9,999 but only that it failed to receive the first packet, containing bytes 0 to 999. In order to solve this problem, an option of selective acknowledgment (SACK) has been added. This option allows the receiver to acknowledge isolated blocks of packets that were received correctly, rather than the sequence number of the last packet received successively, as in the basic TCP acknowledgment. Each block is conveyed by the starting and ending sequence numbers. In the example above, the receiver would send SACK with sequence numbers 1,000 and 10,000. The sender will thus retransmit only the first packet.&lt;br /&gt;The SACK option is not mandatory and it is used only if both parties support it. This is negotiated when connection is established. SACK uses the optional part of the TCP header. See &lt;a title="" href="http://en.wikipedia.org/wiki/Transmission_Control_Protocol#TCP_segment_structure#TCP_segment_structure"&gt;#TCP segment structure&lt;/a&gt;. The use of SACK is widespread - all popular TCP stacks support it. Selective acknowledgment is also used in &lt;a title="Stream Control Transmission Protocol" href="http://en.wikipedia.org/wiki/Stream_Control_Transmission_Protocol"&gt;SCTP&lt;/a&gt;.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/392745368495742159-8979190406299285836?l=aboutprotocol.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aboutprotocol.blogspot.com/feeds/8979190406299285836/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=392745368495742159&amp;postID=8979190406299285836' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/392745368495742159/posts/default/8979190406299285836'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/392745368495742159/posts/default/8979190406299285836'/><link rel='alternate' type='text/html' href='http://aboutprotocol.blogspot.com/2007/10/transmission-control-protocol_11.html' title='Transmission Control Protocol'/><author><name>MP</name><uri>http://www.blogger.com/profile/02485863734608702367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-392745368495742159.post-2649042325305692410</id><published>2007-10-11T06:01:00.001-07:00</published><updated>2007-10-11T06:01:52.075-07:00</updated><title type='text'>USER DATAGRAM PROTOCOL</title><content type='html'>&lt;div align="justify"&gt;User Datagram Protocol (UDP) is one of the core protocols of the Internet protocol suite. Using UDP, programs on networked computers can send short messages sometimes known as datagrams (using Datagram Sockets) to one another. UDP is sometimes called the Universal Datagram Protocol.&lt;br /&gt;UDP does not guarantee reliability or ordering in the way that TCP does. Datagrams may arrive out of order, appear duplicated, or go missing without notice. Avoiding the overhead of checking whether every packet actually arrived makes UDP faster and more efficient, at least for applications that do not need guaranteed delivery. Time-sensitive applications often use UDP because dropped packets are preferable to delayed packets. UDP's stateless nature is also useful for servers that answer small queries from huge numbers of clients. Unlike TCP, UDP supports packet broadcast (sending to all on local network) and multicasting (send to all subscribers).&lt;br /&gt;Common network applications that use UDP include the Domain Name System (DNS), streaming media applications such as IPTV, Voice over IP (VoIP), Trivial File Transfer Protocol (TFTP) and online games.&lt;br /&gt;Ports&lt;br /&gt;UDP uses ports to allow application-to-application communication. The port field is 16 bits so the valid range is 0 to 65,535. Port 0 is reserved, but is a permissible source port value if the sending process does not expect messages in response.&lt;br /&gt;Ports 1 through 1023 are named "well-known" ports and on Unix-derived operating systems, binding to one of these ports requires root access.&lt;br /&gt;Ports 1024 through 49,151 are registered ports.&lt;br /&gt;Ports 49,152 through 65,535 are ephemeral ports and are used as temporary ports primarily by clients when communicating to servers.&lt;br /&gt;&lt;a name="Packet_structure"&gt;&lt;/a&gt;Packet structure&lt;br /&gt;UDP is a minimal message-oriented transport layer protocol that is currently documented in IETF RFC 768.&lt;br /&gt;In the Internet protocol suite, UDP provides a very simple interface between a network layer below (e.g., IPv4) and a session layer or application layer above.&lt;br /&gt;UDP provides no guarantees to the upper layer protocol for message delivery and a UDP sender retains no state on UDP messages once sent (for this reason UDP is sometimes called the Unreliable Datagram Protocol). UDP adds only application multiplexing and checksumming of the header and payload. If any kind of reliability for the information transmitted is needed, it must be implemented in upper layers.&lt;br /&gt;The UDP header consists of only 4 fields. The use of two of those is optional (pink background in table).&lt;br /&gt;Source port&lt;br /&gt;This field identifies the sending port when meaningful and should be assumed to be the port to reply to if needed. If not used, then it should be zero.&lt;br /&gt;Destination port&lt;br /&gt;This field identifies the destination port and is required.&lt;br /&gt;Length&lt;br /&gt;A 16-bit field that specifies the length in bytes of the entire datagram: header and data. The minimum length is 8 bytes since that's the length of the header. The field size sets a theoretical limit of 65,527 bytes for the data carried by a single UDP datagram. The practical limit for the data length which is imposed by the underlying IPv4 protocol is 65,507 bytes.&lt;br /&gt;Checksum&lt;br /&gt;The 16-bit checksum field is used for error-checking of the header and data.&lt;br /&gt;With IPv4&lt;br /&gt;When UDP runs over IPv4, the method used to compute the checksum is defined within RFC 768:&lt;br /&gt;Checksum is the 16-bit one's complement of the one's complement sum of a pseudo header of information from the IP header, the UDP header, and the data, padded with zero octets at the end (if necessary) to make a multiple of two octets.&lt;br /&gt;In other words, all 16-bit words are summed together using one's complement (with the checksum field set to zero). The sum is then one's complemented. This final value is then inserted as the checksum field. Algorithmically speaking, this is the same as for IPv6.&lt;br /&gt;The difference is in the data used to make the checksum. Included is a pseudo-header that mimics the IPv4 header:&lt;br /&gt;The source and destination addresses are those in the IPv4 header. The protocol is that for UDP (see List of IPv4 protocol numbers): 17. The UDP length field is the length of the UDP header and data.&lt;br /&gt;If the checksum is calculated to be zero (all 0's) it should be sent as negative zero (all 1's). If a checksum is not used it should be sent as zero (all 0's) as zero indicates an unused checksum.&lt;br /&gt;With IPv6&lt;br /&gt;When UDP runs over IPv6, the checksum is no longer considered optional, and the method used to compute the checksum is changed, as per RFC 2460:&lt;br /&gt;Any transport or other upper-layer protocol that includes the addresses from the IP header in its checksum computation must be modified for use over IPv6, to include the 128-bit IPv6 addresses instead of 32-bit IPv4 addresses.&lt;br /&gt;When computing the checksum, a pseudo-header that mimics the IPv6 header is included:&lt;br /&gt;The source address is the one in the IPv6 header. The destination address is the final destination; if the IPv6 packet doesn't contain a Routing header, that will be the destination address in the IPv6 header; otherwise, at the originating node, it will be the address in the last element of the Routing header, and, at the receiving node, it will be the destination address in the IPv6 header. The Next Header value is the protocol value for UDP: 17. The UDP length field is the length of the UDP header and data.&lt;br /&gt;If the checksum is calculated to be zero (all 0's) it should be sent as negative zero (all 1's).&lt;br /&gt;Lacking reliability, UDP applications must generally be willing to accept some loss, errors or duplication. Some applications such as TFTP may add rudimentary reliability mechanisms into the application layer as needed. Most often, UDP applications do not require reliability mechanisms and may even be hindered by them. Streaming media, real-time multiplayer games and voice over IP (VoIP) are examples of applications that often use UDP. If an application requires a high degree of reliability, a protocol such as the Transmission Control Protocol or erasure codes may be used instead.&lt;br /&gt;Lacking any congestion avoidance and control mechanisms, network-based mechanisms are required to minimize potential congestion collapse effects of uncontrolled, high rate UDP traffic loads. In other words, since UDP senders cannot detect congestion, network-based elements such as routers using packet queuing and dropping techniques will often be the only tool available to slow down excessive UDP traffic. The Datagram Congestion Control Protocol (DCCP) is being designed as a partial solution to this potential problem by adding end host TCP-friendly congestion control behavior to high-rate UDP streams such as streaming media.&lt;br /&gt;While the total amount of UDP traffic found on a typical network is often in the order of only a few percent, numerous key applications use UDP, including the Domain Name System (DNS), the simple network management protocol (SNMP), the Dynamic Host Configuration Protocol (DHCP) and the Routing Information Protocol (RIP), to name just a few.&lt;br /&gt;&lt;a name="Sample_code_.28Python.29"&gt;&lt;/a&gt;Sample code (Python)&lt;br /&gt;The following, minimalistic example shows how to use UDP for client/server communication:&lt;br /&gt;The server:import socket PORT = 10000BUFLEN = 512 server = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)server.bind(('', PORT)) while True:        (message, address) = server.recvfrom(BUFLEN)        print 'Received packet from %s:%d' % (address[0], address[1])        print 'Data: %s' % message&lt;br /&gt;The client (replace "127.0.0.1" by the IP address of the server):import socket SERVER_ADDRESS = '127.0.0.1'SERVER_PORT = 10000 client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP) for i in range(3):        print 'Sending packet %d' % i        message = 'This is packet %d' % i        client.sendto(message, (SERVER_ADDRESS, SERVER_PORT)) client.close()&lt;br /&gt;&lt;a name="Voice_and_Video_Traffic"&gt;&lt;/a&gt;Voice and Video Traffic&lt;br /&gt;UDP is generally the protocol used in transmitting voice and video across a network. This is because there is no time to re-send lost packets when listening to someone or watching a video in real time. Because both TCP and UDP run over the same network, many businesses are finding that the increase in UDP traffic (VoIP and Video) is hurting the performance of their TCP applications, which could be their order entry system, accounting system, etc. By default TCP will rev down to let the real-time data hog most of the bandwidth. The problem is that both are important for most businesses, so finding the right balance is crucial.[1]&lt;br /&gt;&lt;a name="Difference_between_TCP_and_UDP"&gt;&lt;/a&gt;Difference between TCP and UDP&lt;br /&gt;TCP is a connection-oriented protocol; a connection can be made from client to server, and from then on any data can be sent along that connection.&lt;br /&gt;Reliable - TCP manages message acknowledgment, retransmission and timeout. Many attempts to reliably deliver the message are made. If it gets lost along the way, the server will re-request the lost part. In TCP, there's either no missing data, or, in case of multiple timeouts, the connection is dropped.&lt;br /&gt;Ordered - if two messages are sent along a connection, one after the other, the first message will reach the receiving application first. When data packets arrive in the wrong order, the TCP layer holds the later data until the earlier data can be rearranged and delivered to the application.&lt;br /&gt;Heavyweight - TCP requires three packets just to set up a socket, before any actual data can be sent. It handles connections, reliability and congestion control. It is a large transport protocol designed on top of IP.&lt;br /&gt;Streaming - Data is read as a "stream," with nothing distinguishing where one packet ends and another begins. Packets may be split or merged into bigger or smaller data streams arbitrarily.&lt;br /&gt;UDP is a simpler message-based connectionless protocol. With UDP messages (packets) cross the network in independent units.&lt;br /&gt;Unreliable - When a message is sent, it can't be known if it will reach its destination; it could get lost along the way. There's no concept of acknowledgment, retransmission and timeout.&lt;br /&gt;Not ordered - If two messages are sent to the same recipient, the order in which they arrive cannot be predicted.&lt;br /&gt;Lightweight - There is no ordering of messages, no tracking connections, etc. This means it's a lot quicker. It's a small transport layer designed on top of IP.&lt;br /&gt;Datagrams - Packets are sent individually and are guaranteed to be whole if they arrive. Packets have definite bounds and no split or merge into data streams may exist&lt;br /&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/392745368495742159-2649042325305692410?l=aboutprotocol.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aboutprotocol.blogspot.com/feeds/2649042325305692410/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=392745368495742159&amp;postID=2649042325305692410' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/392745368495742159/posts/default/2649042325305692410'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/392745368495742159/posts/default/2649042325305692410'/><link rel='alternate' type='text/html' href='http://aboutprotocol.blogspot.com/2007/10/user-datagram-protocol_11.html' title='USER DATAGRAM PROTOCOL'/><author><name>MP</name><uri>http://www.blogger.com/profile/02485863734608702367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-392745368495742159.post-9126714019948512868</id><published>2007-10-11T05:57:00.001-07:00</published><updated>2007-10-11T05:58:55.044-07:00</updated><title type='text'>Internet Protocol</title><content type='html'>&lt;div align="justify"&gt;Internet Protocol&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;The Internet Protocol (IP) is a data-oriented protocol used for communicating data across a packet-switched internetwork.&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;IP is a network layer protocol in the Internet protocol suite and is encapsulated in a data link layer protocol (e.g., Ethernet). As a lower layer protocol, IP provides the service of communicable unique global addressing amongst computers.&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;Packetization&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;Data from an upper layer protocol is encapsulated inside one or more packets/datagrams (the terms are basically synonymous in IP). No circuit setup is needed before a host tries to send packets to a host it has previously not communicated with (this is the point of a packet-switched network), thus IP (Internet protocol) is a connectionless protocol. This is quite unlike Public Switched Telephone Networks that require the setup of a circuit before a phone call may go through (a connection-oriented protocol).&lt;br /&gt;&lt;a name="Services_provided_by_IP"&gt;&lt;/a&gt;&lt;/div&gt;&lt;div align="justify"&gt;Services provided by IP&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;Because of the abstraction provided by encapsulation, IP can be used over a heterogeneous network (i.e., a network connecting two computers can be any mix of Ethernet, ATM, FDDI, Wi-Fi, token ring, etc.) and it makes no difference to the upper layer protocols. Each data link layer can (and does) have its own method of addressing (or possibly the complete lack of it), with a corresponding need to resolve IP addresses to data link addresses. This address resolution is handled by the Address Resolution Protocol (ARP).&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;Reliability&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;IP provides an unreliable service (i.e., best effort delivery). This means that the network makes no guarantees about the packet and none, some, or all of the following may apply:&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;data corruption&lt;br /&gt;out of order (packet A may be sent before packet B, but B can arrive before A)&lt;br /&gt;duplicate arrival&lt;br /&gt;lost or dropped/discarded&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;In terms of reliability the only thing IP does is ensure the IP packet's header is error-free through the use of a checksum. This has the side-effect of discarding packets with bad headers on the spot, and with no required notification to either end (though an ICMP message may be sent).&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;To address any of these reliability issues, an upper layer protocol must handle it. For example, to ensure in-order delivery the upper layer may have to cache data until it can be passed up in order.&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;If the upper layer protocol does not self-police its own size by first looking at the Layer 2 Maximum Transmission Unit (MTU) size, and sends the IP layer too much data, IP is forced to fragment the original datagram into smaller fragments for transmission. IP does provide re-ordering of any fragments that arrive out of order by using the fragmentation flags and offset[1]. Transmission Control Protocol (TCP) is a good example of a protocol that will adjust its segment size to be smaller than the MTU. User Datagram Protocol (UDP) and Internet Control Message Protocol (ICMP) are examples of protocols that disregard MTU size thereby forcing IP to fragment oversized datagrams.[2]&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;The primary reason for the lack of reliability is to reduce the complexity of routers. While this does give routers carte blanche to do as they please with packets, anything less than best effort yields a poorer experience for the user. So, even though no guarantees are made, the better the effort made by the network, the better the experience for the user. Most protocols are built around the idea that error checking is best done at each end of the communication line, see End-to-end principle.&lt;br /&gt;&lt;a name="IP_addressing_and_routing"&gt;&lt;/a&gt;&lt;/div&gt;&lt;div align="justify"&gt;IP addressing and routing&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;Perhaps the most complex aspects of IP are IP addressing and routing. Addressing refers to how end hosts become assigned IP addresses and how subnetworks of IP host addresses are divided and grouped together. IP routing is performed by all hosts, but most importantly by internetwork routers, which typically use either interior gateway protocols (IGPs) or external gateway protocols (EGPs) to help make IP datagram forwarding decisions across IP connected networks.&lt;br /&gt;&lt;a name="Version_history"&gt;&lt;/a&gt;&lt;/div&gt;&lt;div align="justify"&gt;Version history&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;IP is the common element found in today's public Internet. The current and most popular network layer protocol in use today is IPv4; this version of the protocol is assigned version 4. IPv4 RFC-791 was adopted by the United States Department of Defense as MIL-STD-1777.&lt;br /&gt;IPv6 is the proposed successor to IPv4 whose most prominent change is the addressing. IPv4 uses 32-bit addresses (~4 billion addresses) while IPv6 uses 128-bit addresses (~3.4×1038 addresses). Although adoption of IPv6 has been slow, as of 2008, all United States government systems must support IPv6 (if only at the backbone level). [3]&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;Version numbers 0 through 3 were development versions of IPv4 used between 1977 and 1979. Version number 5 was used by the Internet Stream Protocol (IST), an experimental stream protocol. Version numbers 6 through 9 were assigned to experimental protocols designed to replace IPv4: SIPP (known nowadays as IPv6), TP/IX, PIP, and TUBA. Except for IPv6, the other ones are not used any more&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/392745368495742159-9126714019948512868?l=aboutprotocol.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aboutprotocol.blogspot.com/feeds/9126714019948512868/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=392745368495742159&amp;postID=9126714019948512868' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/392745368495742159/posts/default/9126714019948512868'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/392745368495742159/posts/default/9126714019948512868'/><link rel='alternate' type='text/html' href='http://aboutprotocol.blogspot.com/2007/10/internet-protocol_11.html' title='Internet Protocol'/><author><name>MP</name><uri>http://www.blogger.com/profile/02485863734608702367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-392745368495742159.post-182715090734842556</id><published>2007-10-11T05:54:00.000-07:00</published><updated>2007-10-11T05:56:51.766-07:00</updated><title type='text'>PROTOCOL (COMPUTING)</title><content type='html'>&lt;div align="justify"&gt;In computing, a protocol is a convention or standard that controls or enables the connection, communication, and data transfer between two computing endpoints. In its simplest form, a protocol can be defined as the rules governing the syntax, semantics, and synchronization of communication.&lt;br /&gt;&lt;br /&gt;Protocols may be implemented by hardware, software, or a combination of the two. At the lowest level, a protocol defines the behavior of a hardware connection. Typical properties It is difficult to generalize about protocols because they vary so greatly in purpose and sophistication. Most protocols specify one or more of the following properties:&lt;br /&gt;&lt;br /&gt;Detection of the underlying physical connection (wired or wireless), or the existence of the other endpoint or node.&lt;br /&gt;&lt;br /&gt;Handshaking Negotiation of various connection characteristics.&lt;br /&gt;How to start and end a message.&lt;br /&gt;How to format a message. What to do with corrupted or improperly formatted messages (error correction).&lt;br /&gt;How to detect unexpected loss of the connection, and what to do next.&lt;br /&gt;Termination of the session or connection.&lt;br /&gt;&lt;br /&gt;Importance:&lt;br /&gt;&lt;br /&gt; The widespread use and expansion of communications protocols is both a prerequisite to the Internet, and a major contributor to its power and success.&lt;br /&gt;&lt;br /&gt;The pair of Internet Protocol (or IP) and Transmission Control Protocol (or TCP) are the most important of these, and the term TCP/IP refers to a collection (or protocol suite) of its most used protocols. Most of the Internet's communication protocols are described in the RFC documents of the Internet Engineering Task Force (or IETF).&lt;br /&gt;&lt;br /&gt;Object-oriented programming has extended the use of the term to include the programming protocols available for connections and communication between objects. Generally, only the simplest protocols are used alone. Most protocols, especially in the context of communications or networking, are layered together into protocol stacks where the various tasks listed above are divided among different protocols in the stack. Whereas the protocol stack denotes a specific combination of protocols that work together, a reference model is a software architecture that lists each layer and the services each should offer. The classic seven-layer reference model is the OSI model, which is used for conceptualizing protocol stacks and peer entities. This reference model also provides an opportunity to teach more general software engineering concepts like hiding, modularity, and delegation of tasks.&lt;br /&gt;&lt;br /&gt;This model has endured in spite of the demise of many of its protocols (and protocol stacks) originally sanctioned by the ISO. The OSI model is not the only reference model however. Common Protocols IP (Internet Protocol) UDP (User Datagram Protocol) TCP (Transmission Control Protocol) DHCP (Dynamic Host Configuration Protocol) HTTP (Hypertext Transfer Protocol) FTP (File Transfer Protocol) Telnet (Telnet Remote Protocol) SSH (SSH Remote Protocol) POP3 (Post Office Protocol 3) SMTP (Simple Mail Transfer Protocol) IMAP (Internet Message Access Protocol) &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/392745368495742159-182715090734842556?l=aboutprotocol.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aboutprotocol.blogspot.com/feeds/182715090734842556/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=392745368495742159&amp;postID=182715090734842556' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/392745368495742159/posts/default/182715090734842556'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/392745368495742159/posts/default/182715090734842556'/><link rel='alternate' type='text/html' href='http://aboutprotocol.blogspot.com/2007/10/protocol-computing_11.html' title='PROTOCOL (COMPUTING)'/><author><name>MP</name><uri>http://www.blogger.com/profile/02485863734608702367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
