0% found this document useful (0 votes)
9 views

Ip Subneting

Uploaded by

ashishatulsian10
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Ip Subneting

Uploaded by

ashishatulsian10
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 15

Network Layer -- IP

Network Layer : --- Logical addressing


--- routing

Logical addressing : IP address --- identifier to identify node over Internet

Routing : --- to find path from S to D


---- to forward packet along the path from S to D

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

TH : 0 – 15 00-00-0000 ---- 00-00-1111 block number --- net id


TDH: 16 – 31 00-01-0000 ---- 00-01-1111 sub block number -- subnet id – can further divide
MH : 32 – 47 00-10-0000 ---- 00-10-1111 node number --- node id or host id
PH : 48 – 63 00-11-0000 ---- 00-11-1111

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

s1, s2, s3 n1, n2, n3, n4, n5, n6,


n7,n8

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

To find if address 00010011 belong to hostel or not


00010011 && 11000000 = 00000000 = 0 (decimal) address of hostel H
Belong to which hostel
00010011 && 11110000 = 00010000 = 16 (decimal) address of hostel TDH
Find address 01000011, 10000011, 11000011 belong to which block
Will find how netmask is used in routing table

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

255 . 255 . 255 . 0

Network address is 202.141.55.0/24 --- first address of the block


Broadcast address is 255.255.255.255 --- last address of the block

7
IP Subnet – Fix length
Allocation of IP address

if ISP has 202.141.55.0/24 and 10 customers requires at least 10 address each


for 10 address require 4 bits 2^4 = 16, 3bits 2^3 = 8 <10, so 4 bits in host id
Net id 202.141.55 can not be changed
Addresses can be given from last 8 bits only, so subnet id 8-4 = 4 bits
Using 4 bits no of subnet = 2^4 = 16 0000-------0000 /x=24+4=28
subnet id host id

202.141.55.0000-0000 ---- 202.141.55.0000-1111 .0 --- .15 s1 /x is /28 i.e. mask


.0001-0000 ---- .0001-1111 .16 --- .31 s2 255.255.255.11110000
.0010-0000 ---- .0010-1111 .32 --- .47 s3 255.255.255.240
.0011-0000 ---- .0011-1111 .48 --- .63 s4
: : :
.1111-0000 ---- .1111-1111 .240 --- .255 s16

8
IP Subnet – Fix length
allotted s1 – s10, left s11-s16

s2 s4
s1 s3

s5 s6 s7 s8
s9
s10

Now 2 customers D,E demand for 5 address each


3 customers, A – 12 addresses, B – 2 addresses, C – 2 addresses

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

Why subnets created :


1 – organization logical view map to IP address groups – easy for management
2– reduction of traffic --- to send packet – broad cast traffic limited to subnet
--- faulty NIC generated traffic limited to subnet
3 – fault detection is easy – need to look into 14 nodes instead of 254 nodes

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

128 : 0 – 127 : 0-0000000 --- 0-1111111 to mnnit 202.141.55.0/25

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

2 customers A – 2, B – 5 allocate from s11 block A /x-30 B /x-29

13
IP Subnet
supper netting : combine subnets to form bigger network

202.141.8.0/24, 202.141.9.0/24, 202.141.10.0/24, 202.141.11.0/24 can be combined


into single network 202.141.8.0/22

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

Or 202.141.8.0/24 & 202.141.9.0/24  202.141.8.0/23 -- 512


202.141.10.0/24 & 202.141.11.0/24  202.141.10.0/23 -- 512
But can not combine 202.141.9.0/24 & 202.141.10.0/24  202.141.9.0/22 or 202.141.9.0/23

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

D class : 224 – 239, multicast addresses

E class 240 – 255 reserved

127 : loop back address 127.0.0.1/8, 0.0.0.0 --- special address

Private IP : 10.0.0.0/8, 172.16-31.0.0/16, 192.168.0.0/24

15

You might also like