0% found this document useful (0 votes)
35 views48 pages

Lecture 4 - Subnetting and Supernetting

The document outlines the concepts of subnetting and supernetting, including the purpose and calculation of subnet masks. It provides examples of subnetting with specific IP addresses and explains the rules for valid IP addresses within subnets. Additionally, it discusses the transition from a two-level to a three-level address structure in networking.

Uploaded by

loukasboh
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)
35 views48 pages

Lecture 4 - Subnetting and Supernetting

The document outlines the concepts of subnetting and supernetting, including the purpose and calculation of subnet masks. It provides examples of subnetting with specific IP addresses and explains the rules for valid IP addresses within subnets. Additionally, it discusses the transition from a two-level to a three-level address structure in networking.

Uploaded by

loukasboh
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

Lecture 4

Subnet #1:
193.2.1.0/26
Subnet #2: Subnet #3:
193.2.1.64/26 193.2.1.128/26
Subnet #4:
193.2.1.192/26

Subnetting and Supernetting


Outline

• IPv4 subnetting
– What is subnetting
– Why subnetting is required?
– How is subnetting calculated
– What are the rules in subnetting
• Supernetting
– What is subnetting
– Why subnetting is required?
– How is subnetting calculated
• Classless Interdomain Routing (CIDR) 2
Subnetting
Subnetting

• Splitting up an address range into a group of


smaller networks
• End result is multiple smaller sub-networks

4
Subnetting (continued)

• Purposes of subnetting
– To enable the reduction and management of
broadcast domains
• To reduce congestion by allowing fewer devices in a subnet
– To divide a network into logical subnets
• Departments/divisions
• Staff/visitors
– To support different network technologies
• Ethernet/WiFi/…
– To support WAN by allowing geographically
separated LANS to use a single network ID
• 131.181.0.0/16 = 131.181.0.0/24+131.181.1.0/24+…

5
Subnetting (continued)

• Sometimes you have a large number of IP addresses to


manage
• Break the host ID portion of the address into a subnet ID
and host ID

Network portion subnetting Host portion

6
Subnetting (continued)
• Example – subnet mask 255.255.255.0 applied to a
class B address will break the host ID (normally 16 bits)
into an 8-bit subnet ID and an 8-bit host ID
Host portion

11111111 11111111 11111111 00000000


Network portion subnetting

7
Subnetting (continued)

• Changes from two level address structure to three level


address structure
• External networks do not know about subnet/host ID
details
– They only see a single network
• User-definable subnet/host ID boundary
Network ID Host ID

becomes

Network ID Subnet ID Host ID

8
Subnetting (continued)
Without Subnetting

193. 2. 1 . 0
Netid Hostid
Network access Host access

With Subnetting – 4 subnets required


193 2 1
0--63 64-127 128- 192-
191 254

9
Subnetting (continued)
The network is seen: 193.2.1.0
As a whole network EXTERNALLY

subnet: subnet:
193.2.1.0/26 193.2.1.64/26

subnet: subnet:
193.2.1.128/26 193.2.1.192/26

0-63 64-127 128-191 192-255

10
Subnetting (continued)

• What address class is this given address?


– Class A, B or C?
• What is the subnet mask?
• What are the subnet addresses?
– Subnets 1, 2, 3 and 4
• How many valid IP addresses in a subnet?

11
Calculating a Subnet Mask

• To decide how to derive the subnet mask:


– Decide how many subnets you need
– Decide how many bits you need to meet or
exceed the number of required subnets
• Use the formula 2n, with n representing the number
of bits you must add to the starting subnet mask
– Borrow bits from the top of the host portion of the
address down
– Ensure that you have enough host bits available
to assign to computers on each subnet (2n-2)
12
Calculating a Subnet Mask (continued)

• When you create non-default subnet masks you


are borrowing two or more host bits and asking
IP to interpret them as network bits.
• Example:
– Creating 4 subnets in a class C address and
figuring out the subnet mask value.
2
4=2
13
Calculating a Subnet Mask (continued)

• STEP1:
– Initial class C address - 24 bits network ID, 8 bits host ID

• STEP2:
– Subnetted address 24 bits network ID, 2 bits subnet ID
and 6 bits host ID  4 subnets each with 62 (2^6-2) hosts

• STEP3: Subnet
Part

– we would apply the mask 255.255.255.192 or


11111111 11111111 11111111 11000000 to identify the
subnet
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0

Subnet
Part
14
Subnetting rules

• Valid IP addresses in a subnet


– Host bits cannot be all 0s  subnet ID
– Host bits cannot be all 1s  broadcast address
• Broadcasts are used to send packets to all hosts
within the subnet

15
Subnet addresses

Subnet
Network Portion Host Part

1 10 00 00 1 0 00 00 01 0 0 00 00 00 1 0 00 00 00 0
193 2 1 0
Network Portion

1 10 00 00 1 0 00 00 01 0 0 00 00 00 1 0 10 00 00 0
193 2 1 64
Network Portion

1 10 00 00 1 0 00 00 01 0 0 00 00 00 1 1 00 00 00 0
193 2 1 128
Network Portion

1 10 00 00 1 0 00 00 01 0 0 00 00 00 1 1 10 00 00 0
193 2 1 192 16
Valid IP addresses in Subnet#1
Subnet
Network Portion Host Part

1 10 00 00 1 0 00 00 01 0 0 00 00 00 1 0 00 00 00 0 0
193 2 1 0
1 10 00 00 1 0 00 00 01 0 0 00 00 00 1 0 00 00 00 1 1

1 10 00 00 1 0 00 00 01 0 0 00 00 00 1 0 00 00 01 0 2
1 10 00 00 1 0 00 00 01 0 0 00 00 00 1 0 00 00 01 1 3
1 10 00 00 1 0 00 00 01 0 0 00 00 00 1 0 00 00 10 0 4

1 10 00 00 1 0 00 00 01 0 0 00 00 00 1 0 0 1 1 1 1 1 0 62
1 10 00 00 1 0 00 00 01 0 0 00 00 00 1 0 01 11 11 1 63
17
Valid IP addresses in Subnet#2
Subnet
Network Portion Host Part

1 10 00 00 1 0 00 00 01 0 0 00 00 00 1 0 1 0 0 0 0 0 0 64
193 2 1 64
1 10 00 00 1 0 00 00 01 0 0 00 00 00 1 0 1 0 0 0 0 0 1 65

1 10 00 00 1 0 00 00 01 0 0 00 00 00 1 0 10 00 01 0 66

1 10 00 00 1 0 00 00 01 0 0 00 00 00 1 0 10 00 01 1 67

1 10 00 00 1 0 00 00 01 0 0 00 00 00 1 0 10 00 10 0 68

1 10 00 00 1 0 00 00 01 0 0 00 00 00 1 0 1 1 1 1 1 1 0 126
1 10 00 00 1 0 00 00 01 0 0 00 00 00 1 0 1 1 1 1 1 1 1 127
18
Valid IP addresses in Subnet#3
Subnet
Network Portion Host Part

1 10 00 00 1 0 00 00 01 0 0 00 00 00 1 1 0 0 0 0 0 0 0 128
193 2 1 128
1 10 00 00 1 0 00 00 01 0 0 00 00 00 1 1 0 0 0 0 0 0 1 129

1 10 00 00 1 0 00 00 01 0 0 00 00 00 1 1 0 0 0 0 0 1 0 130
1 10 00 00 1 0 00 00 01 0 0 00 00 00 1 1 0 0 0 0 0 1 1 131

1 10 00 00 1 0 00 00 01 0 0 00 00 00 1 1 0 0 0 0 1 0 0 132

1 10 00 00 1 0 00 00 01 0 0 00 00 00 1 1 0 1 1 1 1 1 0 190
1 10 00 00 1 0 00 00 01 0 0 00 00 00 1 1 0 1 1 1 1 1 1 191
19
Valid IP addresses in Subnet#4
Subnet
Network Portion Host Part

1 10 00 00 1 0 00 00 01 0 0 00 00 00 1 1 1 0 0 0 0 0 0 192
193 2 1 192
1 10 00 00 1 0 00 00 01 0 0 00 00 00 1 1 1 0 0 0 0 0 1 193

1 10 00 00 1 0 00 00 01 0 0 00 00 00 1 1 1 0 0 0 0 1 0 194
1 10 00 00 1 0 00 00 01 0 0 00 00 00 1 1 1 0 0 0 0 1 1 195

1 10 00 00 1 0 00 00 01 0 0 00 00 00 1 1 1 0 0 0 1 0 0 196

1 10 00 00 1 0 00 00 01 0 0 00 00 00 1 1 1 1 1 1 1 1 0 254
1 10 00 00 1 0 00 00 01 0 0 00 00 00 1 1 1 1 1 1 1 1 1 255
20
Subnetting Example
• Your ISP has allocated a block of addresses 193.64.33.0/24. Your
organization needs to have 8 subnets for its structure.
• You need to work out:
1) The subnet mask
2) The 8 subnets
3) The valid IP addresses for each subnet

1 11 11 11 1 1 11 11 11 1 1 11 11 11 1 1 11 00 00 0
Network portion (24 bits) Subnet 8>=23
Portion
(3 bits)

21
Another Subnetting Example (continued)
• Your ISP has allocated a block of addresses 193.64.33.0/24. Your
organization needs to have 8 subnets for its structure.
• Figure out:
1) the subnet mask,
2) The 8 subnets
3) the host range each subnet

1 10 00 00 1 0 10 00 00 0 0 01 00 01 1 0 00 00 00 0 0

1 10 00 00 1 0 10 00 00 0 0 01 00 01 1 0 01 00 00 0 32

1 10 00 00 1 0 10 00 00 0 0 01 00 01 1 0 10 00 00 0 64

1 10 00 00 1 0 10 00 00 0 0 01 00 01 1 0 11 00 00 0 96
1 10 00 00 1 0 10 00 00 0 0 01 00 01 1 1 0 0 0 0 0 0 0 128
1 10 00 00 1 0 10 00 00 0 0 01 00 01 1 1 0 1 0 0 0 0 0 160
1 10 00 00 1 0 10 00 00 0 0 01 00 01 1 0 1 0 0 0 0 0 0 192
1 10 00 00 1 0 10 00 00 0 0 01 00 01 1 1 1 1 0 0 0 0 0 224

193 64 33 22
“Subnet Pie”

23
Another Subnetting Example (continued)
• Your ISP has allocated a block of addresses 193.64.33.0/24. Your
organization needs to have 8 subnets for its structure.
• Figure out:
1) the subnet mask,
2) the 8 subnets
3) the host range each subnet
This subnet address
1 10 00 00 1 0 10 00 00 0 0 01 00 01 1 0 00 00 00 0 0

1 10 00 00 1 0 10 00 00 0 0 01 00 01 1 0 00 00 00 1 1

1 10 00 00 1 0 10 00 00 0 0 01 00 01 1 0 00 00 01 0 2

1 10 00 00 1
Subnet
0 10 00 00 0
#1
0 01 00 01 1 0 00 11 11 0 30

1 10 00 00 1 0 10 00 00 0 0 01 00 01 1 0 00 11 11 1 31
Broadcast address for this subnet

24
193 64 33 1 - 30
Another Subnetting Example (continued)
• Your ISP has allocated a block of addresses 193.64.33.0/24. Your
organization needs to have 8 subnets for its structure.
• Figure out:
1) the subnet mask,
2) The 8 subnets
3) the host range each subnet
This subnet address
1 10 00 00 1 0 10 00 00 0 0 01 00 01 1 0 01 00 00 0 32

1 10 00 00 1 0 10 00 00 0 0 01 00 01 1 0 01 00 00 1 33

1 10 00 00 1 0 10 00 00 0 0 01 00 01 1 0 01 00 01 0 34

1 10 00 00 1
Subnet
0 10 00 00 0
#2
0 01 00 01 1 0 01 11 11 0 62

1 10 00 00 1 0 10 00 00 0 0 01 00 01 1 0 01 11 11 1 63
Broadcast address for this subnet

25
193 64 33 33 - 62
VLSM (Variable Length Subnetting)

• Most sites use the same subnet mask


throughout
– The subnet mask is 255.255.255.192

#1 #2

MASK 255.255.255.192

#4 #3
26
VLSM (Variable Length Subnetting) (cont.)

• Suppose a class C address 212.5.5.0


• We requires 3 subnets 60 hosts and 2 with 30 hosts
• The solution is to subnet a subnet: by borrowing more
bits from the host portion…

#1 #2

MASK 255.255.255.192
MASK 255.255.255.224

MASK 255.255.255.224
#4 #3
27
VLSM – Example

• 212.5.5.0
• We require 3 subnets with 60hosts and 2 with
30 hosts.
• Borrow 2 bits from the host portion
– Gives 4 subnets (2 bits for subnet) with 60 hosts
each (6 bits for host portion)
• Further subnet one of the 4 subnets by
borrowing an additional 1 bit from the host
portion

28
Supernetting
Supernetting

• It is also called Network summarisation


– To combine a group of continuous subnets to
form a single network
• It is used for route aggregation to reduce the
size of routing tables
– A way of reducing the number of routes in the
routing table
– To consolidate continuous routes into a single
route for route advertisement

30
Supernetting (continued)
Example 1
• The network is seen 193.2.1.0/24 as a whole
network EXTERNALLY

193.2.1.0/24

Subnet 193.2.1.0/25 Subnet 193.2.1.128/25

31
Supernetting (continued)
Example 2
• The network is seen 193.2.1.0/24 as a whole
network EXTERNALLY

193.2.1.0/24
Subnet Subnet Subnet Subnet
193.2.1.0/26 193.2.1.64/26 193.2.1.128/26 193.2.1.192/26

32
Supernetting

• Opposite of subnetting
– “borrow” bits from the network portion
– combine group of continuous network addresses to form a single
larger network
• Manipulate subnet (supernet) mask to form a supernet
• Key lies in (supernet) mask:
– Masks distinguish network bits from host bits
– When mask is applied to any address in any of the NWs making
up the supernet:
• resultant NW address is the same (first network)
• Routers need only know one address for entire supernet
– Reduces load on Internet routers

33
“Borrowing” Bits for Supernetting

• Supernetting involves borrowing network bits


from left of default mask boundary
• Subnetting involves borrowing host bits

34
Supernet – Smaller Routing Table

Routing table for Router B


210.78.168.0 255.255.255.0 210.78.168.1
210.78.169.0 255.255.255.0 210.78.168.1
210.78.170.0 255.255.255.0 210.78.168.1
210.78.171.0 255.255.255.0 210.78.168.1 Routing table for Router B
210.78.172.0 255.255.255.0 210.78.168.1
210.78.168.0 255.255.248.0 210.78.168.1
210.78.173.0 255.255.255.0 210.78.168.1
210.78.174.0 255.255.255.0 210.78.168.1
210.78.175.0 255.255.255.0 210.78.168.1

After
supernetting
Before
supernetting 35
Supernetting (continued)

The network 193.0.0.0/22 is seen as a


whole network externally

ISP ISP
Destination Network Next hop Destination Network Next hop
200.0.0.0/24 Directly Connected 200.0.0.0/24 Directly Connected
192.0.0.0/24 200.0.0.1
192.0.0.0/22 =
192.0.1.0/24 200.0.0.1
(192.0.0.0/24+192.0.1.0/24+ 200.0.0.1
192.0.2.0/24 200.0.0.1
192.0.2.0/24+192.0.3.0/24)
192.0.3.0/24 200.0.0.1
36
Supernetting (continued)

• Benefits of supernetting
– To minimize the latency in a complex network
structure
– To reduce the overhead for routing process, since the
reduced number of route entries in the routing table
– To improve network stability by reducing or
eliminating unnecessary routing updates after part of
the network undergoes a change in topology
– To reduce processor workloads, memory
requirements and bandwidth demand

37
Supernetting (continued)

• “Borrow” bits form the network portion


• Manipulate the network mask to form a
supernetwork
• The key lies in the network mask
– The mask distinguish network bits from host
portion
– When mask is applied to any the networks
making up the supernetwork
• Resultant network address is the same

38
Implementing Supernetting

• Identify the number of networks to aggregate


• Determine number of bits to borrow from
network portion
• Define the mask
• Example:
– Assume a mid size organization requires 1000
addresses.
– How many C class addresses are required?
– What is the subnet mask?

39
Solution

• 1000 addresses would normally require a Class


B network
• Instead a range of 4 C class addresses is
allocated and supernetted so the organisation
can be reached through a single NW address
– Each class C address has 254 host addresses
• 4 networks = 2 n => n = 2
– So 2 bits are borrowed from network portion
– So mask is:
• 11111111.11111111.11111100.00000000
• 255.255.252.0

40
Example Continued

• Suppose the 4 class C addresses allocated to our


organisation are:
– 212.5.4.0 = 11010100.00000101.00000100.00000000
– 212.5.5.0 = 11010100.00000101.00000101.00000000
– 212.5.6.0 = 11010100.00000101.00000110.00000000
– 212.5.7.0 = 11010100.00000101.00000111.00000000

• Applying the mask 255.255.252.0 to an address in any


of these networks will then resolve to 212.5.4.0
– The bits borrowed for the supernet are masked off with the host
bits leaving the id of the first network only

41
To verify the network ID with the mask

IP address 212 5 6 12
Binary 11010100 00000101 00000110 00001100
Supernet mask 11111111 11111111 11111100 00000000
AND Result 11010100 00000101 00000100 00000000

Decimal 212 5 4 0

42
CIDR

Classless InterDomain Routing


Classless Interdomain Routing (CIDR)

• Addressing by class has been superseded by a


more flexible addressing method
– Classless Interdomain Routing (CIDR)
– The network and host demarcation can be made with
any number of bits from beginning of address
– E.g. a Class C address’s network section is 24 bits
• Using CIDR, an address registry can assign an address with a
network section of 26 bits
• 193.2.1.0/24 =
193.2.1.0/26 + 193.2.1.64/26 + 193.2.1.128/26 + 193.2.1.192/26
– Subnetting divides network address in two or more
subnetwork addresses (with fewer host IDs for each)

44
Classless Interdomain Routing (CIDR)

• Example:
– Instead of applying for two Class C addresses, a company
could contact an ISP, which would lease 500 IP addresses
to the company
– The addresses are not identified by any class – they are
simply a contiguous block of IP addresses
• 193.2.0.0/23 = 193.2.0.0/24 + 193.2.1.0/24
• Classless addressing has led to a much more efficient
allocation of the IP address space

45
Subnetting vs. Supernetting

• The process of dividing a • The process of combining a


network into a group of smaller group of continuous network
networks addresses to form a single
• To enable the reduction and network
management of broadcast • To reduce the number of
domains entries in a routing table to
• Host bits are borrowed to be simplify the routing process
used as a subnet ID • Network bits are borrowed to
• Manipulate the network mask be used as the host ID
to divide a network into • Manipulate the network mask
subnets to form a supernetwork

46
IP addressing references

• Greg Tomsho, Guide to Networking Essentials, 7th


Edition
– Chapter 6 IP Addressing
• IP Addressing and Subnetting for New Users
– https://www.cisco.com/c/en/us/support/docs/ip/routing
-information-protocol-rip/13788-3.html
• TCP/IP Fundamentals for Windows (Chapter 3: IP
Addressing)
– http://technet.microsoft.com/en-
us/library/bb726995.aspx

47
B
A C

Application Application
Presentation Presentation
Session Session
Transport Transport
Network Network Network Network Network
Data Link Data Link Data Link Data Link Data Link
Physical Physical Physical Physical Physical

Lecture 5 Routing

You might also like