The TCP/IP Stack
Making it all work
Well this may seem a little too techo-geeky, I think it does serve to show
how information can be creatively and functionally organized to make
a network function. As a result, its worth discussing the structure of
the 32-bit TCP/IP header (or TCP/IP stack) in some detail. We start with
the IP stack shown above:
- the first 4 bits make up the version field which indicates the format of the Internet header.
- Internet header length is the length of the Internet header in 32-bit words. Points to the beginning of the data. The minimum value for a correct header is 5.
- Type of Service: Indicates the quality of service desired. Networks may offer service precedence, meaning that they accept traffic only above a certain precedence at times of high load. There is a three-way trade-off between low delay, high reliability and high throughput.
Bits 0-2: Precedence
111 Network control.
110 Internetwork control.
101 CRITIC/ECP.
100 Flash override.
011 Flash.
010 Immediate.
001 Priority.
000 Routine.
Bit 3: Delay
0 Normal delay.
1 Low delay.
Bit 4: Throughput
0 Normal throughput.
1 High throughput.
Bit 5: Reliability
0 Normal reliability.
1 High reliability.
Bits 6-7: Reserved for future use
- Total length:
Length of the datagram measured in bytes, including the Internet header and data. This field allows the length of a datagram to be up to 65,535 bytes, although such long datagrams are impractical for most hosts and networks. The current standard, however, is to have lengths of
no more than 576 bytes.
- Identification:
Identifying value assigned by the sender to aid in assembling the fragments of a datagram.
- Flags:
3 bits. Control flags:
Bit 0 is reserved and must be zero
Bit 1: Don’t fragment bit:
0 May fragment.
1 Don’t fragment.
Bit 2: More fragments bit:
0 Last fragment.
1 More fragments.
- Fragment offset:
13 bits. Indicates where this fragment belongs in the datagram. The fragment offset is measured in units of 8 bytes (64 bits). The first fragment has offset zero.
- Time to live: encoded in seconds. Designed so that undelivered packets die a relatively
rapid death instead of floating around the network not going anywhere.
- Protocol:
Indicates the next level protocol used in the data portion of the Internet datagram.
- Header checksum:
A checksum on the header only. Since some header fields change, e.g., Time To Live, this is recomputed and verified at each point that the Internet header is processed. This is one of
the tests used to identify packet loss and trigger re-transmittal.
- Source address / destination address:
32 bits each. A distinction is made between names, addresses and routes.
A name indicates an object to be sought.
- An address indicates the location of the object.
- A route indicates how to arrive at the object.
The Internet protocol (IP) deals primarily with addresses. It is the task of higher level protocols (such as host-to-host or application) to make the mapping from names to addresses. The Internet module maps Internet addresses to local net addresses. It is the task of lower level procedures (such as local net or gateways) to make the mapping from local net addresses to routes.
This basic TCP/IP stack has been in use for the last 25 years. As networking becomes more
complex, a new standard is being developed. This is called IPv6. The structure of an IPv6
stack is shown below:
In comparison to IPv4 there are basically three new fields that have been added or substituted
to help more efficient packet flow.
These are:
- Priority:
Enables a source to identify the desired delivery priority of the packets. Priority values are divided into ranges: traffic where the source provides congestion control and non-congestion control traffic.
- Flow label:
Used by a source to label those products for which it requests special handling by the IPv6 router. This is the essence of QOS (Quality of Service) in IPv6.
- Hop limit:
8-bit integer that is decremented by one by each node that forwards the packet. The packet is discarded if the Hop Limit is decremented to zero.