08-Supernetting File

Download Report

Transcript 08-Supernetting File

Revision of Classful IP Addressing
© Tanenbaum, Prentice Hall International
30/11/10
08-Supernetting
1
Revision of Classful IP Addressing
Class Class ID 1st Octet Networks Hosts
A
01
1-126
01111111
127
B
10
128-191
16,382
65,534
Medium Networks
C
110
192-223
2,097,152
254
Small Networks
D
1110
224-239
Multicast
E
1111
240-255
Experimental
30/11/10
126
Purpose
16,777,214 Large Networks
Loopback
08-Supernetting
2
Classless Inter-Domain Routing (CIDR)
PROBLEM 1
• Hierarchical IP address space classes are not the
right size to meet demand
• Not enough organisations want Class C addresses
with 254 hosts
• Too many organisations want Class B addresses with
65534 hosts, but they typically have nothing like as
many hosts as can be supported by Class B
• What is needed is something in between Class B and
Class C
30/11/10
08-Supernetting
3
Classless Inter-Domain Routing (CIDR)
PROBLEM 2
• ISPs typically support hundreds or thousands of different Class B
and Class C networks
• Many of the ISPs were too late to be allocated a Class A address
and hence apply for blocks of Class B and C addresses
• Without CIDR, every router on the Internet needs to have all of
these addresses in its routing tables even though they all route to
the same ISP
• Large routing tables wastes router memory and also network
bandwidth when routing information is transmitted
• Looking up addresses in large routing tables wastes router
processing time
30/11/10
08-Supernetting
4
Classless Inter-Domain Routing (CIDR)
SOLUTION
• CIDR where:
– Classful addressing is abandoned
– Network Ids no longer have to to be an integral
number of bytes long
– Routers can no longer determine the net mask
from the first few bits of the address
– Routers have to include the length of the
network ID within their routing tables
30/11/10
08-Supernetting
5
Classless Inter-Domain Routing (CIDR)
With CIDR networks are represented in
routing tables and elsewhere by an IP
address followed by a “/” and then a prefix
length that defines the length of the network
ID.
EXAMPLE:
30/11/10
192.10.64.0/19
08-Supernetting
6
Example 1: 192.10.64.0/19
An ISP has been allocated the network
address 192.10.64.0/19. What is the
network mask and what are the first and last
host addresses in the range? How many
host addresses can the ISP allocate?
30/11/10
08-Supernetting
7
Example 1:
192.10.64.0/19
The net mask for this network can be found
by setting the network ID to all 1s
Network address:
11000000 00001010 010|00000 00000000 = 192.10.64.0/19
Net mask:
11111111 11111111 111|00000 00000000 = 255.255.224.0
30/11/10
08-Supernetting
8
Example 1:
192.10.64.0/19
The network address is:
010|00000 00000000 = 192.10.64.0/19
The first network host address is:
010|00000 00000001 = 192.10.64.1
The broadcast address for the network is:
010|11111 11111111 = 192.10.95.255
The last host address for the network is:
010|11111 11111110 = 192.10.95.254
There are 213 host addresses (32 - 19 = 13) in this range.
so the ISP can allocate 8192 - 2 = 8190 host addresses
30/11/10
08-Supernetting
9
Example 2: 194.160.0.0 - 194.175.255.255
A company has been allocated the address range
194.160.0.0 to 194.175.255.255.
What network address should it use and what
prefix length?
It’s hard to see what the interesting byte is here. It
cannot be bytes 1 though, because it is the same at
both ends of the range. It is byte 2 (the first byte
that is not the same in both ends of the range).
30/11/10
08-Supernetting
10
Example 2: 194.160.0.0 - 194.175.255.255
The interesting (2nd) byte of the first address is:
16010 = 101000002
The interesting byte of the last network address is:
17510 = 101011112
Find the boundary between the network and the host
parts of the address.
It is just before the first bit that is different between the
first and last addresses i.e. after the 4th bit.
So prefix length is 12 (8 bits from 1st byte + 4 bits from
2nd byte)
30/11/10
08-Supernetting
11
Example 2: 194.160.0.0 - 194.175.255.255
Network address is:
Network mask is:
First host address is:
Last host address is:
Broadcast address is:
30/11/10
08-Supernetting
194.160.0.0/12
255.240.0.0
194.160.0.1
194.175.255.254
194.175.255.255
12
Example 2: 194.160.0.0 - 194.175.255.255
There are 12 bits used for the network ID
and 20 bits can be used for host addresses
(ie 220 – 2 = 1,048,574 addresses are
supported)
30/11/10
08-Supernetting
13
Exercise 1: 210.83.224.0/22
A company has been allocated the network
address 210.83.224.0/22. What is the
network mask and what are the first and last
host addresses in the range? How many
host addresses can be allocated?
30/11/10
08-Supernetting
14
Exercise 1 : 210.83.224.0/22
Interesting byte is the 3rd byte as the boundary
is after the 22nd bit
22410 =
111000|002
To find the netmask set all the network bits to 1
and all the host bits to 0
111111|002
=
25210
Net mask is therefore 255.255.252.0
30/11/10
08-Supernetting
15
Exercise 1 :
210.83.224.0/22
The network address is:
111000|00 00000000 : 210.83.224.0/22
The first network host address is:
111000|00 00000001 : 210.83.224.1
The broadcast address for the network is:
111000|11 11111111 : 210.83.227.255
The last host address for the network is:
111000|11 11111110 : 210.83.227.254
30/11/10
08-Supernetting
16
Exercise 1 : 210.83.224.0/22
There are 210 = 1024 host addresses within
this range (32 – 22 = 10)
Therefore 1024 – 2 = 1022 host addresses can
be allocated
30/11/10
08-Supernetting
17
Exercise 2: 192.16.128.0 - 192.16.135.255
A company has been allocated the address
range 192.16.128.0 to 192.16.135.255.
What network address should it use and
what prefix length?
30/11/10
08-Supernetting
18
Exercise 2: 192.16.128.0 - 192.16.135.255
The interesting byte of the first network address is:
12810 = 10000|0002
The interesting byte of the last network address is:
13510 = 10000|1112
Find the boundary between the network and the host
parts of the address.
It is just before the first bit that is different between the
bytes from the first and last network addresses. Which
will give us 21 1s in the net mask.
So prefix length is 21
30/11/10
08-Supernetting
19
Exercise 2: 192.16.128.0 - 192.16.135.255
Network address is:
Network mask is:
First host address is :
Last host address is:
Broadcast address is:
30/11/10
08-Supernetting
192.16.128.0/21
255.255.248.0
192.16.128.1
192.16.135.254
192.16.135.255
20
Exercise 2: 192.16.128.0 - 192.16.135.255
There are 21 bits used for the network ID
and 11 (32 - 21) bits can be used for host
addresses (ie 211 – 2 = 2046 addresses are
supported)
30/11/10
08-Supernetting
21
Shortcut with Calculations
• For both subnetting and supernetting, there is a shortcut
which allows the calculations to be done in decimal
rather than in binary.
• The shortcut is to find the interesting byte in the
network mask and subtract it from 256.
• The result will give you a power of two that is the size
of each range of network/subnet addresses in the
interesting byte.
• This is how engineers can subnet in their heads!
• Not recommended for examinations, other than to check
answers as it does not demonstrate understanding.
30/11/10
08-Supernetting
22
Subnetting Example 1 with Shortcut
Host Address
= 204.33.180.106
Subnet Mask
= 255.255.255.224.
Interesting Byte is 4th Byte
Magic No = 256 - 224
=
32
This is the size of each subnet address range in this byte
Find multiples of magic no either side of Interesting Byte value
106 is >= 96 (3x32) and < 128 (4x32)
Network address = 204.33.180.96
Broadcast address for subnet = 204.33.180.127
First host address in subnet = 204.33.180.97
Last host address in subnet = 204.33.180.126
30/11/10
08-Supernetting
23
Supernetting Exercise 2 with Shortcut
Network Address
= 192.16.128.0/21
Network Mask
= 255.255.248.0
Interesting Byte is 3rd Byte
Magic No = 256 - 248 = 8
This is the size of the address ranges in this byte
Find multiples of magic no either side of Interesting Byte value
128 is >=128 (16x8) and < 136 (17x8)
Network address = 192.16.128.0/21
Broadcast address = 192.16.135.255
First host address in range = 196.16.128.1
Last host address in range = 196.16.135.254
30/11/10
08-Supernetting
24