Chapter 20-21 PDF
Chapter 20-21 PDF
Chapter 20
N
NetworkkLLayer
IP and Address Mapping
Dr Mznah Al
Dr. Al-Rodhaan
Rodhaan
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
20.2
1
1/11/2010
Connectionless Connection-oriented
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
2
1/11/2010
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
IPv4
The Internet Protocol version 4 (IPv
IPv44) is the delivery
mechanism used by the TCP/IP protocols
protocols..
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
20.6
3
1/11/2010
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
20.7
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
20.8
4
1/11/2010
IP Packet Format
0 4 8 16 19 31
Source IP Address
Destination IP Address
Data
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
0 4 8 16 19 31
Source IP Address
Destination IP Address
Options (variable)
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
5
1/11/2010
0 4 8 16 19 31
Source IP Address
Destination IP Address
Options (variable)
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
0 4 8 16 19 31
Source IP Address
Destination IP Address
Options (variable)
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
6
1/11/2010
Total length of IP datagram in bytes. It is a 16 bit field. Largest size of an IP datagram is 65635
bytes. Maximum header size is 60 bytes. Link layer MTU may restrict this size further.
0 4 8 16 19 31
Source IP Address
Destination IP Address
Options (variable)
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
Identification field uniquely identifies each datagram sent by a host. It is normally incremented
by one each time a host sends a datagram. Very useful for fragmentation and reassembly.
0 4 8 16 19 31
Source IP Address
Destination IP Address
Options (variable)
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
7
1/11/2010
0 4 8 16 19 31
Source IP Address
Destination IP Address
Options (variable)
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
0 4 8 16 19 31
Source IP Address
Destination IP Address
Options (variable)
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
8
1/11/2010
Time-to-live (TTL ) field sets an upper limit on how man routers a datagram can go through.
Every router decrements TTL by 1 before sending it forward. If TTL reaches 0 the datagram is
dropped and an ICMP message is sent to the host application.
0 4 8 16 19 31
Source IP Address
Destination IP Address
Options (variable)
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
Identifies the protocol that sent the datagram. The protocol (today) can be ICMP,
IGMP, TCP, UDP
0 4 8 16 19 31
Source IP Address
Destination IP Address
Options (variable)
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
9
1/11/2010
The header checksum is calculated over the IP header only. TCP, UDP etc
protect their own data and header by a checksum.
0 4 8 16 19 31
Source IP Address
Destination IP Address
Options (variable)
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
Example 20.1
An IPv4 packet has arrived with the first 8 bits as shown:
01000010
The receiver discards the packet.
packet Why?
Solution
(0100) show the version9.
The next 4 bits (0010) show header length (2 × 4 = 8bytes).
Th minimum
The i i number
b off bytes
b in
i the
h header
h d must be b 20.
20
The packet has been corrupted in transmission.
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
10
1/11/2010
Example 20.2
In an IPv4 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
h base
b h d the
header, h next 12 bytes
b are the
h options.
i
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
Example 20.3
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
totall length
l h is
i 40 bytes,
b which
hi h means the h packet
k is i
carrying 20 bytes of data (40 − 20).
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
20.22
11
1/11/2010
Example 20.4
Solution
To find the time-to-live field, we skip 8 bytes. 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).
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
20.23
Fragmentation
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
20.24
12
1/11/2010
Fragmentation example
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
20.25
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
20.26
13
1/11/2010
Ch t 20 from
Chapter f 4th edition
diti (section
( 20.1 until the end off
page 594 except service Type and differentiated services )
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
Chapter 21
Network Layer
Address Mapping
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
14
1/11/2010
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
20.29
Address Mapping
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
15
1/11/2010
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
16
1/11/2010
ARP operation
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
ARP packet
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
21.34
17
1/11/2010
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
21.35
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
21.36
18
1/11/2010
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
Proxy ARP
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
19
1/11/2010
ARP functions
Sender knows IP address
IP asks ARP to create an ARP request message
sender physical address
sender IP address
target IP address
target physical address filled with 0's
Message passed to data link layer; destination address =
broadcast address
All hosts receive frame; only target host accepts the packet
Target host replies (unicast) with an ARP reply message
containing the physical address
Sender receives reply; it now knows the physical address of the
target host
IP datagram's are now unicast to the destination host
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
Cache Table
A sender usually has more than one IP
datagram to send to the same destination
It is inefficient to use ARP for each
datagram
A cache table is used
limited size
mappings retained only for a limited time
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
20
1/11/2010
RARP
Operation
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
21
1/11/2010
A requestt iis b
broadcast;
d t
a reply is unicast.
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
21--2 ICMP
21
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
21.44
22
1/11/2010
ICMP protocol
IP protocol is a best-effort delivery service, however it has
two deficiencies
Lack of error control
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
23
1/11/2010
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
Error-reporting messages
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
21.48
24
1/11/2010
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
21.50
25
1/11/2010
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
21.51
Redirection concept
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
21.52
26
1/11/2010
Ch t 21 from
Chapter f 4th edition
diti (section
( 21.1 until the first
f
paragraph of page 625 except BOOTP page 619)
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Dr. Mznah Al-Rodhaan
27