Вы находитесь на странице: 1из 53

Network Troubleshooting

IP Addressing 1

Topic & structure of the lesson


Classful IP Address
Subnetting

CT046-3-3 Network Troubleshooting

Communication on Internet
Each host contains an unique IP address
Processes on the Network Layer add source and destination IP
addresses on each outgoing packet
Packet is sent to the nearest router (on the same LAN)
Router forwards the packet based on IP address using its routing
table
Packet reaches destination through the network of routers
End router transmits the packet to the host

CT046-3-3 Network Troubleshooting

IP Address
A 32 bit number (IP v4)
Represented as dotted decimal format
Assigned by IANA to maintain uniqueness

128

16

32

13

(Decimal)

1 0 0 0 0 0 0 0 . 0 0 0 1 0 0 0 0 . 0 0 1 0 0 0 0 0 . 0 0 0 0 1 1 0 1 (Binary)

CT046-3-3 Network Troubleshooting

Example

140.179.220.200
Written in binary form:
140

.179

.220

.200

10001100.10110011.11011100.11001000
We see the address in the decimal form
The computer sees it in the binary form
CT046-3-3 Network Troubleshooting

Octets
The 32-bit IP address is broken up into 4 octets, which
are arranged into a dotted-decimal notation scheme.
An octet is a set of 8 bits & not a musical instrument.
Example of an IP version 4:
172.64.126.52

CT046-3-3 Network Troubleshooting

Routing Table and Network Address


Each host is part of some network (small or large)
Instead of keeping address of each individual host,
router keeps address of the associated network
Network address is unique for any two hosts on two
different LANs
Network address is determined by part of the IP address

CT046-3-3 Network Troubleshooting

Classes of IP address
Classes determine number of bits to be examined for
network address
They are called classful IP Address.
There are 5 classes of IP address namely A, B, C, D, E
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

CT046-3-3 Network Troubleshooting

Classes of IP address
A

Network

1 0 Network

1 1 0

Net

1 1 1 0

1 1 1 1 0

CT046-3-3 Network Troubleshooting

Host

Network

Network

Host

Host

Network

Multicast address

Reserved for future use

Host

1.0.0.0 to
127.255.255.255

Host

128.0.0.0 to
191.255.255.255

Host

192.0.0.0 to
223.255.255.255
224.0.0.0 to
239.255.255.255
240.0.0.0 to
247.255.255.255

CT046-3-3 Network Troubleshooting

Identifying Classes
Classes can be identified by examining the value in the
first octet of IP address
Ranges of values in the first octet for different classes :
Class A : 0 127
Class B : 128 191
Class C : 192 223

CT046-3-3 Network Troubleshooting

N.H.H.H
N.N.H.H
N.N.N.H

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

CT046-3-3 Network Troubleshooting

Examples
192.168.20.3
- Class : C
- Network Address: 192.168.20.0
- Broadcast Address: 192.168.20.255

127.0.4.1
- Class : A
- Network Address: 127.0.0.0
- Broadcast Address: 127.255.255.255

185.23.5.1
- Class : B
- Network Address: 185.23.0.0
- Broadcast Address: 185.23.255.255
CT046-3-3 Network Troubleshooting

Subnetting

CT046-3-3 Network Troubleshooting

Introduction
There are only 3 usable IP address classes:
Class A
Class B
Class C
Class A networks have the highest number of available
hosts.
Class C networks have the fewest number of hosts.

CT046-3-3 Network Troubleshooting

Introduction

The world is running out of available IP addresses.

There just isnt an unlimited number of IP addresses available &


subnetting helps extend the existing addresses until either the next
version of IP is rolled out or some other technology charges on the
scene.

Subnetting reduces the size of the routing tables stored in routers.

Subnetting extends the existing IP address base & restructures the IP


address.

As a result, routers must have a way to extract from a IP address both


the Network address & the Host address.

CT046-3-3 Network Troubleshooting

Subnetting, Subnet & Subnet Mask


Subnetting, a subnet & a subnet mask are all different.
In fact, subnetting creates the subnet & is identified by the
subnet mask.
Subnetting is the process of dividing a network & its IP
addresses into segments, each of which is called a
subnetwork or subnet.
The subnet mask is the 32-bit number that the router uses to
cover up the network address to show which bits are being
used to identify the subnet.
CT046-3-3 Network Troubleshooting

Subnetting
A network has its own unique address, such as a Class
B network with the address 172.20.0.0 which has all
zeroes in the host portion of the address.
From the basic definitions of a Class B network & the
default Class B subnet mask, this network can be
created as a single network that contains 65,534
individual hosts.

CT046-3-3 Network Troubleshooting

Subnetting (Cont.)
Through the use of subnetting, the network can be
logically divided into subnets with fewer hosts on each
subnetwork.
It does not improve the available shared bandwidth only,
but it cuts down on the amount of broadcast traffic
generated over the entire network as well.

CT046-3-3 Network Troubleshooting

Subnetting (Cont.)
Example of subnetting:
When the network administrator divides the 172.20.0.0 network
into 5 smaller networks:
172.20.1.0
172.20.2.0
172.20.3.0
172.20.4.0
172.20.5.0
The outside world stills sees the network as 172.20.0.0, but the
internal routers now break the network addressing into the 5
smaller subnetworks.
CT046-3-3 Network Troubleshooting

Subnetting (Cont.)
From the example, only a single IP address is used as
reference to the network.
Instead of 5 network addresses, only one network
reference is included in the routing tables of routers on
other networks.

CT046-3-3 Network Troubleshooting

Why Subnet?

To break the network down into pieces, each of which


can be addressed separately.

Controls network traffic


Reduces broadcasts
Can provide low level security with access lists on
the router
Organization of IP address space
Fewer IP addresses, often as few as one, are needed
to provide addressing to a network & subnetting.

CT046-3-3 Network Troubleshooting

How Subnetting is Performed?

Hosts bits from a given class is reassigned as network bits, known


as borrowing bits

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)

Work from the most significant (LHS) bits of the first octet after the
network number and calculate the number of bits needed to create
the required number of sub networks

CT046-3-3 Network Troubleshooting

How many bits to borrow?


Depends on maximum number of host per subnet
Use the following formulas:
n of usable subnet = 2 n - 2
n of usable hosts = 2 n 2
[Restriction]
- 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
CT046-3-3 Network Troubleshooting

Answer this !
5 bits are borrowed
- How many usable subnets?
- How many usable hosts?
We need 32 usable subnets
- How many bits to borrow?
- How many usable subnets?
- How many usable host?

CT046-3-3 Network Troubleshooting

Answer this !
5 bits are borrowed
- No of usable subnets : 30
- No of usable hosts : 6
We need 32 usable subnets
- No of bits to borrow : 6
- No of usable subnets : 62
- No of usable host : 2

CT046-3-3 Network Troubleshooting

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

CT046-3-3 Network Troubleshooting

Default Subnet Masks


Class A :
- N. H. H. H
- 11111111.00000000.00000000.000000000
- 255 . 0 . 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
CT046-3-3 Network Troubleshooting

Subnet mask for custom subnets

The subnet bits are


determined by adding
the position value of the
bits that were borrowed
If three bits were
borrowed, the mask for a
Class C address would
be 255.255.255.224

CT046-3-3 Network Troubleshooting

Calculating Resident Network using Subnet


Mask
Network address by using subnet mask is performed by
logical ANDing
The IP address and sub network mask are ANDed with the
result being the sub network id
The process is performed in binary level. So all the
addresses must be viewed in binary
AND function table

CT046-3-3 Network Troubleshooting

ANDing process
IP address:

1001000.11001000.11001000.00001010

200 .

200 .

200 . 10

AND
Subnet Mask:

11111111.11111111.11111111.00000000

255 . 255 . 255 .

Network Address: 11001000.11001000.11001000.00000000

200 .
CT046-3-3 Network Troubleshooting

200 . 200 .

Determining the Number of Required


Subnets and the Resulting Subnet Mask
To come up with a subnetting plan (subnetting scheme),
the engineer must answer the following questions:
How many subnets are required for a particular
network?
What is the largest number of hosts needed in the
largest subnet?
How many subnet bits does the subnet mask need to
support (at least) that many subnets?
How many host bits does the subnet mask need to
support (at least) that many hosts per subnet?
What subnet mask(s) support(s) the required number
of subnet and host bits?
CT046-3-3 Network Troubleshooting

Subnetting a Default Class C


Network Address
200.129.41.0

CT046-3-3 Network Troubleshooting

Subnetting a Default Class C Network


Address: 200.129.41.0
Default Class C address is divided into network and host
portions as follows:
N . N . N . H
To subnet we borrow bits from the host portion of the
address (8 bits for Class C)
N . N . N . x x x x x x x x
Borrowing n bits yields 2n 2 subnets.
Leaving n bits yields 2n 2 hosts.
For a class C, we can borrow from 2 to 6 bits.
Why not 1 bit? (How many usable subnets?)
Why not 7 bits? (How many usable hosts?)
CT046-3-3 Network Troubleshooting

Subnetting a Default Class C Network


Address: 200.129.41.0
Suppose we need 14 usable subnets, how many bits do we
borrow?
Remember, borrowing n bits give us:
2n 2 subnets
Try borrowing 3 bits (n = 3):
23 2 = 8 2
= 6 usable subnets (not enough)
Try borrowing 4 bits
24 2 = 16 2
= 14 usable subnets (enough)
CT046-3-3 Network Troubleshooting

Subnetting a Default Class C Network


Address: 200.129.41.0
Write it with the network octet in binary:
subnet bits

host bits

200.129.41.0000 0000
break here

Borrowing 4 bits yields 14 usable subnets


How many usable hosts per subnet?
Same formula as subnets (2n 2)
4 host bits (n = 4)
24 2 = 16 2
= 14 usable hosts per subnet
CT046-3-3 Network Troubleshooting

Subnetting a Default Class C Network


Address: 200.129.41.0
Examples:
First usable
subnet address:
First usable host
on the first subnet:
Second usable host
on the first subnet:
.
.
Last usable host
on the first subnet:
Broadcast address
for the first subnet:
CT046-3-3 Network Troubleshooting

200.129.41.0001 ^ 0000
200.129.41.16
200.129.41.0001 ^ 0001
200.129.41.17
200.129.41.0001 ^ 0010
200.129.41.18

200.129.41.0001 ^ 1110
200.129.41.30
200.129.41.0001 ^ 1111
200.129.41.31

Subnetting a Default Class C Network


Address: 200.129.41.0
Examples:
Second usable
subnet address:
Third usable
subnet address:
Fourth usable
subnet address:

Last usable
subnet address:
CT046-3-3 Network Troubleshooting

200.129.41.0010 ^ 0000
200.129.41.32
200.129.41.0011 ^ 0000
200.129.41.48
200.129.41.0100 ^ 0000
200.129.41.64
.
.
.
200.129.41.1110 ^ 0000
200.129.41.224

The Subnet Mask:


How the Router Determines the
Subnet
The subnet mask (in binary) has:
all ones in the network and subnet portion of the address
all zeros in the host potion of the address
The subnet mask for the previous example is:
255.255.255. 240
255.255.255. 1111^ 0000 (128 + 64 + 32 + 16 =240)
ANDing this mask with any valid host address on the
network will always yield the subnet address for that host.
CT046-3-3 Network Troubleshooting

The Subnet Mask:


How the Router Determines the
Subnet
Example (our subnet mask is 255.255.255.240)
IP host address:
200.129. 41.23
Last octet to binary:
200.129. 41.0001 0111
AND subnet mask:
255.255.255.1111 0000
200.129. 41.0001 0000
Subnet Address:
200.129. 41.16

So the host address 200.129. 41.23 is on the


200.129.41.16 subnet.

CT046-3-3 Network Troubleshooting

Subnetting a Default Class B


Network Address
132.178.0.0

CT046-3-3 Network Troubleshooting

Subnetting a Default Class B Network


Address: 132.178.0.0
Default Class B address is divided into network and host
portions as follows:
N . N . H . H
To subnet we borrow bits from the host portion of the
address (16 bits for Class B)

N . N .x x x x x x x x . x x x x x x x x

For a class B, we can borrow from 2 to 14 bits.


CT046-3-3 Network Troubleshooting

Subnetting a Default Class B Network


Address: 132.178.0.0
Suppose we need 80 usable subnets, how many bits do
we borrow?
Remember, borrowing n bits give us:
2n 2 subnets
Try borrowing 6 bits (n = 6):
26 2 = 64 2
= 62 usable subnets (not enough)
Try borrowing 7 bits
27 2 = 128 2
= 126 usable subnets (enough)
CT046-3-3 Network Troubleshooting

Subnetting a Default Class B Network


Address: 132.178.0.0
Write it with the network octets in binary:
subnet bits

host bits

132.178.0000000 0.00000000
break here

Borrowing 7 bits yields 126 usable subnets


How many usable hosts per subnet?
Same formula as subnets (2n 2)
9 host bits (n = 9)
29 2 = 512 2
= 510 usable hosts per subnet
CT046-3-3 Network Troubleshooting

Subnetting a Default Class B Network


Address: 132.178.0.0
Examples:
First usable

132.178.0000001 ^ 0.00000000

subnet address:
First usable host

132.178.2.0
132.178.0000001 ^ 0.00000001

on the first subnet:


Second usable host

132.178.2.1
132.178.0000001 ^ 0.00000010

on the first subnet:


.
.
.
Last usable host

132.178.2.2

on the first subnet:


Broadcast address

132.178.3.254
132.178.0000001 ^ 1.11111111

for the first subnet:


CT046-3-3 Network Troubleshooting

132.178.0000001 ^ 1.11111110

132.178.3.255

Subnetting a Default Class B Network


Address: 132.178.0.0
Examples:
Second usable
address:
Third usable
address:
.
.
.
Ninety-first usable
subnet address:
.
.
.
Last usable
subnet address:

CT046-3-3 Network Troubleshooting

132.178.0000010 ^ 0.00000000 subnet


132.178.4.0
132.178.0000011 ^ 0.00000000 subnet
132.178.6.0

132.178.1011011 ^ 0.00000000
132.178.182.0

132.178.1111110 ^ 0.00000000
132.178.252.0

Subnetting a Default Class B Network


Address: 132.178.0.0
The subnet mask for this example is:
255.255.254.0
255.255.1111111 ^ 0.00000000
ANDing this mask with any valid host address on this
network will always yield the subnet address.

CT046-3-3 Network Troubleshooting

Subnetting a Default Class B Network


Address: 132.178.0.0
Example:
IP host address:
Last octets to binary:
AND subnet mask:
0.00000000
Subnet Address:

132.178.119.112
132.178.0111011 ^ 1.01110000
255.255.1111111 ^ 0.00000000
132.178.0111011 ^

132.178.118.0

Which subnet is this. How can you tell?

CT046-3-3 Network Troubleshooting

How does the router handle IP addresses


and subnet masks?
Let's assume that a device on another network with an
IP address of 197.15.22.44 wants to send data to
another device attached to a network with an IP address
of 131.108.2.2.
The data is sent out over the Internet until it reaches the
router that is attached to that network.
The router's job is to determine which one of the
networks the data should be routed to.

CT046-3-3 Network Troubleshooting

Inside the router

CT046-3-3 Network Troubleshooting

Inside the router

when the router performs this ANDing" operation, the


host portion falls through.
CT046-3-3 Network Troubleshooting

Inside the router

The router looks at what is left which is the


network number including the subnetwork.
CT046-3-3 Network Troubleshooting

Inside the router

The router then looks in its routing table and tries


to match the network number including the
subnet with an interface.
CT046-3-3 Network Troubleshooting

Вам также может понравиться