Subnetting basics in networking, for network engineers

FahimMousa 14 views 28 slides Jun 29, 2024
Slide 1
Slide 1 of 28
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28

About This Presentation

Subnetting is a process of dividing a larger network into smaller, more manageable sub-networks or subnets. It enhances network performance and security by reducing congestion and simplifying management, allowing better allocation of IP addresses and efficient use of resources.


Slide Content

SUBNETTING

•To connect to the network, you computer requires;
1.An IP address
2.Subnet mask
3.Default gateway
•In reference to IPV4, an IP address is a 32-bit logical address that identifies
your device on the network
•An IP address is represented by four number and each of the numbers is
separated by a “dot” such as 192.168.1.1

•Each of the four numbers in an IP address is represented by
eight bits and the eight bits is referred to as an “octet”
•Each of the bit that makes up eight bits is represented by
either zero (0) or one (1)

CLASSES OF IP ADDRESSES
•CLASS A
•0 -127 (0.0.0.0 –127.255.255.255)
•CLASS B
•128 –191 (128.0.0.0 –191.255.255.255)
•CLASS C
•192 -223 (192.0.0.0 –223.255.255.255)
•CLASS D
•224 –239 (224.0.0.0 –239.255.255.255)
•CLASS E
•240 –255 (240.0.0.0 –255.255.255.255)

THE FIRST OCTET BINARY IN THE CLASSES
•CLASS A: 00000000
•CLASS B: 10000000
•CLASS C: 11000000
•CLASS D: 11100000
•CLASS E: 11110000

•Class D addresses are reserved for multicast
•Class E is used mainly for researches only
•We are now only going to use only three classes (A, B,C)
•The total number of addresses in class A is 16,777,216
•The total number of addresses in class B is 65,536
•The total number of addresses in class c is 256

BINARY
•We need to understand the binary representation of data
•The total number of bits in an ipaddress is 32

SUBNET MASK/IP Subnetting
•Splits the IP address into two sections
•Network section
•Host section
•Network portion is represented by a sequence on 1’s
•Host portion is represented by a sequence of 0’s
•Default Subnet mask in class A is 255.0.0.0
•Default Subnet mask in class A is 255.255.0.0
•Default Subnet mask in class A is 255.255.255.0

POSSIBLE OCTET VALUES
VALUE OCTATE
0 00000000
128 10000000
192 11000000
224 11100000
240 11110000
248 11111000
252 11111100
254 11111110
255 11111111

Example of subnet mask
CLASSFULSUBNET
MASK
BINARY REPRESENTATION
255.0.0.0 11111111.00000000.00000000.00000000
255.255.0.0 11111111.11111111.00000000.00000000
255.255.255.0 11111111.11111111.11111111.00000000

CLASSFULSUBNET
MASK
BINARY REPRESENTATION
255.255.240.0 11111111. 11111111.11110000.00000000
255.254.0.0 11111111.11111110.00000000.00000000
255.255.255.248 11111111.11111111.11111111.11111000

EXAMPLE
•Given in IP address 172.16.15.25 are you are required to subnet it
•Solution
•This is a class B address
•Its subnet mask is 255.255.0.0
•Hence;
•Convert the IP address and subnet mask to binary
•(172.16.15.25 => 10101100.00010000.00001111.00011001)
•(255.255.0.0 => 11111111.11111111.00000000.00000000)

•From the subnet mask, the bits that are represented by zeros (0’s) defines
the host portion and the bits represented by ones (1’s) represents the
network portion
•Now lets assume we have the same IP address but the number of devices
(sensor nodes) on the network are fewer. This means that we are going to
reduce the host portion by say four bits hence
•172.16.15.25 => 10101100.00010000.00001111.00011001
•255.255.240.0 => 11111111.11111111.11110000.00000000

•Assume Computer A with an IP address of 172.16.15.25 would like to send a
packet to another Computer B with IP address of 172.16.17.3.
•Computer A is going to look at its subnet mask which is the default subnet mask of
class B 255.255.0.0 to determine if Computer B is within the same network.
•Source IP: 172.16.15.25 => 10101100.00010000.00001111.00011001
•Subnet Mask: 255.255.0.0 => 11111111.11111111.00000000.00000000
•Destination IP: 172.16.17.3 => 10101100.00010000.00000000.00000000
•It has verified that the network portion on the destination IP address looks exactly the same as
that of the source IP address

•Assume Computer A with an IP address of 172.16.15.25 would like to send a packet to another
Computer B with IP address of 172.16.17.3.
•Computer A is going to look at its subnet mask, which in this case its 255.255.240.0 to determine if
Computer B is within the same network.
•Source IP: 172.16.15.25 => 10101100.00010000.00001111.00011001
•Subnet Mask: 255.255.240.0 => 11111111.11111111.11110000.00000000
•Destination IP 172.16.17.3 => 10101100.00010000.00010001.00000000
•It realises that the last bit on the source IP within the network portion is zero (0) while the last bit on the
destination IP is a one (1)
•Hence the destination IP address is not on the same network hence the packet will be sent to the
gateway IP address (default gateway) that would route it to the said network or subnet

TO CALCULATE THE NUMBER OF AVAILABLE IPs IN A SUBNET
•Look at the number of zeros (0’s) in the subnet mask
•Raise 2 to the power of the number of zeros (0’s)
•2
(number of zeros (0’s) in the subnet mask)
•Consider a subnet mask of 255.255.0.0 hence;

•In every subnet, two IP addresses get reserved for the network (first IP) and
the broadcast (Last IP)
•Hence, if you remove the two IPs then you remain with the usable IPs.

•Consider a subnet mask of 255.255.255.0 hence;
•Number of available Ipsis given by;
•Number of Usable IPS is given by;

Network and Broadcast addresses
Given an IP 172.16.15.25 with subnet mask of 255.255.0.0, we perform AND
on the binary representation of IP address and the subnet mask to get the
binary equivalent of Network IP address.

•Given an IP 172.16.15.25 with subnet mask of 255.255.240.0, we perform
AND on the binary representation of IP address and the subnet mask to get
the binary equivalent of Network IP address.

Given an IP address of 172.16.17.1 with a subnet mask of 255.255.240.0
a)Find the IP address assigned to the Network and the Broadcast
b)What the total number of Useable IP address in this case

Other ways to Finding Number of Usable IPs
•Subnet mask can be represented in decimal (255.255.0.0)or binary
(11111111.11111111.00000000.00000000)
•We could also represent subnet mask inform of CIDR (Class Inter Domain
Routing)
•CIDR is represented where you see an IP address followed by a forward
slash(/) and a number after the forwardslash(/)
•The number after the forward slash defines the number of bits for the
network portion in the subnet mask, that is the ones (1’s)

•The total number of bits in a subnet mask is 32
•To get the number of zeros (0’s) which defines the host portion, we
subtract the CIDR notation value from the 32bits and the resulting values
is for the zeros (0’s) or the host portion.
•For example
•192.168.1.1/25
•This means the Network portion (1’s) is 25
•The Host portion (0’s) is 7
•Total IP is 2
7
=>128
•Total Usable IP is 2
7
-2=>126

CLASSFUL Vs CLASSLESS IPs
•The total number of addresses in class A (0-127) is
16,777,216
•The total number of addresses in class B (128-191) is
65,536
•The total number of addresses in class C is (192-223)
256

Representation of Classes in CIDR
•Class A (0-127) subnet mask is 255.0.0.0 or /8
•Class B (128-191) subnet mask is 255.255.0.0 or /16
•Class Cis (192-223) subnet mask is 255.255.255.0 or /24

PRIVATE IP ADDRESSES
•Each IP class has a set of private IP blocks of addresses
•These private IP blocks can not be routed over the Wide Area Network
(WAN) but can only be made use of in the Local Area Network (LAN)
•Class A: 10.0.0.0/8
•Class B: 172.16.0.0/12
•Class C: 192.168.0.0/16
•If you are at Home, your router may assign you a private IP and the
Network Address Translation protocol (NAT) will then convert your private
IP into a public IP address to allow you access the internet

SPECIAL IP ADDRESSES
•Loop Back Address
•127.0.0.0/8 is a local IP address
•The computer uses this IP address range to identify itself
•For example, “ping 127.0.0.1”
•Also be aware of the IP address 169.254.0.0/16 : this address shalbe
assigned automatically by the DHCP