Você está na página 1de 18

IE

S
G
O
LO
T

IP Address

IP Address is Logical Address

O
O

It is a Network Layer address (Layer 3)

Two Versions of IP:


IP version 4 is a 32 bit address
IP version 6 is a 128 bit address

IP version 4

Bit is represent by 0 or 1 (i.e. Binary)


IP address in binary form (32 bits):

IE
S

01010101000001011011111100000001
32 bits are divided into 4 Octets:
First Octet

Second Octet

Third Octet

Forth Octet

IP address in decimal form:

IP version 6

85.5.191.1

O
LO

01010101. 00000101. 10111111. 00000001

It is represented in Hex notation

O
O

FEDC:BA98:7654:3210:FEDC:BA98:7654:3210

Format of IPv6 address:


x : x : x : x : x : x : x : x where x is 16 bits Hexa
Not case sensitive for A,B,C,D,E,F
Leading zeros in a field are Optional.
Successive Fields of 0 can be represented as ::
but only once.
Eg: 2031:0000:0000:130f:0000:0000:09c4:1300
The above example can be rewritten as below:
2031::130f:0:0:9c4:1300
4

Comparison between IPv4 & IPv6

IPv4

ID

Tot.
Length

Flags

Fragment
offset

Protocol

IPv6
Version

Traffic
Class

Payload Length

Checksum

Flow Label

Next
Header

Source Address

Destination Add

Destination Add

Padding

Options

Hop Limit

Source Address

O
LO

TTL

TOS

IE
S

IHL

Version

IPv4 address range

O
O

Taking Example for First Octet :


Total 8 bits, Value will be 0s and 1s
i.e. 28 = 256 combination
27 26 25 24 23 22 21 20
0 0 0 0 0 0 0 0 = 0
0 0 0 0 0 0 0 1 = 1
Total IP Address Range
0 0 0 0 0 0 1 0 = 2
0 0 0 0 0 0 1 1 = 3
0.0.0.0
0 0 0 0 0 1 0 0 = 4
to

255.255.255.255
1

= 255
6

IP Address Classification

IP Addresses are divided into 5 Classes

Used in LAN & WAN

CLASS C
Reserved for Multicasting

CLASS E

Reserved for Research &


Development

Priority Bit

O
LO

CLASS D

CLASS B

IE
S

CLASS A

O
O

Priority Bit is used for IP Address classification.


Most significant bit(s) from the first octet are selected
for Priority Bit(s).

Class A priority bit is

Class B priority bits are

10

Class C priority bits are

110

Class D priority bits are

1110

Class E priority bits are

1111

CLASS A Range

In Class A : First bit of the first octet


is reserved as priority bit, bit value is zero.
25
0
0
0
0
0

24
0
0
0
0
0

23
0
0
0
0
0

22 21
0 0
0 0
0 1
0 1
1 0

20
0 =
1 =
0 =
1 =
0 =

Class A Range

0 . 0 . 0 . 0 to
127.255.255.255

Exception
0.X.X.X and 127.X.X.X
networks are reserved

= 127

CLASS B Range

0
1
2
3
4

26
0
0
0
0
0

O
LO

27
0
0
0
0
0

IE
S

0xxxxxxx. xxxxxxxx. xxxxxxxx. xxxxxxxx

In Class B : First two bits of the first


octet are reserved as priority bits, bit value as 10.

10xxxxxx. xxxxxxxx. xxxxxxxx. xxxxxxxx


26
0
0
0
0
0

25
0
0
0
0
0

24
0
0
0
0
0

23
0
0
0
0
0

22 21
0 0
0 0
0 1
0 1
1 0

20
0 =
1 =
0 =
1 =
0 =

O
O

27
1
1
1
1
1

128
129
130
131
132

Class B Range

128. 0 . 0 . 0
to
191.255.255.255

= 191
10

CLASS C Range

For Class C range : First Three bits of the first


octet are reserved as priority bits, bit value as 110.
25
0
0
0
0
0

24
0
0
0
0
0

23
0
0
0
0
0

22 21
0 0
0 0
0 1
0 1
1 0

20
0 =
1 =
0 =
1 =
0 =

Class C Range

192. 0 . 0 . 0
to
223.255.255.255

= 223

11

CLASS D Range

192
193
194
195
196

26
1
1
1
1
1

O
LO

27
1
1
1
1
1

IE
S

110xxxxx. xxxxxxxx. xxxxxxxx. xxxxxxxx

For Class D range : First four bits of the first


octet are reserved as priority bits, bit value as 1110.

1110xxxx. xxxxxxxx. xxxxxxxx. xxxxxxxx


26
1
1
1
1
1

25
1
1
1
1
1

24
0
0
0
0
0

23
0
0
0
0
0

22 21
0 0
0 0
0 1
0 1
1 0

20
0 =
1 =
0 =
1 =
0 =

O
O

27
1
1
1
1
1

224
225
226
227
228

Class D Range

224. 0 . 0 . 0
to
239.255.255.255

= 239
12

CLASS E Range

For Class E range : First four bits of the first


octet are reserved as priority bits, bit value as 1111.
24
1
1
1
1
1

23
0
0
0
0
0

22 21
0 0
0 0
0 1
0 1
1 0

1 1

20
0 =
1 =
0 =
1 =
0 =

240
241
242
243
244

Class E Range

240. 0 . 0 . 0
to
255.255.255.255

25
1
1
1
1
1

O
LO

26
1
1
1
1
1

= 255

13

Octet Format

27
1
1
1
1
1

IE
S

1111xxxx. xxxxxxxx. xxxxxxxx. xxxxxxxx

O
O

IP address is divided into Network & Host Portion


CLASS A is written as

N.H.H.H

CLASS B is written as

N.N.H.H

CLASS C is written as

N.N.N.H

14

CLASS A No. Networks & Hosts


Class A Octet Format is N.H.H.H
Network bits : 8

Host bits : 24

No. of Networks

IE
S

2no of network bits Priority bit


28-1
(-1 is Priority Bit for Class A)
7
2
128 2 (-2 is for 0 & 127 Network)
126 Networks

CLASS A

126 Networks

=
=
=
=
=

&

O
LO

No. of Host per network.


16777214 Hosts per
no
of
host
bits
Network
= 2
-2
= 224 2 (-2 is for Network ID & Broadcast ID)
= 16777216 - 2
= 16777214 Hosts/Network
15

CLASS B No. Networks & Hosts


Class B Octet Format is N.N.H.H

Network bits : 16

Host bits : 16

No. of Networks
2no of network bits Priority bit

=
=
=

216-2 (-2 is Priority Bit for Class B)


214
16384 Networks

O
O

CLASS B
16384 Networks

&
No. of Host per network
65534
Hosts
per Network
no
of
host
bits
= 2
-2
= 216 2 (-2 is for Network ID & Broadcast ID)
= 65536 - 2
= 65534 Hosts/Network
16

CLASS C No. Networks & Hosts


Class C Octet Format is N.N.N.H
Network bits : 24

Host bits : 8

2no of network bits Priority bit

=
=
=

224-3 (-3 is Priority Bit for Class C)


221
2097152 Networks

IE
S

No. of Networks

CLASS C

2097152 Networks

&

No. of Host per network

254 Hosts per Network

2no of host bits -2

=
=
=

28 2 (-2 is for Network ID & Broadcast ID)


256 - 2
254 Hosts/Network
17

O
LO

Network & Broadcast ID

O
O

Network ID: IP address with all bits as ZERO in the


host portion.

Broadcast ID: IP address with all bits as ONES in the


host portion.
Valid IP Addresses lie between the Network ID and
the Broadcast ID.
Only Valid IP Addresses are assigned to hosts/clients

18

Example - Class A

Class A
10.0.0.0
10.0.0.1
10.0.0.2
10.0.0.3

Network Address

IE
S

Class A : N.H.H.H
Network Address :
0xxxxxxx.00000000.00000000.00000000
Broadcast Address :
0xxxxxxx.11111111.11111111.11111111

O
LO

Valid IP Addresses

10.255.255.254
10.255.255.255

Broadcast Address

19

Example - Class B

O
O

Class B : N.N.H.H
Network Address :
10xxxxxx.xxxxxxxx.00000000.00000000
Broadcast Address :
10xxxxxx.xxxxxxxx.11111111.11111111

Class B
172.16.0.0
172.16.0.1
172.16.0.2
172.16.0.3

172.16.255.254
172.16.255.255

Network Address

Valid IP Addresses

Broadcast Address
20

10

Example - Class C

Class C
192.168.1.0
192.168.1.1
192.168.1.2
192.168.1.3

Network Address

IE
S

Class C : N.N.N.H
Network Address :
110xxxxx.xxxxxxxx.xxxxxxxx.00000000
Broadcast Address :
110xxxxx.xxxxxxxx.xxxxxxxx.11111111

O
LO

Valid IP Addresses

192.168.1.254
192.168.1.255

Broadcast Address

21

Private IP Address

O
O

There are certain addresses in each class of IP


address that are reserved for Private Networks.
These addresses are called private addresses.
Class A

10.0.0.0 to 10.255.255.255
Class B

172.16.0.0 to 172.31.255.255
Class C

192.168.0.0 to 192.168.255.255

22

11

Subnet Mask

23

O
LO

Represented with all 1s in the network portion


and with all 0s in the host portion.

IE
S

Subnet Mask differentiates Network portion and Host


Portion

Subnet Mask - Examples

O
O

Class A : N.H.H.H
11111111.00000000.00000000.00000000
Default Subnet Mask for Class A is 255.0.0.0

Class B : N.N.H.H
11111111.11111111.00000000.00000000
Default Subnet Mask for Class B is 255.255.0.0
Class C : N.N.N.H
11111111.11111111.11111111.00000000
Default Subnet Mask for Class C is 255.255.255.0

24

12

How Subnet Mask Works ?


IP Address :
Subnet Mask :

192.168.1.1
255.255.255.0

IE
S

ANDING PROCESS :

192.168.1.1
= 11000000.10101000.00000001.00000001
255.255.255.0 = 11111111.11111111.11111111.00000000
=======================================
192.168.1.0
= 11000000.10101000.00000001.00000000
=======================================

25

Subnetting

O
LO

The output of an AND table is 1 if both its inputs are 1.


For all other possible inputs the output is 0.

Creating Multiple independent Networks from a Single


Network.

O
O

Converting Host bits into Network Bits


i.e. Converting 0s into 1s

Subnetting can be performed in two ways.


FLSM (Fixed Length Subnet Mask)
VLSM (Variable Length subnet mask)

Subnetting can be done based on requirement .


Requirement of Networks ?
Requirement of Hosts ?

26

13

Scenario for subnetting


ZOOM Technologies is having 100 PC

Which IP address Class is preferred for the network ?


Answer : Class C.

192.168.1.1
192.168.1.21
192.168.1.41
192.168.1.61
192.168.1.81

to
to
to
to
to

192.168.1.20
192.168.1.40
192.168.1.60
192.168.1.80
192.168.1.100

O
LO

MCSE
CISCO
Hardware
Linux
Exchange

27

ZOOM Technologies 192.168.1.0/24

IE
S

In ZOOM Technologies there are 5 Five Departments


with 20 PCs each

Scenario (continued)

Administrators Requirement :
Inter-department communication should not be
possible ?

O
O

Solution.
Allocate a different Network to each Department
i.e.
MCSE
192.168.1.1 to 192.168.1.20
CISCO
192.168.2.1 to 192.168.2.20
Hardware
192.168.3.1 to 192.168.3.20
Linux
192.168.4.1 to 192.168.4.20
Exchange
192.168.5.1 to 192.168.5.20

28

14

Main Aim of Subnetting

Problem with the previous Scenario is :-

IE
S

Broadcast is done for 254 IPs rather than for 20 IPs.

29

Power table

O
LO

Wastage of IP addresses (Approximately 1000)

29 = 512

217 = 131072

225 = 33554432

22 = 4

210 = 1024

218 = 262144

226 = 67108864

23 = 8

211 = 2048

219 = 524288

227 = 134217728

24 = 16

212 = 4096

220 = 1048576

228 = 268435456

25 = 32

213 = 8192

221 = 2097152

229 = 536870912

26 = 64

214 = 16384 222 = 4194304

230 = 1073741824

27 = 128 215 = 32768 223 = 8388608

231 = 2147483648

O
O

21 = 2

POWER TABLE

28 = 256 216 = 65536 224 = 16777216 232 = 4294967296


30

15

Some Important Values

VALUES IN SUBNET MASK


Mask

128

10000000

192

11000000

224

11100000

240

11110000

248

11111000

252

11111100

254

255

IE
S

Value

O
LO

Bit

11111110
11111111

31

Requirement of Networks is 5 ?
Example 1

Class C : N.N.N.H
110xxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx
Class C : 192.168.1.0
of Subnet
2n 2 Req. of Subnet
23 2 5 (-2 is for First & Last Subnet Range)
82
6 Subnet

No.
=
=
=
=

of Host
2h 2 (-2 is for Network ID & Broadcast ID)
25 2
32 2
30 Hosts/Subnet

O
O

No.
=
=
=
=

32
HELP

16

Example 1 (Continued)
Customized
= Bits to Network Bits
If you Subnet
convertMask
3 Host
255.
255.
255.
224
6 Subnet & 30 Hosts/Subnet

O
LO

IE
S

11111111.11111111.11111111. 11100000
Customized Subnet Mask
255.255.255.224
Range of Networks
Network ID
Broadcast ID
Subnet Range
192.168.1.31 x
192.168.1.0
192.168.1.32 to 192.168.1.63 MCSE
.
192.168.1.63
192.168.1.32
192.168.1.64 to 192.168.1.95 CISCO
.
192.168.1.95
192.168.1.64
192.168.1.96 to 192.168.1.127 FIREWALL
192.168.1.127
192.168.1.96
192.168.1.128 to 192.168.1.159 SOLARIS
Valid Subnets
192.168.1.159
192.168.1.128
192.168.1.160 to 192.168.1.191 TRAINING
192.168.1.191
192.168.1.160
192.168.1.192 to 192.168.1.223 Future Use
192.168.1.223
192.168.1.192
192.168.1.255 x
192.168.1.224
33

Requirement of Networks is 14 ?
Example 2

Class C : N.N.N.H
110xxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx
Class C : 192.168.1.0
of Subnet
2n 2 Req. of Subnet
24 2 14 (-2 is for First & Last Subnet Range)
16 2
14 Subnet

No.
=
=
=
=

of Host
2h 2 (-2 is for Network ID & Broadcast ID)
24 2
16 - 2
14 Hosts/Subnet

O
O

No.
=
=
=
=

34
HELP

17

Example 2 (Continued)
Customized
= Bits to Network Bits
If you Subnet
convertMask
4 Host
255.
255.
255.
240
14 Subnet & 14 Hosts/Subnet

O
LO

IE
S

11111111.11111111.11111111. 11110000
Customized Subnet Mask
255.255.255.240
Range of Networks
Network ID
Broadcast ID
Subnet Range

192.168.1.15 x
192.168.1.0
192.168.1.16 to 192.168.1.31
192.168.1.16

192.168.1.31
192.168.1.32 to 192.168.1.47
192.168.1.32

192.168.1.47
192.168.1.48 to 192.168.1.63
192.168.1.48

192.168.1.63
192.168.1.64 to 192.168.1.80
Valid Subnets

35

O
O

192.168.1.224
192.168.1.239
192.168.1.224 to 192.168.1.239
192.168.1.240
192.168.1.255 x

18

Você também pode gostar