Beruflich Dokumente
Kultur Dokumente
NETWORKING-BASICS
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.
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.,
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
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.
UDP
ARP
RARP
ICMP
IGMP
2. IP ADDRESS
0-255
0-255
0-255
0-255
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
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)
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
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
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
Presentation Layer
Session Layer
Transport Layer
Network Layer
Data Link Layer
Physical Layer
PHYSICAL LAYER
Signal
Length of the
Frequency
cable
AMP
87.5 m (accurately)
100m cable
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.
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
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
HTTP-80
SMTP-25
TELNET-23
POP3-110
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
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.
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
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
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.
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
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
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
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
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
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
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
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
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
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
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
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.
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
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
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
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
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
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
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
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