0% found this document useful (0 votes)
24 views24 pages

IPAddressing

The document discusses IP addressing and routing. It covers topics like IP addressing notation, prefixes, subnets, longest prefix matching, aggregation, and challenges in routing tables looking up IP addresses based on variable length prefixes. The document is intended as lecture material on these fundamental networking concepts.

Uploaded by

dayyanali789
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views24 pages

IPAddressing

The document discusses IP addressing and routing. It covers topics like IP addressing notation, prefixes, subnets, longest prefix matching, aggregation, and challenges in routing tables looking up IP addresses based on variable length prefixes. The document is intended as lecture material on these fundamental networking concepts.

Uploaded by

dayyanali789
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

CS 382: Network-Centric Computing

IP Addressing

Zartash Afzal Uzmi


Spring 2023-24

ACK: Slides use some material from Scott Shenker (UC Berkeley) and Jim Kurose (UMass)
Agenda
⚫ IP Addressing
⚫ Notation
⚫ Prefixes
⚫ Subnets
⚫ Longest Prefix Matching

⚫ Next: Intro to Border Gateway Protocol


⚫ Internet Scale Routing

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

IP Address 11001011 01101100 01011010 01111011


Network (or subnet) Part Host Part
Prefix 11001011 01101100 01011000 00000000
⚫ Prefix notation: 203.108.88.0/21 (host part zero: last 11 bits)
⚫ All 211 IP addresses represented by this prefix have the same network part

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

⚫ Prefix = IP address AND Mask


⚫ IP address and mask: Both configured in your network settings
⚫ The sender determines if the destination is in the “local” network
⚫ If it is not, a router must be involved to deliver the packet
6
So What is Aggregation?
⚫ A router would aggregate the IP addresses of “connected” hosts
⚫ Will announce/advertise a prefix: “I will take care of this prefix (all hosts)”
⚫ An upstream router may further aggregate
⚫ Aggregate multiple prefixes into a shorter prefix
⚫ Will advertise that shorter prefix: more hosts
⚫ In practice:
⚫ What will an SSE router announce? And to whom?
⚫ What will a LUMS router announce?
⚫ What will a PTCL router in Lahore announce?
⚫ What will a PTCL router (in Karachi) announce out of Pakistan?
⚫ What about a SingTel or PCCW router?
7
Prefix Announcement and Allocation
Entire IP space Where does SSE get its IP addresses from?
From the LUMS pool, which gets from?
PTCL-Lahore pool, which gets from?
PTCL-PK pool, which gets from?
SingTel or PCCW pool?
Or even from APNIC?
APNIC gets from ICANN
Shorter prefixes PTCL-PK

As you move up the tree

LUMS Prefix

SSE Prefix
0000 … 000 1111 … 111
SSE

Leaves are IP addresses LUMS


8

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!

⚫ Multi-class addressing – also obsolete


⚫ Class A: 8-bit network part, 24 bits for the host part, starting bit 0
⚫ Class B: 16-bit network part, 16 bits for the host part, starting bits 10
⚫ Class C: 24-bit network part, 8 bits for the host part, starting bits 110

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

⚫ Class B: first byte in [128..191]  assume /16 (starting bits = 10)


~16K nets
10****** ******** ******** ******** 25% of the entire
~65K addresses
⚫ Large blocks IP address space

⚫ Class C: [192..223]  assume /24 (starting bits = 110)


110***** ******** ******** ******** ~2M nets 1/8 of the entire IP
~256 addresses address space
⚫ Small blocks

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

⚫ Variable length subnet/network part


⚫ How does a provider get the subnet part (group of IP addresses)?
⚫ From its upstream provider or directly from numbering bodies (RIRs)

⚫ The remaining bits are for hosts to choose from, uniquely


⚫ Do hosts really choose those bits? They need a complete IP address
⚫ Hosts typically get IP addresses from a DHCP server

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)

⚫ But routers only see the destination 16-bit Identification


3-bit
Flags 13-bit Fragment Offset
IP address 8-bit Time to
8-bit Protocol 16-bit Header Checksum
⚫ Not the subnet and host part Live (TTL)

⚫ How will the lookup work? 32-bit Source IP Address

⚫ Just match the prefix


32-bit Destination IP Address
⚫ After all: A packet in Europe destined
for any host in LUMS should follow the Options (if any)
same path
⚫ Will this work? Payload

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.

Destination Address Range Link interface

11001000 00010111 00010*** ******** 0

11001000 00010111 00011000 ******** 1

11001000 00010111 00011*** ******** 2

otherwise 3

11001000 00010111 00010110 10100001 which interface?


examples: 14
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.

Destination Address Range Link interface

11001000 00010111 00010*** ******** 0

11001000 00010111 00011000 ******** 1

11001000 match!
00010111 00011*** ******** 2

otherwise 3

11001000 00010111 00010110 10100001 which interface?


examples: 15
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.

Destination Address Range Link interface

11001000 00010111 00010*** ******** 0

11001000 00010111 00011000 ******** 1

11001000 00010111 00011*** ******** 2

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.

Destination Address Range Link interface

11001000 00010111 00010*** ******** 0

11001000 00010111 00011000 ******** 1

11001000 00010111 00011*** ******** 2

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)

This is called hierarchical addressing – it allows efficient


advertisement of routing information via aggregation
Organization 0
200.23.16.0/23
Organization 1
“Send me anything
200.23.18.0/23 with addresses
Organization 2 beginning
200.23.20.0/23 . Fly-By-Night-ISP 200.23.16.0/20”
.
. . Internet
.
Organization 7 .
200.23.30.0/23
“Send me anything
ISPs-R-Us
with addresses
beginning
199.31.0.0/16”
19
Hierarchical addressing: more specific routes
Organization 1 decides to multi-home for robust network services
However: it prefers to use a new ISP (ISPs-R-Us) unless this new ISP fails
What if Org 1 wanted to prefer Fly-By-Night-ISP (still multi-homing)?
Organization 0
200.23.16.0/23
Organization 1
“Send me anything
200.23.18.0/23 with addresses
Organization 2 beginning
200.23.20.0/23 . Fly-By-Night-ISP 200.23.16.0/20”
.
. . Internet
.
Organization 7 .
200.23.30.0/23 Routing tables out there will
“Send me anything now have two valid prefix
ISPs-R-Us
with addresses entries to reach Org 1. What
Organization 1 beginning will they choose?
199.31.0.0/16”
200.23.18.0/23 “or 200.23.18.0/23”
20
Example: Forwarding with Original Addressing
Obsolete
8 bits for the network part and
24 bits for the host part
Packet’s dst adress LUMS (obsolete now)

11001001 10001111 00000101 1101001

NUST
PTCL

Destination Next Hop FAST

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)

11001000 10001111 00000101 1101001

NUST
PTCL

Destination Next Hop FAST

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

Which Link the packet would be sent to? 22


Forwarding with CIDR (in practice now)
Arbitrary length prefixes and
subnet sizes. This is classless
Packet’s dst adress LUMS interdomain routing (CIDR)

11001001 10001111 00000101 1101001

NUST
PTCL

Destination Next Hop FAST

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?

Which Link the packet would be sent to?


23
Questions?

24

You might also like