IP addressing 2
Dariusz Dwornikowski,
Andrzej Stroiński
Problems
Subnetting
A company has been given one network address.
The company has 4 buildings.
How to allocate addresses ?
How to separate networks ?
The solution is to divide one network into few smaller ones.
Equal length subnetting
Network part
Computer part
Network part
Computer part
New network part
Borrowed bits
Example
Divide 150.10.0.0/16 into 4 subnets:
00 - the first one
01 - the second one
10 - the third one
11 - the fourth one
Example
Network part
Computer part 16 bits
Network part
Computer part 14 bits
- -
Two bits size
Before
After
Example: First subnet
Network part
Computer part (14 bits)
0 0
Example: First subnet
Example
Subnet number | Address | Mask | Range | Bcast |
00 | 150.10.0.0 | 255.255.192.0 | 150.10.0.1-150.10.63.254 | 150.10.63.255 |
01 | 150.10.64.0 | 255.255.192.0 | 150.10.64.1-150.10.127.254 | 150.10.127.255 |
10 | 150.10.128.0 | 255.255.192.0 | 150.10.128.1-150.10.191.254 | 150.10.191.255 |
11 | 150.10.192.0 | 255.255.192.0 | 150.10.192.1-150.10.255.254 | 150.10.255.255 |
Example: solution
Unequal subnetting (VLSM)
Variable Length Subnet Mask (VLSM)
Solution: multiple subnetting, divide to smaller subnets, then divide these subnets again.
VLSM Example
Let's divide 150.10.64.0/18 into 4 more subnets.
Subnet number | Address | Mask | Range | Bcast |
00 | 150.10.0.0 | 255.255.192.0 | 150.10.0.1-150.10.63.254 | 150.10.63.255 |
01 | 150.10.64.0 | 255.255.192.0 | 150.10.64.1-150.10.127.254 | 150.10.127.255 |
10 | 150.10.128.0 | 255.255.192.0 | 150.10.128.1-150.10.191.254 | 150.10.191.255 |
11 | 150.10.192.0 | 255.255.192.0 | 150.10.192.1-150.10.255.254 | 150.10.255.255 |
VLSM Example
150.10.0.0/18
150.10.128.0/18
150.10.192.0/18
150.10.64.0/20
150.10.80.0/20
150.10.96.0/20
150.10.112.0/20
This way routers outside 150.10.0.0/16 can have only one entry in their routing tables
Routes to subnets need to be handled inside the network (supernet).
VLSM - applicability condition
lets assume that routers R1 and R2 are using RIP algorithm in order to designate routing paths
used VSLM network is 100.0.0.0/8
Problem:
Solution:
VLSM usability condition
VLSM can only be used in routing protocols which announce IP address with its mask.
RIP v2
OSPF
EIGRP
CIDR (Classless Inter-Domain Routing)
CIDR allocation
In classful allocation - small flexibility:
A class - /8 mask - over 16 million addresses
B class - /16 mask - 65536 addresses
C class - /24 mask - 256 addresses
CIDR allocates according to the need:
/27 - 32 addresses
/26 - 64 addresses
...
/13 - 524288 addresses
CIDR aggregation
Example:
200.1.0.0/24 11001000.00000001.000000 00.00000000
200.1.1.0/24 11001000.00000001.000000 01.00000000
200.1.2.0/24 11001000.00000001.000000 10.00000000
200.1.3.0/24 11001000.00000001.000000 11.00000000
Supernet address: 200.1.0.0/22
CIDR aggregation
dest
mask
gateway
dest
mask
gateway
CIDR aggregation
Example:
200.1.48.0/24 - 200.1.79.0/24
Aggregates to:
200.1.48.0/20 for (200.1.48.0 - 200.1.63.0)
and
200.1.64.0/20 for (200.1.64.0 - 200.1.79.0)
first aggregation
second aggregation
Exercises:
Diagram for ex. 3
R1
R2
R3
R4
200.200.50.0/23
100
120
70
50
30
30