Vous êtes sur la page 1sur 29

1.

NETWORKING-BASICS

Network Connection of Computers

Ethernet

Ethernet uses only one cable that is used to connect all over the world
RJ45/CAT 5/CAT 6/10 baset. Earlier Token ring was used in Ethernet.

Types
1. Broadcast Multi-Access: All systems are connected to the network and
only the addressed system receives the packets. First messages are
broadcasted, addresses are received and then the packets are unicasted.

2. Point-to-point: Only two computers are connected. Address is not


mandatory (But is present).It is not broadcasted.

Routers: Router is an intelligent device that receives data (packet) and checks
from where it comes and where it goes (in the best route).Router is a CISCO
product.
RJ45

R RJ11

F
O

RJ11 R RJ45

Server

Router

Telecom
Ethernet
(Fibre Optics)
Data in a network is packed such that it travels in a any media such as RJ45,fibre
optics etc.,

Note: CCNA tells about


How to connect computers?
How hosts systems talks to each other, when and why?
How it interacts with the router and how router talks to the outer world?

Networks are divided as the private (illegal, reserved, non-routable) and public
(Legal) networks. The private networks are secured leased lines that are over a
particular area-used internally only. The public networks are world wide.
Private
secured
leased line

R
Router

Server

Router

Ethernet
Public
network

Computers will have two addresses:


1. Logical Address IP Address
2. Physical Address Hardware address
-- MAC address
-- Ethernet address
-- Permanent address

MAC Address Media Access Control Address. No two network cards will have
the same MAC addresses.
E.g.: 0010ab 1234cd
Vendor Card No.
Code

Operating System: OS interfaces between the hardware and the software. The
software program that binds itself to the machine components
We need a protocol to transfer data between two systems else your system will be
a stand-alone system. In order for two systems to communicate NOS (Network
Operating Systems) is needed.

TCP/IP is used to transfer data between systems. It is not a single protocol


instead it is a stack of protocols.
TCP
IP

UDP

ARP

RARP

ICMP

IGMP

TCP Transmission Control Protocol


UDP User Datagram Protocol
IP Internet Protocol
ARP Address Resolution Protocol
RARP Reverse Address Resolution Protocol
ICMP Internet Control Messaging Protocol
IGMP - Internet Group Messaging Protocol

2. IP ADDRESS

Quality of IP Address (Borrowed from the Human & Telecom networks)


1. Identification and Location
2. Same length
3. Network is divided based on the size
IP Address 32 bit address

Divided into 4 soctets

0-255

0-255

0-255

Each octet is of,


27 26 25 24 23 22 21 20
222222222222222222222
128 64 32 16 8 4 2 1
22
This ranges from 00000000 . 11111111 i.e. from 0 to 255.

0-255

IP Address has two parts.


1. Location (NID Network ID)
2. Identification (HID - Host ID)

Network Classifications
Class A

NID
(Network ID)

HID
(Host ID)

NID 8 bits.
HID 24 bits.
Network ID
There 8 bits and so - 28 networks are possible = 256 networks. These 0-255 values in
first octet are shared among other classes also. We have values ranging in 0-127 for
Class A.
I octet
MSB

1
128 64

0 0

132 116 18

14

12 11

LSB

MSB Most Significant Bit


LSB Least Significant Bit
128(MSB) is reserved for Class A as 0 always.
0.0.0.0 Reserved for representing any network.
127.0.0.0 Loop Back Address.
.
Thus Class A can have 1-126 networks.
E.g. 10.0.0.0 is a Class A Network

Host ID
If the hosts IDs are 0 then it represents the Network and not the host. If the hosts
IDs are 1 then it represents the Broadcast address for the particular network.
E.g.
10.0.0.0
----------- Network Address(All HID 0)
10.0.0.1
----------- First Host IP Address(All HID
0except the least)
10.255.255.254
----------- Last Host IP Address(All HID
1except the least)

10.255.255.255 ----------- Broadcast IP Address(All HID 1)


Class B

NID
(Network ID)

HID
(Host ID)

NID 16 bits.
HID 16 bits.
Network ID:
I octet
MSB

128 64

0 0

LSB

132 116 18 14 12 11

Two bits are reserved for Class B.


The other bits can be from 000000 to 111111.
NID has 2 octets out of which two 2 bits are reserved.
216 - 2 = 214 = 16384 networks for Class B.
E.g. 172.16.0.0 is a Class B network.
Host ID
If the hosts IDs are 0 then it represents the Network and not the host. If the hosts
IDs are 255 then it represents the Broadcast address for the particular network.

E.g.

170.27.0.0
170.27.0.1
170.27.255.254
170.27.255.255

-----------------------------------------

Network Address
First Host IP Address
Last Host IP Address
Broadcast IP Address

Class C

NID
(Network ID)

HID
(Host ID)

NID 24 bits.
HID 8 bits.
Network ID
I octet
MSB

128 64

0 0

1 1

32 16 8

LSB

2 1

The last three bits are reserved for Class C.


The others can be from 00000 to 11111.
NID has 3 octets out of which two 3 bits are reserved.
224 3 = 221 = 2097152 networks for Class C.
E.g. 202.14.0.0 is a Class C network.
Host ID
If the hosts IDs are 0 then it represents the Network and not the host. If the hosts
IDs are 255 then it represents the Broadcast address for the particular network.
E.g.
194.21.16.0
----------- Network Address
194.21.16.1
----------- First Host IP Address
194.21.16.254 ----------- Last Host IP Address
194.21.16.255 ----------- Broadcast IP Address
Class D: Class D can have 224 239 networks. They are used for Multicasting.
Class E: Class E can have 240 255 networks. They are used for Research purposes.

Note: From the above given addresses some addresses are reserved for the private
networks. They are,
10.0.0.0
--------A
172.16.0.0 to 172.31.0.0
--------B
192.168.0.0 to 192.168.255.0
--------C
Broadcasting:
Broadcast involves delivering a message from one sender to many recipients. This
broadcast is 'limited' in that it does not reach every node on the Internet, only nodes on
the LAN.
Broadcast address is found by ORing the IP address and the bit complement of the
subnet mask.
E.g. : Let 190.16.4.9 be the IP address(Class B network).
The subnet mask for class B network is 255.255.0.0
---bit complement is 0.0.255.255
190.16.4.9
0.0.255.255

-------

190.16.255.255 ----

10111110000100000000010000001001
00000000000000001111111111111111
10111110000100001111111111111111

SUMMARY
Class

Host
bits
24

Range- I
octet
1-126

MSB
fixed
0

No of
n/ws
126

No of
hosts
224-2

FHID

N/w
Bits
8

16

16

128-191

10

216-2=214

216-2

X.Y.0.1

24

192-223

110

224-3=221

28-2

X.Y.Z.1

D
E

X.0.0.1

LHI
D
X.255
.255.2
54
X.Y.2
55.25
4
X.Y.Z
.254

BC
Addr
X.255.2
55.255

Subnet
mask
255.0.0.0

X.Y.255
.255

255.
255.0.0

X.Y.Z.2
55

255. 255.
255.0

All
HIDs 1

NID-1
HID-0

224-239
240-255

4. OSI REFERENCE MODEL


OSI Open Systems Interconnection.This is designed by the ISO(International Standard
Organisations).This model is developed from the TCP/IP Model given by the
DoD,Department of Defence,US.
Open Systems: Irrespective of the plaltform ,open to any platform.
The OSI Model comprises of 7 layers.
OSI Model
TCP/IP Model
(Department of Defence,US)

(International Standard Organisation)


Application Layer

Presentation Layer

Session Layer

Transport Layer

Network Layer
Data Link Layer
Physical Layer

PHYSICAL LAYER

Physical layer is about the physical connections/media between the networks.


Connections may be bound or unbound.
Bound UTP, STP, Coaxial, Fibre optics..
Unbound Infrared rays, Blue tooth, Radio waves, Micro waves
UTP Unsheilded Twisted Pair.
10 base T
10 base 10
100 base 10
Bandwidth

Signal
Length of the
Frequency
cable

AMP

87.5 m (accurately)
100m cable

Ethernet Cross over and Straight Through Cables


There are 8 pins in the cables and or of different colours to identfy.

PIN N0
1
2
3
4
5
6
7
8

WIRE COLOR
Orange/White
Orange
Green/White
Blue
Blue/White
Green
Brown/White
Brown

CROSSED-OVER
3
6
1
4
5
2
7
8

STRAIGHT-THROUGH
1
2
3
4
5
6
7
8

If there are more then two systems,connecting them to each and every systems are
not possible.In such cases we use Hub or Switches to connect the systems.
Hub(Concentrator):Hubs operate on the physical layer.Hubs are nothing
but a repeater, that sends copy to all the systems during communicaton.A
hub can contain multiple ports.

HUB

HUB

In a hub with 8 ports, each connected to a system.If system-1 has to send data to
system-8 it sends data to system-8 and also to all other systems that are connected to the
hub. If the data transfer rate is 10 mbps that is shared to send data to all the systems.

Full Duplex
If transmission takes place in one line and data is received in another line,
it is said to be in Full Duplex.

Half Duplex
If transmission and received in same line, it is said to be in Half Duplex.

DATA LINK LAYER


All the systems in the network are identified and are ready to send the data.
This layer concentrates on
How the data look like? Format.
To whom the data is being sent and from where it is coming?
It checks for any collision or error? Error Detection.Error Detection is
done by CSMA/CD(Carrier Sense Multilpe Access/Collision Detection)
that continuously senses the line to check if there is any error or collision.

Network Interface Card(NIC) contains the MAC(Media Access Control)


Address.

Sub Layers of Data Link Layer:

LLC Logical Link Control:It is concerned with managing the


traffic over the network
While carrying the packet from the Data link layer to the network
layer it should also carry data saying that it is a IP packet logical
link between Datalink layer and the Network layer.
A
T

I
P
IP
X

10.0.0.0

Router
MAC Media Access Control: It is concerned with sharing the
physical connection to the network among several computers. Each
computer has its own MAC address.
Frame in the Data link layer consists the To and From MAC address.
Most popular layer-2 component is the Switch.
Switch: A network switch is a small hardware device that joins multiple
computers together within one LAN Technically, network switches operate
at layer 2 i.e Data Link Layer.
A switch unlike hub sends data only to the specific system that
requested the data.
Switch maintains the MAT (MAC Address Table) to look up the
MAC address of the hosts to which it needs to send the data. First time it
broadcasts and there after it maintains the addresses.

Port Number

MAC address

NETWORK LAYER
This layer concentrates on routing the packet to the destination in the best route.

Router

Packtes in the network layer contains the To and From IP address.

In the following figure there are 4 data links between the the two networks.

10.0.0.0

20.0.0.0
Router1

Router2

40.0.0.0

60.0.0.0

Router3

TRANSPORT LAYER

This layer is a software layer(A transport layer product is introduced now.)


The role of the transport layer is to provide a reliable, end-to-end data transport
between source and destination machines.
This layer concentrates on,
Segments: The exchanged between the communicating hosts are called the
segments. This layer packetizes(i.e. turns into segments). The size of the
segment ranges to less than or equal to the MTU(Maximum Transmission
Unit=1500 bytes).
Sequence numbers
Check sum
Acknowledgement
Error checking
Windowing
3-way handshake
Port numbers

HTTP-80

FTP-21- CONTROL,20 - DATA

SMTP-25

TELNET-23

POP3-110

The connection may be connection oriented or connectionless.


Connection oriented
Establishes a connection
Transmits data
Ends connection
TCP/IP provides a reliable and connection-oriented service.
Connectionless:
Data delivery
Error checking
UDP provides an unreliable and connection-less service.

SESSION LAYER
The session layer allows users on different machines to establish sessions between
them. A session management takes place whenever a session opens and ends.
If the port is inactive for a particular period of time the port is reset (the session is
closed).
Source Quench: It is a message from one host to another host saying that to
reduce the speed of data transfer. It is one way to control data flow over the
network.
PRESENTATION LAYER
This layer is concerned with the presentation of data that is transferred between
two application processes.
It ensures that the date exchanged between them has a common meaning Shared
semantics.(common presentation style)
Data are transferred in Binary or ASCII format .
If any compression or encryption are needed they are also agreed upon.
APPLICAION LAYER
This layer ensures that it provides service for an application program to
communicate with other application program in the network.
This layer concentrates on,
Communication partners
Quality of service
User authentication
Constraints on data.
NOTE:
1.Encapsulation-Give the right information to the right user.

DL
NL
TL
SL
PL
A
L

PL

2.Disdavantage of TCP/IP communication? Acknowledgement


3. Which takes part in all layers of OSI model?
a.
Router
b. Amplifier
c.
Bridge
d. Network Management station
e.
Network host
f.
Web Server
Ans : d,e and f takes part in all layer activities.They are all hosts.

5. ROUTING FUNDAMENTALS
Concepts
Routing Table
Default Gateway
Windows DOS Commands
Ipconfig
Ipconfig /all
Route Print
Route Add
Route Delete
Ping
arp a
tracert
Protocols
ICMP
ARP
ROUTING TABLE
A routing table is a database in which a routing protocol stores information about
the network layer topology of the intranet work (The IP Addresses are looked up here
before the packets are being routed).
Routing table can be built in two ways:
1. Manual
Route add <destn> MASK <destn SM> <Next Hop>
(Forwarding Router)
E.g. Route add 30.0.0.0 MASK 255.0.0.0 10.0.0.1
2. Default Gateway

PING command: Sends a packet through the internet to grope the destination host. Echo
Request and Reply are the two pairs in ICMP message. The ICMP checks whether there
is an error during communication.
Echo Request
Echo Reply

50.0.0.2
50.0.0.0
30.0.0.0
30.0.0.1

R1
50.0.0.1

70.0.0.1

90.0.0.1

70.0.0.0
R2

R3

90.0.0.0

70.0.0.2

While pinging a host from the source,If the host/network is not configured with
the router and if it does not identify the destination system in the routing
table,then the following ICMP message is generated,
Destination Host Unreachable

While pinging a host from the source,If the host is connected and configured to
the router, the host sends all its messages to the router and then forwarded to the
destination. Now if the router is enable to identify the destination IP Address in
the routing table,then the following ICMP message isgenerated,
Reply from <destn> ; bytes=32 time=10ms TTL=128

While pinging a host from the source,If the destination host is not connected to
the network or if the cable is loosely connected or if the destination host does not
respond to the source request then the
following ICMP error message isgenerated,
Request timed out

arp a
This command is used to obtain the MAC address of the destination host.

C:\>arp -a
Interface: 9.184.45.180 --- 0x2
Internet Address
Physical Address

Type

9.184.45.1
9.184.45.15
9.184.45.100
9.184.45.184

00-00-0c-07-ac-2d dynamic
00-0d-60-8c-9d-93 dynamic
00-0d-60-fb-e4-ed dynamic
00-11-25-48-14-22 dynamic

C:\>arp d 10.0.0.1
Deletes the MAC address of the particular host.

tracert
The tracert command is used to visually see a network packet being sent and
received and the amount of hops required for that packet to get to its destination.
C:\>tracert
Usage: tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout] target_name
Options:
-d
Do not resolve addresses to hostnames.
-h maximum_hops Maximum number of hops to search for target.
-j host-list
Loose source route along host-list.
-w timeout
Wait timeout milliseconds for each reply.
C:\>tracert 9.184.45.148
Tracing route to 9.184.45.148 over a maximum of 30 hops
1 *
<1 ms <1 ms 9.184.45.148
Trace complete.
Find the FHID, LHID, Broadcast and SubnetMask
CLASS
A
A
B
C

NETWORK
1.0.0.0
39.0.0.0
147.0.0.0
211.0.0.0

FHID
1.0.0.1
39.0.0.1
147.0.0.1
211.0.0.1

LHID
1.255.255.254
39.255.255.254
147.0.255.254
211.0.0.254

BroadCast
1.255.255.255
3.255.255.255
147.0.255.255
211.0.0.255

6. SUBNETTING

SubnetMask
255.0.0.0
255.0.0.0
255.255.0.0
255.255.255.0

Subnetting is the process of subdividing your networks into subnets that are
meaningful, for the effective management of IP Address.With the help of mathematical
functions we divide network itno subnets. Due to this congestion is controlled.
a. If 9.0.0.5 sends a packet to 9.0.0.3 hub copies and sends the packet to all the other
hosts also(Broadcasts).Once it broadcasts it receives the MAC address, it unicasts to
every hosts.Here packet is received by only the destination that matches the To
address(MAC address).
9.0.0.2

9.0.0.3

9.0.0.5

9.0.0.4
HUB

b. In case if a hub is replaced by the switch, intially it broadcasts and receives the MAC
address.After that the switch sends the packet only to the particular destination host and
doesnot send copies to other systems.
c. In case if a router is replaced with the switch/hub, broadcasting and unicasting takes
place.But it ensures that the MAC address doesnot cross the particular network/LAN.

Divide the following network consisting of 2 subnets

CLASS
A

NETWORK
10.0.0.0

To get 2 subnets,

FHID
10.0.0.1

LHID
BroadCast
SubnetMask
10.255.255.254 10.255.255.255 255.0.0.0

2n-2>=no of subnets

21-2=2-2=0 subnets
22-2=4-2=2 subnets.
Hence to get two subnets, we need to borrow 2 bits from the host id.
128 64

NID

HID

Therefore the subnets are,


10.64.0.0 and 10.128.0.0
Class Subnet
FHID
LHID
BroadCast
A
10.64.0.0
10.64.0.1
10.127.255.254 10.127.255.255
A
10.128.0.0 10.128.0.1 10.191.255.254 10.191.255.255
64+(32+16+8+4+2+1)=64+63=127

SubnetMask
255.192.0.0
255.192.0.0
128+64=192

128+63=191
Total no of host id bits=24 -2(borrowed)=22.
So, The no of hosts possible in each subnet = 222-2 = 4194304-2 = 4194302 hosts

Divide the following network consisting of 6 subnets

CLASS
A

NETWORK
10.0.0.0

FHID
10.0.0.1

LHID
BroadCast
SubnetMask
10.255.255.254 10.255.255.255 255.0.0.0

To get 6 subnets,
2n-2>=no of subnets
21-2=2-2=0 subnets
22-2=4-2=2 subnets.
23-2=8-2=6 subnets
Hence to get 6 subnets, we need to borrow 3 bits from the host id.
128 64 32

NID
Therefore the subnets are,

HID
10.32.0.0
10.64.0.0
10.96.0.0
10.128.0.0
10.160.0.0
10.192.0.0

Class
A
A
A
A
A
A

Subnet
FHID
LHID
BroadCast
SubnetMask
10.32.0.0
10.32.0.1
10.63.255.254
10.63.255.255
255.224.0.0
10.64.0.0
10.64.0.1
10.95.255.254
10.95.255.255
255.224.0.0
10.96.0.0
10.96.0.1
10.127.255.254 10.127.255.255 255.224.0.0
10.128.0.0 10.128.0.1 10.159.255.254 10.159.255.255 255.224.0.0
10.160.0.0 10.160.0.1 10.191.255.254 10.191.255.255 255.224.0.0
10.192.0.0 10.192.0.1 10.223.255.254 10.223.255.255 255.224.0.0
32+(16+8+4+2+1)=32+31=63
128+64+32=224
Total no of host id bits=24 -3(borrowed)=21.
So, The no of hosts possible in each subnet = 221-2 = 2097152-2 = 2097150 hosts.

Divide the following network consisting of 14 subnets

CLASS
A

NETWORK
10.0.0.0

FHID
10.0.0.1

LHID
BroadCast
SubnetMask
10.255.255.254 10.255.255.255 255.0.0.0

To get 14 subnets,
2n-2>=no of subnets
21-2=2-2=0 subnets
22-2=4-2=2 subnets.
23-2=8-2=6 subnets
24-2=16-2=14 subnets
Hence to get 14 subnets, we need to borrow 4 bits from the host id.
128 64 32 16

NID

HID

Therefore the subnets are,


10.16.0.0
10.32.0.0
10.48.0.0
|
10.224.0.0
Class
A
A
A
..
A
A

Subnet
FHID
LHID
10.16.0.0
10.16.0.1
10.31.255.254
10.32.0.0
10.32.0.1
10.47.255.254
10.48.0.0
10.48.0.1
10.63.255.254
................
.
10.208.0.0 10.208.0.1 10.223.255.254
10.224.0.0 10.224.0.1 10.239.255.254
16+(8+4+2+1)=16+15=31

BroadCast
SubnetMask
10.31.255.255
255.240.0.0
10.47.255.255
255.240.0.0
10.63.255.255
255.240.0.0
..
..
10.223.255.255 255.240.0.0
10.239.255.255 255.240.0.0
128+64+32+16=240

Total no of host id bits=24 -4(borrowed)=20.


So, The no of hosts possible in each subnet = 220-2 = 1048576-2 = 1048574 hosts.

How many bits you need to borrow to get 23 subnets.

To get 23 subnets,

2n-2>=no of subnets
21-2=2-2=0 subnets
22-2=4-2=2 subnets.
23-2=8-2=6 subnets
24-2=16-2=14 subnets
25-2=32-2=30 subnets
Hence to get 23 subnets, we need to borrow 5 bits from the host id.
128 64 32 16 8

NID

HID

Therefore the subnets are,


10.8.0.0
10.16.0.0
10.24.0.0
|
10.184.0.0
|
10.240.0.0
Class
A
A
A
..
A

Subnet
FHID
10.8.0.0
10.8.0.1
10.16.0.0
10.16.0.1
10.24.0.0
10.24.0.1
................
10.184.0.0 10.184.0.1

.
10.240.0.0 10.240.0.1
8+(4+2+1)=8+7=15

LHID
10.15.255.254
10.23.255.254
10.31.255.254
.
10.191.255.254

10.247.255.254

BroadCast
SubnetMask
10.15.255.255
255.248.0.0
10.23.255.255
255.248.0.0
10.31.255.255
255.248.0.0
..
..
10.191.255.255 255.248.0.0

..
10.247.255.255 255.248.0.0
128+64+32+16+8=248

Total no of host id bits=24 -5(borrowed)=19.


So, The no of hosts possible in each subnet = 219-2 = 524288-2 = 524286 hosts.

How many bits you need to borrow to get 45 subnets.

To get 45 subnets,
2n-2>=no of subnets

21-2=2-2=0 subnets
22-2=4-2=2 subnets.
23-2=8-2=6 subnets
24-2=16-2=14 subnets
25-2=32-2=30 subnets
26-2=64-2=62 subnets
Hence to get 45 subnets, we need to borrow 6 bits from the host id.
128 64 32 16 8

NID

HID

Therefore the subnets are,


10.4.0.0
10.8.0.0
10.12.0.0
|
10.180.0.0
|
10.248.0.0
Class
A
A
A
..
A

Subnet
FHID
10.4.0.0
10.4.0.1
10.8.0.0
10.8.0.1
10.12.0.0
10.12.0.1
................
10.180.0.0 10.180.0.1

.
10.248.0.0 10.248.0.1
4+(2+1)=4+3=7

LHID
10.7.255.254
10.11.255.254
10.15.255.254
.
10..183.254

10.251.255.254

BroadCast
SubnetMask
10.7.255.255
255.252.0.0
10.11.255.255
255.252.0.0
10.15.255.255
255.252.0.0
..
..
10.183.255.255 255.252.0.0

..
10.252.255.255 255.252.0.0
128+64+32+16+8+4=252

Total no of host id bits=24 -6(borrowed)=18.


So, The no of hosts possible in each subnet = 218-2 = 262144-2 = 262142 hosts.

Divide the following network consisting of 75 and 150 subnets

CLASS
A

NETWORK
10.0.0.0

To get 2 subnets,

FHID
10.0.0.1

LHID
BroadCast
SubnetMask
10.255.255.254 10.255.255.255 255.0.0.0

2n-2>=no of subnets

21-2=2-2=0 subnets

22-2=4-2=2 subnets.
23-2=8-2=6 subnets
24-2=16-2=14 subnets.
25-2=32-2=30 subnets
26-2=64-2=62 subnets.
27-2=128-2=126 subnets
28-2=256-2=254 subnets
Hence to get 75 subnets, we need to borrow 7 bits from the host id.
And to get 150 subnets, we need to borrow 8 bits from the host id.
128 64 32 16 8

NID

HID
128 64 32 16 8

2 1

NID
Therefore the subnets are,
75 subnet
150 subnet
10.2.0.0
10.1.0.0
10.4.0.0
10.2.0.0
10.6.0.0
10.3.0.0
|
|
10.150.0.0
10.150.0.0
75 subnets
Class Subnet
FHID
A
10.2.0.0
10.2.0.1
A
10.4.0.0
10.4.0.1

HID

LHID
10.3.255.254
10.3.255.254

BroadCast
10.3.255.255
10.3.255.255

SubnetMask
255.254.0.0
255.254.0.0

10.150.0.0

10.150.0.1

10.151.255.254

10.151.255.255

255.254.0.0

10.254.0.0

10.254.0.1 10.255.255.254
2+(1)=2+1

10.255.255.255 255.254.0.0
128+64+32+16+8+4+2=254

Total no of host id bits=24 -7(borrowed)=17.


So, The no of hosts possible in each subnet = 217-2 = 131072-2 = 131070 hosts
150 subnets
Class Subnet
A
10.1.0.0
A
10.2.0.0
. .
A
10.150.0.0

FHID
10.1.0.1
10.2.0.1
..
10.150.0.1
1+(0)=1

LHID
10.1.255.254
10.2.255.254
..
10.150.255.254

BroadCast
SubnetMask
10.1.255.255
255.255.0.0
10.2.255.255
255.255.0.0
..

10.150.255.255 255.255.0.0
128+64+32+16+8+4+2+1=255

Total no of host id bits=24 -8(borrowed)=16.


So, The no of hosts possible in each subnet = 216-2 = 65536-2 = 65534 hosts
-----------------------------------------------------------------------------------------------------------

Divide the following network consisting of 9 subnets

CLASS
B

NETWORK
170.0.0.0

FHID
170.0.0.1

LHID
BroadCast
SubnetMask
170.0.255.254 170.0.255.255 255.255.0.0

To get 9 subnets,
2n-2>=no of subnets
21-2=2-2=0 subnets
22-2=4-2=2 subnets.
23-2=8-2=6 subnets
24-2=16-2=14 subnets
Hence to get 9 subnets, we need to borrow 4 bits from the host id.
128 64 32 16

NID
Therefore the subnets are,

Class
B
B
B
B
B
B

HID
170.0.16.0
170.0.32.0
170.0.48.0
|
170.0.128.0
170.0.144.0

Subnet
FHID
LHID
170.0.16.0
170.0.16.1
170.0.31.254
170.0.32.0
170.0.32.1
170.0.47.254
170.0.48.0
170.0.48.1
170.0.79.254
.
.
.
170.0.128.0 170.0.128.1 170.0.143.254
170.0.144.0 170.0.144.1 170.0.175.254
16+(8+4+2+1)=16+15=31

BroadCast
SubnetMask
170.0.31.255
255.255.240.0
170.0.47.255
255.255.240.0
170.0.79.255
255.255.240.0
.
..
170.0.143.255 255.255.240.0
170.0.175.255 255.255.240.0
128+64+32+16=240

Total no of host id bits=16 -4(borrowed)=14


So, The no of hosts possible in each subnet = 214-2 = 16384-2 = 16382 hosts.

Divide the following network consisting of 99 subnets

CLASS
B

NETWORK
170.0.0.0

FHID
170.0.0.1

LHID
BroadCast
SubnetMask
170.0.255.254 170.0.255.255 255.255.0.0

To get 99 subnets,
2n-2>=no of subnets
21-2=2-2=0 subnets
22-2=4-2=2 subnets.
23-2=8-2=6 subnets
24-2=16-2=14 subnets
25-2=32-2=30 subnets
26-2=64-2=60 subnets
27-2=128-2=126 subnets
Hence to get 99 subnets, we need to borrow 7 bits from the host id.
128 64 32 16 8 4

NID
Therefore the subnets are,

Class
B
B
B
B
B
B

HID
170.0.2.0
170.0.4.0
170.0.6.0
|
170.0.250.0
170.0.252.0

Subnet
FHID
170.0.2.0
170.0.2.1
170.0.4.0
170.0.4.1
170.0.6.0
170.0.6.1
.
.
170.0.250.0 170.0.250.1
170.0.252.0 170.0.252.1
2+(1)=2+1=3

LHID
170.0.3.254
170.0.5.254
170.0.7.254
.
170.0.251.254
170.0.253.254

BroadCast
SubnetMask
170.0.3.255
255.255.240.0
170.0.5.255
255.255.240.0
170.0.7.255
255.255.240.0
.
..
170.0.251.255 255.255.240.0
170.0.253.255 255.255.240.0
128+64+32+16+8+4+2=254

Total no of host id bits=16 -7(borrowed)=9


So, The no of hosts possible in each subnet = 29-2 =512-2 = 510 hosts.
-----------------------------------------------------------------------------------------------------------

Divide the following network consisting of 2 subnets

CLASS
C

NETWORK
200.0.0.0

FHID
200.0.0.1

LHID
200.0.0.254

BroadCast
200.0.0.255

SubnetMask
255.255.255.0

To get 2 subnets,
2n-2>=no of subnets
21-2=2-2=0 subnets
22-2=4-2=2 subnets.
Hence to get 2 subnets, we need to borrow 2 bits from the host id.
128 64

NID

HID

Therefore the subnets are,

200.0.0.64
200.0.0.128

Class
C
C

Subnet
FHID
LHID
BroadCast
SubnetMask
200.0.0.64
200.0.0.65
200.0.0.126 200.0.0.127 255.255.255.192
200.0.0.128 200.0.0.129 200.0.0.190 200.0.0.191 255.255.255.192
64+(32+16+8+4+2+1)=64+63=127
128+64=192
Note:127 is the Broadcast id.
Total no of host id bits=8 -2(borrowed)=6
So, The no of hosts possible in each subnet = 26-2 =64-2 =62 hosts.

2No of bits left -2 >= No of hosts


2No of bits borrowed 2 >= No of subnets

Divide the following network consisting of 23 hosts.

To get 2 subnets,
2no of bits left-2>=no of hosts
28-2=256-2=254 hosts
27-2=128-2=126 hosts
26-2=64-2=62 hosts
25-2=-32-2=30 hosts-----------------23-2=-8-2=6 subnets
24-2=16-2=14 hosts

Hence to get 23 hosts, we need to borrow 3 bits from the host id so that 5 bits will be left.
128 64 32

NID

HID

Therefore the subnets are,

192.168.1.32
192.168.1.64
192.168.1.96
|
192.168.1.192(we borrow 3 bits and so 32*6 =192)

Class
C
C

Subnet
192.168.1.32
192.168.1.64

FHID
192.168.1.33
192.168.1.65

LHID
192.168.1.62
192.168.1.94

192.168.1.192 192.168.1.193 192.168.1.222


32+(16+8+4+2+1)=32+31=63

BroadCast
192.168.1.63
192.168.1.95

SubnetMask
255.255.255.224
255.255.255.224

192.168.1.223

255.255.255.224
128+64+32=192

Total no of host id bits= 8-3(borrowed)=5


So, The no of hosts possible in each subnet = 25-2 =32-2 =30 hosts in each subnet.

Divide the following network consisting of 11 hosts.

To get 2 subnets,
2no of bits left-2>=no of hosts
28-2=256-2=254 hosts
27-2=128-2=126 hosts
26-2=64-2=62 hosts
25-2=-32-2=30 hosts
24-2=16-2=14 hosts---------------------24-2=-16-2=14
23-2=8-2=6 hosts
Hence to get 11 hosts, we need to borrow 4 bits from the host id so that 4 bits will be left.
128 64 32 16

NID

HID

Therefore the subnets are,

Class
C
C
C
C

192.168.1.16
192.168.1.32
192.168.1.48
|
192.168.224.(we borrow 3 bits and so 16*14=224)

Subnet
FHID
LHID
192.168.1.16
192.168.1.17
192.168.1.30
192.168.1.32
192.168.1.33
192.168.1.46
.
.
...
192.168.1.224 192.168.1.225 192.168.1.254
16+(8+4+2+1)=16+15=31

BroadCast
SubnetMask
192.168.1.31
255.255.255.240
192.168.1.47
255.255.255.240
.. .
192.168.1.255 255.255.255.240
128+64+32+16=240

Total no of host id bits= 8-4(borrowed)=4


So, The no of hosts possible in each subnet = 24-2 =16-2 =14 hosts in each subnet.

Divide the following network consisting of 17 subnets.

To get 2 subnets,
2no of bits borrowed-2>=no of subnets
21-2=2-2=0 subnets
22-2=4-2=2 subnets
23-2=8-2=6 subnets
24-2=16-2=14 subnets
25-2=32-2=30 subnets
Hence to get 17 subnets, we need to borrow 5 bits from the host id.
128 64 32 16 8

NID
Therefore the subnets are,

HID
192.168.1.8
192.168.1.16
192.168.1.24
|
192.168.1.136(we borrow 5 bits and so 8*17=136)
|
192.168.1.240(we borrow 5 bits and so 8*30=240)

Class
C
C
C
C

Subnet
FHID
192.168.1.8
192.168.1.9
192.168.1.16
192.168.1.17
.
.
192.168.1.240 192.168.1.241
8+(4+2+1)=8+7=15

LHID
192.168.1.14
192.168.1.22
...
192.168.1.246

BroadCast
SubnetMask
192.168.1.15
255.255.255.248
192.168.1.23
255.255.255.248
.. ..
192.168.1.247 255.255.255.248
128+64+32+16+8=248

Total no of host id bits= 8-5(borrowed)=3


So, The no of hosts possible in each subnet = 23-2 =8-2 =6 hosts in each subnet.

Divide the following network consisting of 50 subnets.

To get 2 subnets,
2no of bits borrowed-2>=no of subnets
21-2=2-2=0 subnets
22-2=4-2=2 subnets
23-2=8-2=6 subnets
24-2=16-2=14 subnets
25-2=32-2=30 subnets
26-2=64-2=62 subnets
Hence to get 50 subnets, we need to borrow 6 bits from the host id.

128 64 32 16 8

NID

HID

Therefore the subnets are,

Class
C
C
C

Subnet
192.168.1.4
192.168.1.8
.

192.168.1.4
192.168.1.8
192.168.1.12
|
192.168.1.200(we borrow 5 bits and so 4*50=200)
|
192.168.1.248(we borrow 5 bits and so 4*62=248)

FHID
192.168.1.5
192.168.1.9
.

LHID
192.168.1.6
192.168.1.10
...

BroadCast
192.168.1.7
192.168.1.11
..

SubnetMask
255.255.255.252
255.255.255.252
..

192.168.1.248 192.168.1.249
4+(2+1)=4+3=7

192.168.1.250

192.168.1.251 255.255.255.252
128+64+32+16+8+4=252

Total no of host id bits= 8-6(borrowed)=2


So, The no of hosts possible in each subnet = 22-2 =4-2 =2 hosts in each subnet.
NOTE : Subnetting Principle
Donot change your NID
Borrow HID bits to Nid
Octet structure and bit values will not changes
Rules for FHID, LHID, BC and SNM will not change.