Watch Video : - https://youtu.be/gVWC8xz0mok
IPv4 addresses are 32-bit numbers that are
typically displayed in dotted decimal notation. A 32-bit address contains two
primary parts: the network prefix and the host number.
All hosts within a single network share the
same network address. Each host also has an address that uniquely identifies
it. Depending on the scope of the network and the type of device, the address
is either globally or locally unique. Devices that are visible to users outside
the network (webservers, for example) must have a globally unique IP address.
Devices that are visible only within the network must have locally unique IP
addresses.
IP addresses are assigned by a central
numbering authority called the Internet Assigned Numbers Authority (IANA). IANA
ensures that addresses are globally unique where needed and has a large address
space reserved for use by devices not visible outside their own networks.
IPv4 Classful Addressing
To provide flexibility in the number of
addresses distributed to networks of different sizes, 4-octet (32-bit) IP
addresses were originally divided into three different categories or classes:
class A, class B, and class C. Each address class specifies a
different number of bits for its network prefix and host number:
·
Class A addresses use only the first byte (octet) to
specify the network prefix, leaving 3 bytes to define individual host
numbers.
·
Class B addresses use the first 2 bytes to specify the
network prefix, leaving 2 bytes to define host addresses.
·
Class C addresses use the first 3 bytes to specify the
network prefix, leaving only the last byte to identify hosts.
In binary format, with
an x representing each
bit in the host number, the three address classes can be represented as
follows:
00000000 xxxxxxxx xxxxxxxx xxxxxxxx (Class A)
00000000 00000000 xxxxxxxx xxxxxxxx (Class B)
00000000 00000000 00000000 xxxxxxxx (Class C)
Because each bit (x) in a host number can
have a 0 or 1 value, each represents a power of 2. For example, if only
3 bits are available for specifying the host number, only the following
host numbers are possible:
111 110 101 100 011 010 001 000
In each IP address class,
the number of host-number bits raised to the power of 2 indicates how many host
numbers can be created for a particular network prefix. Class A addresses have
224 (or 16,777,216) possible host numbers, class
B addresses have 216 (or 65,536) host numbers,
and class C addresses have 28 (or 256)
possible host numbers.
IPv4 Dotted Decimal Notation
The 32-bit IPv4 addresses
are most often expressed in dotted decimal notation, in which each octet (or
byte) is treated as a separate number. Within an octet, the rightmost bit
represents 20 (or 1), increasing to the left until the first
bit in the octet is 27 (or 128). Following are IP
addresses in binary format and their dotted decimal equivalents:
11010000 01100010 11000000 10101010 =
208.98.192.170
01110110 00001111 11110000 01010101 =
118.15.240.85
00110011 11001100 00111100 00111011 = 51.204.60.59
IPv4 Subnetting
Because of the physical and architectural
limitations on the size of networks, you often must break large networks into
smaller subnetworks. Within a network, each wire or ring requires its own
network number and identifying subnet address.
Figure 1 shows two subnets in a network.
Figure 1: Subnets in a
Network
Figure 1 shows three devices connected to one
subnet and three more devices connected to a second subnet. Collectively, the
six devices and two subnets make up the larger network. In this example, the
network is assigned the network prefix 192.14.0.0, a class B address. Each device has an
IP address that falls within this network prefix.
In addition to sharing a
network prefix (the first two octets), the devices on each subnet share a third
octet. The third octet identifies the subnet. All devices on a subnet must have
the same subnet address. In this case, the alpha subnet has the IP address 192.14.126.0 and the beta subnet
has the IP address 192.14.17.0.
The subnet address 192.14.17.0 can be represented
as follows in binary notation:
11000000 . 00001110 . 00010001 . xxxxxxxx
Because the first
24 bits in the 32-bit address identify the subnet, the last 8 bits
are not significant. To indicate the subnet, the address is written as 192.14.17.0/24 (or just 192.14.17/24). The /24 is the subnet mask
(sometimes shown as 255.255.255.0).
IPv4 Variable-Length Subnet Masks
Traditionally, subnets
were divided by address class. Subnets had either 8, 16, or 24 significant
bits, corresponding to 224, 216, or 28 possible
hosts. As a result, an entire /16 subnet had to be allocated for a network that
required only 400 addresses, wasting 65,136 (216 –
400 = 65,136) addresses.
To help allocate address spaces more
efficiently, variable-length subnet masks (VLSMs) were introduced. Using VLSM,
network architects can allocate more precisely the number of addresses required
for a particular subnet.
For example, suppose a
network with the prefix 192.14.17/24 is divided into two smaller subnets, one consisting of
18 devices and the other of 46 devices.
To accommodate 18
devices, the first subnet must have 25 (32) host
numbers. Having 5 bits assigned to the host number leaves 27 bits of
the 32-bit address for the subnet. The IP address of the first subnet is
therefore 192.14.17.128/27, or the following in binary notation:
11000000 .
00001110 . 00010001 . 100xxxxx
The subnet mask includes 27 significant
digits.
To create the second
subnet of 46 devices, the network must accommodate 26 (64) host numbers. The IP address of the
second subnet is 192.14.17.64/26, or
11000000 .
00001110 . 00010001 . 01xxxxxx
By assigning address bits
within the larger /24 subnet mask, you create two smaller subnets that use the
allocated address space more efficiently.
No comments:
Post a Comment