IPv4 Addresses
Internet Protocol: Which version?
There are currently two versions of the Internet Protocol in use for the Internet
• IPv4 (IP Version 4)• Specified in 1980/81 (RFC 760, 791)• Four byte addresses• Universally deployed• Problem: Address space almost exhausted
• IPv6 (IP Version 6)• Specification from 1998 (RFC 2460)• Significant differences to IPv4, but not fundamental changes• 16-byte addresses• Problem: Not widely used (yet?)
Slow adoption of IPv6
• IPv6 is available since 15 years, and almost all operating systems now support it
• But IPv6 is not yet widely adopted
• Measurements at Internet Exchange Point in Amsterdam:
linear semi-log
Slow adoption of IPv6
• IPv6 is available since 15 years, and almost all operating systems now support it
• But IPv6 is not yet widely adopted
• Measurements at Internet Exchange Point in Amsterdam:
linear
ECE 461: IPv4 based
We use IPv4 throughout in lecture, labs, and assignment
IPv6 concepts are discussed in the lecture
IPv4 Addresses
Application dataTCP HeaderEthernet Header
Ethernet frame
IP Header
version(4 bits)
headerlength
Type of Service/TOS(8 bits)
Total Length (in bytes)(16 bits)
Identification (16 bits)flags
(3 bits)Fragment Offset (13 bits)
Source IP address (32 bits)
Destination IP address (32 bits)
TTL Time-to-Live(8 bits)
Protocol(8 bits)
Header Checksum (16 bits)
32 bits
IPv4 Addresses
Application dataTCP HeaderEthernet Header
Ethernet frame
IP Header
0x4 0x5 0x00 4410
9d08 0102 00000000000002
128.143.137.144
128.143.71.21
12810 0x06 8bff
32 bits
IP Addresses
• An IPv4 address is an address of the Internet Protocol Version 4. When the version is understood from the context we only say “IP address”
• On the public Internet, an IP address is unique global address of a network interface
• The IP address is used by hosts and routers for delivery of IP datagrams
Dotted Decimal Notation
• IPv4 addresses are written using dotted decimal notation:– Each byte is identified by a decimal number in the range
[0..255], separated by periods (`dots’).
• Example:
110010010000000 00001011 001111001st Byte
= 128
2nd Byte
= 100
3rd Byte
= 11
4th Byte
= 60
128.100.11.60
• IP address consists of a network prefix and a host number
– Network prefix identifies a particular network– Host number identifies an interface on the network
• The delivery of a packet from a sender to the destination proceeds in 2 steps:
1. Use network prefix to deliver packet to the right network
2. Once the network is found, use the host number to deliver packet to the right interface
• How can you determine the length of the network prefix?
Structure of an IP address
network prefix host number
• The length of the network prefix must be provided in addition to the numerical value of the address
• There are two conventions for indicating the length:1. Add length of the network prefix to address
(“prefix notation”, “slash notation”, “CIDR notation”)
2. Add bitmask of the network prefix in dotted decimal notation (“netmask”)
Length of network prefix
network prefix host number
32 bits
Length of network prefix
• Example: Suppose the network prefix is 16 bits long
• Prefix notation: 128.100.11.60/16
• Netmask notation: 128.100.11.60255.255.0.0
Notation of IP address
255 0 0
128.100 11.60
network prefix host number
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
255
netmask
Special IP Addresses
• IP address of a network – Host number is set to all zeros, e.g., 128.100.0.0
• Broadcast address– Host number is set to all ones, e.g., 128.100.255.255– Broadcast goes to all hosts on the network – The address 255.255.255.255 is a broadcast on the local
network
• Convention for default gateway (but not a reserved address): – Default gateway has host number set to ‘1’, e.g., 128.100.0.1
Reserved Network Prefixes
• Loopback interfaces:
127.0.0.0/8– Most systems use 127.0.0.1 as loopback address– A host can send a packet to itself by sending it to address 127.0.0.1
• Link Local Addresses:
169.254.0.0/16– Also referred to as auto-configuration– When a system cannot acquire an IP address, it selects a random
address from the range (it tests whether the address is in use)– Packets from this address are not forwarded to other networks
• Private networks: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16– Private networks are IP networks that are not part of the public Internet– IP addresses need to be unique only within the same private network
• Systems on different private networks can re-use addresses– When packets cross between private network and public Internet, IP
addresses in header must be modified
Network Prefix and Address Block
• The IP address of a network has the host number set to 0:128.100.0.0
• Network address with prefix length is called network prefix:
128.100.0.0/16 or 128.100/16
• A network prefix is interpreted as a range of IP addresses:128.100.0.0/16 128.100.0.0–128.100.255.255– A network prefix is also called address block– It provides the range of addresses allowed on the network– The shorter the network prefix, the larger the address block
Network prefix length and address block size
Network Prefix # of IP Addresses
/32 1/31 2 /30 4… … /24 256/23 512/22 1,024/21 2,048/20 4,096 … …
/16 65,536 … …
/8 16,777,216… …
/2 1,073,741,824/1 2,147,483,648
• To set up a network of a given size, one needs to acquire a address block with a sufficient number of addresses
How does one get an IP network address?
• Internet Assigned Number Authorities (IANA) manages the global IP address space.
• IANA allocates addresses to Regional Internet Registries (RIR) – IANA allocates addresses in /8 address blocks– All available blocks have been allocated. The last available address block was assigned
in 2011
IANA
End user
allocates allocates
assigns
End user
assignsRIR
LIR(ISP)
How does one get an IP network address?
• RIR allocates addresses to Local Internet Registries (LIR)– LIRs are generally Internet Service Providers– Block sizes are /20 or larger
• End users obtain addresses from an RIR or LIR• Some countries have National Internet Registries (NIR), which are
between the RIR and LIR levels
IANA
End user
allocates allocates
assigns
End user
assignsRIR
LIR(ISP)
Regional Internet Registries
• There are five Regional Internet Registries, each responsible for managing the address space of a large geographic area
• Address blocks managed by the RIRs are listed at:http://www.iana.org/assignments/ipv4-address-space/ipv4-address-space.xml
Available IPv4 addresses (9/2012)
• RIRs are running low on IP addresses:
(one /8 address block ≈16.8 million IP addresses)
• Current status of remaining IP addresses:
Source: http://www.potaroo.net/tools/ipv4/index.html
(2012) Addresses in RIR Pool (/8s)
Approximate number of Addresses
APNIC 0.9138 ≈ 15 million
RIPENCC 1.1984 ≈ 20 million
ARIN 3.3656 ≈ 56 million
LACNIC 3.2246 ≈ 54 million
AFRINIC 4.1441 ≈ 70 million
(2013) Addresses in RIR Pool (/8s)
Approximate number of Addresses
APNIC 0.8363 ≈ 14 million
RIPENCC 0.8681 ≈ 14.5 million
ARIN 1.8219 ≈ 30 million
LACNIC 1.9690 ≈ 33 million
AFRINIC 3.6389 ≈ 61 million
IPv4 exhaustion and Migration to IPv6
• The vast majority of IPv4 addresses are used up
IPv4 exhaustion• Adoption of IPv6 is driven by IPv4 exhaustion:
– There have been numerous predictions of imminent IPv4 exhaustion– People have been creative with slowing down IPv4 exhaustion through
policies and protocols– IPv4 exhaustion will occur gradually, but is increasingly urgent
• As IPv4 addresses become less available, the use of IPv6 is expected to increase substantially
– The migration from IPv4 to IPv6 is expected to be a slow transition, lasting a decade or more
– Until then, IPv4 and IPv6 will co-exist
Classful IP Addresses
• When Internet addresses were standardized (early 1980s), the Internet address space was divided up into classes
• Three classes available for interfaces:– Class A: Network prefix is 8 bits long– Class B: Network prefix is 16 bits long– Class C: Network prefix is 24 bits long
•Two additional classes:– Class D: Used (multicast) group addresses– Class E: Reserved for future use
Classful IP Addresses
• The classes were identified by the bit values of the IP address– Class A: IP address starts with “0”– Class B: IP address starts with “10”– Class C: IP address starts with “110”
– Class D: IP address starts with “1110”– Class E: IP address starts with “11110”
• The length of the network prefix is implied by the address • There is no need to provide the length of the network prefix
Classful IP Addresses
Class C network id host11 0
Network Prefix24 bits
Host Number8 bits
bit # 0 1 23 242 313
Class B 1 network id host
bit # 0 1 15 162
Network Prefix16 bits
Host Number16 bits
031
Class A 0Network Prefix
8 bits
bit # 0 1 7 8
Host Number24 bits
31
Class D multicast group id11 1bit # 0 1 2 313
04
Class E (reserved for future use)11 1bit # 0 1 2 313
1
Classful IP Addresses
• We will learn about multicast addresses later in this course• Class E addresses have never been released for use
IP Allocation with Classful IP Addresses
• Limited flexibility for obtaining a network address:Class C: ≤ 224 - 2 = 254 IP addresses:
Class B: ≤ 216 - 2 = 65534 IP addresses
Class A: ≤ 224 - 2 = 16,772,214 IP addresses
• Too few network addresses for large networks 27 = 128 Class A networks
214 = 16,384 Class B networks
• Flat address space. Routing tables in the backbone Internet need one entry for each network address.
Class C networks: up to 221 = 2,097,152 entries
By 1993, the lookup time of routing tables had become a bottleneck for Internet performance
Allocation of Classful Addresses
From Classful to Classless
• In 1993, there was a major shift for interpreting and allocating IP addresses:
until 1993:
Classful Addresses
until 1993:
Classful Addresses
after 1993:
Classless Interdomain
Routing(CIDR)
after 1993:
Classless Interdomain
Routing(CIDR)
CIDR - Classless Interdomain Routing
• CIDR abandons the notion of classes• Key Concept: The length of the network prefix of IP
addresses can be any value
• Consequences: • Since the length of the network prefix is no longer
implied by the address, the size of the network prefix must be provided with an IP address ( CIDR notation)
• Hierarchical routing aggregation introduces dependency of IP addresses to service provider
• Need for new lookup algorithms for routing tables
Division of IPv4 address space
00000…00
Class A(231 addresses)
10000…00Class B
(230 addresses)
Class C (229 addresses)11000…00
Class D (228 addresses)11100…00
unused addresses
Class E (228 addresses)11110…00