Internet Protocol Version 4
(IPv4)
Chapter 7
Position of IP in TCP/IP Protocol Suite
2
IP Datagram
3
Fragmentation
IP datagram
Header MTU Trailer
Maximum length of data that can be encapsulated in a frame
Frame
Flags Field
4
Protocol Field
5
Header Checksum
Receiver
Section 1 n bits
Section 2 n bits
..............
Checksum n bits
..............
n bits Section k n bits
Checksum
Packet Sum n bits
Complement
If the result is 0, keep;
n bits otherwise, discard.
Result
6
Service Type
x x x 0 0 0 x x x x x 0
Precedence x x x x 1 1
interpretation
x x x x 0 1
Differential service
interpretation
7
Options
Option Format
8 bits 8 bits Variable length
Type Length Value
Number
Class 00000 End of option
00001 No operation
Copy 00 Datagram control 00011 Loose source route
01 Reserved 00100 Timestamp
0 Copy only in first fragment 10 Debugging and management 00111 Record route
1 Copy into all fragments 11 Reserved 01001 Strict source route
8
No-Operation Option
9
End-of-Option Option
10
Record-Route Option
Used to record the routers that handle the datagram
11
Record-Route Example
Source: 67.34.30.6 Destination: 138.6.25.40
7 15 4 7 15 8 7 15 12 7 15 16
140.10.6.3 140.10.6.3 140.10.6.3
200.14.7.9 200.14.7.9
138.6.22.26
67.34.30.6 138.6.25.40
67.14.10.22
138.6.22.26
200.14.7.14
140.10.6.3
140.10.5.4
67.0.0.0/24 140.10.0.0/16 200.14.7.9 200.14.7.0/24 138.6.0.0/16
Network Network Network Network
12
Strict-Source-Route Option
Used to predetermine a route for the datagram
All routers in the list must be visited by the datagram
A router must not be visited if it is not listed
13
Strict-Source-Route Example
Source: 67.34.30.6 Destination: 138.6.25.40
Source: 67.34.30.6 Source: 67.34.30.6 Source: 67.34.30.6 Source: 67.34.30.6
Destination: 67.14.10.22 Destination:140.10.5.4 Destination:200.14.7.14 Destination:138.6.25.40
137 15 4 137 15 88
137 137 15 12
137 12 137 15 16
137 16
140.10.5.4 67.14.10.22 67.14.10.22 67.14.10.22
200.14.7.14 140.10.6.3
200.14.7.14 140.10.6.3
140.10.5.4 140.10.6.3
140.10.5.4
138.6.25.40 200.14.7.14
138.6.25.40 200.14.7.9
138.6.25.40 200.14.7.14
200.14.7.9
138.6.25.40 138.6.25.40 138.6.22.26
67.34.30.6 138.6.25.40
67.14.10.22
138.6.22.26
200.14.7.14
140.10.6.3
140.10.5.4
200.14.7.9
67.0.0.0/24 140.10.0.0/16 200.14.7.0/24 138.6.0.0/16
Network Network Network Network
14
Loose-Source-Route Option
Similar to strict source route, but more relaxed
Each router in the list must be visited by the datagram
Datagram can visit other routers as well
15
Timestamp Option
Used to record the time of datagram processing by a
router
16
Use of Flags in Timestamp
17
Timestamp Example
Source: 67.34.30.6 Destination: 138.6.25.40
68 28 5 0 1 68 28 13 0 1 68 28 21 0 1 68 28 29 0 1
140.10.6.3 140.10.6.3 140.10.6.3
36000000 36000000 36000000
200.14.7.9 200.14.7.9
36000012 36000012
138.6.22.26
36000020
67.34.30.6 138.6.25.40
67.14.10.22
138.6.22.26
200.14.7.14
140.10.6.3
140.10.5.4
200.14.7.9
67.0.0.0/24 140.10.0.0/16 200.14.7.0/24 138.6.0.0/16
Network Network Network Network
18