Professional Documents
Culture Documents
Network Layer - IP
Network Layer - IP
Network Layer - IP
IP protocol
● IP Protocol: Needed functionality
– IP Protocol: Packet format, addressing
– Forwarding
– Routing
– Error reporting and host signaling
● Focus: Packet Format and Fragmentation and
re-assembly
Packet Format
32 Bits
• Version: Specifies the 0 4 8 16 19 31
Type of
version of the protocol Ver HL
Service
Total Length
Fla Fragment
Identification Offset
gs
– IPv4, IPv6 Time to Upper
Live Header Checksum
Layer
• Header Length: Source IP Address
Specifies the header in Destination IP Address
32-bit words Options
Destination IP Address
Options
Source IP Address
– Physical Networks may
not support large packets Destination IP Address
Options
– Need Fragmentation and
reassembly (more on it Data (Variable Length)
soon)
Packet Format
• Time to Live: Helps catch 0 4 8
32 Bits
16 19 31
packets doing rounds Ver HL
Type of
Total Length
Service
Fla Fragment
Identification Offset
gs
Time to Upper
Live Header Checksum
Layer
Source IP Address
Destination IP Address
Options
Source IP Address
– Routers decrement the
field by one before Destination IP Address
Source IP Address
– TCP: 6, UDP: 17
Destination IP Address
• Checksum (Internet): Options
Detects errors in header
Data (Variable Length)
Packet Format
32 Bits
16 19 31
• Source/Destination IP 0
Ver
4
HL
8
Type of
Total Length
Service
address: 32-bit Fla Fragment
Identification Offset
gs
– Destination key to Time to
Live Protocol Header Checksum
forwarding Source IP Address
independent of physical
Data (Variable Length)
network address (MAC)
Packet Format
32 Bits
0 4 8 16 19 31
• Options: Rarely used Ver HL
Type of
Service
Total Length
Fla Fragment
– Record Time stamp Identification
gs Offset
Time to
Protocol Header Checksum
– Record route taken Live
Source IP Address
– Specify source route
Destination IP Address
• Data/Payload: Higher Options
Layer Data (TCP or UDP
segment) Data (Variable Length)
Fragmentation and Reassembly
Fragmentation and Reassembly
• Goal: Interconnect heterogeneous networks
• Problem: Each technology has different Maximum
Transmission Unit (MTU) size
– MTU: Largest IP datagram that can be carried in a
frame
– E.g. Ethernet: 1500, FDDI: 4352, PPP: 296
(Negotiable), WiFi: 7981
• At host: Select MTU of link it is connected to
Note: Above values not true in practice due to Offset field having
to be a multiple of 8
Fragmentation Fields
• Identification: Helps identify a datagram
– All fragments carry same identification
• Flags: 3 bits Identification Flags
Fragment
Offset
Fragment
Identification Flags Offset
Example
Original Datagram
• Original datagram:
Length=1500 ID=x Fragflag=0 Offset=0
1500B