Sei sulla pagina 1di 56

CNR

Implementation

IP: INTERNET
PROTOCOL

CNR

IP: INTERNET PROTOCOL

Implementation

Every machine on the Internet has a unique identifying number, called


an IP
Address.
For Example: 216.27.61.137
IP addresses usually expressed in decimal format as a dotted decimal
number.
However, computers communicate in binary form:
11011000.00011011.00111101.10001001
The four numbers in an IP address are called Octets.
Each octet has 8 positions. By adding all 4 octets, we get 32 bit
number.
So, An IP is a 32 bit address used for locating a host in a network. (IP
v4)

CNR

Implementation

IP: INTERNET PROTOCOL (CONTD.)

Each bit has 2 states (1/0). Total 8 no of bits per octets


Total number of possible combinations per octets is 28 =256. So, each
octet can
contain any value between 0 and 255.
By combining the 4 octets we get 232= 4,294,967,296 unique values
(About 4.3
billion)
Octets used to create Classes of IP addresses.
Octets are split into 2 sections: Net and Host

CNR

Implementation

AN IP ADDRESS
Denotes the Host Address

Net ID

Host ID
Denotes the network Address

Net is used to identify the network that a computer belongs to.


Host identifies the actual computer on the network.
A Subnet mask is used to Separate Net ID and Host ID from an IP
Address.
Subnet mask is usually represented by / (slash) notation or by
decimal notation.
For Example:
/24 means, upto 24 bit is used for Net address, Rest 8bit is used for
Host address.

CNR

Implementation

There are two ways of IP addressing

Classful Addressing

Classless Addressing

Classful addressing:
There are 5 classes of IP address in Classful Addressing.
First Byte

Second Byte

Third Byte

Fourth Byte

Class A

0 - 127

Class B

128-191

Class C

192 - 223

Class D

224-239

Multicast Address

Class E

240-255

Reserved for Future Use

/8 or 255.0.0.0
/16 or 255.255.0.0
/24 or 255.255.255.0

CNR

Implementation

CLASSES OF IP ADDRESS:
Default Network: The IP address of 0.0.0.0 is used for the
default network. Class A - This class is for very large networks, such
as a major international company might have. IP addresses with a first
octet from 1 to 126 are part of this class. The other three octets are
used to identify each host. In Class A networks, the high order bit value
(the very first binary number) in the first octet is always 0.
0 127 NET

HOST

HOST

HOST

01000000.00011011.00111101.10001001
Value of bit for decimal in their position
Binary format of the 1st Octet

128

64

32

16

Total (64+32+16+8+4+2+1) = 127

Loopback - The IP address 127.0.0.1 is used as the loopback


address. This means that it is used by the host computer to send a

CNR

Implementation

CLASSES OF IP ADDRESS (Contd.)


Classes can be identified by examining the value in the first octet of IP
address

CNR

Implementation

NETWORKS AND HOSTS


- Class A: 128 Networks with 16 million hosts each
- Class B: 16384 Networks with upto 64K hosts each
- Class C: 2 million Networks with 256 hosts each
- Class D: Used for multicasting
- Class E: Reserved
CLASS A: NET AND HOST CALCULATION:
01000000.00011011.00111101.10001001
Total no of Net
Total no of Net: 27
=128
8
Not 2 because 1st octets
is always 0

Total no of Host
1-126.XXX.XXX.XXX
27 . 28 . 28 . 28
So, No of Host: 224 -2
= 16, 777, 214

Total no of Unique ID: (16777214X128) = 2,14,74,83,648

CNR

Implementation

Class B: Net and Host calculation:


Class B is used for medium-sized networks. Class B addresses also
include the second octet as part of the Net identifier.
10010001.00011000.00111101.10001001
145.24.61.137
Total no of Net

Total no of Net: 26.28


=16,384
Class B network have a
1st bit value of 1 and a
2nd bit value of 0 in the
first octet.

Total no of Host
128-191.XXX.XXX.XXX
26 . 28 . 28 . 28
So, No of Host: 216 -2
= 65,534

CNR

Implementation

Class C - Class C addresses are commonly used for small to mid-

size businesses. IP addresses with a first octet from 192 to 223 are
part of this class. Class C addresses also include the second and third
octets as part of the Net identifier. The last octet is used to identify each
host. This means that there are 2,097,152 (221) Class C networks each
with 254 (28 -2) possible hosts for a total of 536,870,912 (229) unique
IP addresses.

Class C networks have a first bit value of 1, second bit value of 1 and
a third bit value of 0 in the first octet.

Class D - Used for multicasts, Class D is slightly different from the

first three classes. It has a first bit value of 1, second bit value of 1, third
bit value of 1 and fourth bit value of 0. The other 28 bits are used to
identify the group of computers the multicast message is intended for.

Class E - Class E is used for experimental purposes only.

CNR

Implementation

Network Address and Broadcast Address


Network address :
- Used to identify the network
- Denoted by values in the network part and all 0s in the host part
Broadcast address :
- Used to address all the hosts in a single network
- Denoted by values in network part followed by all 1s in the host
portion
Examples:

IP

Class

Network Address

Broadcast
Address

192.168.20.3

Class C

192.168.20.0

192.168.20.255

127.0.4.1

Class A

127.0.0.0

127.255.255.255

185.23.5.1

Class B

185.23.0.0

185.23.255.255

CNR

Implementation

There are two ways of IP addressing

Classful Addressing

Classless Addressing

But we need classless Addressing!!!


Although classful addressing is easier and straight forward, we need
classless addressing. The reason is, in classful addressing we are just
wasting lots of IPs and our network design may just not feet that.

For example:
In classful adderssing the IP 172.16.5.0/16 denotes a class B address
having just one network 172.16.0.0 and having 2^16=65536 hosts.
But if we just borrow 7 bits from the Host ID, we can have 2^7 = 128
Subnetworks, Each having 2^9 = 512 Hosts.
As a result, we can design our networks with more flexibility and
Separated Broadcast traffic very easily.

CNR

Implementation

Classless addressing
In classless addressing, There is no predefined subnet masks like /
8, /16 or /24.
We can use any subnet mask to feet our need. For example : /15, /
27, /29, /30 etc
We can borrow bits from Host ID Section to increase no of sub
networks.

CNR

Implementation

SUBNETTING

CNR

Implementation

SUBNETTING
Hosts bits from a given class is reassigned as network bits, known as
borrowing bits
Act of making multiple smaller sub-network from a given network
of any of the classes A, B, C

Advantages:

- Improve manageability

- Enables broadcast containment

- Provided security

Communication between subnets is performed through routers. It is an


internal function of a network performed by network administrator.
From outside the LAN is seen as a single network keeping routing table
small and efficient

CNR

Implementation

Subnet address include


Network portion of the major IP address (Class A, Class B or Class C
network portion)
Subnet field (created by borrowing bits from the original host field of
the major IP address)
Host field (the remaining bits in the original host fields)

CNR

Implementation

Subnet
Subdividing the Host Octets of a Class A Address

Subdividing the Host Octets of a Class B Address

Subdividing the Host Octets of a Class C Address

CNR

Implementation

How many bits to borrow & How to calculate


No. of Subnets
Depends on maximum number of host per subnet
Use the following formulas:
For Classless : No. of usable subnet = 2

(Borrowed bits)

-2

For Classful : No of usable subnet=2Borrowed Bits


No. of usable hosts = 2

(No of remaining host bits)

We are deducting 2 here because

The first address of each subnet is used as Network Address of


that subnet

The last address of each subnet is used as Broadcast Address of


that subnet

CNR

Implementation

Restriction in Subnetting:
The last two bits in the last octet, regardless of the IP address class,
may never be assigned to the sub network
All 0s and all 1s cant be used as the subnet address
All 0s and all 1s cant be used as the host address

CNR

Implementation

Exmaple
5 bits are borrowed

No of usable subnets: 30 (Classless)

No of usable hosts: 6

We need 32 usable subnets

No of bits to borrow: 6

No of usable subnets: 62 (Classless)

No of usable host: 2

No. of subnet
= 2 (Borrowed bits) - 2
No. of hosts
= 2 (No of remaining host bits) 2

Again,
We are given an IP address 192.168.10.0/24.
We have decided it to subnet using /26
So, no. of borrowed bit: 26-24 = 2
So, no. of subnets: 22 = 4 (due to class C IP address)

CNR

Implementation

Subnet Mask
Used to tell devices which part of the IP address in network number
including subnet and which part is the host
Have all 1s in the network portion and all 0s in the host portion
Uses the same format as IP addressing i.e. 32 bit long and divided into
four octets

CNR

Implementation

Default Subnet Masks


Class A :
- N. H. H. H
- 11111111.00000000.00000000.000000000
255 .
0
.
0
.
Class B :
- N. N. H. H
- 11111111.11111111.00000000.000000000
255 . 255
.
0
.
0
Class C :
- N. N. N. H
- 11111111.11111111.11111111.000000000
255 . 255 . 255 .
0

CNR

Implementation

Calculate Subnet mask: Subnetting Class C


address
How can we calculate subnet mask of this IP: 192.168.10.0/26
Binary form of this
IP: 11000000.10101000.00001010.00000000
Net portion
Borrowed
Host portion
portion

11000000.10101000.00001010.

00

000000

To calculate subnet mask, we have to have all 1s in the network portion


and all 0s in the host portion. : 11000000.10101000.00001010.110000
Borrowed
1
2
4
5
6
7
8
SubnettingBitsChart
(Bit Position
and3 Value):
4th
Octet
of the above IP
Value

Subnet mask and


block size calculation
of each subnet

128

64

Subnet Mask value


(128+64)=192

32

16

Block Size = 256 last octet of the


subnet mask
So, Block size= (256-192)=64
NB: Block size (B.S) is used to
determine the network address of each
subnet.

CNR

Implementation

Subnetting class C address:


Another example:
If the subnet mask is: 255.255.255.224 then..

CNR

Implementation

So, conclusion for the given IP address:


192.168.10.0/26
Subnet Mask = 255.255.255.192
From the above calculation
No. of subnet = (22)=4

For Classless :
No. of subnet = 2 (Borrowed bits) - 2
For Classful : No of subnet=2Borrowed Bits

No. of available hosts per subnet = 26-2 = 62.

No. of hosts = 2 (No of remaining host bits) 2

Network Address = 192.168.10.0

From the given IP address 192.168.10.0/24 (putting 0 in


the Host portion)

First Host Address = 192.168.10.1

Next IP of the network address

Last Host Address = 192.168.10.62

Previous IP of the Broadcast address

Broadcast Address = 192.168.10.63

0-63 total 64 IP as the block size is 64.


1st address of each subnet is the Network Address & last
address of each subnet is the Broadcast Address.

First Network

192.168.10.0

Just adding B.S with the previous Network Address. Here


B.S.=64

Second Network

192.168.10.64

Third Network

192.168.10.128

Fourth Network

192.168.10.192

CNR

Implementation

Subnetting Class C address: Subnetting Chart


(last
octet)
Slash Format
/25
/26
/27
/28
/29
/30
N/A
N/A
Bit Borrowed

Value

128

64

32

16

Mask

128

192

224

240

248

252

254

255

Total Subnets

16

32

64

Total Hosts

64

32

16

Usable Hosts

62

30

14

Class C address with a /25 mask only borrows one bit as shown in the
chart above. However, a class B address with a /25 mask borrows 9bits.

CNR

Implementation

Example: Subnetting a class C address


Given IP address: 192.168.10.0/27
Borrowed Bit for Subnetting

27-24 = 3

Subnet Mask

255.255.255.224

Block Size

256 224 = 32 or 25 = 32

No. of Subnets

23 = 8

No. of Hosts/Subnet

25-2 = 32-2 = 30

Subnet addresses

0, 32, 64, 96, 128, 160, 192, 224

192. 168.10.224

Since all of these octets are 255, these network address upto /24 will be
unchanged. Rest of the digits should be changed

All are multiple of the Block Size

CNR

Implementation

Example: Subnetting a class B address


Given IP address : 172.16.0.0/18
Borrowed Bit for Subnetting

18-16 = 2

Subnet Mask

255.255.192.0

Block Size

256 192 = 64 or 26 = 64

No. of Subnets

22 = 4

No. of Hosts/Subnet

214-2 = 16,384-2 = 16,382

Subnet addresses

0, 64, 128, 192

172.16. 192.0

Since all of these octets are 255, these network address upto /16 will be
unchanged. Rest of the digits should be changed

All are multiple of the Block Size

CNR

Implementation

Example: Subnetting a class A address


Given IP address : 10.0.0.0/20
Borrowed Bit for Subnetting

20-8 = 12

Subnet Mask

255.255.240.0

Block Size

256 240 = 16 or 24 = 16

No. of Subnets

212 = 4096

No. of Hosts/Subnet

212 -2 = 4094

Subnet addresses

0, 16,32, 48, 64, 80, 96, .and so on

Since all of these octets are 255, these network address upto /16
will be unchanged. Rest of the digits should be changed

All are multiple of the Block Size

CNR

Implementation

Problems 1

200.200.200.0

5 Subnets

What is the Subnet Mask?

What are the Network Addresses?

What is the Broadcast Domain

What IP Addresses are available?

CNR

Implementation

Problems 1 (contd.)
200.200.200.0 and 5 Subnets
1

What is the CLASS?

C [Range: 192 223]]

How many BITS do we need to borrow?

3 [23-2 = 6] for 5 subnets

Determine Subnet Mask

255.255.255.224

Determine host number

32

Set up Table for network Address , Range & Broadcast Address

Netowrk ID

Fill in Table
Network Id

Range

RANGE

BC
(Reserved for Broadcast Addresses)

(Reserve for Network Address)

Table:
200.200.200.10

BC

200.200.200.0

200.200.200.1 200.200.200.30

200.200.200.31

200.200.200.32

200.200.200.33 200.200.200.62

200.200.200.63

200.200.200.64

200.200.200.65 200.200.200.94

200.200.200.95

200.200.200.96

200.200.200.97 - 200.200.200.126

200.200.200.127

200.200.200.128

200.200.200.129 200.200.200.158

200.200.200.159

200.200.200.160

200.200.200.161 200.200.200.190

200.200.200.191

200.200.200.192

200.200.200.193 200.200.200.222

200.200.200.223

200.200.200.224

200.200.200.225 200.200.200.254

200.200.200.255

CNR

Implementation

Problems 1 (contd.)
Setup subnet

CNR

Implementation

Problems 2
Example : 192.168.10.33 /28
What subnet and broadcast address is the above IP address a
member of?

/28 means 255.255.255.240

B.S= 256 240 = 16.

Subnetworks => 0, 16, 32, 48, 64 ..

But the host address is between the 32 and 48 subnets.

So, The subnet is 192.168.10.32, and the broadcast address is


47. The valid host range is 3346.

CNR

Implementation

Problems 3
Example : 172.16.10.33/27
What subnet and broadcast address is the above IP address a
member of?

/27 means 255.255.255.224

B.S= 256 224 = 32

Subnetworks => 0, 32, 64, 96, ..

But the host address is between the 32 and 64 subnets.

So, The subnet is 172.16.10.32, and the broadcast address is


172.16.10.63. The valid host range is 3362.

CNR

Implementation

Problems 4
You need to create a network having 10 host. What should be
the subnet mask?

That means, we need a subnet containing minimum 10


available IPs for Host.
So,

23 -2 = 6 But this is less than our need

24-2 = 14 This can fit our need.

So, we need 4 bit for Host.


Therefore, the subnet mask should be /28 or 255.255.255.240

CNR

Implementation

Problems 5
You need to create a network having 70 host. What should be
the subnet mask?

That means, we need a subnet containing minimum 70


available IPs for Host.
So,

26 - 2 = 62 But this is less than our need

27 2 =126 This can fit our need.

So, we need atleast 7 bit for Host.


Therefore, the subnet mask should be /25 or 255.255.255.128

CNR

Implementation

Problems 6
Find the Valid hosts for 192.168.10.12/30
Subnet mask : 255.255.255.252
B.S : 256-252 = 6
No. of Hosts = 22-2 = 2
So,

Subnet ID 192.168.10.12

First Host

192.168.10.13

Last Host

192.168.10.14

Broadcast 192.168.10.15

CNR

Implementation

Variable Length
Subnet Mask (VLSM)

CNR

Implementation

What is VLSM?

A Variable Length Subnet Mask (VLSM) is a means of allocating


IP addressing resources to subnets according to their individual need
rather than some general network-wide rule.

VLSM allows an organization to use more than one subnet mask


within the same network address space. It is often referred to as
subnetting a subnet, and can be used to maximize addressing
efficiency.

Subnetting vs. VLSM


Subnetting
Subnetting allows you to divide
big networks into smaller, equalsized slices.

VLSM
VLSM allows you to divide big
networks into smaller, differentsized slices. This enables you to
make maximum use of your
valuable IP address space.

CNR

Implementation

Addressing a Network with Standard


Subnetting

Site A has two Ethernet networks

Site B had one Ethernet network

Site C had one Ethernet network

IP : 207.21.24.0
/24
Site A

25 users 25 users

Site B

Site C

10 users

8 users

How many network addresses are needed?

How many hosts are needed for the largest LAN?

CNR

Implementation

Subnetting in
a
Box
To begin, in a class

C network there are


256 addresses.
When we subnet
the address, we
break it down in to
smaller units or
subnets.

256
addresses

255

CNR

Implementation

Subnetting in
aIf Box
we were to
borrow 1 bit, it
would break the
256 addresses in to
two parts
(networks) with
each part (subnet)
having 128
addresses.
The subnet mask
would be
255.255.255.128.

128

128
addresses

128
addresses

/25

/25

127

255

CNR

Implementation

Subnetting in a
Box
If we were to
borrow 2 bits, it
would break each of
these 2 networks in
half again. This
would give us 4
networks, each with
64 addresses.

128

64
addresse
s
63
64

/26

64
addresse
s
192

191

/26

The subnet mask


would now be
255.255.255.192.

64
addresse
s
/26

64
addresse
s
127

/26

255

CNR

Implementation

Subnetting in a
Box
If we were to
borrow 3 bits, it
would break each of
these 4 networks in
half again. This
would give us 8
networks, each with
32 addresses.
The subnet mask
would now be
255.255.255.224.

32

128

160

32
address
es

32
address
es

32
address
es

32
address
es

/27

/27

/27

/27

31
64

159

63
192

96

191
224

32
address
es

32
address
es

32
address
es

32
address
es

/27

/27

/27

/27

95

127

223

255

CNR

Implementation

Subnetting in a
Box
If we were to
borrow 4 bits, it
would break each of
these 8 networks in
half again. This
would give us 16
networks, each with
16 addresses.
The subnet mask
would now be
255.255.255.240.

32

128

16
16
16
address address
address
es 15
es 47
es 143
16

48

144

160

16
address
es 175
176

16
16
16
16
address address
address
address
es 31
es 63
es 159
es 191
64

96

192

224

16
16
16
16
address address
address
address
es 79
es 111
es 207
es 239
80

112

208

240

16
16
16
16
address address
address
address
es 95
es 127
es 223
es 255

CNR

Implementation

Addressing a Network
Using VLSM
0
32

/30

/30
Site B

Site A

Site C

128

25 users

31
64

Free For
Future Use

63
104

96

25 users

10 users

/28

/27
/27

79

So
Site A,

100
103

111

112

80
95

127
255

8 users

/28

Subnet1 => 207.21.24.0/27


Subnet2 => 207.21.24.32/27
Site B, Subnet1 => 207.21.24.64/28
Site C, Subnet1 => 207.21.24.80/28
P2P Link From Site A to Site B
207.21.24.96/30
P2P Link From Site B to Site C
207.21.24.100/30

CNR

Implementation

AlterNet Way: Addressing a Network


Using VLSM
Highest Number of Host = 25
Useable Host: 25 -2=30 which is
>25
So, number of borrowed Bit: 3
So Subnet Mask is:
11111111.11111111.11111111.1
1100000
=>255.255.255.240.

No. of subnet
= 2 (Borrowed bits) - 2
No. of hosts
= 2 (No of remaining host bits) 2

CNR

Implementation

Problems 7: Addressing a Network Using VLSM


Your company has been assigned IP network 195.39.71.0 /24. Given that
headquarters (60 hosts) is connected to five branch offices (12 hosts
each) by a WAN link, and to an ISP (the ISP owns the addresses on that
link), determine an appropriate IP addressing scheme.
Headquarters
ISP

60 users

Branch 1
12 users

Branch 2
12 users

Branch 3
12 users

Branch 4
12 users

Branch 5
12 users

CNR

Implementation

Given the IP address


195.39.71.0 /24,
subnet according to
the largest subnet
needed.
(Headquarters 60
hosts)
You would need to
borrow 2 bits or /26.
This would give
you 4 networks with
64 host addresses
on each subnet.

128

63

191
192

64

127

255

CNR

Implementation

128

64

192

Playing it safe, we
will not use the first
subnet (subnet 0).

We will start
addressing with
195.39.71.64 /26.
Headquarters needs
60 hosts, so we will
assign them .64 - .
127.

Headquarters
60 hosts
26 bit mask or /
26
(255.255.255.19
2)

CNR

Implementation

The 5 Branch offices


only need 12 hosts
each.
The next address
block available is
the .128 - .191
block (64
addresses). Here
we will apply VLSM.
Using a /28 mask
will give us 16 hosts
at each location.
This will take care of
4 of the Branch
offices.

128

160

Branch 1
12 hosts
/28
(255.255.255.240)

Branch 3
12 hosts
/28
(255.255.255.240)

144

176

Branch 2
12 hosts
/28
(255.255.255.240)

Branch 4
12 hosts
/28
(255.255.255.240)

192

64

Headquarters
60 hosts
26 bit mask or /
26
(255.255.255.1
92)

CNR

Implementation

To obtain a block for


Branch 5, we will
need to subnet the .
192 - .255 block
using a /28 mask.

64

Headquarters

128

160

Branch 1
12 hosts
/28
(255.255.255.240)

Branch 3
12 hosts
/28
(255.255.255.240)

144

176

Branch 2
12 hosts
/28
(255.255.255.240)

Branch 4
12 hosts
/28
(255.255.255.240)

192

224

Branch 5
12 hosts
/28
(255.255.255.240)

60 hosts
26 bit mask or /
26
(255.255.255.1
92)

208

240

CNR

Implementation
0

128

Now we need to
address the 5 WAN
links that connect to
the Branch offices.
These are point-topoint connections
and only require 2
addresses.

Branch 3
Branch 1
12 hosts
12 hosts
/28
/28
(255.255.255.240) (255.255.255.240)

144

176

Branch 4
Branch 2
12 hosts
12 hosts
/28
/28
(255.255.255.240) (255.255.255.240)

192

64

Headquarters
Here we will use a /
30 mask to further
subnet the subnets.

160

60 hosts

Branch 5
12 hosts
/28
(255.255.255.240)

26 bit mask or /
26

208
WA
N1

216
WA
N3

(255.255.255.1
92)

212
WA
N2

220
WA
N4

224
WA
N5

232

228

236

240

CNR

Implementation

Subnet 0 could be
used later if needed
for future growth of
HQ or for more
Branch offices.

128

160

Branch 3
Branch 1
12 hosts
12 hosts
/28
/28
(255.255.255.240) (255.255.255.240)
144

176

Branch 4
Branch 2
12 hosts
12 hosts
/28
/28
(255.255.255.240) (255.255.255.240)
192

64

Headquarters
60 hosts
26 bit mask or /
26
(255.255.255.19
2)

224
WAN
5

Branch 5
12 hosts
/28
228
(255.255.255.240)
208
WAN
1

216
WAN
3

212
WAN
2

220
WAN
4

240

232

236

CNR

Implementation

Applying the Addresses to


the Topology

Address
provided by ISP

9 .7
5.3
19

195.39.71.144 /28

195.39.71.160 /28

5 .3

9 .7

1.2

24

/30

30
0/

195.39.71.128 /28

19

.22
.71

1.2

12

/3 0

30

9
5.3
19

5
19

.7
.39

8/
0
1 .2

195.39.71.216 /30

195.39.71.64 /26

195.39.71.176 /28

195.39.71.192 /28

CNR

Implementation

Thank You

Potrebbero piacerti anche