|CS 321 Spring 2013 > Lecture Notes for Wednesday, April 10, 2013|
The fundamental protocol used on the Internet is—you guessed it—the Internet Protocol (IP). This was created in 1974. The first widely used version is version 4 (IPv4), created in 1980; IPv4 is currently the most common protocol used to send packets over the Internet. It fits nicely into the network layer of the OSI model.
IPv4 identifies a machine using four 8-bit numbers. These are usually written in decimal, separated by periods: 184.108.40.206. Together these are known as an IP address or IP number.
Since IPv4 identifies a machine using a 32-bit number, there are a bit over 4 billion possible IP addresses. This is not enough. The last block of IP addresses was allocated to the companies that distribute them in 2012. Supposedly, we are transitioning to version 6 of IP.
IP version 6 (IPv6) was created in 1998. It completely changes the format of packets, except for the initial four bits, which specifies the version number. IPv6 addresses are eight 16-bit numbers, for 128 bits in all.
In both IPv4 and IPv6, a packet consists of a header and a body (or payload). The header is fixed-length binary data followed by optional data whose length is specified in the header. The length of the body is also given in the header. The format of the body is not specified by IP; it can be anything.
The header-body paradigm is very common. We can build protocol B on top of protocol A by sending a protocol-A message whose body is a protocol-B message (including both protocol-B header and protocol-B body).
This idea can be extended to several levels. For example, web pages are typically written in HTML, and sent via HTTP on top of TCP on top of IP. So an IP packet will have a body that is a TCP message (“segment”) consisting of a header and body. The body of the TCP segment will be an HTTP message, consisting of header and body. The body of the HTTP message will be an HTML document, consisting of header and body.
The Transmission Control Protocol (TCP) is the primary protocol fulfilling (more or less) the responsibilities of the OSI transport layer for the Internet. In fact, TCP and IP go together so well that they are often referred to as TCP/IP. TCP is still on its first version. However, there are standard extensions to the original header format. These extensions are universally used.
A TCP message is called a segment. The address it is sent to consists of an IP address and a port. A port is a 16-bit number that can be considered to represent a single process running on the machine identified by the IP address (although what it actually represents is up to the machine). A standard convention is that ports numbered 0–1023 are reserved for system use, while ports 1024–65535 are usable by any process.
A TCP segment consists of a header and a body. Like IP, the header is fixed-length binary data followed by optional data whose length is specified in the header, and, while the header specifies the length of the body, there are no formatting requirements for the body.
An important field in a TCP header is the window size. TCP includes facilities for acknowledgement of receipt and retries. The window size is that maximum amount of data that is sent before an acknowledgement is received. A window size that is too small leads to inefficient usage of the network. A window size that is too large leads to error checking that occurs too long after the message was sent.
Unfortunately, the window size, which is in units of bytes, is specified by a 16-bit number. The maximum window size is thus 64K, which is not large enough for modern networks.
The window-size problem was solved without requiring a new version of TCP. This was done by adding an optional multiplier to the window size; the multiplier is given in an extension of the header. So the actual window size is the original 16-bit number times the multiplier. Note that, if a machine is running old code that does not know about the multiplier, then transmission is inefficient, but it still works. This is why TCP did not need a new version, even though IP did.