You are on page 1of 33

Unit-3

Network Layer

Computer Network &


Cyber Security
Prepared By:
Prof. Chaitanya Kale
Network Layer Introduction
• The Network Layer is the third layer of the OSI model.
• It handles the service requests from the transport layer and further
forwards the service request to the data link layer.
• The network layer translates the logical addresses into physical
addresses
• It determines the route from the source to the destination and also
manages the traffic problems such as switching, routing and controls
the congestion of data packets.
• The main role of the network layer is to move the packets from
sending host to the receiving host.

Unit-3 Network Layer || Class- TY Mtrx || Prepared By: Prof. Chaitanya Kale
Main Functions of Network Layer
• Routing: When a packet reaches the router's input link, the router will
move the packets to the router's output link.
• For example, a packet from S1 to R1 must be forwarded to the next
router on the path to S2.
• Logical Addressing: The data link layer implements the physical
addressing and network layer implements the logical addressing.
Logical addressing is also used to distinguish between source and
destination system.
• The network layer adds a header to the packet which includes the
logical addresses of both the sender and the receiver.
• Internetworking: This is the main role of the network layer that it
provides the logical connection between different types of networks.
• Fragmentation: The fragmentation is a process of breaking the
packets into the smallest individual data units that travel through
different networks.

Unit-3 Network Layer || Class- TY Mtrx || Prepared By: Prof. Chaitanya Kale
IP- Internet Protocol
• IP stands for internet protocol. It is a protocol defined in the TCP/IP
model used for sending the packets from source to destination.
• The main task of IP is to deliver the packets from source to the
destination based on the IP addresses available in the packet headers.
• IP defines the packet structure that hides the data which is to be
delivered as well as the addressing method that labels the datagram
with a source and destination information.
• An IP protocol provides the connectionless service, which is
accompanied by two transport protocols, i.e., TCP/IP and UDP/IP, so
internet protocol is also known as TCP/IP or UDP/IP.
• The first version of IP (Internet Protocol) was IPv4.
• After IPv4, IPv6 came into the market, which has been increasingly
used on the public internet since 2006.

Unit-3 Network Layer || Class- TY Mtrx || Prepared By: Prof. Chaitanya Kale
IP- Internet Protocol

Unit-3 Network Layer || Class- TY Mtrx || Prepared By: Prof. Chaitanya Kale
Type of IP Protocol
• There are two types of IP protocol-
– IPV4
– IPv6

Unit-3 Network Layer || Class- TY Mtrx || Prepared By: Prof. Chaitanya Kale
What is IPv4?
• IPv4 is a version 4 of IP. It is a current version and the most
commonly used IP address.
• It is a 32-bit address written in four numbers separated by 'dot', i.e.,
periods.
• This address is unique for each device.
• For example, 66.94.29.13
• The above example represents the IP address in which each group of
numbers separated by periods is called an Octet.
• Each number in an octet is in the range from 0-255.
• This address can produce 4,294,967,296 possible unique addresses.

Unit-3 Network Layer || Class- TY Mtrx || Prepared By: Prof. Chaitanya Kale
Drawback of IPv4
• Currently, the population of the world is 7.6 billion.
• Every user is having more than one device connected with the internet,
and private companies also rely on the internet.
• As we know that IPv4 produces 4 billion addresses, which are not
enough for each device connected to the internet on a planet.
• Although the various techniques were invented, such as variable-
length mask, network address translation, port address translation,
classes, inter-domain translation, to conserve the bandwidth of IP
address and slow down the depletion of an IP address.
• In these techniques, public IP is converted into a private IP due to
which the user having public IP can also use the internet. But still, this
was not so efficient, so it gave rise to the development of the next
generation of IP addresses, i.e., IPv6.

Unit-3 Network Layer || Class- TY Mtrx || Prepared By: Prof. Chaitanya Kale
What is IPv6?

• IPv4 produces 4 billion addresses, and the developers think that these
addresses are enough, but they were wrong.
• IPv6 is the next generation of IP addresses. The main difference
between IPv4 and IPv6 is the address size of IP addresses.
• The IPv4 is a 32-bit address, whereas IPv6 is a 128-bit hexadecimal
address.
• IPv6 provides a large address space, and it contains a simple header as
compared to IPv4.
• IPv6 is a 128-bit hexadecimal address made up of 8 sets of 16 bits
each, and these 8 sets are separated by a colon. In IPv6, each
hexadecimal character represents 4 bits. So, we need to convert 4 bits
to a hexadecimal number at a time

Unit-3 Network Layer || Class- TY Mtrx || Prepared By: Prof. Chaitanya Kale
What is IPv6?
• It provides transition strategies that convert IPv4 into IPv6, and
these strategies are as follows:
• Dual stacking: It allows us to have both the versions, i.e., IPv4 and
IPv6, on the same device.
• Tunneling: In this approach, all the users have IPv6 communicates
with an IPv4 network to reach IPv6.
• Network Address Translation: The translation allows the
communication between the hosts having a different version of IP.

Unit-3 Network Layer || Class- TY Mtrx || Prepared By: Prof. Chaitanya Kale
Differences between IPv4 and IPv6
Parameter Ipv4 Ipv6
Address length IPv4 is a 32-bit address. IPv6 is a 128-bit address.

Fields IPv4 is a numeric address IPv6 is an alphanumeric address


that consists of 4 fields which that consists of 8 fields, which
are separated by dot (.). are separated by colon.

Classes IPv4 has 5 different classes of IPv6 does not contain classes of
IP address that includes Class IP addresses.
A, Class B, Class C, Class D,
and Class E.

Number of IP address IPv4 has a limited number of IPv6 has a large number of IP
IP addresses. addresses.

Unit-3 Network Layer || Class- TY Mtrx || Prepared By: Prof. Chaitanya Kale
Differences between IPv4 and IPv6
Address It supports manual and It supports manual, DHCP,
configuration DHCP configuration. auto-configuration, and
renumbering.
Address space It generates 4 billion It generates 340 undecillion
unique addresses unique addresses.

End-to-end In IPv4, end-to-end In the case of IPv6, end-to-


connection integrity connection integrity end connection integrity is
is unachievable. achievable.
Security features In IPv4, security depends In IPv6, IPSEC is developed
on the application. This for security purposes.
IP address is not developed
in keeping the security feature
in mind.

Address In IPv4, the IP address In IPv6, the representation


representation is represented in decimal. of the IP address in
hexadecimal.

Unit-3 Network Layer || Class- TY Mtrx || Prepared By: Prof. Chaitanya Kale
Differences between IPv4 and IPv6
Fragmentation Fragmentation is done by the Fragmentation is done by
senders and the forwarding routers. the senders only.

Packet flow It does not provide any mechanism It uses flow label field in the
identification for packet flow identification. header for the packet flow
identification.
Transmission IPv4 is broadcasting. On the other hand, IPv6 is
scheme multicasting, which
provides efficient network
operations.
Encryption and It does not provide encryption and It provides encryption and
Authentication authentication. authentication.

Number of octets It consists of 4 octets. It consists of 8 fields, and


each field contains 2 octets.
Therefore, the total number
of octets in IPv6 is 16.

Unit-3 Network Layer || Class- TY Mtrx || Prepared By: Prof. Chaitanya Kale
ARP-Address Resolution Protocol
• ARP stands for Address Resolution Protocol.
• It is used to associate an IP address with the MAC address.
• Each device on the network is recognized by the MAC address
imprinted on the NIC.
• Therefore, we can say that devices need the MAC address for
communication on a local area network. MAC address can be changed
easily.
• For example, if the NIC on a particular machine fails, the MAC
address changes but IP address does not change.
• ARP is used to find the MAC address of the node when an internet
address is known.

Unit-3 Network Layer || Class- TY Mtrx || Prepared By: Prof. Chaitanya Kale
RARP-Reverse Address Resolution
Protocol.
• RARP stands for Reverse Address Resolution Protocol.
• If the host wants to know its IP address, then it broadcast the RARP
query packet that contains its physical address to the entire network. A
RARP server on the network recognizes the RARP packet and
responds back with the host IP address.
• The protocol which is used to obtain the IP address from a server is
known as Reverse Address Resolution Protocol.
• The message format of the RARP protocol is similar to the ARP
protocol.
• Like ARP frame, RARP frame is sent from one machine to another
encapsulated in the data portion of a frame.

Unit-3 Network Layer || Class- TY Mtrx || Prepared By: Prof. Chaitanya Kale
RARP-Reverse Address Resolution
Protocol.

Unit-3 Network Layer || Class- TY Mtrx || Prepared By: Prof. Chaitanya Kale
ICMP- Internet Control Message Protocol
• ICMP stands for Internet Control Message Protocol.
• The ICMP is a network layer protocol used by hosts and routers to
send the notifications of IP datagram problems back to the sender.
• ICMP uses echo test/reply to check whether the destination is
reachable and responding.
• ICMP handles both control and error messages, but its main function
is to report the error but not to correct them.
• An IP datagram contains the addresses of both source and destination,
but it does not know the address of the previous router through which
it has been passed. Due to this reason, ICMP can only send the
messages to the source, but not to the immediate routers.
• ICMP protocol communicates the error messages to the sender. ICMP
messages cause the errors to be returned back to the user processes.
• ICMP messages are transmitted within IP datagram.

Unit-3 Network Layer || Class- TY Mtrx || Prepared By: Prof. Chaitanya Kale
DHCP- Dynamic Host Configuration
Protocol
• Dynamic Host Configuration Protocol (DHCP) is a network
management protocol used to dynamically assign an IP address to nay
device, or node, on a network so they can communicate using IP
(Internet Protocol).
• DHCP automates and centrally manages these configurations.
• There is no need to manually assign IP addresses to new devices.
• Therefore, there is no requirement for any user configuration to
connect to a DHCP based network.
• DHCP can be implemented on local networks as well as large
enterprise networks.

Unit-3 Network Layer || Class- TY Mtrx || Prepared By: Prof. Chaitanya Kale
Introduction to Subnetting
• Subnetting is a combination of two words i.e. Sub and Netting. Here
Sub word means Substitute and netting word means Network.
• The Substitute Network created for a function to happen is known as
Subnetting.
• Subnet is the name given to piece of the broken network or can also be
called as the Substitute network is known as Subnet.
• Subnets are the legal small parts of IP (Internet Protocol) Addressing
process

Unit-3 Network Layer || Class- TY Mtrx || Prepared By: Prof. Chaitanya Kale
Purpose of Subnetting in Computer
Networks
• Efficiency of the Network
– By removing the need for extra routers, subnetting makes network
traffic simpler.
– This makes sure the data being transmitted can get to its
destination as fast as possible, eliminating or avoiding any
potential diversions that may slow it down.
• Provides Network Security
– By isolating or removing vulnerable network regions and making
it harder for intruders to move through a company's network,
subnetting helps the network managers in reducing network-wide
risks.

Unit-3 Network Layer || Class- TY Mtrx || Prepared By: Prof. Chaitanya Kale
Purpose of Subnetting in Computer
Networks
• Internet Protocol (IP) Addressing Relocation
– Each class has a finite amount of possible host allocations; for
instance, networks with more than 254 devices require a Class B
allocation. Assume that you are a network administrator.
– Now, you have a task of allocating 150 hosts among three physical
networks in three distinct cities for a Class B or C network.
• Reduction of Network Traffic
– Placing all of the computers on the same subnet can assist
minimize network traffic if a significant amount of an
organization's traffic is intended to be shared routinely among a
number of devices. Without a subnet, all computers and servers on
the network would be able to see data packets from every other
machine

Unit-3 Network Layer || Class- TY Mtrx || Prepared By: Prof. Chaitanya Kale
Purpose of Subnetting in Computer
Networks
• Network Speed Improvement
– The main network is divided into smaller subnets through the
process of subnetting, and the goal of these smaller, linked
networks is to split the large network into a collection of smaller,
less-busy networks. Subnets reduce the need for traffic to use
unnecessary routes, which speeds up the network.
• Division of IP Addresses
– The split address may then be further divided into units using the
subnet mask approach, and those units can be assigned to different
network devices.

Unit-3 Network Layer || Class- TY Mtrx || Prepared By: Prof. Chaitanya Kale
Routing Algorithm
• In order to transfer the packets from source to the destination, the
network layer must determine the best route through which packets
can be transmitted.
• Whether the network layer provides datagram service or virtual circuit
service, the main job of the network layer is to provide the best route.
The routing protocol provides this job.
• The routing protocol is a routing algorithm that provides the best path
from the source to the destination. The best path is the path that has the
"least-cost path" from source to the destination.
• Routing is the process of forwarding the packets from source to the
destination but the best route to send the packets is determined by the
routing algorithm.

Unit-3 Network Layer || Class- TY Mtrx || Prepared By: Prof. Chaitanya Kale
Distance Vector Routing Algorithm
• The Distance vector algorithm is iterative, asynchronous and
distributed.
– Distributed: It is distributed in that each node receives
information from one or more of its directly attached neighbors,
performs calculation and then distributes the result back to its
neighbors.
– Iterative: It is iterative in that its process continues until no more
information is available to be exchanged between neighbors.
– Asynchronous: It does not require that all of its nodes operate in
the lock step with each other.
• The Distance vector algorithm is a dynamic algorithm.
• It is mainly used in ARPANET, and RIP.
• Each router maintains a distance table known as Vector.

Unit-3 Network Layer || Class- TY Mtrx || Prepared By: Prof. Chaitanya Kale
Link State-Routing Algorithm
• Link state routing is a technique in which each router shares the
knowledge of its neighborhood with every other router in the
internetwork.
• The three keys to understand the Link State Routing algorithm:
– Knowledge about the neighborhood: Instead of sending its routing
table, a router sends the information about its neighborhood only. A
router broadcast its identities and cost of the directly attached links to
other routers.
– Flooding: Each router sends the information to every other router on
the internetwork except its neighbors. This process is known as
Flooding. Every router that receives the packet sends the copies to all
its neighbors. Finally, each and every router receives a copy of the
same information.
– Information sharing: A router sends the information to every other
router only when the change occurs in the information.

Unit-3 Network Layer || Class- TY Mtrx || Prepared By: Prof. Chaitanya Kale
Metrics

• The metric is the standard of measurement such as hop count,


bandwidth, delay, current load on the path, etc. used by the routing
algorithm to determine the optimal path to the destination.

• The routing algorithm initializes and maintains the routing table for the
process of path determination.

Unit-3 Network Layer || Class- TY Mtrx || Prepared By: Prof. Chaitanya Kale
Hierarchy in Addressing

• The network is defined by the first component of the address, known


as the prefix, and the node is defined by the second component,
known as the suffix (connection of a device to the Internet).

• A 32-bit IPv4 address's prefix and suffix are shown in the given figure.
The lengths of the prefix and suffix are n bits and (32 - n) b its,
respectively.

Unit-3 Network Layer || Class- TY Mtrx || Prepared By: Prof. Chaitanya Kale
Hierarchy in Addressing

Unit-3 Network Layer || Class- TY Mtrx || Prepared By: Prof. Chaitanya Kale
CLASSFUL ADDRESSING

• An IPv4 address originally had a fixed-length prefix, but three fixed-


length prefixes (n = 8, n = 16, and n = 24) were created in order to
support both small and big networks.

• As shown in the figure below, the entire address space was partitioned
into five classes (classes A, B, C, D, and E).

• Classful addressing is the term used to describe this system.


Unit-3 Network Layer || Class- TY Mtrx || Prepared By: Prof. Chaitanya Kale
CLASSFUL ADDRESSING

Unit-3 Network Layer || Class- TY Mtrx || Prepared By: Prof. Chaitanya Kale
Network Address Translation (NAT)
• NAT (Network Address Translation) connects two networks and
maps the private (inside local) addresses into public addresses (inside
global).
• Inside local denotes that the best address belonged to an internal
network and was not assigned by a Network Information
Centre or service power.
• The inside global signifies that the address is a valid address assigned
by the NIC or service provider, and one or more inside local addresses
to the outside world.
• NAT is a method of converting a private IP address or a local address
into a public IP address.
• NAT is a technique for reducing the rate at which available IP
addresses are depleted by translating a local IP or private IP address
into a global or public IP address.

Unit-3 Network Layer || Class- TY Mtrx || Prepared By: Prof. Chaitanya Kale
Network Address Translation (NAT)

Unit-3 Network Layer || Class- TY Mtrx || Prepared By: Prof. Chaitanya Kale
References

• Kurose, Ross “Computer Networking a Top Down Approach


Featuring the Internet”,Pearson, ISBN-10: 0132856204.
• Matthew S. G, “802.11 Wireless Networks”, O’Reilly publications,
ISBN: 81-7656-992-5

Unit-3 Network Layer || Class- TY Mtrx || Prepared By: Prof. Chaitanya Kale

You might also like