|
|
The Network layer portion of TCP/IP is called Internet Protocol. IP is what actually moves the data from point A to point B, a process that is called routing.
IP is referred to as connectionless; that is, it does not swap control information (or handshaking information) before establishing an end-to-end connection and starting a transmission. The Internet Protocol must rely on TCP to determine that the data arrived successfully at its destination and to retransmit the data if it did not. IP’s only job is to route the data to its destination. In this effort, IP inserts its own header in the datagram once it is received from TCP. The main contents of the IP header are the source and destination addresses, the protocol number, and a checksum.
Note | You may sometimes hear IP described as unreliable because it contains no error detection or recovery code. |
Without the header provided by IP, intermediate routers between the source and destination—commonly called gateways —would not be able to determine where to route the datagram. Figure 3.3 shows the layout of the datagram with the TCP and IP headers in place.
Figure 3.3: A datagram with TCP and IP headers
The fields in the IP header include the following:
Version Defines the IP version number. Version 4 is the current standard, and values of 5 or 6 indicate that special protocols are being used. IP version 6 is currently supported by the newest equipment and is quickly becoming the new standard.
IHL (Internet Header Length) Defines the length of the header information. The header length can vary; the default header is five 32-bit words, and the sixth word is optional.
TOS (Type of Service) Indicates the kind or priority of the required service.
Total Length Specifies the total length of the datagram, which can be a minimum of 576 bytes and a maximum of 65,536 bytes.
Identification Provides information that the receiving system can use to reassemble fragmented datagrams.
Flags The first flag bit specifies that the datagram should not be fragmented and must therefore travel over subnetworks that can handle the size without fragmenting it; the second flag bit indicates that the datagram is the last of a fragmented packet.
Fragmentation Offset Indicates the original position of the data and is used during reassembly.
Time to Live Originally, the time in seconds that the datagram could be in transit; if this time was exceeded, the datagram was considered lost.
Now interpreted as a hop count and usually set to the default value of 32 (for 32 hops), this number is decremented by each router through which the packet passes.
Protocol Identifies the protocol type, allowing the use of non-TCP/IP protocols. A value of 6 indicates TCP, and a value of 17 indicates User Datagram Protocol (UDP).
Header Checksum An error-checking value that is recalculated at each stopover point; necessary because certain fields change.
TCP Header The header added by the TCP part of the protocol suite.
The data in the packet immediately follows this header information.
As you already know, routing is the process of getting your data from point A to point B. Routing datagrams is similar to driving a car. Before you drive off to your destination, you determine which roads you will take to get there. And sometimes along the way, you may change your mind and alter your route.
The IP portion of the TCP/IP protocol inserts its header in the datagram, but before the datagram can begin its journey, IP determines whether it knows the destination. If it does know it, IP sends the datagram on its way. If it doesn’t know and can’t find out, IP sends the datagram to the host’s default gateway.
Each host on a TCP/IP network has a default gateway, an off-ramp for datagrams not destined for the local network. They’re going somewhere else, and the gateway’s job is to forward them to that destination if it knows where it is. Each gateway has a defined set of routing tables that tell the gateway the route to specific destinations.
Because gateways don’t know the location of every IP address, they have their own gateways that act just like any TCP/IP host. In the event that the first gateway doesn’t know the way to the destination, it forwards the datagram to its own gateway. This forwarding, or routing, continues until the datagram reaches its destination. The entire path to the destination is known as the route.
Datagrams intended for the same destination may actually take different routes to get there. Many variables determine the route. For example, overloaded gateways may not respond in a timely manner or may simply refuse to route traffic, and so they time out. That time-out causes the sending gateway to seek an alternate route for the datagram.
Routes can be predefined and made static, and alternate routes can be predefined, providing a maximum probability that your datagrams travel via the shortest and fastest route.
|
|