Unit 4: Network Layer
➢ The network layer is considered the backbone of the OSI model.
➢ The network layer is responsible for the source-to-destination delivery of a packet, possibly
across multiple networks (links) i.e., it ensures that each packet gets from its point of origin
to its final destination
➢ It manages the best logical path for data transfer between nodes.
➢ It manages device addressing, tracks the location of devices on the network, and
determines the best way to move data.
➢ Logical addressing and path determination (Routing) are described at this layer.
➢ network layer can support either connection-oriented or connectionless networks, but
such a network can only be of one type and not both.
Functions
➢ It translates logical network address into physical address, concerned with circuit,
message or pocket switching.
➢ Routers and gateways operate in this layer.
➢ Breaks larger packets into smaller packets.
➢ Network layer flow control, network layer error control and packet sequence control.
The protocols work at this network layer are:
✓ Routed Protocols:
• Routed protocols act as data carriers and defines logical addressing.
• IP, IPX, AppleTalk… etc. (IPX by Novell NetWare network operating system)
✓ Routing Protocols:
• Routing protocols performs path determination (routing)
• RIP, IGRP, EIGRP, OSPF……. ETC.
Internet Protocol (IP) Address
• Every device that connects to the internet requires a unique number. This number is
called as internet protocol (IP) address.
• It is a unique identity of a computer connected in a network.
• The Internet Protocol is a set of rules for communication over the internet, such as
sending mail, streaming video, or connecting to a website.
• An IP address identifies a network or device on the internet.
• The IP address space is globally managed by the Internet Assign Numbers Authority
(IANA).
• There are two types of IP addresses: IPv4 and IPv6.
✓ IPv4 addresses contain a series of four numbers, ranging from 0 (except the first
one) to 255.
✓ IPv6 addresses are represented as eight groups of four hexadecimal digits, with
the groups separated by colons. A typical IPv6 address might look like this:
2620:0[Link]
• The purpose of an IP address is to handle the connection between devices that send and
receive information across a network.
• The IP address uniquely identifies every device on the internet; without one, there’s no
way to contact them.
• IP addresses allow computing devices (such as PCs and tablets) to communicate with
destinations like websites and streaming services, and they let websites know who is
connecting.
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.
• IPv4 are uses 32-bit integers addresses which will be expressed in decimal notation. That
allows 232 unique IP addresses.
• Example - [Link]
Parts of IPv4
1. 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.
2. 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.
For example: if a host has the IPv4 address [Link], the first three octets
192.168.18, identify the network portion of the address, and the last octet, 57 identifies
the host. This is known as hierarchical addressing, because routers only need to
communicate with networks and not individual hosts.
3. 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.
IPv4 addressing structure
IPv4 addresses are divided into the following classes:
• Class A - [Link] to [Link] (1st octet range 0-127)
Class A, which indicates that the first octet of the IPv4 address is the network portion
• Class B - [Link] to [Link] (1st octet range 128-191)
Class B, which indicates that the first two octets of the IPv4 address is the network
portion
• Class C - [Link] to [Link] (1st octet range 192-223)
Class C, which indicates that the first three octets of the IPv4 address is the network
portion
• Class D - (1st octet range 224-239) ....................... are used for multicast groups, such as
webcasts or streaming video to select group.
• Class E - (1st octet range 240-255) ...................... are reserved for research use only
Subnetting
Note:
Subnetting an IP address involves dividing a larger network into smaller subnetworks to
efficiently manage network resources. It's commonly done by manipulating the host portion of
an IP address to create multiple subnetworks with their own unique network IDs and host
ranges.
Classful Classless
Classful Inter-Domain Routing Classless Inter-Domain Routing (CIDR) is a method used to
(CIDR) is the older method of IP allocate IP addresses and IP routing. CIDR allows for more
addressing and routing used. flexible allocation of IP addresses than the older classful
addressing methods.
Not customize subnet mask Customize subnet mask
Correct subnet mask Not correct subnet mask
Examples /8,/16/,24 Examples/1,………,/7,/9,…………,/15,/17,…….,/23,/25,….,/32
Class - C (subnetting)
[Link] /25
1. New Subnet mask= 11111111.11111111.11111111.10000000 Note
[Link] 10000000= 128
11000000= 192
1=Network= 1 on bit 11100000= 224
2. No. of network=2n (on bit) 0= Host= 0 off bit 11110000= 240
11111000= 248
21 =2 11111100= 252
11111110= 254
3. No. of valid host per network= 2n (off bit) - 2 11111111= 255
= 27-2
= 128-2= 126
4. Block size/ jumping value/ magic number = 256-128
= 128
5. Table
Subnet/Network id IP 1st IP-------- valid IP -------- last IP Broadcast id IP
[Link] [Link] ---------------------[Link] [Link]
[Link] [Link]-------------------[Link] [Link]
[Link] X
[Link] /26
1. New subnet mask= 255.255.255.11000000
[Link]
2. No. of network=2n (on bit)
22 =4
3. No. of valid host per network= 2n (off bit) - 2
= 26-2
= 64-2= 62
4. Block size/ jumping value/ magic number = 256-192
= 64
5. Table
Subnet/Network id IP 1st IP-------- valid IP -------- last IP Broadcast id IP
[Link] [Link] ---------------------[Link] [Link]
[Link] [Link]-------------------[Link] [Link]
[Link] [Link]-------------------[Link] [Link]
[Link] [Link]-------------------[Link] [Link]
[Link] X
Class - B (subnetting)
[Link] /27
1. New Subnet mask= 11111111.11111111.11111111.11100000
[Link]
1=Network= 1 on bit
2. No. of network=2n (on bit) 0= Host= 0 off bit
211 =2024
3. No. of valid host per network= 2n (off bit) - 2
= 25-2
= 30
4. Block size/ jumping value/ magic number = 256-224
= 32
5. Table
Subnet/Network id IP 1st IP-------- valid IP -------- last IP Broadcast id IP
[Link] [Link]---------------------[Link] [Link]
[Link] [Link]---------------------[Link] [Link]
[Link] [Link]---------------------[Link] [Link]
[Link] [Link]---------------------[Link] [Link]
[Link] [Link]---------------------[Link] [Link]
[Link] [Link]---------------------[Link] [Link]
[Link] [Link]---------------------[Link] [Link]
[Link] [Link]---------------------[Link] [Link]
[Link] [Link]----------------------[Link] [Link]
[Link] [Link]----------------------[Link] [Link]
[Link] [Link]----------------------[Link] [Link]
[Link]
.
.
.
.
[Link] [Link]
[Link] [Link] --------------------[Link] [Link]
[Link] [Link]-------------------[Link] [Link]
[Link] [Link]-----------------[Link] [Link]
[Link] [Link]---------------[Link] [Link]
[Link] [Link]---------------[Link] [Link]
[Link] [Link]-----------------[Link] [Link]
[Link] [Link]---------------[Link] [Link]
[Link] [Link]---------------[Link] [Link]
[Link] [Link]-------------------[Link] [Link]
[Link] [Link]-------------------[Link] [Link]
[Link] [Link]-----------------[Link] [Link]
[Link] [Link]---------------[Link] [Link]
[Link] [Link]---------------[Link] [Link]
[Link] [Link]---------------[Link] [Link]
[Link] [Link]---------------[Link] [Link]
[Link] X
[Link] /20
1. New Subnet mask= 11111111.11111111.11110000.00000000
[Link]
1=Network= 1 on bit
2. No. of network=2n (on bit) 0= Host= 0 off bit
24 =16
3. No. of valid host per network= 2n (off bit) - 2
= 212-2
= 4094
4. Block size/ jumping value/ magic number = 256-240
= 16
5. Table
Subnet/Network id IP 1st IP-------- valid IP -------- last IP Broadcast id IP
[Link] [Link]---------------------[Link] [Link]
[Link] [Link]-------------------[Link] [Link]
[Link] [Link]-------------------[Link] [Link]
[Link] [Link]-------------------[Link] [Link]
[Link] [Link]-------------------[Link] [Link]
[Link] [Link]-------------------[Link] [Link]
[Link] [Link]-------------------[Link] [Link]
[Link] [Link]-------------------[Link] [Link]
[Link] [Link]-------------------[Link] [Link]
[Link] [Link]-------------------[Link] [Link]
[Link] [Link]-------------------[Link] [Link]
[Link] [Link]-------------------[Link] [Link]
[Link] [Link]-------------------[Link] [Link]
[Link] [Link]-------------------[Link] [Link]
[Link] [Link]-------------------[Link] [Link]
[Link] [Link]-------------------[Link] [Link]
[Link] X
Class B Sub-netting:
Class A subnetting:
Have we run out of IPv4 addresses?
IP NEEDS ON EVERY DEVICES:-
• IPv4 has a theoretical limit of 4.3 billion addresses, which was more than enough in
1980.
• But as the internet grew and went global, we quickly ran out of addresses, especially
intoday’s era of smart phones and IoT devices.
• The internet has been running out of IPv4 addresses since the 1990s.
• Developed to solve these capacity issues for good, IPv6 was needed when IPv4 could
nolonger support the load.
IPv6: Evolution & Characteristics
• Internet Protocol version 6, or IPv6, was first introduced in the late 1990s as a
replacement for IPv4.
• It uses 128-bit addresses formatted as eight groups of four hexadecimal numbers
separated by colons. For examples :- [Link]
• IPv6 is the solution that addresses the relatively limited number of IP addresses possible
under IPv4.
• IPv6 allows for a theoretical 340,282,366,920,938,463,463,374,607,431,768,211,456, or
340 undecillion addresses. This means that every device on the internet can have a
unique IPv6 address.
• An example IPv6 addresses looks like this [Link]
but there are ways to abbreviate this rather clunky notation.
• The advent of IPv6 brought more functionality, in addition to more IP addresses. For
Examples:
✓ IPv6 supports multicast addressing, which allows bandwidth-intensive packet
flows (such as multimedia streams) to be sent to multiple destinations
simultaneously, reducing network bandwidth. But is IPv6 better than IPv4? Let’s
find out.
✓ IPv6 has a new feature called auto configuration, which allows a device to
generate an IPv6 address as soon as it powers up and puts itself on the network.
The device begins by looking for an IPv6 router. If one is present, the device can
generate a local address and a globally routable address, allowing access to the
wider internet. In IPv4-based networks, the process of adding devices often has to
be done manually.
✓ IPv6 allows devices to stay connected to several networks simultaneously. This is
due to interoperability and configuration capabilities that enable the hardware to
automatically assign multiple IP addresses to the same device.
TYPES OF IPv6 ADDRESSES
IPv6 addresses are broadly classified into three categories:
1. Unicast addresses: A Unicast address acts as an identifier for a single interface. An IPv6
packet sent to a Unicast address is delivered to the interface identified by that address.
✓ Global Unicast Address:
• An IPv6 global unicast address is globally unique. Similar to a public IPv4
address, it can be routed in the internet without modification.
• Global unicast addresses that are currently assigned by the Internet
Assigned Numbers Authority (IANA) use the range of addresses that start
with binary value 001 (2000::/3). This range represents one-eighth of the
total IPv6 address space and is the largest block of assigned.
• A global unicast address can be further classified into the various
configuration options available.
• Global Unicast Address Configuration Options
By Er. Ramesh Tharu
✓ Link Local Address:
• Link local addresses are confined to a single link. They need to be unique
only to that link because packets with a link-local source or destination
address are not routable off the link.
• Link-Local addresses are configured in one of three ways:
→ Dynamically, using EUI-64
→ Random-generated interface ID
→Statically, entering the link-local address manually
• Link-Local addresses provide a unique benefit in IPv6. A device can create
its link-local address. Completely on its own, link-local unicast addresses are
in the range of FE80::/10 to FEBF::/10
By Er. Ramesh Tharu
✓ Loopback Address:
• The loopback address for IPv6 is an all 0s address except for the last bit,
which is set to a 1.
✓ Unspecified Address:
• The unspecified unicast address is the all 0s address, represented as ::.
• It cannot be assigned to an interface but is reserved for communications
when the sending device does not have a valid IPv6 address yet.
✓ Unique Local Address:
• Unique local addresses (ULA) are defined by RFC 4193, "Unique Local IPv6
Unicast Addresses."
✓ IPv4 Embedded Address:
• IPv4 mapped IPv6 addresses are used by transition mechanisms on hosts
and routers to create IPv4 tunnels that deliver IPv6 packets over IPv4
networks.
IPv4 Mapped IPv6 Addresses
By Er. Ramesh Tharu
2. Multicast addresses: A Multicast address acts as an identifier for a group/set of
interfaces that may belong to the different nodes. An IPv6 packet delivered to a
Multicast address is delivered to the multiple interfaces.
✓ Assigned Multicast Address:
• Well-known multicast addresses:
→ FF02::1 -All multicast nodes on a subnet.
→ FF02::2 -All multicast routers on a subnet.
→ FF02::5 - OSPFv3 routers.
→ FF02::6 - OSPFv3 designated routers.
→ FF02::9 - RIPnG routers.
→ FF02::A - EIRGP routers.
→ FF02::D - PIM routers
Note:
❖ FF02::1 -All multicast nodes group: This is a multiple group that all
IPv6 enabled devices join
❖ FF02::1 -All multicast routers group: This is a multicast group that all
IPv6 routers join.
A router becomes a member of this group when it is enabled as an
IPv6 router with the IPv6 unicast routing global configuration
command. A packet sent to this group is received and processed by
all IPv6 routers on the link or network.
✓ Solicited Node Multicast:
• These multicast addresses are automatically create using a special mapping
of the device's unicast address with the solicited-node multicast prefix
[Link]/104.
3. Anycast addresses: Anycast addresses act as identifiers for a set of interfaces that may
belong to the different nodes. An IPv6 packet destined for an Anycast address is
delivered to one of the interfaces identified by the address.
IPv6 ADDRESS NOTATION
IPv6 addresses are denoted by eight groups of hexadecimal quartets separated by colons in
between them. Following is an example of a valid IPv6 address:
[Link]
Advantages of IPv6 addresses
IPv6 addresses can bring a variety of benefits, including:
• More efficient routing with smaller routing table and aggregation of prefixes.
• Simplified packet processing due to more streamlined packet headers.
• Support of multicast packet flows.
• Hosts can generate their own IP addresses.
• Eliminates the need for network address translation (NAT).
• Easier to implement services like peer-to-peer (P2P) networks, Voice over IP (VoIP) and
stronger security.
• IPv6 also still uses the same two families of routing protocols – Interior Gateway
Protocol (IGP) and Exterior Gateway Protocol (EGP).
Why don't we switch to IPv6 permanently?
• According to the Internet Society much of that is because technologies like NAT
(network address translation) have enabled many ISPs and companies to use a single
IP address for many machines. But the biggest problem is that IPv6 requires time and
investment, and since there are some workarounds that have done the job until now,
many organizations aren’t willing to put their resources for no clear or immediate
return.
• The majority of end-user devices are compatible only with the IPv4, which covers
approximately 70 percent of the Net, hence the needlessness to make the switch.
The shift to IPv6-compatible tech is going to take some time, as well as investment;
therefore, there are not many volunteers, willing to be in the frontlines of the
transition.
• Without a doubt, IPv6’s maturity is increasing, but there’s still a long road ahead
before it is as fully accessible as it needs to be, in order to facilitate the Network’s
further expansion. It could be years till the majority of tech runs only with version 6,
and even then, most of the hardware will need to have backlink compatibility, as
there will be older phones, laptops, or other devices that need IPv4 to connect.
Solutions is IPv6
• A new version of the internet protocol viz; Internet Protocol version 6. Originally known
as Ipng (next generation)
• IPv6 increased the number of addresses to 2128 from which IPv4 about 232 addresses.
• Useful for mobility, QoS, and privacy extension.