Download Internet Protocol - Internet - Lecture Slides and more Slides Internet and Information Access in PDF only on Docsity!
IP - The Internet Protocol
1
Relates to Lab 2.
A module on the Internet Protocol.
Orientation
• IP (Internet Protocol) is a Network Layer Protocol.
• IP’s current version is Version 4 (IPv4). It is specified in
RFC 891.
2
Network Layer
Link Layer
IP
ARP NetworkAccess
Media
ICMP IGMP
Transport TCP UDP Layer
Application protocol
• IP is the highest layer protocol which is
implemented at both routers and hosts
4
Application
TCP
IP
Data Link
Application
TCP
IP
Network Access
Application protocol
TCP protocol
IP protocol IP protocol
Data Link
Data Link
IP
Data Link
Data Link
IP
Data Link
Data Link
Data Link
IP protocol
Host Router Router Host
IP Service
- Delivery service of IP is minimal
- IP provide provides an unreliable connectionless best effort service (also called: “datagram service”). - Unreliable: IP does not make an attempt to recover lost packets - Connectionless: Each packet (“datagram”) is handled independently. IP is not aware that packets between hosts may be sent in a logical sequence - Best effort: IP does not make guarantees on the service (no throughput guarantee, no delay guarantee,…)
- Consequences:
5
- Higher layer protocols have to deal with losses or with duplicate packets
- Packets may be delivered out-of-sequence
IP Datagram Format
- 20 bytes ≤ Header Size < 2 4 x 4 bytes = 60 bytes
- 20 bytes ≤ Total Length < 2 16 bytes = 65536 bytes
7
version headerlength DS ECN total length (in bytes) Identification Fragment offset
source IP address destination IP address options (0 to 40 bytes)
payload
4 bytes
time-to-live (TTL) protocol header checksum
bit # 0 7 8 15 16 23 24 31
0 DF MF
IP Datagram Format
• Question: In which order are the bytes of an IP
datagram transmitted?
• Answer:
- Transmission is row by row
- For each row:
- First transmit bits 0-
- Then transmit bits 8-
- Then transmit bits 16-
- Then transmit bits 24-
• This is called network byte order or big endian
byte ordering.
- Note: Many computers (incl. Intel processors) store 32-bit words in little endian format. Others (incl. Motorola processors) use big endian.
Fields of the IP Header
• Version (4 bits) : current version is 4, next version will
be 6.
• Header length (4 bits) : length of IP header, in multiples
of 4 bytes
• DS/ECN field (1 byte)
- This field was previously called as Type-of-Service (TOS)
field. The role of this field has been re-defined, but is
“backwards compatible” to TOS interpretation
- Differentiated Service (DS) (6 bits):
- Used to specify service level (currently not supported in the Internet)
- Explicit Congestion Notification (ECN) (2 bits):
- New feedback mechanism used by TCP
Fields of the IP Header
• Identification (16 bits): Unique identification
of a datagram from a host. Incremented
whenever a datagram is transmitted
• Flags (3 bits):
– First bit always set to 0
– DF bit (Do not fragment)
– MF bit (More fragments)
Will be explained later Fragmentation
Fields of the IP Header
• Protocol (1 byte):
- Specifies the higher-layer protocol.
- Used for demultiplexing to higher layers.
13
IP
1 = ICMP 2 = IGMP
6 = TCP 17 = UDP
4 = IP-in-IP encapsulation
Fields of the IP Header
• Options:
- Security restrictions
- Record Route: each router that processes the packet adds its IP address to the header.
- Timestamp: each router that processes the packet adds its IP address and time to the header.
- (loose) Source Routing: specifies a list of routers that must be traversed.
- (strict) Source Routing: specifies a list of the only routers that can be traversed.
• Padding: Padding bytes are added to ensure
that header ends on a 4-byte boundary Docsity.com^14
IP Fragmentation
FDDI Ring Host A Router Host B
Ethernet
16
MTUs: FDDI: 4352 Ethernet: 1500
- Fragmentation :
- IP router splits the datagram into several datagram
- Fragments are reassembled at receiver
- What if the size of an IP datagram exceeds the MTU?
IP datagram is fragmented into smaller units.
- What if the route contains networks with different MTUs?
Where is Fragmentation done?
- Fragmentation can be done at the sender or at
intermediate routers
- The same datagram can be fragmented several times.
- Reassembly of original datagram is only done at
destination hosts !!
17
Router
IP datagram H Fragment 2 H2 Fragment 1 H
What’s involved in Fragmentation?
- The following fields in the IP header are involved:
version headerlength DS ECN total length (in bytes) Identification Fragment offset time-to-live (TTL) protocol header checksum
0 DF MF
19
Fragment offset Offset of the payload of the current
fragment in the original datagram
Total length Total length of the current fragment
Example of Fragmentation
- A datagram with size 2400 bytes must be fragmented according to an MTU
limit of 1000 bytes IP datagram
- Fragment 3 Fragment Router - MTU: 4000 MTU: - Fragment - Header length:
- Total length:
- Identification: 0xa - DF flag: - MF flag: - Fragment offset: - Header length: - Total length: - Identification: 0xa - DF flag: - MF flag: - fragment offset: - Header length: - Total length: - Identification: 0xa - DF flag: - MF flag: - Fragment offset: - Header length: - Total length: - Identification: 0xa - DF flag: - MF flag: - Fragment offset: