0% found this document useful (0 votes)
4 views

Lecture 7- IP Part 1

Uploaded by

Chellam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Lecture 7- IP Part 1

Uploaded by

Chellam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

Chapter 8

Internet Protocol
(IP)
©The McGraw-Hill Companies, Inc., 2000 1 © Adapted for use at JMU by Mohamed Aboutabl, 2003
CONTENTS
• DATAGRAM
• FRAGMENTATION
• OPTIONS
• CHECKSUM
• IP PACKAGE

©The McGraw-Hill Companies, Inc., 2000 2 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Introduction to IP
• Connectionless datagram protocol for packet switching networks
• Best-effort Service:
– No error checking
– Possible out-of-order delivery
• To achieve reliability, use with TCP, or similar reliable protocol)

©The McGraw-Hill Companies, Inc., 2000 3 © Adapted for use at JMU by Mohamed Aboutabl, 2003
8.1 DATAGRAM

Fragmentation-
related

Fixed
values

©The McGraw-Hill Companies, Inc., 2000 4 © Adapted for use at JMU by Mohamed Aboutabl, 2003
The Protocol field and Multiplexing

Value Protocol
1 ICMP
2 IGMP
6 TCP
17 UDP
89 OSPF

©The McGraw-Hill Companies, Inc., 2000 5 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Example 1

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


Í 01000010

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 header
length, which means (2 × 4 = 8), which is wrong. The minimum
number of bytes in the header must be 20. The packet has been
corrupted in transmission.

©The McGraw-Hill Companies, Inc., 2000 6 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Example 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 main header,
the next 12 bytes are the options.

©The McGraw-Hill Companies, Inc., 2000 7 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Example 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).

©The McGraw-Hill Companies, Inc., 2000 8 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Example 4 An IP packet has arrived with the first few
hexadecimal digits as shown below:

Value Protocol
Í
1 ICMP 45000028000100000102...................
2 IGMP
6 TCP
How many hops can this packet travel before
17 UDP being dropped? The data belong to what upper
89 OSPF layer protocol?

Solution

To find the time-to-live field, we should 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.

©The McGraw-Hill Companies, Inc., 2000 9 © Adapted for use at JMU by Mohamed Aboutabl, 2003
8.2 FRAGMENTATION

• A Router may connect different physical networks


– Incoming IP datagram may be encapsulated inside an Ethernet frame
– Outgoing same IP datagram may be encapsulated in a Token Ring
frame
– Each type of frame may have its Maximum Transfer Unit
• The size of an IP datagram may be up to 65,535. This is too big for some
physical networks.
– The IP datagram must be fragmented into smaller units to pass through.
It could even be further fragmented by other routers ahead.
• Each fragment becomes a datagram with its own header. Reassembly is
done at destination host.

©The McGraw-Hill Companies, Inc., 2000 10 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Fragmentation fields
1. Identification: Set by the source host (a counter incremented each time a
datagram is emitted).
• Together with the source IP address, it uniquely identifies the
datagram
• All fragments of this datagram will copy the same Identification
2. Flags: 3-bit field as shown:

3. Fragmentation Offset: a 13-bit field, specifies the position of the fragment


in the original datagram in multiples of 8 bytes.

©The McGraw-Hill Companies, Inc., 2000 11 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Fragmentation example

©The McGraw-Hill Companies, Inc., 2000 12 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Detailed
example

©The McGraw-Hill Companies, Inc., 2000 13 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Example 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.

©The McGraw-Hill Companies, Inc., 2000 14 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Example 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). However,
we can definitely say the original packet has been fragmented
because the M bit value is 1.

©The McGraw-Hill Companies, Inc., 2000 15 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Example 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.

©The McGraw-Hill Companies, Inc., 2000 16 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Example 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.

©The McGraw-Hill Companies, Inc., 2000 17 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Example 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. If the first byte number is 800, the last
byte number must 879.

©The McGraw-Hill Companies, Inc., 2000 18 © Adapted for use at JMU by Mohamed Aboutabl, 2003
8.3 OPTIONS

• Used for network testing and debugging


• Each option follows the TLV (Type-Length-Value) format

©The McGraw-Hill Companies, Inc., 2000 19 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Figure 8-11
Categories of options

©The McGraw-Hill Companies, Inc., 2000 20 © Adapted for use at JMU by Mohamed Aboutabl, 2003
No operation option

©The McGraw-Hill Companies, Inc., 2000 21 © Adapted for use at JMU by Mohamed Aboutabl, 2003
End of option option

©The McGraw-Hill Companies, Inc., 2000 22 © Adapted for use at JMU by Mohamed Aboutabl, 2003

You might also like