IPAddressing
IPAddressing
IP Addressing
ACK: Slides use some material from Scott Shenker (UC Berkeley) and Jim Kurose (UMass)
Agenda
⚫ IP Addressing
⚫ Notation
⚫ Prefixes
⚫ Subnets
⚫ Longest Prefix Matching
2
Populating Routing Tables
⚫ A host that wants to be reached must “announce” its presence
⚫ In terms of an IP address
⚫ Would it be this IP address that would get into the routing tables?
⚫ 4Billion IP addresses (much more with IPv6)
⚫ Need instant lookup in the routing table
⚫ 100B packet at 40Gb/s has 20 nanoseconds
⚫ Is it scalable to put IP addresses in the routing tables?
⚫ No. Announce prefixes instead of IP addresses. Who will do this?
⚫ A prefix represents a group of contiguous IP addresses
Who should announce a prefix? A router; but which one?
3
IP Aggregation
⚫ Example: A routing table with the following two entries
⚫ 203.108.90.123 = 11001011 01101100 01011010 01111011
⚫ 203.108.94.116 = 11001011 01101100 01011110 01110100
⚫ What is a valid possible shared prefix in this example?
⚫ The 21-bit one 11001011 01101100 01011 211 IP addresses
⚫ All 211 IP addresses are “aggregated” in this 21-bit prefix
⚫ A router announcing this prefix must know how to deliver to all these folks
⚫ For the above example:
⚫ Any prefix shorter than 21 bits will also be a valid one
⚫ Shorter prefixes represent (or cover, or aggregate) more IP addresses
4
Representing IP Addresses and Prefixes
⚫ IP Address
⚫ 203.108.90.123 = 11001011 01101100 01011010 01111011
⚫ Dotted decimal (or dotted quad) notation versus binary notation
⚫ A network part – determined by what prefix represents this IP address
⚫ A host part – indicates the variable part in a group of IP addresses
5
Subnet from an IP Address
⚫ Can you tell a specific prefix by looking at an IP address?
⚫ Not until you know the size of the subnet (bits in the prefix)
Network (or subnet) Part Host Part
11001011 01101100 01011010 01111011 IP Address
11001011 01101100 01011000 00000000 Prefix
11111111 11111111 11111000 00000000 Subnet Mask
LUMS Prefix
SSE Prefix
0000 … 000 1111 … 111
SSE
PTCL-LHR
IP Address Classes
⚫ Original design (obsolete)
⚫ 8-bit network part, 24 bits for the host part
⚫ 256 prefixes, each with 224 hosts
⚫ A prefix “represents” a network. Very few networks!
9
Classful or Multi-class Addressing
⚫ Class A: if first byte in [0..127] assume /8 (starting bit = 0)
0******* ******** ******** ******** ~128 nets Half of the entire IP
⚫ Very large blocks ~16M addresses address space
10
* There were two more classes, class D and E. But they were reserved for special purposes.
Drawbacks of Classful Addressing
⚫ Why is multi-class addressing not used anymore?
⚫ Can you identify any drawbacks of classful addressing?
⚫ Only comes in 3 sizes
⚫ Wasted address space
⚫ In particular
⚫ Depletion of class B
⚫ Any network with more than 256 hosts needs a block of class B
⚫ Or multiple class C blocks that may or may not be aggregatable!
11
Addressing in use TODAY
⚫ Classless interdomain routing (CIDR)
⚫ Not limited to just three (A, B, C) classes of IP addresses
12
Routing Challenge
4-bit 4-bit 8-bit
⚫ Routing tables contain prefixes Version Header Type of Service
Length (TOS)
16-bit Total Length (Bytes)
13
Longest prefix matching
longest prefix match
when looking for forwarding table entry for a given
destination IP address, use the longest address prefix that
matches the destination address.
otherwise 3
11001000 match!
00010111 00011*** ******** 2
otherwise 3
otherwise 3
match!
11001000 00010111 00010110 10100001 which interface?
examples: 16
11001000 00010111 00011000 10101010 which interface?
Longest prefix matching
longest prefix match
when looking for forwarding table entry for a given
destination IP address, use the longest address prefix that
matches the destination address.
otherwise 3
match!
11001000 00010111 00010110 10100001 which interface?
examples: 17
11001000 00010111 00011000 10101010 which interface?
The need for Longest Prefix Matching
18
Standard Route Aggregation
Eight organizations serviced by a single ISP (Fly-By-Night-ISP)
NUST
PTCL
124.*.*.* Link 1
201.*.*.* Link 2 Which link the packet would be sent to?
200.*.*.* Link 3
21
Forwarding with Classful/Multi-Class Addressing
Also Obsolete
Class A, B, and C with 8,16,
and 24 bits for the network
Packet’s dst adress LUMS part (also obsolete now)
NUST
PTCL
124.5.201.* Link 1
201.5.*.* Link 2 Which class of networks the destination
200.143.5.* Link 3 belongs to (i.e., A or B or C)?
NUST
PTCL
201.143.0.0/21 Link 1
201.143.4.0/22 Link 2 Are there multiple network addresses in
201.143.5.0/24 LInk3 the table that match the destination?
24