You are on page 1of 44

IP Addressing

ALTTC/ DX Faculty

What is an IP address?
Each host on a TCP/IP network is
uniquely identified at the IP layer
with an address.
An Internet Protocol (IP) address
specifies the location of a host or
client on the Internet.
The IP address is also known as
Protocol address
The IPv4 address is 32 bits long

ALTTC/ DX Faculty

IPv4 Address Scheme

What the Internet machines see an IP


address?
11001010000011100100000000000001
For human understanding the 32 bits of
IP address are separated into 4 bytes of 8
binary digits
Each binary byte is converted into
decimal and is separated by a dot hence
also known as Dotted Decimal Notation
How
we
see
an
IP
address?
202.14.64.1

ALTTC/ DX Faculty

IPv4 Address Scheme


32 Bits
Network

Host

8 Bits 8 Bits 8 Bits 8 Bits


172

16

. 122 . 204

In decimal the address range is


0.0.0.0 to 255.255.255.255
The IP address is of the form
<networkID,hostID>

ALTTC/ DX Faculty

IPv4 Address Scheme

Two types of addressing schemes for IPv4


Classful
Classless
Classful
Original style of addressing based on first few
bits of the address.
Generally used in customer sites.
Classless
A new type of addressing that disregards the
class bit of an address and applies a variable
prefix (mask) to determine the network number.

ALTTC/ DX Faculty

IPv4 Address Scheme

There are five classes of addresses A, B, C, D & E.


A, B & C classes are used to represent host and
network address.
Class D is a special type of address used for
multicasting.
Class E is reserved for experimental use.

ALTTC/ DX Faculty

IPv4 Address classes


Class-A:

Class-B:

Class-C:

Class-D:

For Multicast

Class-E:

For Research

N=Network number assigned by IR.


H=Host number assigned by network administrator.
ALTTC/ DX Faculty

Network Address Mask

Class-A Address

00001010.00001010.01000000.00001001
Natural or Default Mask is /8
11111111.00000000.00000000.00000000
255.0.0.0

Class-B Address

10001010.00001110.01010000.00000001
Natural or Default Mask is /16
11111111.11111111.00000000.00000000
255.255.0.0

ALTTC/ DX Faculty

Network Address Mask

Class-C Address

11001010.00001100.01000000.10000001
Natural or Default Mask is /24
11111111.11111111.11111111.00000000
255.255.255.0

ALTTC/ DX Faculty

Identifying a class of address


Address Identifier Network Address

0 7 bits Network Address

10

110

1110

1111

ALTTC/ DX Faculty

Host Address

24 bits Host Address

14 bits Network Address

21 bits Network Address

16 bits Host Address

8 bits Host Address

Multicast address (224.0.0.0-239.255.255.255)

Reserved for future use

10

Class-A address (Networks)


0nnnnnnn

hhhhhhhh

Network

0 7 bits Network Address

hhhhhhhh

hhhhhhhh

Host

24 bits Host Address

Number of Networks = 27 i.e.128 (0-127)


Network ID 0 is not used.
Network ID 127 is reserved for loop back and is
used for internal testing.
Number of Networks = 126
Network IDs = 1-126

ALTTC/ DX Faculty

11

Class-A address (Hosts)


0nnnnnnn

hhhhhhhh

Network

0 7 bits Network Address

hhhhhhhh

hhhhhhhh

Host

24 bits Host Address

Number of Hosts=224=16777216
No Host ID can have all zeros
i.e. 0.0.0 and specifies network address.
No Host ID can have all ones
i.e. 255.255.255 and specifies the broadcast
address.
Number of Hosts per network= 224 -2=16777214

ALTTC/ DX Faculty

12

IPv4 address
All 0s in the host ID indicates the network itself.

All 1s in the host ID indicates the broadcast address.


203.251.7.0

168.126.0.0

203.251.7.255

168.126.255.255

203.251.7.00000000
203.251.7.11111111

ALTTC/ DX Faculty

168.126.00000000.00000000
168.126.11111111.11111111

13

Class-B address
10nnnnnn

nnnnnnnn

hhhhhhhh

Network

10

14 bits Network Address

hhhhhhhh

Host

16 bits Host Address

Number of Networks = 214 i.e.16384


Number of Hosts = 216 i.e. 65,536 (0-65,535)
No Host ID can have all zeros
i.e. 0.0 and specifies network address.
No Host ID can have all ones
i.e. 255.255 and specifies the broadcast address.
Number of Hosts per network= 216 -2=65534

ALTTC/ DX Faculty

14

Class-C address
110nnnnn

nnnnnnnn

nnnnnnnn

Network

110

21 bits Network Address

hhhhhhhh
Host

8 bits Host Address

Number of Networks = 221 i.e. 2097152


Number of Hosts = 28 i.e. 256 (0-255)
No Host ID can have all zeros
i.e. 00000000 and specifies network address.
No Host ID can have all ones
i.e. 11111111 and specifies the broadcast
address.
Number of Hosts = 28-2 = 254

ALTTC/ DX Faculty

15

Class-D & E addresses


1110

Multicast address (224.0.0.0-239.255.255.255)

Class D are special addresses are known as


multicast addresses
This address is assigned to a group of networks
and not to represent a unique address
This address is used to send IP datagrams to a
group but not to all the hosts on the network
This address is also used to address router update
messages
1111

ALTTC/ DX Faculty

Reserved (240.0.0.0-255.255.255.255)
16

IP Address Bit Patterns


8 Bits 8 Bits 8 Bits 8 Bits
Class-A:

00000000

01111111

0-127

Class-B:

10000000

10111111

128-191

Class-C:

11000000

11011111

192-223

Class-D:

11100000

11101111

224-239

Class-E:

11110000

11111111

240-255

ALTTC/ DX Faculty

17

Address space utilisation


128
10000000

127
01111111

100%

B-25%

191

10111111

0
1

192

11000000
C-12.5%
D-6.25%
11100000
E-6.25%

11110000

ALTTC/ DX Faculty

224
11101111
11111111

239

A-50%

11011111

223

240

00000000
255

18

Networks Vs Hosts

In Classless environment we can have


232=4294967296 Hosts
Class
Networks
Hosts/Network
A
126
16777214
B
16384
65354
C
2097152
254
Having 16777214 hosts for Class-A and
254 hosts for Class-C were not working
well

ALTTC/ DX Faculty

19

Subnetting

Chopping up of a network into a number of smaller


networks is called subnetting.
Allows to assign some of the bits, normally used
by the host portion of the address, to the network
portion of the address.
The format of subnetted IP address would be
<network number, subnet number, host number>
Efficiently uses the full network address.
Subnet is a real network under a network.
Any of the classes can be subnetted.

ALTTC/ DX Faculty

20

Subnetting (1 Bit)
N.N.N.H

Subnet-2
N.N.N.128/25

Subnet-1
N.N.N.0/25

Hosts:
27-2=126
(1-126)

ALTTC/ DX Faculty

Hosts:
27-2=126
(1-126)

N.N.N.0hhhhhhh
N.N.N.1hhhhhhh
0000000 - 0
0000001 - 1
0000010 - 2
.
.
.
.
1111110 - 126
1111111 - 127

21

Subnetting (2 Bits)
N.N.N.H
SN3
N.N.N.128/26

Hosts:62

Hosts:62
0

1
SN4
N.N.N.192/26

Hosts:62
(1-62)

ALTTC/ DX Faculty

SN2
N.N.N.64/26

N.N.N.00hhhhhh
N.N.N.01hhhhhh
N.N.N.10hhhhhh
N.N.N.11hhhhhh

1
0

SN1
N.N.N.0/26

Hosts:62
(1-62)

000000 - 0
000001 - 1
000010 - 2
.
.
.
.
111110 - 62
111111 - 63
22

Subnetting (8 Bits)
IP Address

172

16

Network

Default / Natural Mask

255

Host

255

Network

8 bit Subnet Mask

255

Default / Natural Mask


8 bit Subnetting
ALTTC/ DX Faculty

:
:

0
Host

255

Network

255

Subnet

Host

172.16.H.H /16
172.16.N.H /24
23

Identifying Network Address


201.222.5.121/29

11001001

11011110

00000101

01111001

Subnet Mask

11111111

11111111

11111111

11111000

11001001

11011110

00000101

01111000

ANDing

Network

201

222

120

Five bits of subnetting


Subnet address: 201.222.5.120 (0+64+32+16+8)
Host Number : 1
ALTTC/ DX Faculty

24

Variable Length Subnet Mask

Subnetting creates subnets with equal number of


hosts, in a network.
The number of bits subnetted i.e. the length of
subnet mask will be same for all the subnets.
To co-op with the variable number of hosts in
subnets, in a network, number subnetted bits i.e.
the length of subnet mask for the subnets will
also vary.
The method of achieving subnetting, with variable
length of subnet mask, is known as Variable
Length Subnet Mask.

ALTTC/ DX Faculty

25

Variable Length Subnet Mask


E- 100H
A- 50H
C- 14H
B- 13H
D- 6H
SL1
SL2
SL3

= 27 = 128
= 26 = 64
= 24 = 16
= 24 = 16
= 23 = 8
= 22 = 4
= 22 = 4
= 22 = 4

202.195.32.0
A (50 Hosts)
E (100 Hosts)

Link-3
S0
S0

E0
E1

Link-2

S1
E0

S1
Link-1
S0

B (13 Hosts)

E0

C (14 Hosts)

ALTTC/ DX Faculty

E1

D (6 Hosts)

26

Variable Length Subnet Mask


E- 100H
A- 50H
C- 14H
B- 13H
D- 6H
SL1
SL2
SL3

E A C B D SL1SL2SL3-

= 27 = 128
= 26 = 64
= 24 = 16
= 24 = 16
= 23 = 8
= 22 = 4
= 22 = 4
= 22 = 4

202.195.32.0 0000000
202.195.32.10 000000
202.195.32.1100 0000
202.195.32.1101 0000
202.195.32.11100 000
202.195.32.111010 00
202.195.32.111011 00
202.195.32.111100 00

ALTTC/ DX Faculty

A
0
10

1
0

01
0

1
0

27

Variable Length Subnet Mask


N/W
N/W Address
E - 202.195.32.0 0000000
202.195.32.0
A - 202.195.32.10 000000
202.195.32.128
C - 202.195.32.1100 0000
202.195.32.192
B - 202.195.32.1101 0000
202.195.32.208
D - 202.195.32.11100 000
202.195.32.224
SL1 - 202.195.32.111010 00
202.195.32.232
SL2 - 202.195.32.111011 00
202.195.32.236
SL3 - 202.195.32.111100 00
202.195.32.240
Network Address:
Set all host bits to zero
Calculate the binary value of last byte
ALTTC/ DX Faculty

28

Variable Length Subnet Mask


N/W
B/C Address
E - 202.195.32.0 1111111
202.195.32.127
A - 202.195.32.10 111111
202.195.32.191
C - 202.195.32.1100 1111
202.195.32.207
B - 202.195.32.1101 1111
202.195.32.223
D - 202.195.32.11100 111
202.195.32.231
SL1 - 202.195.32.111010 11
202.195.32.235
SL2 - 202.195.32.111011 11
202.195.32.239
SL3 - 202.195.32.111100 11
202.195.32.243
Broadcast Address:
Set all host bits to one
Calculate the binary value of last byte
ALTTC/ DX Faculty

29

Variable Length Subnet Mask


N/W
E A C B D SL1 SL2 SL3 N/W
EACBDSL1SL2SL3ALTTC/ DX Faculty

N/W Address
B/C Address
202.195.32.0
202.195.32.127
202.195.32.128
202.195.32.191
202.195.32.192
202.195.32.207
202.195.32.208
202.195.32.223
202.195.32.224
202.195.32.231
202.195.32.232
202.195.32.235
202.195.32.236
202.195.32.239
202.195.32.240
202.195.32.243
IP Address Range
202.195.32.1 202.195.32.126
202.195.32.129 202.195.32.190
202.195.32.193 202.195.32.206
202.195.32.209 202.195.32.222
202.195.32.225 202.195.32.230
202.195.32.233 202.195.32.234
202.195.32.237 202.195.32.238
202.195.32.241 202.195.32.242
30

CIDR

Classless Inter Domain Routing


Pronounced as - cider
Also known by the name supernetting
RFC 1519
Helps in reducing number of route table
entries

192.168.0.0/24
192.168.1.0/24
192.168.2.0/24
192.168.3.0/24

ALTTC/ DX Faculty

192.168.0.0/22

31

Without CIDR
NAP

198.32.1.0
198.32.2.0
198.32.3.0

198.0.0.0 through
198.255.255.0
ISP3

198.32.0.0 through
198.32.255.0
ISP1
198.32.1.0 198.32.2.0

ALTTC/ DX Faculty

198.32.3.0

198.32.1.0
198.32.3.0
198.32.2.0
198.33.1.0
198.33.1.0
198.33.0.0 through
198.33.255.0
ISP2
198.33.1.0

32

With CIDR
NAP
198.0.0.0/8

198.32.0.0/16

198.0.0.0/8
ISP3

198.33.0.0/16
ISP2

198.32.0.0/16
ISP1
198.32.1.0 198.32.2.0

ALTTC/ DX Faculty

198.33.0.0/16

198.32.3.0

198.33.1.0

33

CIDR

Initially IP addresses were arbitrarily handed out


without regard to geographic location and were
overtaxing the Internet routing tables
Class A stopped being handed out and Class-B
was exhausted
With the remaining Class-C addresses the whole
world has been divided into 4 zones
Each zone is given a portion of Class-C addresses
194.0.0.0 to 195.255.255.255 (Europe)
198.0.0.0 to 199.255.255.255 (North America)
200.0.0.0 to 201.255.255.255 (C&S.America)
202.0.0.0 to 203.255.255.255 (Asia & the Pacific)

ALTTC/ DX Faculty

34

CIDR

Each zone is given about (2x224) 32 million


addresses to allocate
Another (20x224) 320 million Class-C addresses
204.0.0.0 to 223.255.255.255 are reserved for
future.
32 million address entries have been compressed
to one router table entry.
Any route outside Europe that gets packet
addressed to 194.0.0.0 to 195.255.255.255 can just
send it to Standard European Gateway.
Once a packet gets to Europe (2x28x28) 131072
network entries are needed, if /16 bits prefix is
used.

ALTTC/ DX Faculty

35

Internet Registry (IR)

An Internet Registry is an organisation that is


responsible for distributing IP address space to
its members or customers and for registering
those distributions. IRs can be classified as:
RIRs (Regional Internet Registery)
NIRs (National Internet Registery)
LIRs (Local Internet Registery)

ALTTC/ DX Faculty

36

Internet Registries
IANA
InterNIC
America

RIPE
Europe

APNIC
Asia

Regional

National

Local
Consumer

ALTTC/ DX Faculty

37

Private Address Space

IANA has reserved the following three blocks of


the IP address space for private internets (RFC
1918):

10.0.0.0 - 10.255.255.255 (10.0.0.0/8 prefix)

172.16.0.0 - 172.31.255.255 (172.16.0.0/12 prefix)

24-bit block
Complete class-A network number
172.0001/0000.0.0-172.0001/1111.255.255
20-bit block
Set of 16 contiguous class-B network numbers

192.168.0.0 - 192.168.255.255 (192.168.0.0/16 prefix)

16-bit block
Set of 256 contiguous class-C network numbers

ALTTC/ DX Faculty

38

Decimal Notation

28181D or 2818110
10 digits are used this notation ( 0, 1, 2, 3, 4, 5, 6,
7, 8, 9)
10000

1000

100

10

104

103

102

101

100

=10000x2+1000x8+100x1+10x8+1x1
=20000+8000+100+80+1
=28181D

ALTTC/ DX Faculty

39

Binary Notation
2 digits are used this notation ( 0 & 1)
11010011102 or 846D

846

423

211

105

52

26

13

ALTTC/ DX Faculty

512

256

128

64

32

16

29

28

27

26

25

24

23

22

21

20

11010011102
=512x1+256x1+128x0+64x1+32x0+16x0
+8x1+4x1+2x1+1x0
=512+256+64+8+4+2=846D

40

Hexa-decimal Notation

16 digits are used this notation ( 0, 1,


2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F)
6E1516 or 6E15H or 28181D

16

28181

16

1761

4096

256

16

16

110

163

162

161

160

16

ALTTC/ DX Faculty

6E15H
=4096x6+256x14+16x1+1x5
=24576+3584+16+5=28181D
41

Decimal; Binary Hexa-decimal


Decimal
0

Binary
0000

Hexa-decimal
0

1
2
3

0001
0010
0011

1
2
3

0100

0101

0110

0111

1000

9
10
11

1001
1010
1011

9
A
B

12

1100

13

1101

14
15

1110
1111

E
F

ALTTC/ DX Faculty

42

Binary Hexa-decimal Notation


2

3333

1666

2048

1024

512

256

128

64

32

16

833

211

210

29

28

27

26

25

24

23

22

21

20

416

208

104

52

26

13

ALTTC/ DX Faculty

1101000001012
=2048x1+1024x1+256x1+4x1+1x1
=2048+1024+256+4+1=3333D
=1101 0000 01012
=162xD+ 161x0 + 160x5 =D05H

43

ALTTC/ DX Faculty

44

You might also like