0% found this document useful (0 votes)
14 views

ch3_ip

Uploaded by

sjf65309
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

ch3_ip

Uploaded by

sjf65309
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

IP - The Internet Protocol

Presenter: Assoc.Prof.Dr. Fatih ABUT

▪ Introduction
▪ IP Addressing
▪ Subnetting
▪ Variable Length Subnet Mask (VLSM)
Orientation

• IP (Internet Protocol) is a Network Layer Protocol.

TCP UDP Transport


Layer

Network
ICMP IP IGMP
Layer

Network
ARP Link Layer
Access

Media

• IP’s current version is Version 6 (IPv6).

2
IP: The waist of the hourglass

• IP is the waist of the


hourglass of the Internet Applications
protocol architecture
HTTP FTP SMTP

TCP UDP
• Multiple higher-layer protocols
• Multiple lower-layer protocols IP

• Only one protocol at the Data link layer


protocols
network layer.
Physical layer
protocols

3
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:

• Higher layer protocols have to deal with losses or with duplicate


packets

• Packets may be delivered out-of-sequence


4
IP Addresses

 An IP address is an address used to uniquely identify a


device on an IP network.
 The address is made up of 32 binary bits which can be
divisible into a network portion and host portion with the help
of a subnet mask.
 32 binary bits are broken into four octets (1 octet = 8 bits)
 Dotted decimal format (for example, 172.16.81.100)

5
IP Address Classes

6
IP Address Classes

• Class A: The first octet is the network portion. Octets 2, 3,


and 4 are for subnets/hosts
• Class B: The first two octets are the network portion. Octets 3
and 4 are for subnets/hosts
• Class C: The first three octets are the network portion. Octet 4
is for subnets/hosts

7
Private Address Range

Address Class Reserved Address Space


Class A 10.0.0.0 - 10.255.255.255
Class B 172.16.0.0 - 172.31.255.255
Class C 192.168.0.0 - 192.168.255.255

8
Network/Subnet Masks

• Distinguishes which portion of the address identifies the


network and which portion of the address identifies the
node.
• Default masks:
➢ Class A: 255.0.0.0/8
➢ Class B: 255.255.0.0/16
➢ Class C: 255.255.255.0/24

9
Subnetting

 Creates multiple logical networks that exist within a single


Class A, B, or C network.
 If you do not subnet, you will only be able to use one network
from your Class A, B, or C network, which is unrealistic
 Each data link on a network must have a unique network ID,
with every node on that link being a member of the same
network

Example

10
Benefits of Subnetting

1) Reduced network traffic


2) Optimized network performance
3) Simplified management
4) Facilitated spanning of large geographical distances

11
IP Service

• IP supports the following services:


• one-to-one (unicast)
• one-to-all (broadcast)
• one-to-several (multicast)

unicast
broadcast multicast

• IP multicast requires support of other protocols (IGMP, multicast routing)

12
IP Datagram Format
bit # 0 7 8 15 16 23 24 31
header
version DS ECN total length (in bytes)
length
D M
Identification 0 Fragment offset
F F
time-to-live (TTL) protocol header checksum

source IP address

destination IP address

options (0 to 40 bytes)

payload

4 bytes

• 20 bytes ≤ Header Size < 24 x 4 bytes = 60 bytes


• 20 bytes ≤ Total Length < 216 bytes = 65536 bytes
13
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
14
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

15
Fields of the IP Header

• Time To Live (TTL) (1 byte):


– Specifies longest paths before datagram is dropped
– Role of TTL field: Ensure that packet is eventually dropped
when a routing loop occurs
Used as follows:
– Sender sets the value (e.g., 64)
– Each router decrements the value by 1
– When the value reaches 0, the datagram is dropped

16
Fields of the IP Header

• Protocol (1 byte):
• Specifies the higher-layer protocol.
4 = IP-in-IP
• Used for demultiplexing to higher layers. encapsulation

6 = TCP 17 = UDP

1 = ICMP 2 = IGMP

IP

• Header checksum (2 bytes): A simple 16-bit long checksum


which is computed for the header of the datagram.
17
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
18
Maximum Transmission Unit
• Maximum size of IP datagram is 65535, but the data link layer protocol
generally imposes a limit that is much smaller

• Example:
– Ethernet frames have a maximum payload of 1500 bytes
→ IP datagrams encapsulated in Ethernet frame cannot be longer than
1500 bytes

• The limit on the maximum IP datagram size, imposed by the data link
protocol is called maximum transmission unit (MTU)

• MTUs for various data link protocols:


Ethernet: 1500 FDDI: 4352
802.3: 1492 ATM AAL5: 9180
802.5: 4464 PPP: negotiated
19
IP Fragmentation

• 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?

Ethernet
FDDI
Ring
Host A Router Host B
MTUs: FDDI: 4352 Ethernet: 1500

• Fragmentation:
• IP router splits the datagram into several datagram
• Fragments are reassembled at receiver
20
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 !!

IP datagram H Fragment 2 H2 Fragment 1 H1

Router

21
What’s involved in Fragmentation?

• The following fields in the IP


header are involved:
header
version
length
DS ECN total length (in bytes)
DM
Identification 0 Fragment offset
F F
time-to-live (TTL) protocol header checksum

Identification When a datagram is fragmented, the


identification is the same in all fragments
Flags
DF bit is set: Datagram cannot be fragmented and must
be discarded if MTU is too small
MF bit set: This datagram is part of a fragment and an
additional fragment follows this one 22
What’s involved in Fragmentation?

• The following fields in the IP


header are involved:
header
version
length
DS ECN total length (in bytes)
DM
Identification 0 Fragment offset
F F
time-to-live (TTL) protocol header checksum

Fragment offset Offset of the payload of the current


fragment in the original datagram
Total length Total length of the current fragment

23
VLSM Subnetting

• Using classful subnetting wastes IP addresses


• The number of hosts involved in each subnet must of same
size
• Create a number of subnet masks that suit our needs more
efficiently than a classful subnetting scheme could

Example

24

You might also like