Chapter 4 - IP Layer
Chapter 4 - IP Layer
IP Protocol
1
Introduction
IP Protocol
IP services
IP packet description
Fragmentation & Re-assemble
Addressing
ARP / RARP / BOOTP
ICMP
2
Internet Protocol (IP)
Addressing
Routing
Packets Fragmentation & reassembling
Time To Live
Congestion
Datagram
32bit addressing (IP-v4)
Error control (header only)
Security
Fault Management 4
Advantages
Datagram services
– Simple packet management
– No bottom neck
– Connection less service
Addressing (Network, Machine)
Simple
Routing is independent of the selected
route 5
Disadvantages
Limited addressing
Low security
6
IPv4 packet description
0 4 8 12 16 20 24 28 - 31
Header
Version length Type of Service Packet length
Identification Flags Fragment displacement
Time To Live Protocol ID Checksum
Source Address
Destination Address
Options Padding
Data
7
IPv4 packet description
0 Standard
4 8 IP packet
12 16 size
20 is 20
24 bytes
28 - 31
Header
Version length Type of Service Packet length
Identification Flags Fragment displacement
Time To Live Protocol ID Checksum
Source Address
Destination Address
Options Padding
Data
8
IP packet fields
Version (Value = 4 for IPv4).
Header length (IHL Internet Header Length).
Type of Service (ToS) – not used.
Total packet length.
Packet Identification.
Flags
– First bit D (Don’t Fragment);
– Second bit M (More Fragment);
– Third bit O (Qualification of packet).
Fragment displacement= TCP Fragment position if it exist
Time To Live (TTL).
Protocol (6: TCP, 17: UDP, 1: ICMP)
Error control (Header Checksum).
Source Address & Destination Address.
Options. 9
Padding.
Fragmentation & Reassembling
Problem
– Different technologies have different packet sizes
MTU (Maximum Transfer Unit)
– The source doesn’t know the path (route) to be taken by the
packet (in order to know the MTU).
The source router fragments the packet if its size is bigger then
the interface MTU.
Each fragment is a complete datagram (packet).
The destination must reassemble the fragments to obtain the
original packet.
– The fragments can be delivered in random order (the receiver
reorder the fragments).
– If a packet misses a fragment, the packet will be deleted.
No fragment retransmission is carried at IP level. 10
IP address allocation
13
IPv4 Address classes
For network administration purposes, IP addresses are divided in
classes or group of address. Each class is associated with a Subnet
Mask. The class structures ease the management of the IP
distribution.
Class A 0 N H H H
Class B 1 0 N N H H
Class C 1 1 0 N N N H
Class D 1 1 1 0 Multicast
Class E 1 1 1 1 0 Reserved
14
15
IPv4 Address classes
16
IPv4 Address classes
17
IP Addresses classes
18
IP Addresses classes
19
Address Mask
20.
IP Subnet Mask
Class Range Default
From To subnet mask
A 0.0.0.0 126 . 255 . 255 . 255 255 . 0 . 0 . 0
B 128 . 0 . 0 . 0 191 . 255 . 255 . 255 255 . 255 . 0 . 0
C 192 . 0 . 0 . 0 223 . 255 . 255 . 255 255 . 255 . 255 . 0
D 224 . 0 . 0 . 0 239 . 255 . 255 . 255
E 240 . 0 . 0 . 0 254 . 255 . 255 . 255
The subnet mask allow to distinguish between the network address and the machine
address. If the subnet is 255.0.0.0, the first eight bits represents the network address
segment, and the last 3 bytes represents the machines addresses.
A network cannot have 16’000’000 machine address, or even 64’000 without using
routers (collision, congestion…). Consequently, the A & B Classes also C class uses
rarely the default address mask.
21
Private IPs
22
Private IPs
23
Private IPs
From Class A:
– 10.0.0.0 - 10.255.255.255
From Class B:
– 172.16.0.0 - 172.31.255.255
From Class C:
– 192.168.0.0 - 192.168.255.255
There are also private addresses that can be used for the
diagnostic testing of devices. This type of private address is
known as a loopback address. The class A, 127.0.0.0 network,
is reserved for loopback addresses.
24
Classless InterDomain Routing (CIDR)
Since the parts that are used as the NetID and HostID, are
not fixed and vary from one IP to another, an additional
information is needed in order to determine the NetID as
well as the HostID.
This information is supplied in another 32-bit number called a
subnet mask.
Example:
If we take the IP 192.168.50.110 with the subnet mask
255.255.255.0, we will be able to identify that the
NetID is 192.168.50.0 and
the HostID is 0.0.0.110
26
Example: IP address
28
Classes Advantages and
Disadvantages
Advantages
– Equal analysis time
– Adaptation to the organization needs
– Help routing
Disadvantages
– Each organization might not uses its allocated
space no optimization of the IP address
– Subnet Doesn’t split the network
29
Packet delivery
– Each packet hold the destination address
– Each machine has a local routing table
1. Is the machine on the same subnet?
Yes: deliver , no: go to step 2
2. The packet is sent to the default gateway (router)
3. Go to step 1
Routing algorithms are used to optimize the number of hops and use
better the network resources.
– DV : Distance Vector
– LS : Link State
– SPF : Shortest Path First
30
Internet routing
The Internet is an hierarchy of routers (multi level of routers):
32
Physical address versus IP address
33
Address Resolution Protocol (ARP)
34
Reverse Address Resolution Protocol (RARP)
35
BOOTP
RARP variant
– RARP uses a fixed table for physical address and IP address.
37
Internet Control Message Protocol (ICMP)
Flow control
Detect inaccessible destination
Routing redirection
IP header IP Data
ICMP
Type Code ...
39
Internet Control Message Protocol (ICMP)
Application Message
ICMP
IP Datagram
ARP RARP
Data link Frame
Physical Bit 41
TCP/IP over Ethernet
IP header IP Data
42
TCP/IP Architecture
OSI Model TCP/IP
Layers Protocol TCP/IP
Architecture Protocol Suite
Application Layer Layers
data
44
IPv6 addresses
IPv6 Works with 128-bit numbers.
45
IPv6-IPv4 translating
To convert an IPv4 to an IPv6, we add 96 leading 0’s to the
32 bit IP address
Example: Convert 192.168.25.234 to IPv6 address:
192 ÷ 16 = 12 remainder 0 192 = C0
168 ÷ 16 = 10 remainder 8 168 = A8 A = 10
B = 11
25 ÷ 16 = 1 remainder 9 25 = 19 C = 12
234 ÷ 16 = 14 remainder 10 234= EA D = 13
E = 14
F = 15
192.168.25.234 0:0:0:0:0:0:C0A8:19EA
192.168.1.2 :0:0:0:0:0:0:C0A8:0102
72.212.2.1 :::::::48D4:0201
46