3. Training Contents
• What is an IP?
• Need for an IP?
• Representation of an IP
• Classes of an IP Address
• Sub netting and its types
4. Introduction to IP Address
• An IP address is a 32-bit address that identifies a connection to the
Internet.
• The IP addresses are universally unique.
• The address space of IPv4 is 2^32 or 4,294,967,296.
7. How IP ‘s are used for Identification?
Network
Host
Process
Network
Host
Process
www.google.com
INDIA CALIFORNIA
8. Few Organized Numbering Systems
+91 - 9790410977
COUNTRY
CODE
ACCESS
CODE
SERVICE
PROVIDER
CODE
SUBSCRIBER
NUMBER
1116 – 15 – 106 – 003
111615106003
10. IP Address Space
• Initially 8 bits were allotted for Network ID and remaining 24 bits were
allotted for Host ID
• 8 bits 28 Networks 256 Networks
• 24 bits 224 Hosts Per Network 16Million hosts per network
• NOT SCALABLE
19. Simple Exercise
Given the network address 17.0.0.0, find the class, the block, and the range of the
addresses.
• Solution:
• Class A because first byte lies between 0 – 127
• Net ID is 17.0.0.0 so address block ranges from (17.0.0.0 to 17.255.255.255)
20. Simple Exercise
• Given the network address 132.21.0.0, find the class, the block, and the range of the addresses.
• Solution:
• The class is B because the first byte is between 128 and 191.
• The addresses range from 132.21.0.0 to 132.21.255.255
21. Simple Exercise
• Given the network address 220.34.76.0, find the class, the block, and the range of the
addresses.
• Solution:
• The class is C because the first byte is between 192 and 223
• The addresses range from 220.34.76.0 to 220.34.76.255.
22. Not all IP Address are usable…
• Network ID or Net ID – First IP of address block
• Broad cast Address – Last IP of address block
• Types of broadcast
• Limited Broadcast
• Directed Broadcast
11.0.0.0
LBA: 255.255.255.255
11.0.0.0
20.0.0.0
DBA: 20.255.255.255
23. Try to fill the Table
IP Address Network ID Directed Broadcast ID Limited Broadcast ID
1.2.3.4 1.0.0.0 1.255.255.255 255.255.255.255
10.15.20.60 10.0.0.0 10.255.255.255 255.255.255.255
130.1.2.3 130.1.0.0 130.1.255.255 255.255.255.255
150.0.150.150 150.0.0.0 150.0.255.255 255.255.255.255
200.1.10.100 200.1.10.0 200.1.10.255 255.255.255.255
220.15.1.10 220.15.1.0 220.15.1.255 255.255.255.255
250.0.1.2 NOT POSSIBLE NOT POSSIBLE NOT POSSIBLE
300.1.2.3 INCORRECT IP ADDRESS
24. Subnets and Subnet Mask
• What are subnets?
• Dividing the large address space into smaller blocks of IP Address
• Why do we go for subnets?
• If the blocks of IP address are used as such millions of IP address are wasted.
• Managing the Large block of IP Address is also difficult
• What are the types of subnets?
• Fixed Length Subnetting
• Variable Length Subnetting
• Subnet Mask
• Will be discussed few slides later
25. Fixed Length Subnetting
• Lets consider an Organization and the entire organization has different
departments / Sections
I
II III
IVECE
EEE
CSE
MECH
26. Fixed Length – Example 1
• Divide the address block 200.1.2.0 into 2 subnets
Given address block is Class C 24 bits for NID and 8 bits for HID
200.1.2.00000000
200.1.2.11111111
200.1.2.0
200.1.2.255 200.1.2.X0000000
X = 0 X = 1
Network ID : 200.1.2.0
Broadcast ID: 200.1.2.255
1 bit is required
to make 2 parts
Get Back
27. 200.1.2.X0000000
X = 0 X = 1
200.1.2.0_ _ _ _ _ _ _
Runs from
200.1.2.00000000
200.1.2.00000001
200.1.2.00000010
200.1.2.00000011
.
.
200.1.2.01111111
200.1.2.1_ _ _ _ _ _ _
Runs from
200.1.2.10000000
200.1.2.10000001
200.1.2.10000010
200.1.2.10000011
.
.
200.1.2.11111111
200.1.2.0
200.1.2.127
200.1.2.128
200.1.2.255
Network ID : 200.1.2.0
Broadcast ID: 200.1.2.127
Network ID : 200.1.2.128
Broadcast ID: 200.1.2.255
27 = 128
Address in Each Subnet
Get Back
28. Fixed Length – Example 2
• Divide the address block 200.1.2.0 into 4 subnets
Given address block is Class C 24 bits for NID and 8 bits for HID
200.1.2.00000000
200.1.2.11111111
200.1.2.0
200.1.2.255 200.1.2.XX000000
XX = 00
Network ID : 200.1.2.0
Broadcast ID: 200.1.2.255
XX = 01 XX = 10
XX = 11
2 bits are required
to make 4 parts
29. 200.1.2.XX000000
XX = 00
XX = 01 XX = 10
XX = 11
200.1.2.00 _ _ _ _ _ _
Runs from
200.1.2.00000000
to
200.1.2.00111111
200.1.2.01 _ _ _ _ _ _
Runs from
200.1.2.01000000
to
200.1.2.01111111
200.1.2.11 _ _ _ _ _ _
Runs from
200.1.2.11000000
to
200.1.2.11111111
200.1.2.10 _ _ _ _ _ _
Runs from
200.1.2.10000000
to
200.1.2.10111111
200.1.2.0 Network ID
200.1.2.63 Broadcast ID
200.1.2.128 Network ID
200.1.2.191 Broadcast ID
200.1.2.192 Network ID
200.1.2.255 Broadcast ID
200.1.2.64 Network ID
200.1.2.127 Broadcast ID
26 = 64
Address in Each Subnet
30. Fixed Length – Exercise 1
Divide the address block 192.168.9.0 into 5 networks
Given address block is Class C 24 bits for NID and 8 bits for HID
192.168.9.00000000
192.168.9.11111111
192.168.9.0
192.168.9.255 192.168.9.XXX00000
Network ID : 192.168.9.0
Broadcast ID: 192.168.9.255
3 bits are required
to make 8 parts
000
001
010
011 100
101
110
111
31. NET 1
192.168.9.00000000 192.168.9.0
192.168.9.00011111 192.168.9.31
NET 2
192.168.9.00100000 192.168.9.32
192.168.9.00111111 192.168.9.63
NET 3
192.168.9.01000000 192.168.9.64
192.168.9.01011111 192.168.9.95
NET 4
192.168.9.01100000 192.168.9.96
192.168.9.01111111 192.168.9.127
NET 5
192.168.9.10000000 192.168.9.128
192.168.9.10011111 192.168.9.159
NET 6
192.168.9.10100000 192.168.9.160
192.168.9.10111111 192.168.9.191
NET 7
192.168.9.11000000 192.168.9.192
192.168.9.11011111 192.168.9.223
NET 8
192.168.9.11100000 192.168.9.224
192.168.9.11111111 192.168.9.255
32. Fixed Length – Exercise 2
Divide the address space 172.16.0.0 into 3 networks
Given address block is Class B 16 bits for NID and 16 bits for HID
172.16.00000000.00000000
To
172.16.11111111.11111111
172.16.XX000000.00000000
XX = 00
Network ID : 172.16.0.0
Broadcast ID: 172.16.255.255
XX = 01 XX = 10
XX = 11
2 bits are required
to make 4 parts
33. NET 1
172.16.00000000.00000000 172.16.0.0
172.16.00111111.11111111 172.16.63.255
NET 2
172.16.01000000.00000000 172.16.64.0
172.16.01111111.11111111 172.16.127.255
NET 3
172.16.10000000.00000000 172.16.128.0
172.16.10111111.11111111 172.16.191.255
NET 4
172.16.11000000.00000000 172.16.192.0
172.16.11111111.11111111 172.16.255.255
34. Fixed Length – Exercise 3
• Divide the address space 192.168.9.0 into suitable number of networks so
that each network can handle at least 10 hosts
In each subnet 2 address are not usable
so total no of address required is 12
2? Gives 12 address This is not possible
24 Gives 16 address This is the nearest possible value
192.168.9.XXXX_ _ _ _
36. Subnet Mask
• A Subnet mask is a 32-bit number that masks an IP address, and divides
the IP address into network address and host address.
• Subnet Mask is made by setting
• network bits to all "1"s
• host bits to all "0"s.
37.
38. Representation of Subnet Mask
• There are 3 types of representation
• Binary Representation
• Dotted Decimal Representation
• /n Representation or CIDR Representation
(n Defines #. Of bits allotted for Network)
39. Default Subnet Mask
Class NID - HID Binary
Class A NID – HID – HID – HID 11111111.00000000.00000000.00000000
Class B NID – NID – HID – HID 11111111.11111111.00000000.00000000
Class C NID – NID – NID – HID 11111111.11111111.11111111.00000000
Class Dotted Decimal /n
Class A 255.0.0.0 /8
Class B 255.255.0.0 /16
Class C 255.255.255.0 /24
40. Need for Subnet Mask
1. Given any IP Address, Subnet mask can be used to identify the network
ID
41. Need for Subnet Mask
2. To inform the router that subnetting is performed
Lets go back to the Example problem
200.1.2.0
200.1.2.127
200.1.2.0 /25
200.1.2.127 /25
11111111.11111111.11111111.10000000
255 . 255 . 255 . 128
43. Variable Length Subnetting
• There are certain drawbacks in fixed length methods
• All subnets will have equal number of IP Address
64 64
6464
64
64
128
This scenario is called VLSM
(Variable Length Subnet Masking)
44. Variable Length – Example 1
• Divide the given address space 172.16.0.0 / 16 into 7 networks whose requirement is given below
• Net 1 500 hosts
• Net 2 200 hosts
• Net 3 100 hosts
• Net 4 60 hosts
• Net 5 20 hosts
• Net 6 2 hosts
• Net 7 2 hosts
45. 500
200
100
60
20
2
2
1. Arrange the required No. of hosts in Ascending Order
2. Allocate the No of bits required for Hosts in powers of 2
29 = 512
28 = 256
27 = 128
26 = 64
25 = 32
22 = 4
22 = 4
3. Write the given address space with required no of Host Bits
172.16.00000000.00000000
4. Count for required no of bits from right side ( ) and find the first and last address
172.16.00000001.11111111
5. Write the starting and ending address with subnet mask
172.16.0.0 / 23
172.16.1.255 / 23
6. Write the immediate next ip address for next subnet
172.16.00000010.00000000
7. Count the number of bits required for 2nd subnet
172.16.00000010.00000000
172.16.00000010.11111111
Write the first and last ip address with subnet mask
172.16.2.0 / 24
172.16.2.255 / 24
Repeat the procedure until last subnet
172.16.00000011.00000000
172.16.00000011.01111111
172.16.3.0 / 25
172.16.3.127 / 25
172.16.00000011.10000000
172.16.00000011.10111111
172.16.3.128 / 26
172.16.3.191 / 26
172.16.00000011.11000000
172.16.00000011.11011111
172.16.3.192 / 27
172.16.3.223 / 27
172.16.00000011.11100000
172.16.00000011.11100011
172.16.3.224 / 30
172.16.3.227 / 30
172.16.00000011.11100100
172.16.00000011.11100111
172.16.3.228 / 30
172.16.3.231 / 30
46. Variable Length – Example 2
Divide the address space 172.16.0.0 / 16 for 3 LANS as mentioned below
Lan 1 should have 50 address
Lan 2 should have 217 address
Lan 3 should have 300 address
47. Solution
NET #
No of Bits
Required
Address space
Address with subnet
mask
LAN 3 300 29 = 512
172.16.00000000.00000000 172.16.0.0 /23
172.16.00000001.11111111 172.16.1.255 /23
LAN 2 217 28 = 256
172.16.00000010.00000000 172.16.2.0 /24
172.16.00000010.11111111 172.16.2.255 /24
LAN 1 50 26 = 64
172.16.00000011.00000000 172.16.3.0 /26
172.16.00000011.00111111 172.16.3.63 /26
48. Mastering the Subnets Problem
Divide the address space 172.16.0.0 / 16 for 3 LANS as mentioned below
• Lan 1 should have 50 address
• Lan 1.1 25 address
• Lan 1.2 12 address
• Lan 1.3 5 address
• Lan 1.4 5 address
• Lan 2 should have 217 address
• Lan 2.1 70 address
• Lan 2.2 30 address
• Lan 2.3 16 address
• Lan 2.4 10 address
• Lan 3 should have 300 address
• Lan 3.1 80 address
• Lan 3.2 42 address
• Lan 3.3 25 address
• Lan 3.4 15 address
• Lan 3.5 all remaining address
50. Classless Inter Domain Routing (CIDR)
CA
CB
CC
CD
CE
10
1110
110
1111
There are certain Drawbacks in class full addressing
The least number of host Address that you can get is (2^8) 256 in
class C.
51. Rules for CIDR Blocks
• All IP address should be Contiguous
• The size of the requested IP should be in power of 2
• Meaning – you cannot ask for 500 IP address. You can get only 512 IP Address
as a block
Taking this further will have their applications in Operating Systems
So, I will leave it to your exercise