IP and SUbnet
IP and SUbnet
IP stands for Internet Protocol and v4 stands for Version Four (IPv4). IPv4 was the
primary version brought into action for production within the ARPANET in 1983.
IP version four addresses are 32-bit integers which will be expressed in decimal
notation.
Example- 192.0.2.126 could be an IPv4 address.
Parts of IPv4
Network part:
The network part indicates the distinctive variety that’s appointed to the network.
The network part conjointly identifies the category of the network that’s assigned.
Host Part:
The host part uniquely identifies the machine on your network. This part of the IPv4
address is assigned to every host.
For each host on the network, the network part is the same, however, the host half
must vary.
Subnet number:
This is the nonobligatory part of IPv4. Local networks that have massive numbers of
hosts are divided into subnets and subnet numbers are appointed to that.
Characteristics of IPv4
IPv4 could be a 32-Bit IP Address.
IPv4 could be a numeric address, and its bits are separated by a dot.
The number of header fields is twelve and the length of the header field is twenty.
It has Unicast, broadcast, and multicast style of addresses.
IPv4 supports VLSM (Virtual Length Subnet Mask).
IPv4 uses the Post Address Resolution Protocol to map to the MAC address.
RIP may be a routing protocol supported by the routed daemon.
Networks ought to be designed either manually or with DHCP.
Packet fragmentation permits from routers and causing host.
Advantages of IPv4
IPv4 security permits encryption to keep up privacy and security.
IPV4 network allocation is significant and presently has quite 85000 practical
routers.
It becomes easy to attach multiple devices across an outsized network while not
NAT.
This is a model of communication so provides quality service also as economical
knowledge transfer.
IPV4 addresses are redefined and permit flawless encoding.
Routing is a lot of scalable and economical as a result of addressing is collective
more effectively.
Data communication across the network becomes a lot of specific in multicast
organizations.
Limitations of IPv4
IP relies on network layer addresses to identify end-points on network, and each
network has a unique IP address.
The world’s supply of unique IP addresses is dwindling, and they might eventually
run out theoretically.
If there are multiple host, we need IP addresses of next class.
Complex host and routing configuration, non-hierarchical addressing, difficult to
re-numbering addresses, large routing tables, non-trivial implementations in
providing security, QoS (Quality of Service), mobility and multi-homing,
multicasting etc. are the big limitation of IPv4 so that’s why IPv6 came into the
picture.
What is IPv6?
The most common version of the Internet Protocol currently in use, IPv4, will soon be
replaced by IPv6, a new version of the protocol. The well-known IPv6 protocol is being
used and deployed more often, especially in mobile phone markets. IP address
determines who and where you are in the network of billions of digital devices that are
connected to the Internet.
The next generation Internet Protocol (IP) address standard, known as IPv6, is meant to
work in tandem with IPv4, which is still in widespread use today, and eventually replace
it. To communicate with other devices, a computer, smartphone, home automation
component, Internet of Things sensor, or any other Internet-connected device needs a
numerical IP address. Because so many connected devices are being used, the original
IP address scheme, known as IPv4, is running out of addresses.
IPv4 vs IPv6
The common type of IP address (is known as IPv4, for “version 4”). Here’s an example
of what an IP address might look like:
25.59.209.224
An IPv4 address consists of four numbers, each of which contains one to three digits,
with a single dot (.) separating each number or set of digits. This group of separated
numbers creates the addresses that let you and everyone around the globe to send
and retrieve data over our Internet connections. The IPv4 uses a 32-bit address scheme
allowing to store 232 addresses which is more than 4 billion addresses. To date, it is
considered the primary Internet Protocol and carries 94% of Internet traffic. Initially, it
was assumed it would never run out of addresses but the present situation paves a
new way to IPv6, let’s see why? An IPv6 address consists of eight groups of four
hexadecimal digits. Here’s an example IPv6 address:
3001:0da8:75a3:0000:0000:8a2e:0370:7334
This new IP address version is being deployed to fulfil the need for more Internet
addresses. With 128-bit address space, it allows 340 undecillion unique address space.
IPv6 support a theoretical maximum of 340, 282, 366, 920, 938, 463, 463, 374, 607, 431,
768, 211, 456. To keep it straightforward, we will never run out of IP addresses again.
The next iteration of the IP standard is known as Internet Protocol version 6 (IPv6).
Although IPv4 and IPv6 will coexist for a while, IPv6 is meant to work in tandem with
IPv4 before eventually taking its place. We need to implement IPv6 in order to proceed
and keep bringing new gadgets and services to the Internet. We can only move
forward with an innovative and open Internet if we implement it, which was created
with the needs of a global commercial Internet in mind.
Advantages of IPv6
Faster Speeds: IPv6 supports multicast rather than broadcast in IPv4.This feature
allows bandwidth-intensive packet flows (like multimedia streams) to be sent to
multiple destinations all at once.
Stronger Security: IPSecurity, which provides confidentiality, and data integrity, is
embedded into IPv6.
Routing efficiency
Reliability
Most importantly it’s the final solution for growing nodes in Global-network.
The device allocates addresses on its own.
Internet protocol security is used to support security.
Enable simple aggregation of prefixes allocated to IP networks; this saves
bandwidth by enabling the simultaneous transmission of large data packages.
Disadvantages of IPv6
Conversion: Due to widespread present usage of IPv4 it will take a long period to
completely shift to IPv6.
Communication: IPv4 and IPv6 machines cannot communicate directly with each
other.
Not going backward Compatibility: IPv6 cannot be executed on IPv4-capable
computers because it is not available on IPv4 systems.
Conversion Time: One significant drawback of IPv6 is its inability to uniquely
identify each device on the network, which makes the conversion to IPV4 extremely
time-consuming.
Cross-protocol communication is forbidden since there is no way for IPv4 and IPv6
to communicate with each other.
IPv6 IPv4
IPv6 has a 128-bit address length IPv4 has a 32-bit address length
IPv6 has a header of 40 bytes fixed IPv4 has a header of 20-60 bytes.
IPv6 IPv4
Hexadecimal Notation
Some points to be noted about dotted decimal notation:
1. The value of any segment (byte) is between 0 and 255 (both included).
2. No zeroes are preceding the value in any segment (054 is wrong, 54 is correct).
Classful Addressing
The 32-bit IP address is divided into five sub-classes. These are given below:
Class A
Class B
Class C
Class D
Class E
Each of these classes has a valid range of IP addresses. Classes D and E are reserved
for multicast and experimental purposes respectively. The order of bits in the first
octet determines the classes of the IP address. The IPv4 address is divided into two
parts:
Network ID
Host ID
The class of IP address is used to determine the bits used for network ID and host ID
and the number of total networks and hosts possible in that particular class. Each ISP
or network administrator assigns an IP address to each device that is connected to its
network.
Note:
1. IP addresses are globally managed by Internet Assigned Numbers Authority (IANA)
and regional Internet registries(RIR).
2. While finding the total number of host IP addresses, 2 IP addresses are not counted
and are therefore, decreased from the total count because the first IP address of
any network is the network number and whereas the last IP address is reserved for
broadcast IP.
Class A
IP addresses belonging to class A are assigned to the networks that contain a large
number of hosts.
The higher-order bit of the first octet in class A is always set to 0. The remaining 7 bits
in the first octet are used to determine network ID. The 24 bits of host ID are used to
determine the host in any network. The default subnet mask for Class A is 255.x.x.x.
Therefore, class A has a total of:
224 – 2 = 16,777,214 host ID
IP addresses belonging to class A ranges from 0.0.0.0 – 127.255.255.255.
Class B
IP address belonging to class B is assigned to networks that range from medium-sized
to large-sized networks.
The higher-order bits of the first octet of IP addresses of class B are always set to 10.
The remaining 14 bits are used to determine the network ID. The 16 bits of host ID are
used to determine the host in any network. The default subnet mask for class B is
255.255.x.x. Class B has a total of:
Class C
IP addresses belonging to class C are assigned to small-sized networks.
The higher-order bits of the first octet of IP addresses of class C is always set to 110.
The remaining 21 bits are used to determine the network ID. The 8 bits of host ID are
used to determine the host in any network. The default subnet mask for class C is
255.255.255.x. Class C has a total of:
Class D does not possess any subnet mask. IP addresses belonging to class D range
from 224.0.0.0 – 239.255.255.255.
Class E
IP addresses belonging to class E are reserved for experimental and research purposes.
IP addresses of class E range from 240.0.0.0 – 255.255.255.254. This class doesn’t have
any subnet mask. The higher-order bits of the first octet of class E are always set to
1111.
The Network address identifies a network on the internet. Using this, we can find
a range of addresses in the network and total possible number of hosts in the network.
Mask is a 32-bit binary number that gives the network address in the address block
when AND operation is bitwise applied on the mask and any IP address of the block.
Classless Addressing
Here, subnet mask is found by putting the given number of bits out of 32 as 1, like, in
the given address, we need to put 28 out of 32 bits as 1 and the rest as 0, and so, the
subnet mask would be 255.255.255.240.
Question:
Given IP Address – 172.16.0.0/25, find the number of subnets and the number of
hosts per subnet. Also, for the first subnet block, find the subnet address, first
host ID, last host ID, and broadcast address.
Solution:
This is a class B address.
So, no. of subnets = 2(25-16) = 29 = 512.
No. of hosts per subnet = 2(32-25) – 2 = 27 – 2 = 128 – 2 = 126
For the first subnet block (means Subnet Number = 1), we have subnet address =
172.16.0.0,
first host id = 172.16.0.1,
last host id = 172.16.0.126 and
broadcast address = 172.16.0.127
Sr.
Parameter Classful Addressing Classless Addressing
No.
Classless addressing
In Classful addressing IP came to replace the
addresses are allocated classful addressing and
1. Basics
according to the classes- A to to handle the issue of
E. rapid exhaustion of IP
addresses.
2. Practical It is less practical. It is more practical.
It supports Classless
It does not support Classless
6. CIDR Inter-Domain Routing
Inter-Domain Routing (CIDR).
(CIDR).
Network
Division of Host
9. Host
Address Subnet
Subnet
Classless Inter Domain Routing (CIDR)
CIDR addresses are represented using a slash notation, which specifies the number of
bits in the network prefix. For example, an IP address of 192.168.1.0 with a prefix
length of 24 would be represented as 192.168.1.0/24. This notation indicates that the
first 24 bits of the IP address are the network prefix and the remaining 8 bits are the
host identifier.
Now, let’s suppose an Organization requires 214 hosts, then it must have to purchase
a Class B network. In this case, 49150 Hosts will be wasted. This is the major drawback
of Classful Addressing. In order to reduce the wastage of IP addresses a new concept
of Classless Inter-Domain Routing is introduced. Nowadays IANA is using this
technique to provide IP addresses. Whenever any user asks for IP addresses, IANA is
going to assign that many IP addresses to the User.
Representation:
It is as also a 32-bit address, which includes a special number that represents the
number of bits that are present in the Block Id.
a.b.c.d/n
Where n is the number of bits that are present in Block Id / Network Id.
Example:
20.10.50.100/20
Example: If the Block size is 25 then, Host Id will contain 5 bits and Network will
contain 32 – 5 = 27 bits.
Introduction To Subnetting
When a bigger network is divided into smaller networks, to maintain security, then that
is known as Subnetting. So, maintenance is easier for smaller networks.
For example, if we consider a class A address, the possible number of hosts is 224 for
each network, it is obvious that it is difficult to maintain such a huge number of hosts,
but it would be quite easier to maintain if we divide the network into small parts.
Uses of Subnetting
1. Subnetting helps in organizing the network in an efficient way which helps in
expanding the technology for large firms and companies.
2. Subnetting is used for specific staffing structures to reduce traffic and maintain
order and efficiency.
3. Subnetting divides domains of the broadcast so that traffic is routed efficiently,
which helps in improving network performance.
4. Subnetting is used in increasing network security.
The network can be divided into two parts: To divide a network into two parts, you
need to choose one bit for each Subnet from the host ID part.
For Subnet-1: The first bit which is chosen from the host id part is zero and the
range will be from (193.1.2.00000000 till you get all 1’s in the host ID part i.e,
193.1.2.01111111) except for the first bit which is chosen zero for subnet id part.
For Subnet-2: The first bit chosen from the host id part is one and the range will
be from (193.1.2.100000000 till you get all 1’s in the host ID part i.e,
193.1.2.11111111).
The best way to find out the subnet mask of a subnet is to set the fixed bit of host-id
to 1 and the rest to 0.
Finally, after using the subnetting the total number of usable hosts is reduced from
254 to 252.
Note:
1. To divide a network into four (22) parts you need to choose two bits from the host
id part for each subnet i.e, (00, 01, 10, 11).
2. To divide a network into eight (23) parts you need to choose three bits from the
host id part for each subnet i.e, (000, 001, 010, 011, 100, 101, 110, 111) and so on.
3. We can say that if the total number of subnets in a network increases the total
number of usable hosts decreases.
Along with the advantage, there is a small disadvantage to subnetting that is, before
subnetting to find the IP address first the network id is found then the host id followed
by the process id, but after subnetting first network id is found then the subnet id then
host id and finally process id by this the computation increases.
Example 1:
An organization is assigned a class C network address of 201.35.2.0. It uses a netmask
of 255.255.255.192 to divide this into sub-networks. Which of the following is/are valid
host IP addresses?
1. 201.35.2.129
2. 201.35.2.191
3. 201.35.2.255
4. Both (A) and (C)
Solution:
Converting the last octet of the netmask into the binary form: 255.255.255.11000000
Converting the last octet of option 1 into the binary form: 201.35.2.10000001
Converting the last octet of option 2 into the binary form: 201.35.2.10111111
Converting the last octet of option 3 into the binary form: 201.35.2.11111111
From the above, we see that Options 2 and 3 are not valid host IP addresses (as they
are broadcast addresses of a subnetwork), and OPTION 1 is not a broadcast address
and it can be assigned to a host IP.
Example 2:
An organization has a class C network address of 201.32.64.0. It uses a subnet mask of
255.255.255.248. Which of the following is NOT a valid broadcast address for any
subnetworks?
1. 201.32.64.135
2. 201.32.64.240
3. 201.32.64.207
4. 201.32.64.231
Solution:
Converting the last octet of the netmask into the binary form: 255.255.255.11111000
Converting the last octet of option 1 into the binary form: 201.32.64.10000111
Converting the last octet of option 2 into the binary form: 201.32.64.11110000
Converting the last octet of option 3 into the binary form: 201.32.64.11001111
Converting the last octet of option 4 into the binary form: 201.32.64.11100111
From the above, we can see that in OPTION 1, 3, and 4, all the host bits are 1 and give
the valid broadcast address of subnetworks. and OPTION 2, the last three bits of the
Host address are not 1 therefore it’s not a valid broadcast address.
Advantages of Subnetting
The advantages of Subnetting are mentioned below:
1. It provides security to one network from another network. eg) In an Organisation,
the code of the Developer department must not be accessed by another
department.
2. It may be possible that a particular subnet might need higher network priority than
others. For example, a Sales department needs to host webcasts or video
conferences.
3. In the case of Small networks, maintenance is easy.
Disadvantages of Subnetting
The disadvantages of Subnetting are mentioned below:
1. In the case of a single network, only three steps are required to reach a Process i.e
Source Host to Destination Network, Destination Network to Destination Host, and
then Destination Host to Process.
2. In the case of a Single Network only two IP addresses are wasted to represent
Network Id and Broadcast address but in the case of Subnetting two IP addresses
are wasted for each Subnet.
3. The cost of the overall Network also increases. Subnetting requires internal routers,
Switches, Hubs, Bridges, etc. which are very costly.
4. This platform doesn’t allow me to study efficiently.