Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

UNIT 3

Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

UNIT 3

NETWORK LAYER
What is Network Layer?
 The Network Layer is the third layer of the OSI model.
 The network layer translates the logical addresses into physical
addresses.
 It handles the service requests from the transport layer and
further forwards the service request to the data link layer.
 The main role of the network layer is to move the packets from
sending host to the receiving host.

Switching:
 Switching is the process of transferring data packets from one
device to another in a network, or from one network to another,
using specific devices called switches.
 Switching technique is used to connect the systems for making
one-to-one communication.

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.
 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.
 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
 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.
 The correct order of the packets is reached, then the
acknowledgment message will be sent.

Approaches Of Packet Switching:


✓Datagram Packet switching:
 It is a packet switching technology in which packet is known as a
datagram, is considered as an independent entity.
 In Datagram Packet Switching technique, the path is not fixed.

✓ Virtual Circuit Switching:


 Virtual Circuit Switching is also known as connection-
oriented switching.
 In the case of Virtual circuit switching, a preplanned
route is established before the messages are sent.

Virtual Circuit Switching

Advantages Of Packet Switching :


 Cost-effective
 Reliable
 Efficient

Disadvantages Of Packet Switching:


 The protocols used in a packet switching technique are
very complex and requires high implementation cost.
 If the network is overloaded or corrupted, then it
requires retransmission of lost packets.
 It can also lead to the loss of critical information if errors are nor
recovered.

What is the Internet Protocol (IP)?


 The Internet Protocol (IP) is a protocol, or set of rules, for routing
and addressing packets of data so that they can travel across
networks and arrive at the correct destination.
 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.

An internet protocol defines two things:


 Format of IP packet
 IP Addressing system

Uses of Internet Protocol :


Internet Protocol (IP) is used for:
 Addressing: Assigns unique IP addresses to devices on a
network.
 Routing: Directs data packets to their destination across
different networks.
 Packet Transmission: Breaks data into smaller packets for
transmission.
 Inter-networking: Facilitates communication between
different networks.
 Device Identification: Identifies devices for
communication over the internet.

Types of Internet Protocol:


 TCP/IP(Transmission Control Protocol/ internet Protocol).
 SMTP(Simple Mail Transfer Protocol.
 PPP(Point-to-Point Protocol).
 FTP (File Transfer Protocol).
 SFTP(Secure File Transfer Protocol).
 HTTP(Hyper Text Transfer Protocol).
 HTTPS(HyperText Transfer Protocol Secure).
 TELNET(Terminal Network).
Versions of IP:
 IPv4(Internet Protocol version 4)
 IPv6(Internet Protocol version 6)

IPv4:
IPv4 stands for Internet Protocol (IP) version 4. Launched in the

year 1983, it is the first and the oldest version of Internet Protocol. Till

date, it is still used to identify devices over the Internet.

 IPv4 has a 32-bit address.


 4.3 billion IP Addresses are generated through IPv4 address.
 It has 4 numbers separated by dots.
 The IPv4 address numbers could be anywhere between 0 to 255
in decimal numbers.
 The IPv4 address consists of 4 octets. Each octet has 8 bits.

Example of an IPv4 address


167.233.123.290

IPv6 (Internet Protocol version 6):


Since IPv4 had very limited IP addresses, there was a need of a newer
version of IP address. This gave rise to the Internet Protocol (IP) version
6.

 IPv6 is a 128-bit IP address.


 It consists of both numbers and alphabets.It consists of 8
hexadecimal numbers separated with colons (:).
For example
2063:e67c:2we5:4500:7h3w:0000:5678:d222

✓ Ipv6 has 340 trillion unique addresses.

✓ It consists of 8 octets. Each octet has 16-bits.


Purpose of subnetting :
The purpose of subnetting is to divide a large network into smaller,

more manageable sub-networks (subnets). This process provides

several advantages:

1.Improved Network Performance

2.Efficient IP Address Allocation

3.Enhanced Security

4.Simplified Network Management

5.Supports Hierarchical Routing


Why Subnetting is Needed ?
 The main goal of subnetting is to optimize the use of IP addresses
and improve network performance.
 As networks grow, having all devices on the same network can
lead to inefficiencies like excessive broadcast traffic, slower
performance, and poor network security.
 Subnetting addresses these issues by breaking large networks into
smaller subnetworks, each having its own network ID and
broadcast domain.

Structure of an IPv4 address(network and host


portion):
 An IPv4 address is a 32-bit number divided into four octets (each
octet is 8 bits), typically represented in dotted decimal format
(e.g., 192.168.1.1). It has two main parts: the network portion and
the host portion.

1. Network Portion:
 Identifies the specific network to which the device belongs.

 The length of the network portion is determined by the subnet


mask (e.g., 255.255.255.0 or /24 in CIDR notation).

 All devices on the same network share the same network portion
of the IP address.

For example, in the IP address 192.168.1.15/24, the first 24 bits


(192.168.1) represent the network portion.
2. Host Portion:
 Identifies the specific device (host) within the network.
 The remaining bits (after the network portion) are assigned
to the host.
For example, in 192.168.1.15/24, the last 8 bits (.15)
represent the host portion

Subnet Mask

 The subnet mask determines which part of an IP address is the


Network ID and which part is the Host ID.
 A subnet mask is also written in dotted decimal format, such as
255.255.255.0.
 When applied to an IP address, it separates the network portion
from the host portion.

For example:
IP: 192.168.1.1

Subnet Mask: 255.255.255.0

Broadcast
A broadcast address is the last IP address in the range of a subnet.
When message is sent to this address, it is delivered to all hosts in that
subnet.

Here's how to calculate it in a subnet:


1. Identify the network range:

2. Find broadcast address:

Net work Address: 192.168.1.0 (first address in the range). Broadcast


Address: 192.168.1.255 (last address in the range).
HOW TO FIND THE NUMBER OF NETWORK

2h (Here, n indicated total number of bits borrowed from host) 21 = 2


(You can create only two networks)

HOW TO FIND THE NUMBER OF IP ADDRESS ON


EACH NETWORK
2n (Here, n indicated total number of host bits) 27 128 (On each

HOW TO FIND THE NUMBER OF HOSTS IN EACH


NETWORK
2-2 (Here, n indicated total number of remaining host bits) 27-2126
(You will have total 126 Host IP Address on each network)

NOTE: In every network, the first ip address is reserved for the


network id and the last ip address is reserved for broadcast id

Advantages of Subnetting:
 Efficient IP address management.
 Improved network performance.
 Enhanced security and control.
 Easier troubleshooting.
 Reduced broadcast traffic.

Disadvantages of Subnetting:
 Increased network complexity.

 Requires more equipment.

 Time-consuming initial setup. Risk of misconfiguration.

ICMP (Internet Control Message Protocol):


• It is used for error handling in the network layer.

• It is primarily used on network devices such as routers.

• As different types of errors can exist in the network layer, so


ICMP can be used to report these errors and to debug those
errors.

• For example, some sender wants to send the message to some


destination, but the router couldn't send the message to the
destination. In this case, the router sends the message to the
sender that I could not send the message to that destination.
Messages:
The ICMP messages are usually divided into two categories:

• Error Reporting Message

• Ouery Message

Error-reporting messages:
 The error-reporting message means that the router
encounters a problem when it processes an IP packet then it
reports a message.

Query Message :
The query messages are those messages that help the host to get
the specific information of another host.

Types of Error Reporting messages:


The error reporting messages are broadly classified into the following
categories:
Query Messages:
The ICMP Query message is used for error handling or debugging the
internet.

Types of Query Message


• Echo Request Message

• Echo Response Message

ICMP Message Format:


 The type defines the type of message while the code defines
the subtype of the message.

The ICMP message contains the following fields:


Type:
It is an 8-bit field. It defines the ICMP message type.

Code:
It is an 8-bit field that defines the subtype of the ICMP message

Checksum:
It is a 16-bit field to detect whether the error exists in the message or
not.

Advantages of ICMP:
• Network Maintenance

• Simple and Lightweight

• Flow control and Path Discovery

• Automatic routing

Disadvantage of ICMP :
• Limited Functionality
• Resources Consumption

• Information Leakage

DHCP(Dynamic Host Configuration Protocol)


• Dynamic Host Configuration Protocol is a network protocol used
to automate the process of assigning IP
addressess,(configuration(Arrangement)).

• And other network configuration parameters to devices (such as


computers, smartphones, and printers) on a network.

• DHCP allows devices to connect to a network and receive all


necessary network information, like IP address and DNS server
addresses, automatically from a DHCP server.
Components of DHCP:
The main components of DHCP include:

 DHCP Server:

DHCP Server is a server that holds IP Addresses and other


information related to configuration.

 DHCP Client:

It is a device that receives configuration information from the


server. It can be a mobile, laptop, computer, or any other electronic
device that requires a connection.

 DHCP Relay:

DHCP relays basically work as a communication channel between


DHCP Client and Server.

Advantages of DHCP:
• Automatically IP assigned .

• Ease of adding new client to a network.

• Reduced Errors.

• Flexibility.

• Scalability.

Disadvantage of DHCP:
• Complexity.
• Single point of failure.

• Scalability Limitation.

• Security Risk.

You might also like