0% found this document useful (0 votes)
15 views26 pages

UNIT 3 Network Layer

A computer network is a collection of interconnected hosts that share data over wired or wireless media, ranging from simple connections to complex systems like the Internet. Key components include hosts, media, hubs, switches, routers, gateways, and firewalls, each serving specific roles in data exchange. Addressing in networks involves physical (MAC) and logical (IP) addresses, with IPv4 being the most widely used version for device identification, while IPv6 addresses the limitations of IPv4 with a larger address space.

Uploaded by

Kinemaster Edits
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)
15 views26 pages

UNIT 3 Network Layer

A computer network is a collection of interconnected hosts that share data over wired or wireless media, ranging from simple connections to complex systems like the Internet. Key components include hosts, media, hubs, switches, routers, gateways, and firewalls, each serving specific roles in data exchange. Addressing in networks involves physical (MAC) and logical (IP) addresses, with IPv4 being the most widely used version for device identification, while IPv6 addresses the limitations of IPv4 with a larger address space.

Uploaded by

Kinemaster Edits
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/ 26

What is Network?

A Network in the world of computers is said to be a collection of interconnected hosts, via


some shared media which can be wired or wireless. A computer network enables its hosts to
share and exchange data and information over the media. Network can be a Local Area
Network spanned across an office or Metro Area Network spanned across a city or Wide
Area Network which can be spanned across cities and provinces.

A computer network can be as simple as two PCs connected together via a single copper
cable or it can be grown up to the complexity where every computer in this world is
connected to every other, called the Internet. A network then includes more and more
components to reach its ultimate goal of data exchange. Below is a brief description of the
components involved in computer network −

Hosts − Hosts are said to be situated at ultimate end of the network, i.e. a host is a source of
information and another host will be the destination. Information flows end to end between
hosts. A host can be a user’s PC, an internet Server, a database server etc.

Media − If wired, then it can be copper cable, fiber optic cable, and coaxial cable. If wireless,
it can be free-to-air radio frequency or some special wireless band. Wireless frequencies can
be used to interconnect remote sites too.

Hub − A hub is a multiport repeater and it is used to connect hosts in a LAN segment.
Because of low throughputs hubs are now rarely used. Hub works on Layer-1 (Physical
Layer) of OSI Model.

Switch − A Switch is a multiport bridge and is used to connect hosts in a LAN segment.
Switches are much faster than Hubs and operate on wire speed. Switch works on Layer-2
(Data Link Layer), but Layer-3 (Network Layer) switches are also available.

Router − A router is Layer-3 (Network Layer) device which makes routing decisions for the
data/information sent for some remote destination. Routers make the core of any
interconnected network and the Internet.

Gateways − A software or combination of software and hardware put together, works for
exchanging data among networks which are using different protocols for sharing data.
Firewall − Software or combination of software and hardware, used to protect users data
from unintended recipients on the network/internet.

All components in a network ultimately serve the hosts.

Host Addressing
Communication between hosts can happen only if they can identify each other on the
network. In a single collision domain (where every packet sent on the segment by one host is
heard by every other host) hosts can communicate directly via MAC address.

MAC address is a factory coded 48-bits hardware address which can also uniquely identify a
host. But if a host wants to communicate with a remote host, i.e. not in the same segment or
logically not connected, then some means of addressing is required to identify the remote
host uniquely. A logical address is given to all hosts connected to Internet and this logical
address is called Internet Protocol Address.

Physical Address and Logical Address in Networking


A physical address is a unique identifier given to network interfaces for communication over a
physical network segment. A logical address is a unique address assigned to each networked device
to identify its location and enable routing. In this article, we will discuss Physical Address and Logical
Address.
What is a Physical Address?
The physical address is also known as the MAC (Media Access Control) address or link address. It is
the address of a node which is defined by its LAN or WAN. It is used by the data link layer and is the
lowest level of addresses. MAC address is the unique address of a device. The size of a physical
address is 48 bits (6 bytes). Below is the format for representing a physical address:
XX : XX : XX : YY : YY : YY, where 1 octant = 8 bits.
Example:
16 : 1A : BB : 6F : 90 : E5
The first 24 bits of a MAC address XX : XX: XX is decided by OUI (Organizationally Unique
Identifier). It represents the identity of the manufacturer. The next 24 bits of a MAC address YY :
YY : YY represents the unique identity of the device. It is assigned by the manufacturer. They
represent NIC (Network Interface Card).
Below is a diagram representing the working mechanism of a physical address:
Mechanism of Physical Address
In the above diagram, we can see that there are two networks - Network 1 and Network 2. A1 is the
sender and there are two receivers - D1 and D2. In case of physical address, receiver D1 receives the
data but receiver D2 is unable to receive data. This is because receiver D2 does not belong to the same
network as the sender A1 belongs to. Physical address can only be passed in the same network and not
in different networks. The purpose of using Physical address is to identify devices in the same
network.
Advantages
●​ Physical address can uniquely identify devices and deliver data packets accurately.

●​ We can restrict access to any network by allowing only those devices which have the
authorized MAC addresses to connect. Thus, it can also be used for network security.
Disadvantages
●​ MAC addresses can be easily spoofed. Thus, the devices can easily gain unauthorized access
to a network.
●​ As physical addresses cannot traverse through the routers therefore they can only be used in
local networks and not between different networks.
Physical and Logical Address

What is a Logical Address?


Logical address also referred to as IP (Internet Protocol) address is an universal addressing system.
It is used in the Network layer. This address facilitates universal communication that are not
dependent on the underlying physical networks. There are two types of IP addresses - IPv4 and IPv6.
The size of IPv4 is 32 bits. For example ,
192 : 180 : 210 where, 1 octant = 8 bits.
The size of IPv6 is 128 bits. For example ,
1C18 : 1B32 : C450 : 62A5 : 34DC : AE24 : 15BC : 6A5D where , 1 octant = 16 bits.
Below is a diagram representing the working mechanism of Logical address:
Mechanism of Logical Address
In the above diagram , we can see that there are two networks - Network 1 and Network 2. A1 is the
sender and there are two receivers - D1 and D2. In case of logical address, receiver D1 as well as D2
receives the data. This is because logical address can be passed in different networks. The purpose of
using logical address is to send the data across networks.
Advantages
●​ Logical address can be used in different networks because they can traverse through routers.

●​ They can handle a number devices and networks. Even if the number of devices and network
increases, the logical address is able to handle all them very easily. Thus, they are highly
scalable.
Disadvantages
●​ Internet Protocol is vulnerable to attacks such as hacking, phishing etc. and there can be data
loss.
●​ It lacks privacy. The data which is moving through the packets can be intercepted, traced and
monitored by unauthorized entities.
Differences between Physical Address and Logical Address
Physical Address Logical Address

Physical Address is the address of Logical address also referred to as IP


a node which is defined by its (Internet Protocol) address is an universal
LAN or WAN addressing system

Physical Address is computed bu


Logical Address is generated by CPU.
MMU.

Found on Data Link Layer. Found on Network Layer.

Format is 48-bit address in Format is IPv4: 32-bit​


hexadecimal. IPv6: 128-bit

Physical address is not visible to


Logical address is visible to users.
users.

What is IPv4?
IP stands for Internet Protocol version v4 stands for Version Four (IPv4), is the most widely used
system for identifying devices on a network. It uses a set of four numbers, separated by periods (like
192.168.0.1), to give each device a unique address. This address helps data find its way from one
device to another over the internet.
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.
What is an IP Address?
An IP address (Internet Protocol address) is a unique identifier assigned to each device connected
to a network that uses the Internet Protocol for communication. It serves two main purposes:
●​ Identification: It uniquely identifies a device on a network.

●​ Location Addressing: It indicates where a device is located within a network, making data
routing possible.
Understanding IPv4 Addressing
An IPv4 address consists of series of four eight-bit binary numbers which are separated by decimal
point. Although any numbering system can be used to represent a unique 32- bit number, most
commonly you see IP address expressed in dot decimal notation. Some of the examples are :
Site Dot-decimal Binary

Twitter.com 104.244.42.129 01101000.11110100.00101010.10000001

Reddit.com 151.101.65.140 10010111.01100101.01000001.10001100

Linkedin.com 108.174.10.10 01101100.10101110.00001010.00001010

IPv4 Address Format


An IPv4 address consists of 32 bit (binary digit), grouped into four section of known as octets or
bytes. Each octet has 8 bits and this bits can be represented only in 0 or 1 form, and when they
grouped together, they form a binary number. Since each octet has 8 bits, it can represent 256 numbers
ranging from o to 255. These four octets are represented as decimal numbers, separated by periods
known as dotted decimal notation. For example IPv4 address 185.107.80.231 consists of four octets.
Binary Representation
IPv4 is basically converted into binary form by computer although these are usually seen in decimal
form for human readability. Each octet is converted into 8 bit binary number . For
instance 185.107.80.231 in binary looks like:
●​ 185: 10111001

●​ 107: 01101011

●​ 80: 01010000

●​ 231: 11100111

So 185.107.80.231 in binary is: 10111001.01101011.01010000.11100111

Parts of IPv4
IPv4 addresses consist of three parts:
●​ 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 non obligatory part of IPv4. Local networks that have massive
numbers of hosts are divided into subnets and subnet numbers are appointed to that.

IPv4 supports three different types of addressing modes. −


Unicast Addressing Mode
In this mode, data is sent only to one destined host. The Destination Address field contains 32- bit IP
address of the destination host. Here the client sends data to the targeted server −

Broadcast Addressing Mode


In this mode, the packet is addressed to all the hosts in a network segment. The Destination Address
field contains a special broadcast address, i.e. 255.255.255.255. When a host sees this packet on the
network, it is bound to process it. Here the client sends a packet, which is entertained by all the
Servers −

Multicast Addressing Mode


This mode is a mix of the previous two modes, i.e. the packet sent is neither destined to a single host
nor all the hosts on the segment. In this packet, the Destination Address contains a special address
which starts with 224.x.x.x and can be entertained by more than one host.

Here a server sends packets which are entertained by more than one servers. Every network has one IP
address reserved for the Network Number which represents the network and one IP address reserved
for the Broadcast Address, which represents all the hosts in that network.
Hierarchical Addressing Scheme
IPv4 uses hierarchical addressing scheme. An IP address, which is 32-bits in length, is divided into
two or three parts as depicted −

A single IP address can contain information about the network and its sub-network and ultimately the
host. This scheme enables the IP Address to be hierarchical where a network can have many
sub-networks which in turn can have many hosts.
Subnet Mask
The 32-bit IP address contains information about the host and its network. It is very necessary to
distinguish both. For this, routers use Subnet Mask, which is as long as the size of the network address
in the IP address. Subnet Mask is also 32 bits long. If the IP address in binary is ANDed with its
Subnet Mask, the result yields the Network address. For example, say the IP Address is 192.168.1.152
and the Subnet Mask is 255.255.255.0 then −

This way the Subnet Mask helps extract the Network ID and the Host from an IP Address. It can be
identified now that 192.168.1.0 is the Network number and 192.168.1.152 is the host on that network.
Binary Representation
The positional value method is the simplest form of converting binary from decimal value. IP address
is 32 bit value which is divided into 4 octets. A binary octet contains 8 bits and the value of each bit
can be determined by the position of bit value '1' in the octet.

Positional value of bits is determined by 2 raised to power (position – 1), that is the value of a bit 1 at
position 6 is 2^(6-1) that is 2^5 that is 32. The total value of the octet is determined by adding up the
positional value of bits. The value of 11000000 is 128+64 = 192. Some examples are shown in the
table below −
\

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

●​ IPv4 has high System Management prices and it’s labor-intensive, complex, slow & prone to
errors.
●​ Routing is scalable and economical as a result of addressing its 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 the 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 hosts, we need the IP addresses of the 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
limitations of IPv4 so that’s why IPv6 came into the picture.

IPV6
The wonder of IPv6 lies in its header. An IPv6 address is 4 times larger than IPv4, but surprisingly,
the header of an IPv6 address is only 2 times larger than that of IPv4. IPv6 headers have one Fixed
Header and zero or more Optional (Extension) Headers. All the necessary information that is essential
for a router is kept in the Fixed Header. The Extension Header contains optional information that
helps routers to understand how to handle a packet/flow.
Fixed Header

IPv6 fixed header is 40 bytes long and contains the following information.

S.N. Field & Description

1 Version (4-bits): It represents the version of Internet Protocol, i.e. 0110.

Traffic Class (8-bits): These 8 bits are divided into two parts. The most significant 6 bits are
2 used for Type of Service to let the Router Known what services should be provided to this
packet. The least significant 2 bits are used for Explicit Congestion Notification (ECN).

Flow Label (20-bits): This label is used to maintain the sequential flow of the packets
belonging to a communication. The source labels the sequence to help the router identify that a
3
particular packet belongs to a specific flow of information. This field helps avoid re-ordering of
data packets. It is designed for streaming/real-time media.

Payload Length (16-bits): This field is used to tell the routers how much information a
particular packet contains in its payload. Payload is composed of Extension Headers and Upper
4 Layer data. With 16 bits, up to 65535 bytes can be indicated; but if the Extension Headers
contain Hop-by-Hop Extension Header, then the payload may exceed 65535 bytes and this field
is set to 0.

Next Header (8-bits): This field is used to indicate either the type of Extension Header, or if
5 the Extension Header is not present then it indicates the Upper Layer PDU. The values for the
type of Upper Layer PDU are same as IPv4s.

Hop Limit (8-bits): This field is used to stop packet to loop in the network infinitely. This is
6 same as TTL in IPv4. The value of Hop Limit field is decremented by 1 as it passes a link
(router/hop). When the field reaches 0 the packet is discarded.

7 Source Address (128-bits): This field indicates the address of originator of the packet.
Destination Address (128-bits): This field provides the address of intended recipient of the
8
packet.

Extension Headers
In IPv6, the Fixed Header contains only that much information which is necessary, avoiding those
information which is either not required or is rarely used. All such information is put between the
Fixed Header and the Upper layer header in the form of Extension Headers. Each Extension Header is
identified by a distinct value.
When Extension Headers are used, IPv6 Fixed Headers Next Header field points to the first Extension
Header. If there is one more Extension Header, then the first Extension Headers Next-Header field
points to the second one, and so on. The last Extension Headers Next-Header field points to the Upper
Layer Header. Thus, all the headers points to the next one in a linked list manner.
If the Next Header field contains the value 59, it indicates that there are no headers after this header,
not even Upper Layer Header.
The following Extension Headers must be supported as per RFC 2460:

The sequence of Extension Headers should be:

These headers:
●​ 1. should be processed by First and subsequent destinations.

●​ 2. should be processed by Final Destination.


Extension Headers are arranged one after another in a linked list manner, as depicted in the following
diagram:

[Image: Extension Headers Connected Format]

The major differences between IPv4 and IPv6 are:


IPv4 (Internet Protocol Version 4) IPv6 (Internet Protocol Version 6)

Encryption and authentication is not provided in IPv4 Encryption and authentication is provided in
(Internet Protocol Version 4). IPv6 (Internet Protocol Version 6)

Header of IPv4 is 20 – 60 bytes. Header of IPv6 is fixed at 40 bytes

Checksumfield is available in IPv4. Checksumfield is not available in IPv6.

Packet flow identification is not available in IPv4 (Internet Packet flow identification is available in IPv6.
Protocol Version 4). Flow label field is available in the header.

IPv4 addresses are usually represented in dot-decimal An IPv6 address is represented as eight groups
notation, consisting of four decimal numbers, each ranging of four hexadecimal digits, each group
from 0 to 255, separated by dots. representing 16 bits.

Sender and forwarding routers performs fragmentation in Fragmentation is performed only by the sender
IPv4 in IPv6.

In IPv4, security features relies on application In IPv6, there is an inbuilt security feature
named IPSEC.

End to end connection integrity cannot be achieved in IPv4. End to end connection integrity can be done in
IPv6.

IPv4 supports DHCP and Manual address configuration IPv6 supports renumbering and auto address
configuration.
IPv4 addresses are 32-bit long IPv6 addresses are 128 bits long.

The address space in IPv4 is 4.29 ×109 The address space in IPv6 is 3.4 ×1038

IPv4 has a broadcast message transmission scheme. Multicast and Anycast message transmission
scheme is available in IPv6.

Introduction of Classful IP Addressing


An IP address is an address that has 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.
Classful IP addressing is a way of organizing and managing IP addresses, which are used to identify
devices on a network. Think of IP addresses like street addresses for houses; each device on a network
needs its unique address to communicate with other devices. In this article, we will discuss Classful IP
addresses, and their types in detail.
Classful IP Addressing
Classful IP addressing is an obsolete method for allocating IP addresses and dividing the available IP
address space across networks. It was used from 1981 to 1993 until the introduction of CIDR (Based
on Prefixes rather than classes). Classful method categorizes IP addresses into five classes (A, B, C,
D, and E), each defined by the first few bits of the address and serving specific ranges of purposes.
The functionality of classful networking also extended to ease of configuration. Network
administrators could set up networks with default subnet masks without the need for detailed
subnetting strategies, which was particularly beneficial in less complex networking environments.
IPV4 Address
An IPv4 address is a unique number assigned to every device that connects to the internet or a
computer network. It’s like a home address for your computer, smartphone, or any other device,
allowing it to communicate with other devices.
●​ Format: An IPv4 address is written as four numbers separated by periods, like this:
192.168.1.1. Each number can range from 0 to 255.
●​ The IPv4 address is divided into two parts: NID (Network ID) = 8bit, and HID (Host ID) =
24bit. So there are 28 which is 256 total networks created and 224 which is 16M Host per
network.
●​ Purpose: The main purpose of an IPv4 address is to identify devices on a network and ensure
that data sent from one device reaches the correct destination.
●​ Example: When you type a website address into your browser, your device uses the IPv4
address to find and connect to the server where the website is hosted.
There are two notations in which the IP address is written, dotted decimal and hexadecimal
notation.
Dotted Decimal Notation
Some points to be noted about dotted decimal notation:
●​ The value of any segment (byte) is between 0 and 255 (both included).

●​ No zeroes preceding the value in any segment (054 is wrong, 54 is correct).

Dotted Decimal Notation


Hexadecimal Notation

Need For Classful Addressing


●​ Classful addressing provided a straightforward method to allocate and manage IP addresses
based on fixed classes, simplifying the administrative burden associated with IP address
distribution.
●​ Network equipment of the time, such as routers, could be more easily programmed to handle
a limited number of fixed classes, speeding up the routing process because the class of an
address could be quickly identified from its first few bits.
●​ While it did have limitations, classful addressing allowed for scaling of networks within the
bounds of each class size. Larger networks could use a Class A or B address, and smaller
networks could operate efficiently within a Class C subnet.
●​ By standardizing address ranges, classful addressing facilitated the implementation of
uniform network protocols, which was important for the interoperability of network devices
across different networks and platforms.
●​ Classful addressing was a cost-effective solution that supported the early expansion of
the Internet by avoiding the need for complex subnetting schemes that require additional
computing resources and more sophisticated network management tools.
Classes of IP 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 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.

Classful Addressing
Note:
●​ IP addresses are globally managed by Internet Assigned Numbers Authority (IANA) and
Regional Internet Registries (RIR).
●​ 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.
Occupation of The Address Space In Classful Addressing
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 A
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 B
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 C
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 D
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.255. This class doesn’t have any subnet mask. The
higher-order bits of the first octet of class E are always set to 1111.

Class E
Range of Special IP Addresses
169.254.0.0 – 169.254.0.16 : Link-local addresses​
127.0.0.0 – 127.255.255.255 : Loop-back addresses​
0.0.0.0 – 0.0.0.8: used to communicate within the current network.
Rules for Assigning Host ID
Host IDs are used to identify a host within a network. The host ID is assigned based on the following
rules:
●​ Within any network, the host ID must be unique to that network.

●​ A 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.
Rules for Assigning Network ID
Hosts that are located on the same physical network are identified by the network ID, as all host on
the same physical network is assigned the same network ID. The network ID is assigned based on the
following rules:
●​ 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.
Structure of Classful Addressing

In the above table No. of networks for class A should be 127. (Network ID with all 0 s is not
considered)
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 = 2097152 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.
Classful and Classless Addressing
Here is the main difference between Classful and Classless Addressing:

Parameter Classful Addressing Classless Addressing

Classless addressing came to


In Classful addressing IP addresses
replace the classful addressing
Basics are allocated according to the classes-
and to handle the issue of rapid
A to E.
exhaustion of IP addresses.

Practical It is less practical. It is more practical.

Network ID and The changes in the Network ID and There is no such restriction of
Host ID Host ID depend on the class. class in classless addressing.

It does not support the Variable It supports the Variable Length


VLSM
Length Subnet Mask (VLSM). Subnet Mask (VLSM).

Classful addressing requires more It requires less bandwidth.


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

It does not support Classless It supports Classless


CIDR
Inter-Domain Routing (CIDR). Inter-Domain Routing (CIDR).

Updates Regular or periodic updates Triggered Updates

Troubleshooting and problem


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

●​ Network
●​ Host
Division of Address ●​ Host
●​ Subnet
●​ Subnet
Conclusion
Classful IP addressing, with its categorization into classes like A, B, and C, was a fundamental
method in early networking. It organized IP addresses based on network size but faced limitations in
flexibility and efficient use of address space. The development of CIDR addressed these issues by
allowing more precise control over subnetting and optimizing address allocation.

Role of Subnet Mask


A subnet mask is a 32-bit number that separates an IP address into two parts: the network ID and
the host ID. It tells devices which portion of the address belongs to the network and which identifies
individual devices. By doing this it helps to determine which devices belong to the same local
network and which devices reside on different networks. It supports efficient network organization,
better control of data flow and overall improved security and management of the network.
For example:

Role of Subnet Mask


Subnet masks help divide a large network into smaller sub-networks (subnets), improving network
efficiency, security, and performance.
Function of Subnet Mask
Why Use a Subnet Mask?
Suppose we have a Class A network which means we have 16 million hosts in a network. Managing
such a large network becomes challenging due to:
1.​ Maintenance of such a huge network.
2.​ Security for the network – For example, we have 4 departments in a company, and all of the 4
departments need access to the whole network.
Solution: Subnetting
Subnetting solves these problems by dividing a large network into smaller, manageable sub-networks
(subnets). Each department gets its own subnet, improving security and efficiency.
Without subnetting, identifying a device requires three steps:
●​ Identification of the network

●​ Identification of the host

●​ Identification of the process

In case of addressing with subnetting, the process of reaching an address is done by 4 steps –
1.​ Identification of the network
2.​ Identification of the subnet
3.​ Identification of the host
4.​ Identification of the process
Suppose we have a Class C network and we want to divide it into 4 subnets. To divide we need to
choose 2 bits from the host part.

As the first and last IP addresses are reserved for network ID and directed broadcast address in
every subnet, we have to reserve 8 IP addresses in this case.

Representation of Subnet Masks


A subnet mask is a 32-bit number made of 1s and 0s. The 1s identify the network, and the 0s represent
devices (hosts) in that network. For this case subnet mask is,
11111111.11111111.11111111.11000000 ​
or​
255.255.255.192
So in order to get the network which the destination address belongs to we have to bitwise & with
subnet mask.
11111111.11111111.11111111.11000000​
&& 11001000.00000001.00000010.00010100​
—————————————————–​
11001000.00000001.00000010.00000000
The address belongs to,
11001000.00000001.00000010.00000000 ​
or​
200.1.2.0
The internal router will forward the packet to the network through an interface . The interface will be
identified by the routing table residing in the router.
Routing Table and Subnet Matching
If the network id doesn’t matches with any of the subnet mask then the packet will be sent to default
entry.
Default entry has network id as 0.0.0.0.

In some cases the network id may match with two entries in the routing table, so here the interface
having the longest subnet mask (more 1’s) is selected.
How Does Subnetting Work
Subnetting divides a large network into smaller sub-networks by modifying the subnet mask. This
improves the management of IP addresses, reduces broadcast traffic, and increases network security
by isolating different parts of the network. Subnetting also helps optimize the use of IP address space
and improves troubleshooting and overall network performance.
For example, subnetting can organize devices into logical groups, such as separating a company’s
departments into different subnets. This way, traffic within one department does not unnecessarily
interfere with others, improving performance and security
Network Classes
The Internet Assigned Numbers Authority (IANA), through InterNIC, oversees the allocation of IP
addresses. IP addresses are divided into classes to simplify their use, with Classes A, B, and C being
the most commonly used. Classes D and E exist but are not used by end users. Each class has
a default subnet mask, and the first octet of the IP address determines its class. The ranges of Class
A, B, and C Internet addresses are given below, along with a sample address for each:
Range of Classes
Advantages of Subnetting
●​ Reduces network congestion: Limits broadcast traffic, improving network speed.

●​ Efficient IP Usage: Allocates IPs based on need, avoiding wastage.

●​ Enhances security by isolating subnets: For example, no other department within an


organization should be able to view the code created by the Developer department.
●​ Enables Departmental Segmentation: A higher network priority may be needed for some
subnets than for others. For instance, a sales department might need to hold video conferences
or webcasts.
●​ Supports Scalability: Allows networks to grow while remaining organized.

Disadvantages of Subnetting
●​ Limited IP Address Space: Dividing networks reduces available IPs per subnet.

●​ Additional Hardware: Subnetting reduces the overall number of IP addresses in the network,
yet it could necessitate purchasing extra hardware, like a router. Thus it could be very
expensive.
●​ Complex Setup: Requires expertise to plan and configure subnets.

●​ Compatibility Issues: Older devices or systems may struggle with subnetting configurations.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy