0% found this document useful (0 votes)
7 views

network layer

The document provides an overview of the network layer in the OSI model, focusing on the delivery of packets across networks and the role of IPv4 in this process. It explains the structure of the IPv4 datagram header, types of IP addresses, and the differences between unicast, broadcast, and multicast communication methods. Additionally, it discusses the distinctions between static and dynamic IP addresses, as well as dedicated and shared website IP addresses.

Uploaded by

tanzir ahmed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

network layer

The document provides an overview of the network layer in the OSI model, focusing on the delivery of packets across networks and the role of IPv4 in this process. It explains the structure of the IPv4 datagram header, types of IP addresses, and the differences between unicast, broadcast, and multicast communication methods. Additionally, it discusses the distinctions between static and dynamic IP addresses, as well as dedicated and shared website IP addresses.

Uploaded by

tanzir ahmed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

Introduction and IPv4 Datagram Header

The network layer is the third layer (from bottom) in the OSI
Model. The network layer is concerned with the delivery of a
packet across multiple networks. The network layer is considered
the backbone of the OSI Model. It selects and manages the best
logical path for data transfer between nodes. This layer contains
hardware devices such as routers, bridges, firewalls, and
switches, but it actually creates a logical image of the most
efficient communication route and implements it with a physical
medium. Network layer protocols exist in every host or router.
The router examines the header fields of all the IP packets that
pass through it. Internet Protocol and Netware IPX/SPX are the
most common protocols associated with the network layer. In the
OSI model, the network layer responds to requests from the layer
above it (transport layer) and issues requests to the layer below
it (data link layer). Responsibilities of Network Layer:
Packet forwarding/Routing of packets: Relaying of data
packets from one network segment to another by nodes in a
computer network Connectionless communication(IP): A
data transmission method used in packet-switched networks in
which each data unit is separately addressed and routed based
on information carried by it Fragmentation of data
packets: Splitting of data packets that are too large to be
transmitted on the network
There are two types of network transmission techniques, circuit
switched network and packet switched network. Circuit Switch
vs Packet Switch In circuit switched network, a single path is
designated for transmission of all the data packets. Whereas in
case of a packet-switched network, each packet may be sent
through a different path to reach the destination. In a circuit
switched network, the data packets are received in order
whereas in a packet switched network, the data packets may be
received out of order. The packet switching is further subdivided
into Virtual circuits and Datagram.
IPv4: IPv4 is a connectionless protocol used for packet-switched
networks. It operates on a best-effort delivery model, in which
neither delivery is guaranteed, nor proper sequencing or
avoidance of duplicate delivery is assured. Internet Protocol
Version 4 (IPv4) is the fourth revision of the Internet Protocol and
a widely used protocol in data communication over different
kinds of networks. IPv4 is a connectionless protocol used in
packet-switched layer networks, such as Ethernet. It provides a
logical connection between network devices by providing
identification for each device. There are many ways to configure
IPv4 with all kinds of devices – including manual and automatic
configurations – depending on the network type. IPv4 is defined
and specified in IETF publication RFC 791. IPv4 uses 32-bit
addresses for Ethernet communication in five classes: A, B, C, D
and E. Classes A, B and C have a different bit length for
addressing the network host. Class D addresses are reserved for
multicasting, while class E addresses are reserved for military
purposes. IPv4 uses 32-bit (4-byte) addressing, which gives
232 addresses. IPv4 addresses are written in the dot-decimal
notation, which comprises of four octets of the address
expressed individually in decimal and separated by periods, for
instance, 192.168.1.5.
IPv4 Datagram Header Size of the header is 20 to 60 bytes.

IPv4 Datagram Header

VERSION: Version of the IP protocol (4 bits), which is 4 for IPv4


HLEN: IP header length (4 bits), which is the number of 32 bit
words in the header. The minimum value for this field is 5 and
the maximum is 15.
Type of service: Low Delay, High Throughput, Reliability (8
bits)
Total Length: Length of header + Data (16 bits), which has a
minimum value 20 bytes and the maximum is 65,535 bytes.

Identification: Unique Packet Id for identifying the group of


fragments of a single IP datagram (16 bits)
Flags: 3 flags of 1 bit each : reserved bit (must be zero), do not
fragment flag, more fragments flag (same order)
Fragment Offset: Represents the number of Data Bytes ahead
of the particular fragment in the particular Datagram. Specified
in terms of number of 8 bytes, which has the maximum value of
65,528 bytes.
Time to live: Datagram’s lifetime (8 bits), It prevents the
datagram to loop through the network by restricting the number
of Hops taken by a Packet before delivering to the Destination.
Protocol: Name of the protocol to which the data is to be
passed (8 bits)
Header Checksum: 16 bits header checksum for checking
errors in the datagram header
Source IP address: 32 bits IP address of the sender
Destination IP address: 32 bits IP address of the receiver
Option: Optional information such as source route, record route.
Used by the Network administrator to check whether a path is
working or not.
Due to the presence of options, the size of the datagram header
can be of variable length (20 bytes to 60 bytes).

Difference between Unicast, Broadcast


and Multicast in Computer Network
The cast term here signifies some data(stream of packets) is
being transmitted to the recipient(s) from the client(s) side over
the communication channel that helps them to communicate.
Let’s see some of the “cast” concepts that are prevailing in the
computer networks field.
Feature Unicast Broadcast Multicast

Definition A communication A communication A communication


where a message is where a message is where a message is
sent from one sender sent from one sender sent from one sender
to one receiver. to all receivers. to a group of receivers

Data is sent to all


Data is sent to a Data is sent to a group
Transmission recipients in a
single recipient of recipients
network

Uses a unique Uses a special Uses a special


Addressing
destination address broadcast address multicast address

Not all devices may


Not all devices may be
Delivery Guaranteed delivery be interested in the
interested in the data
data

Generates the least Generates the most


Network Generates moderate
amount of network amount of network
Traffic network traffic
traffic traffic

Less secure because Moderately secure


More secure because
data is sent to all because data is sent
Security data is sent to a
devices in the to a specific group of
specific recipient
network devices

DHCP requests, ARP Video streaming,


Examples Email, file transfer
requests online gaming

Destination Single receiver All receivers Grop of receivers

Bandwidth
Moderate High Moderate
usage
Latency Low High Moderate

1. Unicast:

This type of information transfer is useful when there is a


participation of a single sender and a single recipient. So, in
short, you can term it a one-to-one transmission. For example, if
a device having IP address 10.1.2.0 in a network wants to send
the traffic stream(data packets) to the device with IP address
20.12.4.2 in the other network, then unicast comes into the
picture. This is the most common form of data transfer over
networks.

2. Broadcast:

Broadcasting transfer (one-to-all) techniques can be classified


into two types:
Limited Broadcasting: Suppose you have to send a stream of
packets to all the devices over the network that your reside, this
broadcasting comes in handy. For this to achieve, it will append
255.255.255.255 (all the 32 bits of IP address set to 1)
called Limited Broadcast Address in the destination address
of the datagram (packet) header which is reserved for
information transfer to all the recipients from a single client
(sender) over the network.

Direct Broadcasting: This is useful when a device in one


network wants to transfer packet stream to all the devices over
the other network. This is achieved by translating all the Host ID
part bits of the destination address to 1, referred to as Direct
Broadcast Address in the datagram header for information
transfer.
This mode is mainly utilized by television networks for video and
audio distribution. One important protocol of this class in
Computer Networks is Address Resolution Protocol (ARP) which is
used for resolving an IP address into a physical address which is
necessary for underlying communication.

3. Multicast:

In multicasting, one/more senders and one/more recipients


participate in data transfer traffic. In this method traffic recline
between the boundaries of unicast (one-to-one) and broadcast
(one-to-all). Multicast lets servers direct single copies of data
streams that are then simulated and routed to hosts that request
it. IP multicast requires the support of some other protocols
like IGMP (Internet Group Management Protocol),
Multicast routing for its work. Also in Classful IP
addressing Class D is reserved for multicast groups.

Structure and Types of IP Address


An IP address represents an Internet Protocol address. A unique
address that identifies the device over the network. It is almost
like a set of rules governing the structure of data sent over the
Internet or through a local network. An IP address helps the
Internet to distinguish between different routers, computers, and
websites. It serves as a specific machine identifier in a specific
network and helps to improve visual communication between
source and destination.
IP address structure: IP addresses are displayed as a set of
four digits- the default address may be 192.158.1.38. Each
number on the set may range from 0 to 255. Therefore, the total
IP address range ranges from 0.0.0.0 to 255.255.255.255.
IP address is basically divided into two parts: X1. X2. X3. X4
1. [X1. X2. X3] is the Network ID
2. [X4] is the Host ID
1. Network ID–
It is the part of the left-hand IP address that identifies the
specific network where the device is located. In the
normal home network, where the device has an IP
address 192.168.1.32, the 192.168.1 part of the address
will be the network ID. It is customary to fill in the last
part that is not zero, so we can say that the device’s
network ID is 192.168.1.0.
2. Hosting ID–
The host ID is part of the IP address that was not taken
by the network ID. Identifies a specific device (in the
TCP / IP world, we call devices “host”) in that network.
Continuing with our example of the IP address
192.168.1.32, the host ID will be 32- the unique host ID
on the 192.168.1.0 network.
Version of IP address:
Currently there are 2 versions of IP addresses are in use i.e IPV4
and IPV6
1. IPV4 (Internet Protocol Version 4): It is the first
version of Internet Protocol address. The address size of
IPV4 is 32 bit number. In this Internet Protocol Security
(IPSec) with respect to network security is optional. It is
having 4,294,967,296 number of address still we are
seeing a shortage in network addresses as the use of
network & virtual devices are increasing rapidly.
2. IPV6 (Internet Protocol Version 6): It is the recent
version of Internet Protocol address. The address size of
IPV6 is 128 bit number. In this Internet Protocol Security
(IPSec) with respect to network security is mandatory. It
allows 3.4 x 10^38 unique IP addresses which seems to
be more than sufficient to support trillions of internet
devices present now or coming in future.
IP Address Types:
There are 4 types of IP Addresses- Public, Private, Fixed, and
Dynamic. Among them, public and private addresses are derived
from their local network location, which should be used within
the network while public IP is used offline.
1. Public IP address–
A public IP address is an Internet Protocol address,
encrypted by various servers/devices. That’s when you
connect these devices with your internet connection. This
is the same IP address we show on our homepage. So
why the second page? Well, not all people speak the IP
language. We want to make it as easy as possible for
everyone to get the information they need. Some even
call this their external IP address. A public Internet
Protocol address is an Internet Protocol address accessed
over the Internet. Like the postal address used to deliver
mail to your home, the public Internet Protocol address is
a different international Internet Protocol address
assigned to a computer device. The web server, email
server, and any server device that has direct access to
the Internet are those who will enter the public Internet
Protocol address. Internet Address Protocol is unique
worldwide and is only supplied with a unique device.
2. Private IP address–
Everything that connects to your Internet network has a
private IP address. This includes computers,
smartphones, and tablets but also any Bluetooth-enabled
devices such as speakers, printers, or smart TVs. With
the growing internet of things, the number of private IP
addresses you have at home is likely to increase. Your
router needs a way to identify these things separately,
and most things need a way to get to know each other.
Therefore, your router generates private IP addresses
that are unique identifiers for each device that separates
the network.
3. Static IP Address–
A static IP address is an invalid IP address. Conversely, a
dynamic IP address will be provided by the Dynamic Host
Configuration Protocol (DHCP) server , which can change.
The Static IP address does not change but can be
changed as part of normal network management.
Static IP addresses are incompatible, given once, remain
the same over the years. This type of IP also helps you
get more information about the device.
4. Dynamic IP address–
It means constant change. A dynamic IP address changes
from time to time and is not always the same. If you have
a live cable or DSL service, you may have a strong IP
address. Internet Service Providers provide customers
with dynamic IP addresses because they are too
expensive. Instead of one permanent IP address, your IP
address is taken out of the address pool and assigned to
you. After a few days, weeks, or sometimes even months,
that number is returned to the lake and given a new
number. Most ISPs will not provide a static IP address to
customers who live there and when they do, they are
usually more expensive. Dynamic IP addresses are
annoying, but with the right software, you can navigate
easily and for free.
Types of Website IP address:
Website IP address is of two types- Dedicated IP Address and
Shared IP Address. Let us discuss the two.
1. Dedicated IP address–
A dedicated IP address is one that is unique for each
website. This address is not used by any other domain. A
dedicated IP address is beneficial in many ways. It
provides increased speed when the traffic load is high
and brings in increased security. But dedicated IPs are
costly as compared to shared IPs.
2. Shared IP address–
A shared IP address is one that is not unique. It is shared
between multiple domains. A shared IP address is enough
for most users because common configurations don’t
require a dedicated IP.
IP Address Classification Based on Operational
Characteristics:
According to operational characteristics, IP address is classified
as follows:
1. Broadcast addressing –
The term ‘Broadcast’ means to transmit audio or video
over a network. A broadcast packet is sent to all users of
a local network at once. They do not have to be explicitly
named as recipients. The users of a network can open the
data packets and then interpret the information, carry
out the instructions or discard it. This service is available
in IPv4. The IP address commonly used for broadcasting
is 255.255.255.255
2. Unicast addressing–
This address identifies a unique node on the network.
Unicast is nothing but one-to-one data transmission from
one point in the network to another. It is the most
common form of IP addressing. This method can be used
for both sending and receiving data. It is available in IPv4
and IPv6.
3. Multicast IP addresses –
These IP addresses mainly help to establish one-to-many
communication. Multicast IP routing protocols are used to
distribute data to multiple recipients. The class D
addresses (224.0.0.0 to 239.255.255.255) define the
multicast group.
4. Anycast addressing–
In anycast addressing the data, a packet is not
transmitted to all the receivers on the network. When a
data packet is allocated to an anycast address, it is
delivered to the closest interface that has this anycast
address.

You might also like