Professional Documents
Culture Documents
Lecture 04
Lecture 04
TCP/IP – Part II
Prof Indranil Sengupta
Computer Science and Engineering
Indian Institute of Technology
Kharagpur
1
Introduction
Fragmentation
• Why needed?
¾The IP layer injects a packet into the
datalink layer, and hopes for the best.
Not responsible for the reliable transport of
these packets.
¾Each layer imposes some maximum
size of packets, due to various reasons.
Called Maximum Transfer Unit (MTU).
¾Suppose a large packet travels through
a network whose MTU is too small.
Fragmentation is required.
2
Fragmentation (contd.)
• What to do then?
¾The different networks are connected
among themselves through routers.
¾Allow the routers to break the packets
into fragments, if necessary.
¾Each fragment is transmitted as a
separate IP packet.
¾The fragments need to be reassembled
back.
Fragmentation (contd.)
3
Interconnection of Networks
N2
R
R
R
H
N1 R N4
R
H
R R
N3
Transparent Fragmentation
4
Transparent Fragmentation (contd.)
N2
R
R
R
H
N1 R N4
R
H
R
Packet R
N3
5
Transparent Fragmentation (contd.)
• Drawbacks:
¾All packets must be routed via the same
exit router.
¾Exit router must know when all the pieces
have been received.
Either a “count” field or “end-of-packet”
field must be stored in each packet.
¾Lot of overhead.
A large packet may be fragmented and
reassembled repeatedly.
Non-transparent Fragmentation
6
Non-transparent Frag. (contd.)
N2
R 213 1
R 1 2 3 2
R 3
P1 H 4
N1 R N4 5
R
H P2 P1 P2 4
P 5
Packet R 4 5 R
N3
• Advantage:
¾Multiple exit routers may be used.
¾Higher throughput.
• Drawback:
¾When a large packet is fragmented,
overhead increases.
¾Each fragment must have a header
(minimum 20 bytes).
• IP protocol uses non-transparent
fragmentation.
7
IP Datagram
0 4 8 15 16 31
VER HLEN Service type Total Length
-------HEADER--------
Identification Flags Fragment Offset
Time to Live Protocol Header Checksum
Source IP Address
Destination IP Address
Options
DATA
8
What does IP do? (contd.)
¾Flags (3 bits)
Two flags are defined:
D bit :: don’t fragment; prevents
fragmentation from taking
place.
M bit :: more fragment; specifies if
this fragment is the last one
in the original packet or not.
Example :: IP Fragmentation
N1 N2
1000
bytes
data MTU = MTU =
620 bytes 400 bytes
9
Example (contd.)
ID=5,FO=0,M=0 20 1000
By N1
ID=5,FO=0,M=1 ID=5,FO=75,M=0
20 600 20 400
By N2
ID=5,FO=47,M=1 ID=5,FO=75,M=1
20 376 20 224 20 376 20 24
ID=5,FO=0,M=1 ID=5,FO=122,M=0
Basic IP Addressing
10
Dotted Decimal Notation
Hierarchical Addressing
11
IP Address Classes
12
Class A Address
• Network bits : 7
¾Number of networks = 27 – 1 = 127
• Host bits: 24
¾Number of hosts = 224 – 2 = 16,777,214
• Address range:
¾0.0.0.0 to 127.255.255.255
Class B Address
• Network bits : 14
¾Number of networks = 214 – 1 = 16,383
• Host bits: 16
¾Number of hosts = 216 – 2 = 65,534
• Address range:
¾128.0.0.0 to 191.255.255.255
13
Class C Address
• Network bits : 21
¾Number of networks = 221 – 1 = 2,097,151
• Host bits: 8
¾Number of hosts = 28 – 2 = 254
• Address range:
¾192.0.0.0 to 223.255.255.255
Class D Address
• Address range:
¾224.0.0.0 to 239.255.255.255
14
Address Distribution
A 2 billion
B 1 billion
C 500 million
Special-purpose IP Addresses
15
Some Conventions
16
SOLUTIONS TO QUIZ
QUESTIONS ON
LECTURE 3
32 bits
48 bits
17
Quiz Solutions on Lecture 3
It identifies an application/server
running on the designated machine. It
is an 8-bit number.
18
Quiz Solutions on Lecture 3
19
Quiz Solutions on Lecture 3
20
Quiz Solutions on Lecture 3
20 bytes, 60 bytes
21
Quiz Solutions on Lecture 3
6, because 6x32=192.
22
QUIZ QUESTIONS ON
LECTURE 4
23
Quiz Questions on Lecture 4
4. A packet has arrived at the destination
with the M bit as zero. What can you say
about the packet?
5. A packet has arrived at the destination
with the M bit as one. What can you say
about the packet?
6. A packet has arrived at the destination
with the M bit as one, and also the
fragment offset field as zero. What can
you say about the packet?
7. A packet has arrived at the destination
with the fragment offset field as 500.
What can you say about the packet?
24
Quiz Questions on Lecture 4
25
Indian Institute of Technology Kharagpur
26