100% found this document useful (1 vote)
74 views56 pages

IPv4 - IPv6 - Header Autosaved

The document provides an overview of the Internet Protocol (IP) and its role within the TCP/IP protocol suite, detailing the structure and function of datagrams, including header and payload components. It discusses fragmentation, maximum transfer units (MTU), and the significance of options in IP headers, particularly in IPv6. Additionally, it compares IPv4 and IPv6 packet formats, highlighting enhancements in IPv6 such as improved header structure and support for resource allocation and security.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
74 views56 pages

IPv4 - IPv6 - Header Autosaved

The document provides an overview of the Internet Protocol (IP) and its role within the TCP/IP protocol suite, detailing the structure and function of datagrams, including header and payload components. It discusses fragmentation, maximum transfer units (MTU), and the significance of options in IP headers, particularly in IPv6. Additionally, it compares IPv4 and IPv6 packet formats, highlighting enhancements in IPv6 such as improved header structure and support for resource allocation and security.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 56

7-1 INTRODUCTION

The Internet Protocol (IP) is the


transmission mechanism used by the
TCP/IP protocols at the network layer.

TCP/IP Protocol Suite 1


Topics Discussed in the Section
Relationship of IP to the rest of the TCP/IP Suite

TCP/IP Protocol Suite 2


Figure 7.1 Position of IP in TCP/IP protocol suite

TCP/IP Protocol Suite 3


7-2 DATAGRAMS

Packets in the network (internet) layer


are called datagrams. A datagram is a
variable-length packet consisting of two
parts: header and data. The header is 20
to 60 bytes in length and contains
information essential to routing and
delivery. It is customary in TCP/IP to
show the header in 4-byte sections. A
brief description of each field is in order.

TCP/IP Protocol Suite 4


Topics Discussed in the Section
Format of the datagram packet
Some examples

TCP/IP Protocol Suite 5


Figure 7.2 IP datagram

Payload:0-65515 bytes

Total bits
160 bits

32 bits

32 bits

TCP/IP Protocol Suite 6


Figure 20.6 Service type or differentiated services

Precedence: Priority
Delay occurs when you call you use internet
Delay should 1 when u want minimum delay
else 0
Throughput:Rate of transfer should be high
then value 1 else 0
Reliability more value 1 else 0
Cost: minimum value 1 else 0
20.7
Table 20.1 Types of service

20.8
Note

The total length field defines the total


length of the datagram including the
header.

TCP/IP Protocol Suite 9


Figure 7.4 Encapsulation of a small datagram in an Ethernet frame

TCP/IP Protocol Suite 10


Figure 7.5 Multiplexing

When the payload is encapsulated in a


datagram at source IP,
The corresponding protocol is inserted in that
field, when it arrives the destination the value
of field helps to define to which protocol the
payload
TCP/IP Protocol Suite needs to be delivered. 11
TCP/IP Protocol Suite 12
Example 7.1
An IP packet has arrived with the first 8 bits as
shown:

The receiver discards the packet. Why?

TCP/IP Protocol Suite 13


Example 7.1
An IP packet has arrived with the first 8 bits as
shown:

The receiver discards the packet. Why?

Solution
There is an error in this packet. The 4 left-most
bits (0100) show the version, which is correct.
The next 4 bits (0010) show the wrong header
length (2 × 4 = 8). The minimum number of bytes
in the header must be 20. The packet has been
corrupted in transmission.

TCP/IP Protocol Suite 14


Example 7.2
In an IP packet, the value of HLEN is 1000 in
binary. How many bytes of options are being
carried by this packet?

TCP/IP Protocol Suite 15


Example 7.2
In an IP packet, the value of HLEN is 1000 in
binary. How many bytes of options are being
carried by this packet?

Solution
The HLEN value is 8, which means the total
number of bytes in the header is 8 × 4 or 32
bytes. The first 20 bytes are the base header, the
next 12 bytes are the options.

TCP/IP Protocol Suite 16


Example 7.3
In an IP packet, the value of HLEN is 516 and the
value of the total length field is 002816. How
many bytes of data are being carried by this
packet?

Solution
The HLEN value is 5, which means the total
number of bytes in the header is 5 × 4 or 20
bytes (no options). The total length is 40 bytes,
which means the packet is carrying 20 bytes of
data (40 − 20).

TCP/IP Protocol Suite 17


Example 7.4
An IP packet has arrived with the first few
hexadecimal digits as shown below:

How many hops can this packet travel before


being dropped? The data belong to what upper
layer protocol?

Solution
To find the time-to-live field, we skip 8 bytes (16
hexadecimal digits). The time-to-live field is the
ninth byte, which is 01. This means the packet
can travel only one hop. The protocol field is the
next byte (02), which means that the upper layer
protocol is IGMP (see Table 7.2)
TCP/IP Protocol Suite 18
7-3 FRAGMENTATION

A datagram can travel through different


networks. Each router decapsulates the
IP datagram from the frame it receives,
processes it, and then encapsulates it in
another frame. The format and size of
the received frame depend on the
protocol used by the physical network
through which the frame has just
traveled. The format and size of the sent
frame depend on the protocol used by
the physical network through which the
frame
TCP/IP is going to travel.
Protocol Suite 19
Topics Discussed in the Section
 Maximum Transfer Unit (MTU)
 Fields Related to Fragmentation

TCP/IP Protocol Suite 20


Figure 7.6 MTU

IP datagram

Header MTU Trailer


Maximum length of data that can be encapsulated in a frame
Frame

TCP/IP Protocol Suite 21


Table 20.5 MTUs for some networks

20.22
Note

Only data in a datagram is fragmented.

TCP/IP Protocol Suite 23


Figure 7.7 Flags field

First is reserved

If D=1 the machine will not fragment the datagram


If D=0 the datagram can be fragmented if
necessary
If M=1 it means the datagram is not the last
fragment
If M=0 it means the datagram is the last fragment.

TCP/IP Protocol Suite 24


IDENTIFICATION
BITS OFFSET

FLAG
RESERVE DF MF
D

0 0
DF=0 means 0 1
fragmentation 1 1
done
1 1

TCP/IP Protocol Suite 25


A datagram of 3000 bytes has 20 bytes
of header and 2980 bytes of payload.The
MTU has capacity of 500B. How many
fragments are made,what is the MF
value,Offset value.

TCP/IP Protocol Suite 26


An IP packet of size 1600 bytes
passes through network segment
before it reaches its destination.
HLEN is 30.Maximum packet size in
MTU is 1400 bytes. Calculate the
number of fragments,offset value
and MF value.

TCP/IP Protocol Suite 27


Figure 7.8 Fragmentation example

Offset = 0000/8 = 0

0000 1399

Offset = 1400/8 = 175


1400 2799

Offset = 2800/8 = 350


2800 3999

Offset value is measured in Bytes

TCP/IP Protocol Suite 28


Figure 7.9 Detailed fragmentation example

1420
14,567 1 000

Bytes 0000–1399 820


14,567 1 175
Fragment 1
4020
14,567 0 000
1420 Bytes 1400–2199
14,567 1 175
Fragment 2.1

Bytes 0000–3999
Bytes 1400–2799

Original datagram Fragment 2

1220
14,567 0 350

Bytes 2800–3999
Fragment 3

TCP/IP Protocol Suite 29


Example 7.5
A packet has arrived with an M bit value of 0. Is
this the first fragment, the last fragment, or a
middle fragment? Do we know if the packet was
fragmented?

Solution
If the M bit is 0, it means that there are no
more fragments; the fragment is the last
one. However, we cannot say if the
original packet
was fragmented or not. A nonfragmented
packet is considered the last fragment

TCP/IP Protocol Suite 30


Example 7.6
A packet has arrived with an M bit value of 1. Is
this the first fragment, the last fragment, or a
middle fragment? Do we know if the packet was
fragmented?
Solution
If the M bit is 1, it means that there is
at least one more fragment. This
fragment can be the first one or a
middle one, but not the last one. We
don’t know if it is the first one or a
middle one; we need more information
(the value of the fragmentation
offset). See also the next example.
TCP/IP Protocol Suite 31
Example 7.7
A packet has arrived with an M bit value of 1 and
a fragmentation offset value of zero. Is this the
first fragment, the last fragment, or a middle
fragment?

Solution
Because the M bit is 1, it is either the first
fragment or a middle one. Because the offset
value is 0, it is the first fragment.

TCP/IP Protocol Suite 32


Example 7.8
A packet has arrived in which the offset value is
100. What is the number of the first byte? Do we
know the number of the last byte?

Solution
To find the number of the first byte, we multiply
the offset value by 8. This means that the first
byte number is 800. We cannot determine the
number of the last byte unless we know the
length of the data.

TCP/IP Protocol Suite 33


Example 7.9
A packet has arrived in which the offset value is
100, the value of HLEN is 5 and the value of the
total length field is 100. What is the number of
the first byte and the last byte?

Solution
The first byte number is 100 × 8 = 800. The total
length is 100 bytes and the header length is 20
bytes (5 × 4), which means that there are 80
bytes in this datagram.
Offset value shows number is 800 for first byte
Datagram has 80 bytes which means the last byte
number must be 879.

TCP/IP Protocol Suite 34


Figure 20.13 Example of checksum calculation in IPv4

20.35
7-4 OPTIONS

The header of the IP datagram is made


of two parts: a fixed part and a variable
part. The fixed part is 20 bytes long. The
variable part comprises the options,
which can be a maximum of 40 bytes.
Options, as the name implies, are not
required for a datagram. They can be
used for network testing and debugging.
Although options are not a required part
of the IP header, option processing is
required of the IP software.
TCP/IP Protocol Suite 36
Figure 7.11 Categories of options

TCP/IP Protocol Suite 37


Changes implemented in the protocol
in addition to changing address size
and format.
 ❑ Better header format. IPv6 uses a new header
format in which options are separated from the
base header and inserted, when needed,
between the base header and the data. This
simplifies and speeds up the routing process
because most of the options do not need to be
checked by routers.
 ❑ New options. IPv6 has new options to allow for
additional functionalities.
 ❑ Allowance for extension. IPv6 is designed to
allow the extension of the protocol if required by
new technologies or applications.
TCP/IP Protocol Suite 38
 ❑ Support for resource allocation. In IPv6, the
type-of-service field has been removed, but two
new fields, traffic class and flow label, have
been added to enable the source to request
special handling of the packet. This mechanism
can be used to support traffic such as real-time
audio and video.

 ❑Support for more security. The encryption and


authentication options in IPv6 provide
confidentiality and integrity of the packet

TCP/IP Protocol Suite 39


27-2 PACKET FORMAT

The IPv6 packet is shown in Figure 27.1.


Each packet is composed of a mandatory
base header followed by the payload.
The payload consists of two parts:
optional extension headers and data
from an upper layer. The base header
occupies 40 bytes, whereas the
extension headers and data from the
upper layer contain up to 65,535 bytes of
information.

TCP/IP Protocol Suite 40


Figure 20.15 IPv6 datagram header and
payload

20.
41
Figure 27.1 IPv6 datagram

TCP/IP Protocol Suite 42


Figure 27.2 Format of the base header

TCP/IP Protocol Suite 43


 Version. The 4-bit version field defines the version number
of the IP. For IPv6, the value is 6.
 ❑ Traffic class. The 8-bit traffic class field is used to
distinguish different payloads with different delivery
requirements. It replaces the type-of-service field in IPv4.
 ❑ Flow label. The flow label is a 20-bit field that is designed
to provide special handling for a particular flow of data. We
will discuss this field later. (used for real-time data)
 ❑ Payload length. The 2-byte payload length field defines
the length of the IP datagram excluding the header. Note
that IPv4 defines two fields related to the length: header
length and total length. In IPv6, the length of the base
header is fixed (40 bytes); only the length of the payload
needs to be defined..

TCP/IP Protocol Suite 44


 ❑ Next header. The next header is
an 8-bit field defining the type of
the first extension header (if
present) or the type of the data
that follows the base header in the
datagram. This field is similar to
the protocol field in IPv4, but we
talk more about it when we discuss
the payload
TCP/IP Protocol Suite 45
 Hop limit. The 8-bit hop limit field serves the
same purpose as the TTL field in IPv4.
 ❑ Source and destination addresses. The
source address field is a 16-byte (128-bit)
Internet address that identifies the original
source of the datagram. The destination
address field is a 16-byte (128-bit) Internet
address that identifies the destination of the
datagram.
 ❑ Payload. Compared to IPv4, the payload field
in IPv6 has a different format

TCP/IP Protocol Suite 46


TCP/IP Protocol Suite 47
Figure 27.3 Extension header format

TCP/IP Protocol Suite 48


Figure 20.17 Extension header types

20.
49
Table 20.9 Comparison between IPv4 and IPv6 packet
headers

20.50
20.51
Table 20.10 Comparison between IPv4 options and IPv6 extension
headers

20.52
Transition from IPv4 to
IPv6
Figure 20.19 Dual stack

20.
54
Figure 20.20 Tunneling strategy

20.5
0

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy