0% found this document useful (0 votes)
4 views45 pages

4 Unit

This document provides an overview of the Network Layer in data communications, detailing its services such as packetizing, routing, forwarding, error control, flow control, congestion control, quality of service, and security. It discusses packet switching methods, including the datagram and virtual-circuit approaches, and addresses issues like delay, throughput, and packet loss. Additionally, it covers IP addressing, including classful and classless addressing, and the Internet Protocol version 4 (IPv4) and Address Resolution Protocol (ARP).

Uploaded by

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

4 Unit

This document provides an overview of the Network Layer in data communications, detailing its services such as packetizing, routing, forwarding, error control, flow control, congestion control, quality of service, and security. It discusses packet switching methods, including the datagram and virtual-circuit approaches, and addresses issues like delay, throughput, and packet loss. Additionally, it covers IP addressing, including classful and classless addressing, and the Internet Protocol version 4 (IPv4) and Address Resolution Protocol (ARP).

Uploaded by

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

19MAM44

DATA COMMUNICATIONS AND


NETWORKING
(UNIT – IV)

Prepared by
Dr. Stanly Felix C
Assistant Professor
Department of Computing (MSc Software Systems)
Coimbatore Institute of Technology, India
Overview of Unit III

NETWORK LAYER

 Switching - Packet switching at Network Layer

 Network layer Services

 Issues

 IP Addresses

 Delivery and Forwarding of Packets

 Internet Protocol IPv4

 Address Resolution Protocol

 Internet Control Message Protocol

2
NETWORK LAYER
Network layer services

3
NETWORK LAYER
Network layer services
1. Packetizing
• Encapsulating the payload (data received from upper layer) in a network-layer packet
at the source and decapsulating the payload from the network-layer packet at the
destination.
• The duty of the network layer is to carry a payload from the source to the destination
without changing it or using it.
• The source is not allowed to change the content of the payload unless it is too large for
delivery and needs to be fragmented.
• If the packet is fragmented at the source or at routers along the path, the network layer is
responsible for waiting until all fragments arrive, reassembling them, and delivering
them to the upper-layer protocol.

2. Routing
• The network layer is responsible for routing the packet from its source to the
destination.
• A physical network is a combination of networks (LANs and WANs) and routers that
connect them.
• There is more than one route from the source to the destination. The network layer is4
responsible for finding the best one among these possible routes.
NETWORK LAYER
3. Forwarding
• Forwarding can be defined as the action applied by each router when a packet arrives
at one of its interfaces.
• The decision-making table a router normally uses for applying this action is sometimes
called the forwarding table and sometimes the routing table.

5
NETWORK LAYER
4. Error Control
• Error control is the technique of detecting and correcting blocks of data during
communication. In other words, it checks the reliability of characters both at the bit
level and packet level.
5. Flow Control
• Flow control is a technique that allows two stations working at different speeds to
communicate with each other. It is a set of measures taken to regulate the amount of
data that a sender sends so that a fast sender does not overwhelm a slow.
6. Congestion Control
• Congestion Control is a mechanism that controls the entry of data packets into the
network, enabling a better use of a shared network infrastructure and avoiding
congestive collapse.
7. Quality of Service
• Quality of service (QoS) is the use of mechanisms or technologies that work on a
network to control traffic and ensure the performance of critical applications with
limited network capacity.
8. Security
• Network Security protects your network and data from breaches, intrusions and other
threats. This is a vast and overarching term that describes hardware and software
solutions as well as processes or rules and configurations relating to network use,6
accessibility, and overall threat protection.
NETWORK LAYER
Packet Switching
• Packet switching is used at the network layer because the unit of data at this layer is a
packet.
• At the network layer, a message from the upper layer is divided into manageable
packets and each packet is sent through the network.
• The source of the message sends the packets one by one; the destination of the message
receives the packets one by one.
• The destination waits for all packets belonging to the same message to arrive before
delivering the message to the upper layer.
• The connecting devices in a packet-switched network still need to decide how to
route the packets to the final destination.
• Packet-switched network uses two different approaches to route the packets: 1) the
datagram approach and 2) the virtual circuit approach.

1. Datagram Approach: Connectionless Service


• Network-layer protocol treats each packet independently, with each packet having no
relationship to any other packet.
• The network layer is only responsible for delivery of packets from the source to the
destination.
7
• The packets in a message may or may not travel the same path to their destination.
NETWORK LAYER

• Each packet is routed based on the information contained in its header: source and
destination addresses.
• The router in this case routes the packet based only on the destination address. The
source address may be used to send an error message to the source if the packet is
discarded. 8
NETWORK LAYER

9
NETWORK LAYER
2. Virtual-Circuit Approach: Connection-Oriented Service
• There is a relationship between all packets belonging to a message. Before all datagrams
in a message can be sent, a virtual connection should be set up to define the path for the
datagrams.
• After connection setup, the datagrams can all follow the same path.
• Along with the source and destination addresses, the packets must also contain a flow
label, a virtual circuit identifier that defines the virtual path the packet should follow.

10
NETWORK LAYER
• To create a connection-oriented service, a three-phase process is used: setup, data
transfer, and teardown.

1. Setup Phase
• The source and destination addresses of the sender and receiver are used to make table
entries for the connection-oriented service and it is done by the router.
• For example, suppose source A needs to create a virtual circuit to destination B. Two
auxiliary packets need to be exchanged between the sender and the receiver: the
request packet and the acknowledgment packet.
• Request packet - A request packet is sent from the source to the destination. This
auxiliary packet carries the source and destination addresses.
• Acknowledgment Packet - A special packet, called the acknowledgment packet,
completes the entries in the switching tables.

11
NETWORK LAYER

12
NETWORK LAYER

13
NETWORK LAYER
Request packet process and procedure:

14
NETWORK LAYER

15
NETWORK LAYER
Acknowledgement packet process and procedure:

16
NETWORK LAYER
2. Data-Transfer Phase
• After all routers have created their forwarding table for a specific virtual circuit, then the
network-layer packets belonging to one message can be sent one after another.
• The source computer uses the label 14, which it has received from router R1 in the setup
phase. Router R1 forwards the packet to router R3, but changes the label to 66.
• Router R3 forwards the packet to router R4, but changes the label to 22. Finally, router
R4 delivers the packet to its final destination with the label 77.
• All the packets in the message follow the same sequence of labels, and the packets
arrive in order at the destination.

3. Teardown Phase
• In the teardown phase, source A, after sending all packets to B, sends a special packet
called a teardown packet.
• Destination B responds with a confirmation packet. All routers delete the
corresponding entries from their tables.

17
NETWORK LAYER

18
NETWORK LAYER
 Issues – Network layer performance
1. Delay
• We expect instantaneous response from a network, but a packet, from its source to its
destination, encounters delays.
• The delays in a network can be divided into four types: transmission delay, propagation
delay, processing delay, and queuing delay.

19
NETWORK LAYER

20
NETWORK LAYER

21
NETWORK LAYER
2. Throughput

22
NETWORK LAYER

23
NETWORK LAYER
3. Packet Loss

4. Congestion Control
• Congestion control refers to techniques and mechanisms that can either prevent
congestion before it happens or remove congestion after it has happened.
• In general, we can divide congestion control mechanisms into two broad categories:
open-loop congestion control (prevention) and closed-loop congestion control
(removal).

24
NETWORK LAYER

25
NETWORK LAYER

26
NETWORK LAYER

27
NETWORK LAYER

28
NETWORK LAYER
 IP Addresses
• The identifier used in the IP layer of the TCP/IP protocol suite to identify the connection of each
device to the Internet is called the Internet address or IP address.
• An IPv4 address is a 32-bit address that uniquely and universally defines the connection of a host
or a router to the Internet.
• The IP address is the address of the connection, not the host or the router, because if the device is
moved to another network, the IP address may be changed.
Address Space
• An address space is the total number of addresses used by the protocol. If a protocol uses b bits to
define an address, the address space is 2^b
• IPv4 uses 32-bit addresses, which means that the address space is 232 or 4,294,967,296 (more than
four billion).
• There are three common notations to show an IPv4 address: binary notation (base 2), dotted-
decimal notation (base 256), and hexadecimal notation (base 16).

29
NETWORK LAYER
Hierarchy in Addressing
• A 32-bit IPv4 address is hierarchical, but divided only into two parts. The first part of
the address, called the prefix, defines the network; the second part of the address,
called the suffix, defines the node (connection of a device to the Internet).

30
NETWORK LAYER
Classful Addressing (fixed length prefix)
• An IPv4 address was designed with a fixed-length prefix, but to accommodate both
small and large networks, three fixed-length prefixes were designed instead of one (n =
8, n = 16, and n = 24).
• The whole address space was divided into five classes (class A, B, C, D, and E) and
referred as classful addressing.

31
NETWORK LAYER
• In class A, the network length is 8 bits, but since the first bit, which is 0, defines the
class, we can have only seven bits as the network identifier. This means there are only
2^7 = 128 networks in the world that can have a class A address.
Address Depletion
• The addresses were not distributed properly, the Internet was faced with the problem
of the addresses being rapidly used up, resulting in no more addresses available for
organizations and individuals that needed to be connected to the Internet.
• Class A can be assigned to only 128 organizations in the world, but each organization
needs to have a single network (seen by the rest of the world) with 16,777,216 nodes
(computers in this single network). Since there may be only a few organizations that
are this large, most of the addresses in this class were wasted (unused).
• Class B addresses were designed for midsize organizations, but many of the addresses
in this class also remained unused.
• Class C addresses have a completely different flaw in design. The number of addresses
that can be used in each network (256) was so small that most companies were not
comfortable using a block in this address class.
• Class E addresses were almost never used, wasting the whole class.

32
NETWORK LAYER
Subnetting and Supernetting
• Subnetting - used to reduce address depletion to some extent.
• In subnetting, a class A or class B block is divided into several subnets. Each subnet has
a larger prefix length than the original network.
• For example, if a network in class A is divided into four subnets, each subnet has a
prefix of nsub = 10. At the same time, if all of the addresses in a network are not used,
subnetting allows the addresses to be divided among several organizations.
• This idea did not work because most large organizations were not happy about
dividing the block and giving some of the unused addresses to smaller organizations.
• Supernetting - devised to combine several class C blocks into a larger block
• attractive to organizations that need more than the 256 addresses available in a class C
block.
Advantage of Classful Addressing
• Given an address, we can easily find the class of the address and, since the prefix length
for each class is fixed, we can find the prefix length immediately.

33
NETWORK LAYER
Classless Addressing
• Subnetting and supernetting in classful addressing did not really solve the address
depletion problem. With the growth of the Internet, it was clear that a larger address
space was needed as a long-term solution.
• A short-term solution was also devised to use the same address space but to change
the distribution of addresses to provide a fair share to each organization, referred as
classless addressing.
• In classless addressing, variable-length blocks are used that belong to no classes. We
can have a block of 1 address, 2 addresses, 4 addresses, 128 addresses, and so on.
• The whole address space is divided into variable length blocks.

34
NETWORK LAYER
• The prefix length in classless addressing is variable. We can have a prefix length that
ranges from 0 to 32.
• The size of the network is inversely proportional to the length of the prefix. A small
prefix means a larger network; a large prefix means a smaller network.
Prefix Length: Slash Notation
• The prefix length is not inherent in the address, so we need to separately give the length
of the prefix.
• The prefix length, n, is added to the address, separated by a slash. The notation is
informally referred to as slash notation and formally as classless interdomain routing
or CIDR

35
NETWORK LAYER

36
NETWORK LAYER
 Internet Protocol IPv4
• Internet Protocol version 4 (IPv4), is responsible for packetizing, forwarding, and
delivery of a packet at the network layer.

37
NETWORK LAYER
• IPv4 is an unreliable datagram protocol—a best-effort delivery service. The term
best-effort means that IPv4 packets can be corrupted, be lost, arrive out of order, or be
delayed, and may create congestion for the network.
• If reliability is important, IPv4 must be paired with a reliable transport-layer protocol
such as TCP.
• IPv4 is also a connectionless protocol that uses the datagram approach. This means that
each datagram is handled independently, and each datagram can follow a different route
to the destination.
Datagram Format
• Packets used by the IP are called datagrams.

38
NETWORK LAYER

39
NETWORK LAYER

40
NETWORK LAYER

41
NETWORK LAYER

42
NETWORK LAYER
 Address Resolution Protocol (ARP)

43
NETWORK LAYER
 ARP PACKET

44
NETWORK LAYER

45

You might also like