Está en la página 1de 35

IP Addressing

NGN Faculty ALTTC,Ghaziabad INDIA

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

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
3

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>

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.
5

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.

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.
7

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

Network Address Mask

Class-C Address

11001010.00001100.01000000.10000001
Natural or Default Mask is /24
11111111.11111111.11111111.00000000
255.255.255.0

Identifying a class of address


Address Identifier Network Address

0 7 bits Network Address

10

110

1110

1111

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
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

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

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
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
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

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

17

Address space utilisation


12 12
8 0111111
7
100000
00
1

100%

B-25%
1011111
19 1
1
19
2
110000
00
C-12.5%
1101111
1
22
D-6.25%
3 22
E-6.25%

0
1
0

A-50%

1
1

0
1

1110000
4 23
0
0 1110111 9 24
1
0 25
11110000
1111111
5
1

0000000
0 0

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
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.
20

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

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

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

1 0

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

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

SN2
N.N.N.64/26

Hosts:62

Hosts:62
0

1
1 0

SN4
1
N.N.N.192/26

Hosts:62
(1-62)

SN1
N.N.N.0/26

Hosts:62
(1-62)

N.N.N.00hhhhhh
N.N.N.01hhhhhh
N.N.N.10hhhhhh
N.N.N.11hhhhhh
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

:
:

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
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 cop up 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.
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)

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

A
0
10

1
0

B
D

0
1

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
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
29

Variable Length Subnet Mask


N/W
E A C B D SL1 SL2 SL3 N/W
EACBDSL1SL2SL3-

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

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

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

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)

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.
35

También podría gustarte