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

UNIT 4 CN course

The document discusses the Network Layer's design issues, including addressing, packet switching, and routing, highlighting the differences between connectionless and connection-oriented services. It also covers routing algorithms, classifying them into adaptive, non-adaptive, and hybrid types, and explains various routing protocols like RIP, IGRP, and BGP. Additionally, it addresses congestion control techniques and algorithms such as the leaky bucket and token bucket, emphasizing their importance in managing network traffic and ensuring efficient data flow.

Uploaded by

hema33243
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)
9 views

UNIT 4 CN course

The document discusses the Network Layer's design issues, including addressing, packet switching, and routing, highlighting the differences between connectionless and connection-oriented services. It also covers routing algorithms, classifying them into adaptive, non-adaptive, and hybrid types, and explains various routing protocols like RIP, IGRP, and BGP. Additionally, it addresses congestion control techniques and algorithms such as the leaky bucket and token bucket, emphasizing their importance in managing network traffic and ensuring efficient data flow.

Uploaded by

hema33243
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/ 18

Unit4

Communication Networks

Network Layer :

I.Network Layer: Design issues :

Addressing: Maintains the address at the frame header of both source and destination and performs
addressing to detect various devices in the network.

Packeting: This is performed by Internet Protocol. The network layer converts the packets from its upper
layer.

Routing: It is the most important functionality. The network layer chooses the most relevant and best
path for the data transmission from source to destination.

Inter-networking: It works to deliver a logical connection across multiple devices.

Network Layer Design Issues

The network layer comes with some design issues that are described as follows:

1. Store and Forward packet switching

The host sends the packet to the nearest router. This packet is stored there until it has fully arrived once
the link is fully processed by verifying the checksum then it is forwarded to the next router till it reaches
the destination. This mechanism is called “Store and Forward packet switching.”

2. Services provided to the Transport Layer

Through the network/transport layer interface, the network layer transfers its patterns services to the
transport layer. These services are described below. But before providing these services to the transfer
layer, the following goals must be kept in mind:-

Offering services must not depend on router technology.

The transport layer needs to be protected from the type, number, and topology of the available router.

The network addresses for the transport layer should use uniform numbering patterns, also at LAN and
WAN connections.

Based on the connections there are 2 types of services provided :

Connectionless – The routing and insertion of packets into the subnet are done individually. No added
setup is required.
Connection-Oriented – Subnet must offer reliable service and all the packets must be transmitted over a
single route.

3. Implementation of Connectionless Service

Packets are termed as “datagrams” and corresponding subnets as “datagram subnets”. When the
message size that has to be transmitted is 4 times the size of the packet, then the network layer divides
into 4 packets and transmits each packet to the router via. a few protocols. Each data packet has a
destination address and is routed independently irrespective of the packets.

4. Implementation of Connection-Oriented service:

To use a connection-oriented service, first, we establish a connection, use it, and then release it. In
connection-oriented services, the data packets are delivered to the receiver in the same order in which
they have been sent by the sender. It can be done in either two ways :

Circuit Switched Connection – A dedicated physical path or a circuit is established between the
communicating nodes and then the data stream is transferred.

Virtual Circuit Switched Connection – The data stream is transferred over a packet switched network, in
such a way that it seems to the user that there is a dedicated path from the sender to the receiver. A
virtual path is established here. While, other connections may also be using the same path.

Connection-less vs Connection-Oriented

Both Connection-less and Connection-Oriented are used for the connection establishment between two
or more devices. These types of services are provided by the Network Layer.

Connection-oriented service: In connection-Oriented service we have to establish a connection between


sender and receiver before communication. Handshske method is used to establish a connection
between sender and receiver. Connection-Oriented service include both connection establishment as
well as connection termination phase. Real life example of this service is telephone service, for
conversation we have to first establish a connection.
Connection-less service: In Connection-Less service no need of connection
establishment and connection termination. This Service does not give a guarantee
of reliability. In this service, Packets may follow the different path to reach their
destination. Real life examples of this service is postal system, Online gaming,
real-time video and audio streaming etc.

II. ROUTING ALGORITHMS

Routing algoritm is a set of rules that determine the path of a data packet to reach it from
source to destination.
The primary function of routing algorithm is to find the shortest and optimal path between
source and destination in computer Networks.
There are mainly two types of routing ie Static and Dynamic Routing
Static Routing : Static Routing is also known as non-adaptive routing which doesn’t
change the routing table unless the network administrator changes or modifies them
manually. Static routing does not use complex routing algorithms and It provides high or
more security than dynamic routing.
Dynamic Routing : Dynamic routing is also known as adaptive routing which changes the
routing table according to the change in topology. Dynamic routing uses complex routing
algorithms and it does not provide high security like static routing.

2.1Classification of Routing Algorithms :

Routing is the process of establishing the routes that data packets must follow to reach the destination. In
this process, a routing table is created which contains information regarding routes that data packets
follow. Various routing algorithms are used for the purpose of deciding which route an incoming data
packet needs to be transmitted on to reach the destination efficiently.

Classification of Routing Algorithms

The routing algorithms can be classified as follows:


Adaptive Algorithms

Non-Adaptive Algorithms

Hybrid Algorithms

Routing algorithms can be classified into various types such as distance vector,
link state, and hybrid routing algorithms. Each has its own strengths and
weaknesses depending on the network structure.

1. Adaptive Algorithms

These are the algorithms that change their routing decisions whenever network topology or traffic load
changes. The changes in routing decisions are reflected in the topology as well as the traffic of the
network. Also known as dynamic routing, these make use of dynamic information such as current
topology, load, delay, etc. to select routes. Optimization parameters are distance, number of hops, and
estimated transit time.

Further, these are classified as follows:

Isolated: In this method each, node makes its routing decisions using the information it has without
seeking information from other nodes. The sending nodes don’t have information about the status of a
particular link. The disadvantage is that packets may be sent through a congested network which may
result in delay. Examples: Hot potato routing, and backward learning.

Centralized: In this method, a centralized node has entire information about the network and makes all the
routing decisions. The advantage of this is only one node is required to keep the information of the entire
network and the disadvantage is that if the central node goes down the entire network is done. The link
state algorithm is referred to as a centralized algorithm since it is aware of the cost of each link in the
network.

Distributed: In this method, the node receives information from its neighbors and then takes the decision
about routing the packets. A disadvantage is that the packet may be delayed if there is a change in
between intervals in which it receives information and sends packets. It is also known as a decentralized
algorithm as it computes the least-cost path between source and destination.

2. Non-Adaptive Algorithms

These are the algorithms that do not change their routing decisions once they have been selected. This is
also known as static routing as a route to be taken is computed in advance and downloaded to routers
when a router is booted.

Further, these are classified as follows:

Flooding: This adapts the technique in which every incoming packet is sent on every outgoing line except
from which it arrived. One problem with this is that packets may go in a loop and as a result of which a
node may receive duplicate packets. These problems can be overcome with the help of sequence numbers,
hop count, and spanning trees.

Random walk: In this method, packets are sent host by host or node by node to one of its neighbors
randomly. This is a highly robust method that is usually implemented by sending packets onto the link
which is least queued.

3. Hybrid Algorithms

As the name suggests, these algorithms are a combination of both adaptive and non-adaptive algorithms.
In this approach, the network is divided into several regions, and each region uses a different algorithm.

Further, these are classified as follows:

Link-state: In this method, each router creates a detailed and complete map of the network which is then
shared with all other routers. This allows for more accurate and efficient routing decisions to be made.
Distance vector: In this method, each router maintains a table that contains information about the distance
and direction to every other node in the network. This table is then shared with other routers in the
network. The disadvantage of this method is that it may lead to routing loops.

Difference between Adaptive and Non-Adaptive Routing Algorithms

The main difference between Adaptive and Non-Adaptive Algorithms is:

Adaptive Algorithms are the algorithms that change their routing decisions whenever network topology or
traffic load changes. It is called Dynamic Routing. Adaptive Algorithm is used in a large amount of data,
highly complex network, and rerouting of data.

Non-Adaptive Algorithms are algorithms that do not change their routing decisions once they have been
selected. It is also called static Routing. Non-Adaptive Algorithm is used in case of a small amount of
data and a less complex network.

Types of Routing Protocol in Computer Networks

1. Routing information protocol (RIP)

One of the earliest protocols developed is the inner gateway protocol, or RIP. we can use it with local area
networks (LANs), that are linked computers in a short range, or wide area networks (WANs), which are
telecom networks that cover a big range. Hop counts are used by the Routing Information Protocol (RIP)
to calculate the shortest path between networks.

2. Interior gateway protocol (IGRP)

IGRP was developed by the multinational technology corporation Cisco. It makes use of many of the core
features of RIP but raises the maximum number of supported hops to 100. It might therefore function
better on larger networks. IGRPs are elegant and distance-vector protocols. In order to work, IGRP
requires comparisons across indicators such as load, reliability, and network capacity. Additionally, this
kind updates automatically when things change, such as the route. This aids in the prevention of routing
loops, which are mistakes that result in an unending data transfer cycle.

3. Exterior Gateway Protocol (EGP)

Exterior gateway protocols, such as EGP, are helpful for transferring data or information between several
gateway hosts in autonomous systems. In particular, it aids in giving routers the room they need to
exchange data between domains, such as the internet.
4. Enhanced interior gateway routing protocol (EIGRP)

This kind is categorised as a classless protocol, inner gateway, and distance vector routing. In order to
maximize efficiency, it makes use of the diffusing update method and the dependable transport protocol.
A router can use the tables of other routers to obtain information and store it for later use. Every router
communicates with its neighbor when something changes so that everyone is aware of which data paths
are active. It stops routers from miscommunication with one another. The only external gateway protocol
is called Border Gateway Protocol (BGP).

5. Open shortest path first (OSPF)

OSPF is an inner gateway, link state, and classless protocol that makes use of the shortest path first (SPF)
algorithm to guarantee effective data transfer. Multiple databases containing topology tables and details
about the network as a whole are maintained by it. The ads, which resemble reports, provide thorough
explanations of the path’s length and potential resource requirements. When topology changes, OSPF
recalculates paths using the Dijkstra algorithm. In order to guarantee that its data is safe from
modifications or network intrusions, it also employs authentication procedures. Using OSPF can be
advantageous for both large and small network organizations because to its scalability features.

6. Border gateway protocol (BGP)

Another kind of outer gateway protocol that was first created to take the role of EGP is called BGP. It is
also a distance vector protocol since it performs data package transfers using the best path selection
technique. BGP defines communication over the internet. The internet is a vast network of interconnected
autonomous systems. Every autonomous system has autonomous system number (ASN) that it receives
by registering with the Internet Assigned Numbers Authority.

III. Congestion Control in Computer Networks :

Congestion in a computer network happens when there is too much data being sent at the same time,
causing the network to slow down. Just like traffic congestion on a busy road, network congestion leads
to delays and sometimes data loss. When the network can’t handle all the incoming data, it gets
“clogged,” making it difficult for information to travel smoothly from one place to another.

Congestion control is a crucial concept in computer networks. It refers to the methods used to prevent
network overload and ensure smooth data flow.Congestion control techniques help manage the traffic, so
all users can enjoy a stable and efficient network connection. These techniques are essential for
maintaining the performance and reliability of modern networks.

Effects of Congestion Control

Improved Network Stability: Congestion control helps keep the network stable by preventing it from
getting overloaded. It manages the flow of data so the network doesn’t crash or fail due to too much
traffic.

Reduced Latency and Packet Loss: Without congestion control, data transmission can slow down, causing
delays and data loss. Congestion control helps manage traffic better, reducing these delays and ensuring
fewer data packets are lost, making data transfer faster and the network more responsive.
Enhanced Throughput: By avoiding congestion, the network can use its resources more effectively. This
means more data can be sent in a shorter time, which is important for handling large amounts of data and
supporting high-speed applications.

Fairness in Resource Allocation: Congestion control ensures that network resources are shared fairly
among users. No single user or application can take up all the bandwidth, allowing everyone to have a fair
share.

Better User Experience: When data flows smoothly and quickly, users have a better experience. Websites,
online services, and applications work more reliably and without annoying delays.

Mitigation of Network Congestion Collapse: Without congestion control, a sudden spike in data traffic
can overwhelm the network, causing severe congestion and making it almost unusable. Congestion
control helps prevent this by managing traffic efficiently and avoiding such critical breakdowns.

Congestion Control Algorithm

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. Congestive-avoidance
algorithms (CAA) are implemented at the TCP layer as the mechanism to avoid congestive collapse in a
network. There are two congestion control algorithms which are as follows:

Leaky Bucket Algorithm

The leaky bucket algorithm discovers its use in the context of network traffic shaping or rate-limiting.

A leaky bucket execution and a token bucket execution are predominantly used for traffic shaping
algorithms.

This algorithm is used to control the rate at which traffic is sent to the network and shape the burst traffic
to a steady traffic stream.

The disadvantages compared with the leaky-bucket algorithm are the inefficient use of available network
resources.

The large area of network resources such as bandwidth is not being used effectively.

Let us consider an example to understand. Imagine a bucket with a small hole in the bottom. No matter at
what rate water enters the bucket, the outflow is at constant rate. When the bucket is full with water
additional water entering spills over the sides and is lost.

Similarly, each network interface contains a leaky bucket and the following steps are involved
in leaky bucket algorithm:
 When host wants to send packet, packet is thrown into the bucket.
 The bucket leaks at a constant rate, meaning the network interface transmits packets at a
constant rate.
 Bursty traffic is converted to a uniform traffic by the leaky bucket.
 In practice the bucket is a finite queue that outputs at a finite rate.
Similarly, each network interface contains a leaky bucket and the following steps are involved
in leaky bucket algorithm:
 When host wants to send packet, packet is thrown into the bucket.
 The bucket leaks at a constant rate, meaning the network interface transmits packets at a
constant rate.
 Bursty traffic is converted to a uniform traffic by the leaky bucket.
 In practice the bucket is a finite queue that outputs at a finite rate.

Token Bucket Algorithm


 The leaky bucket algorithm has a rigid output design at an average rate independent of the
bursty traffic.
 In some applications, when large bursts arrive, the output is allowed to speed up. This calls
for a more flexible algorithm, preferably one that never loses information. Therefore, a
token bucket algorithm finds its uses in network traffic shaping or rate-limiting.
 It is a control algorithm that indicates when traffic should be sent. This order comes based
on the display of tokens in the bucket.
 The bucket contains tokens. Each of the tokens defines a packet of predetermined size.
Tokens in the bucket are deleted for the ability to share a packet.
 When tokens are shown, a flow to transmit traffic appears in the display of tokens.
 No token means no flow sends its packets. Hence, a flow transfers traffic up to its peak
burst rate in good tokens in the bucket.
Need of Token Bucket Algorithm
The leaky bucket algorithm enforces output pattern at the average rate, no matter how
bursty the traffic is. So in order to deal with the bursty traffic we need a flexible algorithm
so that the data is not lost. One such algorithm is token bucket algorithm.

Steps of this algorithm can be described as follows:

In regular intervals tokens are thrown into the bucket.


The bucket has a maximum capacity.
If there is a ready packet, a token is removed from the bucket, and the packet is sent.
If there is no token in the bucket, the packet cannot be sent.

Let’s understand with an example, In figure (A) we see a bucket holding three tokens, with five
packets waiting to be transmitted. For a packet to be transmitted, it must capture and destroy
one token. In figure (B) We see that three of the five packets have gotten through, but the other
two are stuck waiting for more tokens to be generated.
Token Bucket vs Leaky Bucket
The leaky bucket algorithm controls the rate at which the packets are introduced in the
network, but it is very conservative in nature. Some flexibility is introduced in the token bucket
algorithm. In the token bucket algorithm , tokens are generated at each tick (up to a certain
limit). For an incoming packet to be transmitted, it must capture a token and the transmission
takes place at the same rate. Hence some of the busty packets are transmitted at the same rate if
tokens are available and thus introduces some amount of flexibility in the system.

Leaky Bucket
Advantages
 Stable Network Operation: Congestion control ensures that networks remain stable and
operational by preventing them from becoming overloaded with too much data traffic.
 Reduced Delays: It minimizes delays in data transmission by managing traffic flow
effectively, ensuring that data packets reach their destinations promptly.
 Less Data Loss: By regulating the amount of data in the network at any given time,
congestion control reduces the likelihood of data packets being lost or discarded.
 Optimal Resource Utilization: It helps networks use their resources efficiently, allowing
for better throughput and ensuring that users can access data and services without
interruptions.
 Scalability: Congestion control mechanisms are scalable, allowing networks to handle
increasing volumes of data traffic as they grow without compromising performance.
 Adaptability: Modern congestion control algorithms can adapt to changing network
conditions, ensuring optimal performance even in dynamic and unpredictable
environments.
Disadvantages
 Complexity: Implementing congestion control algorithms can add complexity to network
management, requiring sophisticated systems and configurations.
 Overhead: Some congestion control techniques introduce additional overhead, which can
consume network resources and affect overall performance.
 Algorithm Sensitivity: The effectiveness of congestion control algorithms can be sensitive
to network conditions and configurations, requiring fine-tuning for optimal performance.
 Resource Allocation Issues: Fairness in resource allocation , while a benefit, can also pose
challenges when trying to prioritize critical applications over less essential ones.
 Dependency on Network Infrastructure: Congestion control relies on the underlying
network infrastructure and may be less effective in environments with outdated or
unreliable equipment.

IV. Internetworking :

Internetworking

Internetworking is the process of connecting multiple computer networks, enabling communication


between devices across different networks. It involves hardware components like routers, switches, and
gateways, along with communication protocols such as TCP/IP to ensure seamless data exchange.

Key Components of Internetworking

1. Local Area Network (LAN): A network limited to a small geographic area, like an office or home.
2. Wide Area Network (WAN): A network that connects multiple LANs over a large area (e.g., the
Internet).
3. Router: Connects different networks and forwards data packets between them.
4. Switch: Facilitates internal communication within a LAN.
5. Gateway: Connects networks using different communication protocols.
6. Protocols: Define rules for data transmission (e.g., TCP/IP, HTTP, FTP).

Types of Internetworking

1. Extranet: A private network that allows controlled external access.


2. Intranet: A private network used within an organization.
3. Internet: The global network interconnecting millions of devices.

Benefits of Internetworking

 Efficient Communication – Enables seamless connectivity between remote locations.


 Resource Sharing – Allows sharing of hardware, software, and data.
 Scalability – Supports business expansion without major infrastructure changes.
 Security & Control – Implements measures to protect data and regulate network access.

Internetworking is fundamental for modern communication, facilitating global connectivity, cloud


computing, and data sharing across multiple networks.

V. Addressing and Routing

Addressing and routing are essential concepts in computer networks that ensure data packets are
correctly delivered from the source to the destination across interconnected networks.

1. Addressing in Networks

Addressing is the process of uniquely identifying devices in a network using IP addresses. Every device
on a network must have a unique address for communication.

Types of Addresses

1. MAC Address (Media Access Control):


o A physical address assigned to network interfaces.
o Used in LAN communication (Data Link Layer).
o Example: 00:1A:2B:3C:4D:5E.
2. IP Address (Internet Protocol Address):
o A logical address used for device identification over the Internet.
o Exists in two versions:
 IPv4 (32-bit, e.g., 192.168.1.1).
 IPv6 (128-bit, e.g., 2001:0db8:85a3::8a2e:0370:7334).
3. Subnet Mask:
o Defines the network and host portions of an IP address.
o Example: 255.255.255.0 (Class C network).
4. Default Gateway:
o The IP address of a router that connects local networks to external networks.

2. Routing in Networks

Routing is the process of determining the best path for data packets to travel across networks. Routers
handle this process by examining the destination IP address and forwarding packets accordingly.

Types of Routing

1. Static Routing:
o Manually configured by network administrators.
o Used in small, stable networks.
2. Dynamic Routing:
o Uses routing protocols to determine the best path automatically.
o Examples of routing protocols:
 RIP (Routing Information Protocol): Distance-vector protocol.
 OSPF (Open Shortest Path First): Link-state protocol.
 BGP (Border Gateway Protocol): Used for Internet routing.

3. Routing Table

A router maintains a routing table that contains information about:

 Destination network
 Next-hop address
 Cost/metric of the route
5. Importance of Addressing & Routing

 Ensures Accurate Data Delivery – Prevents data loss and misrouting.


 Optimizes Network Performance – Finds the shortest and most efficient path.
 Supports Scalability – Enables large-scale Internet communication.
 Enhances Security – Allows access control and filtering through firewalls.

Conclusion: Addressing uniquely identifies devices, while routing ensures efficient data
transfer. Both are fundamental for seamless communication in networks and the Internet.

VI. IP Addressing (Classful & Classless), Subnetting

IP addressing is a fundamental concept in networking that provides a unique identifier to devices for
communication over a network. It consists of two main types: Classful and Classless Addressing.

1. Classful IP Addressing :In classful addressing, IP addresses are divided into five classes
(A, B, C, D, and E) based on predefined subnet masks.
2. Classless IP Addressing (CIDR - Classless Inter-Domain Routing)

CIDR removes the rigid class system and allows flexible allocation of IP addresses using Variable Length
Subnet Mask (VLSM).

CIDR Notation Example:

 192.168.1.0/24 (Subnet Mask: 255.255.255.0)


 172.16.0.0/16 (Subnet Mask: 255.255.0.0)

Advantages of CIDR:

✅ Efficient IP address allocation


✅ Reduces routing table size
✅ Supports subnetting and super netting

3. Subnetting

Subnetting divides a larger network into smaller sub networks to improve efficiency and
security.
5. Conclusion

 Classful addressing was the original method but is inefficient.


 CIDR (Classless Addressing) allows flexible IP distribution.
 Subnetting improves network performance and security.
 These concepts are essential for efficient IP address management in modern networks.

VII. Network Layer Protocols: ARP (Address Resolution Protocol)

1. Introduction to ARP

The Address Resolution Protocol (ARP) is a network layer protocol used to map an IP address to a MAC
address within a local network (LAN). It enables devices to communicate by resolving logical addresses
(IP) to physical addresses (MAC).

2. Working of ARP

When a device wants to communicate with another device in a LAN, it follows these steps:

1. The sender checks its ARP cache (a table storing recent IP-to-MAC address mappings).
2. If the destination MAC address is not found, the sender broadcasts an ARP request to all
devices on the network.
3. The device with the matching IP address responds with an ARP reply, providing its MAC address.
4. The sender stores the MAC address in its ARP cache for future communication.
4. ARP Packet Structure

An ARP packet consists of:

 Hardware Type (e.g., Ethernet)


 Protocol Type (e.g., IPv4)
 Hardware Address Length
 Protocol Address Length
 Operation (Request/Reply)
 Sender MAC & IP Address
 Target MAC & IP Address
6. Importance of ARP

✅ Ensures Proper Data Transmission – Resolves MAC addresses dynamically.


✅ Reduces Network Overhead – Caches resolved addresses for efficiency.
✅ Essential for LAN Communication – Used in Ethernet-based networks.

7. Conclusion

ARP is a crucial network layer protocol that facilitates IP-to-MAC resolution in local networks.
It enables devices to communicate efficiently and ensures smooth packet delivery in Ethernet
networks.

VIII. Network Layer Protocol IPV4 :

You might also like