IP Addressing
IP Addressing
IP Addressing
Makerere University Business School
www.mubs.ac.ug
Structure of an IP address
Classful IP addresses
Limitations and problems with classful IP addresses
CIDR
IP Version 4 Vs IP V6 addresses
What is an IP Address?
An IP address:
- is a 32 bit long identifier
- encodes a network number (network prefix)
and a host number
IP address
4
Why Address
6
Logical Addressing: IP
7
Logical Addressing: IP
8
Binary and Decimal Conversion
9
IP address cont’d…
If you add all the positions together, you get 32, which is why IP
Since each of the eight positions can have two different states (1 or 0) the
Combine 4 octets & you get 232 or a possible 4,294,967,296 unique values!
10
Network prefix and host number
Example:
10000000 10001111 10001001 10010000
1st Byte 2nd Byte 3rd Byte 4th Byte
= 128 = 143 = 137 = 144
128.143.137.144
Special IP Addresses
Reserved or (by convention) special addresses:
Loopback interfaces
all addresses 127.0.0.1-127.255.255.255 are reserved for loopback interfaces
Most systems use 127.0.0.1 as loopback address
loopback interface is associated with name “localhost”
IP address of a network
Host number is set to all zeros, e.g., 128.143.0.0
Broadcast address
Host number is all ones, e.g., 128.143.255.255
Broadcast goes to all hosts on the network
Often ignored due to security concerns
Test / Experimental addresses
Certain address ranges are reserved for “experimental use”. Packets should get dropped if they
contain this destination address (see RFC 1918):
10.0.0.0 - 10.255.255.255
172.16.0.0 - 172.31.255.255
192.168.0.0 - 192.168.255.255
Convention (but not a reserved address)
Default gateway has host number set to ‘1’, e.g., e.g., 192.0.1.1
Classful IP Adresses (Until 1993)
bit # 0 1 7 8 31
Class A 0
Network Prefix Host Number
8 bits 24 bits
bit # 0 1 2 15 16 31
bit # 0 1 2 3 23 24 31
bit # 0 1 2 3 4 31
bit # 0 1 2 3 4 5 31
Other problems:
– Too few network addresses for large networks
• Class A and Class B addresses were gone
– Limited flexibility for network addresses:
• Class A and B addresses are overkill (>64,000 addresses)
• Class C address is insufficient (requires 40 Class C addresses)
CIDR - Classless Interdomain Routing
• Goals:
– New interpretation of the IP address space
– Restructure IP address assignments to increase efficiency
– Permits route aggregation to minimize route table entries
• CIDR notation can replace the use of subnetmasks (but is more general)
– IP address 128.143.137.144 and subnetmask 255.255.255.0 becomes
128.143.137.144/24
Example:
• Assume that an ISP owns the address block 206.0.64.0/18, which
represents 16,384 (214) IP addresses
• Suppose a client requires 800 host addresses
• With classful addresses: need to assign a class B address (and
waste ~64,700 addresses) or four individual Class Cs (and introducing 4
new routes into the global Internet routing tables)
• With CIDR: Assign a /22 block, e.g., 206.0.68.0/22, and allocated a
block of 1,024 (210) IP addresses.
CIDR and Routing
Prefix Interface
What is the outgoing interface for
128.0.0.0/4 interface #5
128.143.137.0/24 ?
128.128.0.0/9 interface #2
128.143.128.0/17 interface #1
Makerere Univ :
206.0.68.0/22
ISP X owns:
206.0.64.0/18
204.188.0.0/15
209.88.232.0/21
Internet
Backbone MTN as an
ISP :
209.88.237.0/24
• IP Version 6
– Is the successor to the currently used IPv4
– Specification completed in 1994
– Makes improvements to IPv4 (no revolutionary changes)