Lecture 7- IP Part 1
Lecture 7- IP Part 1
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
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
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
©The McGraw-Hill Companies, Inc., 2000 9 © Adapted for use at JMU by Mohamed Aboutabl, 2003
8.2 FRAGMENTATION
©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:
©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
Solution
©The McGraw-Hill Companies, Inc., 2000 14 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Example 6
Solution
©The McGraw-Hill Companies, Inc., 2000 15 © Adapted for use at JMU by Mohamed Aboutabl, 2003
Example 7
Solution
©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
©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