Unit 3-2
Unit 3-2
Unit 3-2
o The network layer is the computer network component that enables the node to
transfer the data packets using the connection between different nodes and
devices.
o The transmission of data between different devices is performed in the form of
packets through different logical network paths.
o The network layer provides paths to transfer the data packets in the network.
o The network layer also arranges and manages the possible routes for data
transmission.
o The network layer assigns destination and source IP address to each data
segment.
o It arranges all the possible paths to transfer the data in the network and then
chooses the best logical path to transfer the data between the different nodes.
o The network layer act upon the requests of the layer above it. The layer above it
is the transport layer. Then it generates requests forwarded to the model's lower
layer, that is, the data link layer.
1. Routing:
It is the process to determine the most effective route for data transmission in
the network.
When a data packet arrives at the router's input link, it determines the ideal route
for data transmission in the network.
It determines the path that will be used to transfer the packet further in the
network.
2. Logical Addressing:
1
ZCoER,Pune
There are two types of addressing performed in the network: logical addressing
and physical addressing.
The data link layer performs the physical addressing, while the network layer does
the logical addressing in the OSI model.
Logical addressing is also used to distinguish between the 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.
3. Internetworking:
This is the most important function performed by the network layer of the OSI
model.
4. Fragmentation:
It is the conversion of data packets into the smallest individual data units capable
of being transmitted in the network.
Switching Techniques :
Switching is the mechanism in computer networks that helps in deciding the best
possible route for data transmission.
In large networks there might be multiple paths linking between sender and
receiver.
Information may be switched from one node to another and travels through
various communication channels before reaching to the destination.
There are three typical switching techniques available for digital traffic.
2
ZCoER,Pune
Switched
Networks
Circuit Switching :
Circuit Establishment
A dedicated circuit between the source and the destination is established with the help
of numerous intermediate switching centres.
The requesting and receiving of the communication signals are possible when the
sender and receiver transmit signals across the circuit.
3
ZCoER,Pune
Data Transfer
The transfer of data and voice signals are possible between the source and the
destination after the establishment of the circuit.
The connection between both the end parties continues as long as they communicate.
If the frame is sent by the primary station, it contains the address(es) of the secondary
station(s).
Circuit Disconnect
The disconnection in the circuit happens when one of the users initiates to disconnect.
When the disconnection takes place, all the intermediate links between the sender and
receiver are removed.
Once the dedicated path is established, the only delay occurs in the speed of data
transmission.
It takes a long time to establish a connection approx 10 seconds during which no data
can be transmitted.
It is more expensive than other switching techniques as a dedicated path is required for
each connection.
It is inefficient to use because once the path is established and no data is transferred,
then the capacity of the path is wasted.
In this case, the connection is dedicated therefore no other data can be transferred
even if the channel is free.
4
ZCoER,Pune
Message Switching :
Data channels are shared among the communicating devices that improve the efficiency
of using available bandwidth.
Traffic congestion can be reduced because the message is temporarily stored in the
nodes.
Message priority can be used to manage the network.
The size of the message which is sent over the network can be varied. Therefore, it
supports the data of unlimited size.
5
ZCoER,Pune
The message switches must be equipped with sufficient storage to enable them to store
the messages until the message is forwarded.
The Long delay can occur due to the storing and forwarding facility provided by the
message switching technique.
Not suitable for streaming media and real time applications
Packet Switching:
The packet switching is a switching technique in which the message is sent in one go,
but it is divided into smaller pieces, and they are sent individually.
It combines the advantages of message and circuit switching and minimize the
disadvantages of both.
The message splits into smaller pieces known as packets and packets are given a unique
number to identify their order at the receiving end.
Every packet contains some information in its headers such as source address,
destination address and sequence number.
Packets will travel across the network, taking the shortest path as possible.
All the packets are reassembled at the receiving end in correct order.
If any packet is missing or corrupted, then the message will be sent to resend the
message.
If the correct order of the packets is reached, then the acknowledgment message will be
sent.
6
ZCoER,Pune
Network Addressing :
7
ZCoER,Pune
IP Protocol :
Internet protocol is widely respected and deployed Network Layer protocol which helps
to communicate end to end devices over the internet.
Types
1. IPv4 : Which has ruled the world for decades but now is running out of address space.
IPv4 protocol only allowed for 232 addresses
2. IPv6 : It is created to replace IPv4. The available address space and allowed for 2128
addresses
IPV4 :
Uses Dotted Decimal Notation … with every eight bits (octet) represented by a number
from 1 to 255, each separated by a dot.
Uses Dotted Decimal Notation … with every eight bits (octet) represented by a number
from 1 to 255, each
1. Class A
• In a class A address, the first bit of the first octet is always ‘0’.
• Thus, class A addresses range from 0.0.0.0 to 127.255.255.255(as 01111111 in
binary converts to 127 in decimal).
• The first 8 bits or the first octet denote the network portion and the rest 24 bits
or the 3 octets belong to the host portion.
• Its Subnet mask is 255.0.0.0.
• Example: 10.1.1.1
• Exception –-
8
ZCoER,Pune
• 127.X.X.X is reserved for loopback and 0.X.X.X is reserved for default network
(Thus, the actual range of class A is: 1.0.0.0 to 126.255.255.255)
2. Class B
• In a class B address, the first octet would always start with ’10’.
• Thus, class B addresses range from 128.0.0.0 to 191.255.255.255.
• The first 16 bits or the first two octets denote the network portion and the
remaining 16 bits or two octets belong to the host portion.
• Its Subnet mask is 255.255.0.0.
• Example: 172.16.1.1
3. Class C
• In a class C address, the first octet would always start with ‘110’.
• Thus, class C addresses range from 192.0.0.0 to 223.255.255.255.
• The first 24 bits or the first three octets denote the network portion and the rest
8 bits or the remaining one octet belong to the host portion.
• Its Subnet mask is 255.255.255.0.
• Example: 192.168.1.1
4. Class D
• Class D is used for multicast addressing
• The first octet would always start with ‘1110’.
• Thus, class D addresses range from 224.0.0.0 to 239.255.255.255.
• Its Subnet mask is not defined.
• Example: 239.2.2.2
• Class D addresses are used by routing protocols like OSPF, RIP, etc.
5. Class E
9
ZCoER,Pune
• Class E addresses are reserved for research purposes and future use.
• The first octet in a class E address starts with ‘1111’.
• Thus, class E addresses range from 240.0.0.0 to 255.255.255.255.
• Its Subnet mask is not defined.
10
ZCoER,Pune
IPV6 :
• An IPv6 address consists of eight groups of four hexadecimal digits(Total 128 bits).
Types of IPV6 :
Advantages of IPV6 :
• Reliability
• Faster Speeds:
IPv6 supports multicast rather than broadcast in IPv4.
11
ZCoER,Pune
Most importantly it’s the final solution for growing nodes in Global-network.
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.
They need an intermediate technology to make that possible.
IPv4 IPv6
IPv4 has a 32-bit address length IPv6 has a 128-bit address length
It Supports Manual and DHCP address It supports Auto and renumbering address
configuration configuration
In IPv4 end to end, connection integrity In IPv6 end to end, connection integrity is
is Unachievable Achievable
It can generate 4.29×109 address space Address space of IPv6 is quite large it can
produce 3.4×1038 address space
12
ZCoER,Pune
The Security feature is dependent on IPSEC is an inbuilt security feature in the IPv6
application protocol
In IPv4 Packet flow identification is not In IPv6 packet flow identification are
available Available and uses the flow label field in the
header
IPv4 has a header of 20-60 bytes IPv6 has header of 40 bytes fixed
IPv4 consist of 4 fields which are IPv6 consist of 8 fields, which are separated
separated by dot (.) by colon (:)
IPv4’s IP addresses are divided into IPv6 does not have any classes of IP address
five different classes. Class A , Class B,
Class C , Class D , Class E
13
ZCoER,Pune
• It has an IP address called as Private IP Address for a computer to communicate with other
computers and web servers on the Internet.
• And to access resources outside the network, like the Internet, It must have a public address
in order for responses to their requests to return to them.
• The private addressing scheme works well for computers that only have to access resources
inside the network, like workstations needing access to file servers and printers.
• Routers inside the private network can route traffic between private addresses with no
trouble.
• Sub-netting :
• 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.
14
ZCoER,Pune
• For example, if we consider a class A address, the possible number of hosts is 2 24 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.
• In the Classful addressing the no of Hosts within a network always remains the same
depending upon the class of the Network.
• Class A network contains 224 Hosts
• Class B network contains 216 Hosts
• Class C network contains 28 Hosts
• If any Organization requires 214 hosts (16384), then it must have to go with a Class B network
with 216 Hosts (65536).
• In this case, 49152 Hosts will be wasted (65536 - 16384 = 42152) .
• 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.
1. ARP
2. RARP
3. ICMP
15
ZCoER,Pune
4. IGMP
5. IP
• ARP uses a simple message format sent over the data link layer and network layer (Layers 2
and 3 of the OSI model).
• This message contains one request
16
ZCoER,Pune
• Here A it sends out a broadcast ARP request to every computer on the network asking
"Who has IP address 192.168.1.101?".
• In response, only Computer B will then send a unicast (1 to 1) response saying "I have
192.168.1.101 and my MAC address is 11:22:33:44:55:66!".
• If a HOST does not recognize its IP own address, it may send out a RARP (Reverse Address
Resolution Protocol) appeal deliver by a RARP server which has a table of MAC addresses and
IP addresses.
• The RARP server works as a elementary server.
• RARP Server replies back with IP address of HOST
17
ZCoER,Pune
18
ZCoER,Pune
19
ZCoER,Pune
ICMP Messages
20
ZCoER,Pune
• It is a protocol that allows several devices to share one IP address so they can all receive the
same data.
• IGMP is a network layer protocol used to set up multicasting on networks that use the
Internet Protocol version 4 (IPv4). Specifically, IGMP allows devices to join a multicast group.
• The IGMP protocol gives the multicast routers information about the membership status of
hosts (routers) connected to the network.
• A multicast router may receive thousands of multicast packets every day for different groups.
• If a router has no knowledge about the membership status of the hosts, it must broadcast all
these packets.
• This creates a lot of traffic and consumes bandwidth.
• A better solution is to keep a list of groups in the network for which there is at least one loyal
member.
21
ZCoER,Pune
• IGMP helps the multicast router create and update this list.
Type Value
General or special query Ox11 or 00010001
Membership report Ox16 or 00010110
Leave report Ox17 or 00010111
22
ZCoER,Pune
• Static Routing
• No Overhead: It has no overhead on the CPU usage of the router. Therefore, the cheaper
router can be used to obtain static routing.
• Bandwidth: It has not bandwidth usage between the routers.
• Security: It provides security as the system administrator is allowed only to have control
over the routing to a particular network.
• For a large network, it becomes a very difficult task to add each route manually to the
routing table.
• The system administrator should have a good knowledge of a topology as he has to add
each route manually.
• Dynamic Routing
• It is easier to configure.
• It is more effective in selecting the best route in response to the changes in the condition
or topology.
23
ZCoER,Pune
• Distance-Vector Routing
24
ZCoER,Pune
• Path Vector
• Path vector (PV) protocols, such as Border Gateway Protocols (BGP), are used across
domains aka autonomous systems.
• A path-vector routing protocol is a network routing protocol which maintains the path
information that gets updated dynamically.
• Updates that have looped through the network and returned to the same node are easily
detected and discarded.
• In a path vector protocol, a router does not just receive the distance vector for a particular
destination from its neighbour; instead, a node receives the distance as well as path
information (aka BGP path attributes), that the node can use to calculate (via the BGP
path selection process) how traffic is routed to the destination .
• Routing Protocols
• BGP is an exterior gateway protocol that was initially developed to replace EGP.
• It uses the best path selection algorithm for performing data package transfers, making it
a distance vector protocol as well.
• To automatically determine the best route, BGP references factors like:
• Path length
• Origin type
• Router identification
• Neighbor IP addresses
• BGP allows administrators to alter transfer routes depending on their needs and offers
advanced security features so only authorized routers can exchange data and information
with each other.
26
ZCoER,Pune
• Whereas network addresses identify endpoints the labels identify established paths
between endpoints.
• Routing in MANET
• MANETs
• AODV is a reactive routing protocol used in Mobile Ad Hoc Networks (MANETs) that
establishes routes only when needed.
• It efficiently finds routes to distant nodes while minimizing control overhead.
• Key Features
• On-Demand Route Discovery: Routes are created only when a node wants to
communicate with another node.
• Route Maintenance: AODV maintains routes as long as they are needed and
removes them when they are no longer valid.
• Sequence Numbers: Helps in determining the freshness of routes and avoiding
routing loops.
• Unicast and Broadcast: Supports both unicast (one-to-one) and broadcast (one-
to-all) communications.
Operation of AODV
• AODV's operation can be broken down into two main processes: route discovery and
route maintenance.
27
ZCoER,Pune
b. Route Maintenance
• DSR is a reactive routing protocol designed for Mobile Ad Hoc Networks (MANETs)
that allows nodes to discover and maintain routes on-demand.
• It is used to establish routes as needed, reducing unnecessary overhead associated with
proactive protocols.
28
ZCoER,Pune
• Key Features
• On-Demand Route Discovery: Routes are created only when a source node
requires a path to a destination node.
• Source Routing: The complete route is specified in the packet header, allowing
each packet to carry the routing information.
• Route Caching: Nodes can cache routes they have recently used, enabling
quicker route discovery in the future.
Operation of DSR
• DSR consists of two main processes: route discovery and route maintenance.
• b. Route Maintenance
29
ZCoER,Pune
• Nodes can cache routes they have recently used, allowing for faster route
discovery in future communications.
• Mobile IP
• Key Components
• Home Agent (HA): A router on the home network of the mobile device that
keeps track of the device's current location and forwards packets to it.
• Foreign Agent (FA): A router on the visited network that provides routing
services to the mobile device while it is connected to that network.
• Mobile Node (MN): The device (e.g., smartphone, laptop) that is moving
between networks.
Operation of Mobile IP
30