Ip Subneting
Ip Subneting
1
IP Subnet
IP address allocation : IP is 32 bit number
Divide organization into blocks and IP address bits into fields
Map IP address fields to blocks
Example : let us take 8 bits address
: institute have 4 blocks – H, CM, CC, COL if each have 10 nodes, so 10 address
: 8 bit max addresses = 2^8 = 256
: if allocate serially
H : 1 – 10
CM : 11 – 20
CC : 21 – 30
COL : 31 – 40
If increase 5 nodes in each block binary ---- 00110100
H : 41 – 45, CM : 46 – 50, CC : 51 –55, COL : 56 – 60
search address no 52 by looking over the address we can not find in which block address resides
we need to search linearly, no information inside address about blocks
2
IP Subnet
Packet is delivered to node by using destination address in packet
is it possible that address contain some information about block & node inside block ?
like mobile phone number --- 2 digit country code ( largest block )
--- 4 digit provider code ( smaller block )
---- 6 digit subscriber code (smallest block) ---- 91-9415-649169
Total 256 addresses can be divided into 4 equal blocks 256/4 = 64 addresses in each
H : 0 – 63 00-000000 --- 00-111111 block number 00 – H, 01 – CM, 10 – CC, 11 -- COL
CM: 64 – 127 01-000000 --- 01-111111 node number
CC : 128 – 191 10-000000 --- 10-111111
COL: 192 – 255 11-000000 –- 11-111111 third address of CC, third address of CM
Address : 10-00011, 01-000011 using first 2 bits we can tell address belong to which block
--- 2 digits block number ( first 2 digits – change slowly )
---- 6 digits node number ( last 6 digits – change faster compared to first 2 digits )
3
IP Subnet
Further H : Hostel block has four hostels TH, TDH, MH, PH
: H has 64 addresses can be divided into 4 = 64/4 = 16 addresses each hostel
First address denote the block or network or subnet not assign to any node
Last address denotes broadcast address of that block
Remaining addresses can be allocated to nodes of the network or subnet
00-10--011 ---- 3rd node of MH, 00100011/x or 35/x where x – 4 number of bits in net/subnet id
Address --- 2 digits block (network ) number
---- 2 digits sub block ( subnet ) number
---- 4 digits node number | divide MH in 2 wings 8 address in each wing
4
Network Layer -- IP
Network , subnetwork, node --------- different fields in IP address
net id node id
network MSB
LSB
s1 s2 s3 sub id node id
n1 n2 n3 n4 n5 n6 n7 n8
5
IP Subnet
Netmask : used to find network number in a address
if we know IP address and apply (do logical &&) netmask of the network
we can find if the IP address belong to that network or not
To get netmask of a network keep netid bits 1 and hostid bits 0
For hostel H netmask is = 11000000 = 192 (decimal)
For MH netmask is = 11110000 =240 (decimal)—(128 + 64 + 32 + 16 )
find netmask of CM, CC, COL
find netmask of TH, TDH, PH
6
IP
IP address has 32 bits, has four fields Each field is of 8 bits
written as : 202.141.55.6 / 24 /x – x number of bits in net id +subnet id
net id host id
For 202.141.55.6 /24 --- netmask is net id bits 1 and host id bits 0
11111111.11111111.11111111.00000000
7
IP Subnet – Fix length
Allocation of IP address
8
IP Subnet – Fix length
allotted s1 – s10, left s11-s16
s2 s4
s1 s3
s5 s6 s7 s8
s9
s10
9
IP Subnet – Fix length
Exercise :
1: If ISP has 202.141.52.0/23 & 4 customers each need at least 100 addresses do allocation
2: If ISP has 202.141.52.0/23 & 8 customers each need at least 50 addresses do allocation
3: If ISP has 202.141.52.0/23 & 16 customers each need at least 25 addresses do allocation
10
IP Subnet – variable length
If ISP has 202.141.55.0/24 address block
mnnit demand for 100 IP addresses, iiita demand for 50 IP addresses and iert need 25 IP
addresses & remaining IP addressesremains with ISP
allocate to nearest 2 to power
For mnnit --- allocate 2^7 = 128 addresses for 100 required
For iita ---- allocate 2^6 = 64 addresses for 50 required
For iert --- allocate 2^5 = 32 addresses for 25 required
This is known as CIDR – classless inter domain routing uses slash x notation /x x– bits in net id
Total addresses = 256 mnnit
128 iiita iert
iiita 128 256 64 32
128 64
64 32 32 left with ISP 32
iert
11
IP Subnet – variable length
202.141.55.0/24
0-0000000
1-0000000 128 : 128 – 255 202.141.55.128/25
64 : 128 – 191 : 1-0-000000 ---- 1-0-111111 to iiita 202.141.55.128/26
1-0-000000
1-1-000000 64 : 192 --- 255
32 : 192 --- 223 : 1-1-0-00000 ---- 1-1-0-11111 to iert 202.141.55.192/27
1-1-0-00000
1-1-1-00000 32 : 224 ---- 255 left with ISP 202.141.55.224/27
This is variable length subnetting, smallest block is of 4 addresses only 2 usable for nodes
202.141.55.111000-00/30 4 :224 -- 227
12
IP Subnet – variable length
allotted s1 – s10, left s11-s16 s10 – 144, s11 – 160, s12 – 176, s13 – 192,
s2 s4
s1 s3
s5 s6 s7 s8
s9
s10
13
IP Subnet
supper netting : combine subnets to form bigger network
202.141.00001000.0/24
202.141.00001001.0/24
202.141.00001010.0/24 202.141.000010-00.0/22 --- 1024 addresses
202.141.00001011.0/24
14
IP Subnet
Historically : IP address divided in A,B,C,D,E classes
Divided by the value of first byte
A class : 1-127 , netmask /8 i.e. 255.0.0.0 105.60.1.5/8 net id – 8 bits node id – 24 bits
B class : 128 – 191, netmask /16 i.e. 255.255.0.0 130.60.1.5/16 net id – 16 bits node id – 16 bits
C class : 192 – 223, netmask /24 255.255.255.0 202.141.55.0/24 net id 24 bits node id – 8 bits
15