You are on page 1of 20

A supernetwork

Comparison of subnet, default,


and supernet masks

Weneedtomakeasupernetworkoutof16classCblocks.Whatis
thesupernetmask?

Solution

Weneed16blocks.For16blocksweneedtochangefour1sto0sinthedefault
mask.Sothemaskis
11111111111111111111000000000000
or
255.255.240.0

A supernet has a first address of 205.16.32.0 and a supernet mask of


255.255.248.0. A router receives three packets with the following destination
addresses:
205.16.37.44
205.16.42.56
205.17.33.76
Whichpacketbelongstothesupernet?

Weapplythesupernetmasktoseeifwecanfindthebeginningaddress.
205.16.37.44AND255.255.248.0 205.16.32.0
205.16.42.56AND255.255.248.0

205.16.40.0

205.17.33.76AND255.255.248.0

205.17.32.0

Onlythefirstaddressbelongstothissupernet.

Asupernethasafirstaddressof205.16.32.0andasupernetmask
of255.255.248.0.Howmanyblocksareinthissupernetandwhat
istherangeofaddresses?

Solution
The supernet has 21 1s. The default mask has 24 1s. Since the
differenceis3,thereare23or8blocksinthissupernet.Theblocks
are205.16.32.0to205.16.39.0.Thefirstaddressis205.16.32.0.The
lastaddressis205.16.39.255.

Classless Addressing

NumberofAddressesinaBlock
Thereisonlyoneconditiononthenumberofaddressesinablock;it
mustbeapowerof2(2,4,8,...).Ahouseholdmaybegivenablock
of2addresses.Asmallbusinessmaybegiven16addresses.Alarge
organizationmaybegiven1024addresses.

BeginningAddress
Thebeginningaddressmustbeevenlydivisiblebythenumberofaddresses.
Forexample,ifablockcontains4addresses,thebeginningaddressmustbe
divisibleby4.Iftheblockhaslessthan256addresses,weneedtocheckonly
therightmostbyte.Ifithaslessthan65,536addresses,weneedtocheckonly
thetworightmostbytes,andsoon.

Which of the following can be the beginning address of a block


thatcontains16addresses?
205.16.37.32
190.16.42.44
17.17.33.80
123.45.24.52

Solution
The address 205.16.37.32 is eligible because 32 is divisible by 16.
Theaddress17.17.33.80iseligiblebecause80isdivisibleby16.

Which of the following can be the beginning address of a block


thatcontains1024addresses?
205.16.37.32
190.16.42.0
17.17.32.0
123.45.24.52

Solution
Tobedivisibleby1024,therightmostbyteofanaddressshouldbe
0 and the second rightmost byte must be divisible by 4. Only the
address17.17.32.0meetsthiscondition.

Mask and slash Notation


In subnetting, an organization is given a first address + a
subnet mask
In supernetting, an organization is given a first address + a
supernet mask
Similarly, in classless addressing it is given the first address
+ mask
X.Y.Z.W/16 means the mask is 255.255.0.0 (class B)
X.Y.Z.W/17 means the mask is 255.255.128.0 (own class)
CIDR (Classless Interdomain Routing)
Address is classless
Routing is interdomain

A small organization is given a block with the beginning address


andtheprefixlength205.16.37.24/29(inslashnotation).Whatis
therangeoftheblock?

Solution
Thebeginningaddressis205.16.37.24.Tofindthelastaddresswe
keepthefirst29bitsandchangethelast3bitsto1s.
Beginning:11001111000100000010010100011000(24)
Ending:11001111000100000010010100011111(33)
Thereareonly8addressesinthisblock.

Finding the network address


What is the network address if one of the addresses is
167.199.170.82/27?

Solution
Theprefixlengthis27,whichmeansthatwemustkeepthefirst27
bitsasisandchangetheremainingbits(5)to0s.The5bitsaffect
only the last byte. The last byte is 01010010. Changing the last 5
bits to 0s, we get 01000000 or 64. The network address is
167.199.170.64/27.

Subnetting
An organization is granted the block 130.34.12.64/26. The
organization needs to have four subnets. What are the subnet
addressesandtherangeofaddressesforeachsubnet?

Solution
Thesuffixlengthis6.Thismeansthetotalnumberofaddressesin
theblockis64(26).Ifwecreatefoursubnets,eachsubnetwillhave
16addresses.

Let us first find the subnet prefix (subnet mask). We need four subnets,
whichmeansweneedtoaddtwomore1stothesiteprefix.Thesubnet
prefixisthen/28.
Subnet1:130.34.12.64/28to130.34.12.79/28.
Subnet2:130.34.12.80/28to130.34.12.95/28.
Subnet3:130.34.12.96/28to130.34.12.111/28.
Subnet4:130.34.12.112/28to130.34.12.127/28 .

Example
An ISP is granted a block of addresses starting with 190.100.0.0/16. The ISP
needs to distribute these addresses to three groups of customers as follows:
1.Thefirstgrouphas64customers;eachneeds256addresses.
2.Thesecondgrouphas128customers;eachneeds128addresses.
3. The third group has 128 customers; each needs 64 addresses.
Design the subblocks and give the slash notation for each subblock. Find out
howmanyaddressesarestillavailableaftertheseallocations.

Configurationforroutingexample

Mask

Dest.

NextHop

I.

255.0.0.0

111.0.0.0

m0

255.255.255.224

193.14.5.160

255.255.255.224

193.14.5.192

m2
m1

255.255.255.255
194.17.21.16
111.20.18.14
m0

255.255.255.0

192.16.7.0

111.15.17.32

m0

255.255.255.0

194.17.21.0

111.20.18.14

m0

0.0.0.0

0.0.0.0

111.30.31.18

m0

Data structures and algorithms For


Classless lookup
One major consideration is speed
Speed of finding next hop
Speed of making changes to values in the table

CIDR address is not self-identifying


Router cannot determine the subdivision between prefix and suffix by
looking at the address

In Classfull addressing Hashing is used to optimize speed


lookup, ( router extracts network portion and uses it as a
hash key), if same hash function
Host key precedes
Subnet key precedes
Network key

Hashing does not work well in CIDR

Classless lookup
Searching by mask length
Iterate over all possible divisions between prefix and suffix
Given a destination address D:
Algorithm tries using 32 bits of D, then 31 and so on
For each possible size M, the router extracts M bits from D, assumes
it contains a network prefix and looks up the prefix in the table

Worst case is 32 searches when no routes exists


To find a traditional class B address it needs 16 searches
And the default route for 31 searches

Classless lookup (cont.)


Searching using a binary trie structure
To avoid inefficient searches, classless routing tables are usually
stored in a hierarchical data structure
A binary trie is a tree with paths determined by the data stored
32 bit address
00110101 00000000 00000000 00000000
01000110 00000000 00000000 00000000
01010110 00000000 00000000 00000000
01100001 00000000 00000000 00000000
10101010 11110000 00000000 00000000
10110000 00000010 00000000 00000000
10111011 00001010 00000000 00000000

Unique Prefix
001
0100
0101
011
1010
10110
10111

Classless lookup (cont.)


Searching using a binary trie structure
A search for address 10010010 11110000 00000000 00000001 fails because no entry in the trie with 100
Each exterior node in must contain a 32 bit address A and a mask M.
If search reaches an exterior node then conventional look up algorithm is used

1
0

What if there is more than


one prefix ???
In practice, routing table could
Have a network-specific route
And a particular subnet of the
Same network ????

0
1

You might also like