0% found this document useful (0 votes)
37 views20 pages

IP and SUbnet

Uploaded by

Ally Mikoi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views20 pages

IP and SUbnet

Uploaded by

Ally Mikoi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

What is IPv4?

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.

IPv6 or Internet Protocol Version 6 is a network layer protocol that allows


communication to take place over the network. IPv6 was designed by Internet
Engineering Task Force (IETF) in December 1998 with the purpose of superseding the
IPv4 due to the global exponentially growing internet users.

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.

Types of IPv6 Address


Now that we know about what is IPv6 address let’s take a look at its different types.
 Unicast addresses : Only one interface is specified by the unicast address. A packet
moves from one host to the destination host when it is sent to a unicast address
destination.
 Multicast addresses It represents a group of IP devices and can only be used as
the destination of a datagram.
 Anycast addresses The multicast address and the anycast address are the same.
The way the anycast address varies from other addresses is that it can deliver the
same IP address to several servers or devices. Keep in mind that the hosts do not
receive the IP address. Stated differently, multiple interfaces or a collection of
interfaces are assigned an anycast address.

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.

Differenece Between IPv6 and IPv4

IPv6 IPv4

IPv6 has a 128-bit address length IPv4 has a 32-bit address length

It supports Auto and renumbering It Supports Manual and DHCP address


address configuration configuration

The address space of IPv6 is quite large it


It can generate 4.29×109 address space
can produce 3.4×1038 address space

Address Representation of IPv6 is in Address representation of IPv4 is in


hexadecimal decimal

In IPv6 checksum field is not available In IPv4 checksum field is available

IPv6 has a header of 40 bytes fixed IPv4 has a header of 20-60 bytes.
IPv6 IPv4

IPv4 supports VLSM(Variable Length


IPv6 does not support VLSM.
subnet mask).

Introduction of Classful IP Addressing

An IP address is an address having information about how to reach a specific host,


especially outside the LAN. An IP address is a 32-bit unique address having an address
space of 232. Generally, there are two notations in which the IP address is written,
dotted decimal notation and hexadecimal notation.

Dotted Decimal Notation

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 network ID is 8 bits long.


 The host ID is 24 bits long.

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 network ID is 16 bits long.


 The host ID is 16 bits long.

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:

 214 = 16384 network address


 216 – 2 = 65534 host address
IP addresses belonging to class B ranges from 128.0.0.0 – 191.255.255.255.

Class C
IP addresses belonging to class C are assigned to small-sized networks.

 The network ID is 24 bits long.


 The host ID is 8 bits long.

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:

 221 = 2097152 network address


 28 – 2 = 254 host address
IP addresses belonging to class C range from 192.0.0.0 – 223.255.255.255.
Class D
IP address belonging to class D is reserved for multi-casting. The higher-order bits of
the first octet of IP addresses belonging to class D is always set to 1110. The remaining
bits are for the address that interested hosts recognize.

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.

Summary of Classful Addressing

Problems with Classful Addressing


The problem with this classful addressing method is that millions of class A addresses
are wasted, many of the class B addresses are wasted, whereas, the number of
addresses available in class C is so small that it cannot cater to the needs of
organizations. Class D addresses are used for multicast routing and are therefore
available as a single block only. Class E addresses are reserved.
Since there are these problems, Classful networking was replaced by Classless Inter-
Domain Routing (CIDR) in 1993.

 The network ID is 24 bits long.


 The host ID is 8 bits long.
 221 = 2,097,152 network address
 28 – 2 = 254 host address
 Within any network, the host ID must be unique to that network.
 Host ID in which all bits are set to 0 cannot be assigned because this host ID is
used to represent the network ID of the IP address.
 Host ID in which all bits are set to 1 cannot be assigned because this host ID is
reserved as a broadcast address to send packets to all the hosts present on that
particular network.
 The network ID cannot start with 127 because 127 belongs to the class A
address and is reserved for internal loopback functions.
 All bits of network ID set to 1 are reserved for use as an IP broadcast address
and therefore, cannot be used.
 All bits of network ID set to 0 are used to denote a specific host on the local
network and are not routed and therefore, aren’t used.

Classless Addressing in IP Addressing

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.

The default masks in different classes are :


1. Class A – 255.0.0.0
2. Class B – 255.255.0.0
3. Class C – 255.255.255.0
Subnetting
Dividing a large block of addresses into several contiguous sub-blocks and assigning
these sub-blocks to different smaller networks is called subnetting. It is a practice that
is widely used when classless addressing is done.

A subnet or subnetwork is a network inside a network. Subnets make networks more


efficient. Through subnetting, network traffic can travel a shorter distance without
passing through unnecessary routers to reach its destination.

Classless Addressing

To reduce the wastage of IP addresses in a block, we use sub-netting. What we do is


that we use host id bits as net id bits of a classful IP address. We give the IP address
and define the number of bits for mask along with it (usually followed by a ‘/’ symbol),
like, 192.168.1.1/28.

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.

A classless addressing system or classless interdomain routing (CIDR or supernetting)


is the way to combine two or more class C networks to create a/23 or a /22 supernet.

A classless addressing system or classless interdomain routing (CIDR) is an improved IP


addressing system. In a classless addressing system the block of IP address is assigned
dynamically based on specific rules.

Some Values Calculated in Subnetting:


1. Number of subnets : 2(Given bits for mask – No. of bits in default mask)
2. Subnet address : AND result of subnet mask and the given IP address
3. Broadcast address : By putting the host bits as 1 and retaining the network bits
as in the IP address
4. Number of hosts per subnet : 2(32 – Given bits for mask) – 2
5. First Host ID : Subnet address + 1 (adding one to the binary representation of
the subnet address)
6. Last Host ID : Subnet address + Number of Hosts

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

Difference between Classful Addressing and Classless Addressing

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.

The changes in the Network ID There is no such


Network ID and
3. and Host ID depend on the restriction of class in
Host ID
class. classless addressing.

It does not support the It supports the Variable


4. VLSM Variable Length Subnet Mask Length Subnet Mask
(VLSM). (VLSM).

Classful addressing requires It requires less


more bandwidth. As a result, it bandwidth. Thus, fast
5. Bandwidth becomes slower and more and less expensive as
expensive as compared to compared to classful
classless addressing. addressing.

It supports Classless
It does not support Classless
6. CIDR Inter-Domain Routing
Inter-Domain Routing (CIDR).
(CIDR).

7. Updates Regular or periodic updates Triggered Updates

Troubleshooting and problem


detection are easy than
Troubleshooting It is not as easy
classless addressing because
8. and Problem compared to classful
of the division of network, host
detection addressing.
and subnet parts in the
address.

 Network
Division of  Host
9.  Host
Address  Subnet
 Subnet
Classless Inter Domain Routing (CIDR)

Classless Inter-Domain Routing (CIDR) is a method of IP address allocation and IP


routing that allows for more efficient use of IP addresses. CIDR is based on the idea
that IP addresses can be allocated and routed based on their network prefix rather
than their class, which was the traditional way of IP address allocation.

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

Rules for forming CIDR Blocks:


 All IP addresses must be contiguous.
 Block size must be the power of 2 (2n).
 If the size of the block is the power of 2, then it will be easy to divide the
Network.
 Finding out the Block Id is very easy if the block size is of the power of 2.

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.

How Does Subnetting Work?


The working of subnets starts in such a way that firstly it divides the subnets into
smaller subnets. For communicating between subnets, routers are used. Each subnet
allows its linked devices to communicate with each other. Subnetting for a network
should be done in such a way that it does not affect the network bits.
In class C the first 3 octets are network bits so it remains as it is.

 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.

Thus, the range of subnet 1 is: 193.1.2.0 to 193.1.2.127

Subnet id of Subnet-1 is : 193.1.2.0


The direct Broadcast id of Subnet-1 is: 193.1.2.127
The total number of hosts possible is: 126 (Out of 128, 2 id's are used for Subnet id &
Direct Broadcast id)
The subnet mask of Subnet- 1 is: 255.255.255.128

 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).

Thus, the range of subnet-2 is: 193.1.2.128 to 193.1.2.255

Subnet id of Subnet-2 is : 193.1.2.128

The direct Broadcast id of Subnet-2 is: 193.1.2.255


The total number of hosts possible is: 126 (Out of 128, 2 id's are used for Subnet id &
Direct Broadcast id)
The subnet mask of Subnet- 2 is: 255.255.255.128

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.

You might also like