Beruflich Dokumente
Kultur Dokumente
Once TCP and UDP have segmented the data and have added their headers, they send the segment
down to the Network layer. The destination host may reside in a different network far from the host
divided by multiple routers. It is the task of the Internet Layer to ensure that the segment is moved across
the networks to the destination network.
The Internet layer of the TCP/IP model corresponds to the Network layer of the OSI reference model in
function. It provides logical addressing, path determination and forwarding.
The Internet Protocol (IP) is the most common protocol that provides these services. Also working at this
layer are routing protocols which help routers learn about different networks they can reach and
the Internet Control Message Protocol (ICMP) that is used to send error messages across at this layer.
Almost half of the book is dedicated IP and Routing protocols so they will be discussed in detail in later
chapters, but the following sections discuss these protocols in brief.
As IP receives segments from TCP or UDP, it adds a header with source IP address and destination IP
address amongst other information. This PDU is called a packet. When a router receives a packet, it
looks at the destination address in the header and forwards it towards the destination network. The
packet may need to go through multiple routers before it reaches the destination network. Each router it
has to go through is called a hop.
Header Length – This specifies the size of the header itself. The minimum size is 20 bytes. The figure
does not show the rarely used options field that is of a variable length. Most IPv4 headers are 20 bytes in
length.
DS Field – The differentiated Services field is used for marking packets. Different Quality-Of-Service
(QoS) levels can be applied on different markings. For example, data belonging to voice and video
protocols have no tolerance for delay. The DS field is used to mark packets carrying data belonging to
these protocols so that they get priority treatment through the network. On the other hand, peer-to-peer
traffic is considered a major problem and can be marked down to give in best effort treatment.
Total Length – This field specifies the size of the packet. This means the size of the header plus the size
of the data.
Identification – When IP receives a segment from TCP or UDP; it may need to break the segment into
chucks called fragments before sending it out to the network. Identification fields serves to identify the
fragments that make up the original segment. Each fragment of a segment will have the same
identification number.
Fragment Offset – This field identifies the fragment number and is used by hosts to reassemble the
fragments in the correct order.
Time to Live – The Time to Live (TTL) value is set at the originating host. Each router that the packet
passes through reduces the TTL by one. If the TTL reaches 0 before reaching the destination, the packet
is dropped. This is done to prevent the packet from moving around the network endlessly.
Protocol – This field identifies the protocol to which the data it is carrying belongs. For example a value
of 6 implies that the data contains a TCP segment while a value of 17 signifies a UDP segment. Apart
from TCP and UDP there are many protocols whose data can be carried in an IP packet.
Header Checksum – This field is used to check for errors in the header. At each router and at the
destination, a cyclic redundancy check performed on the header and the result should match the value
stored in this field. If the value does not match, the packet is discarded.
Source IP address – This field stores the IP address of the source of the packet.
Destination IP address – This field stores the IP address of the destination of the packet.
Routing Protocols
In Figure 1-14, Router1 knew that it needed to send the packet destined to Host3 toward Router2.
Router2 in turn knew that the packet needed to go toward Router3. To make these decisions, the routers
need to build their routing table. This is a table of all networks known by it and all the routers in the
internetwork. The table also lists the next router towards the destination network. To build this table
dynamically, routers use routing protocols. There are many routing protocols and their sole purpose is to
ensure that routers know about all the networks and the best path to any network. Chapter 4 and Chapter
5 discuss the routing process and some routing protocols in detail.