0% found this document useful (0 votes)
2 views13 pages

Unit 9

The document discusses switching methods (Circuit, Message, and Packet Switching) used in networking to determine data paths, highlighting their advantages and disadvantages. It also covers routing algorithms, classifying them into adaptive and non-adaptive types, and compares Distance Vector and Link State Routing. Additionally, it addresses congestion control mechanisms and network addressing, including classful addressing and the division of IP addresses into NetID and HostID.

Uploaded by

chirag240302
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)
2 views13 pages

Unit 9

The document discusses switching methods (Circuit, Message, and Packet Switching) used in networking to determine data paths, highlighting their advantages and disadvantages. It also covers routing algorithms, classifying them into adaptive and non-adaptive types, and compares Distance Vector and Link State Routing. Additionally, it addresses congestion control mechanisms and network addressing, including classful addressing and the division of IP addresses into NetID and HostID.

Uploaded by

chirag240302
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/ 13

1.

2 Switching

Switching is the process used to determine the path that data will take to reach its destination. In
the context of the network layer, switching mechanisms determine how packets of data are
forwarded from one node to another in the network.

There are three primary switching methods:

Circuit Switching
Message Switching
Packet Switching (further categorized into Virtual Circuit Switching and Datagram
Switching)

Switching Methods Overview

Circuit Switching:
In this method, a dedicated communication path is established between the sender and
the receiver before communication begins. This path remains open for the duration of the
communication.
Example: Traditional telephone systems where the path between two phones is
established for the entire duration of the call.
Advantages:
Consistent bandwidth and low latency.
Ideal for real-time services (e.g., voice calls).
Disadvantages:
Wasted resources if the communication is idle.
Not efficient for bursty or data-intensive communications.
Message Switching:
In message switching, the entire message is sent to the next switch, where it's stored
temporarily (store-and-forward). The switch then forwards it to the next node until it
reaches the destination.
Example: Early telegraph and telegram systems.
Advantages:
Simple and reliable as it doesn't require establishing a dedicated path.
Can be used for sending large data chunks.
Disadvantages:
High latency due to the store-and-forward process.
Could be inefficient with very large networks.
Packet Switching:
This is the most common method used in the modern internet. Here, data is divided into
small packets. Each packet is routed independently, possibly taking different paths to
reach the destination, where they are reassembled.
Example: The Internet, where data packets are sent between routers and reassembled at
the destination.
Two Types of Packet Switching:
1. Virtual Circuit Switching:
A virtual circuit is established between sender and receiver before the data
transfer begins. However, it doesn't require a physical connection between
nodes; instead, a logical path is established using packet switching techniques.
Advantages:
Data transfer is efficient as the path is predefined.
Guarantees reliable packet delivery.
Disadvantages:
A failure in the path disrupts communication for all related virtual circuits.
2. Datagram Switching:
Each packet is sent independently, and no pre-established path is required. Each
packet can take a different route to reach the destination.
Advantages:
Flexible, fault-tolerant, and ideal for dynamic networks.
Disadvantages:
No guaranteed delivery order. Packets may arrive out of sequence.

Comparison of Circuit Switching, Virtual Circuit, and Datagram Switching


Feature Circuit Switching Virtual Circuit Datagram
Switching Switching

Path Dedicated path Logical path (not No dedicated path


between sender physical)
and receiver

Communication Connection- Connection- Connectionless


Type oriented oriented

Data Transmission Continuous (voice, In packets In independent


etc.) (messages, text) packets

Bandwidth Usage Fixed, allocated Dynamically Dynamically


allocated allocated

Bandwidth Low (wastes Higher (path High (no wasted


Efficiency unused shared by many) bandwidth)
bandwidth)

Delay Minimum (once Moderate Maximum


path is set) (depends on path)

Example Telephone systems ATM, Frame Relay Internet (TCP/IP)

Key Takeaways:

Switching determines how data is transmitted between nodes in a network.


Circuit Switching establishes a dedicated path but is inefficient for bursty data.
Virtual Circuit Switching provides a logical path with guaranteed delivery, while Datagram
Switching sends data independently.
Packet Switching is the backbone of modern internet communication due to its efficiency
and flexibility.

Practice Questions:

1. Multiple Choice: Which switching method establishes a dedicated communication path


between sender and receiver?
A) Datagram Switching
B) Circuit Switching
C) Virtual Circuit Switching
D) Message Switching
2. Short Answer: What is the main difference between Virtual Circuit and Datagram
Switching?

1.3 Routing Algorithm

Routing algorithms are responsible for determining the path that data takes across the network,
ensuring that packets are forwarded from one node to another until they reach their destination.
The network layer handles these tasks through various routing algorithms.

Routing algorithms typically focus on selecting the best path based on specific criteria such as
distance, network load, or cost. These algorithms play a key role in optimizing network
performance, improving efficiency, and ensuring data reliability.

Key Properties of a Routing Algorithm:

A good routing algorithm should possess the following qualities:

1. Correctness: Ensure packets are forwarded to the correct destination.


2. Simplicity: Keep the algorithm simple to reduce overhead.
3. Robustness: It should continue working effectively even in the event of failures or errors.
4. Stability: The algorithm must remain stable under varying network conditions.
5. Fairness: Every node should get a fair share of bandwidth.
6. Optimality: Ensure the best path is chosen in terms of throughput and minimal delay.

1.3.1 Classification of Routing Algorithms

Routing algorithms can be classified into two broad categories based on how they select paths:

1. Adaptive Routing Algorithms (Dynamic):


These algorithms adapt to network conditions by using real-time information about the
network's topology, load, and traffic. They adjust their routes based on changes in the
network's state, such as congestion or topology changes.
2. Non-Adaptive Routing Algorithms (Static):
These algorithms use pre-calculated routes and do not adapt to changes in the network's
state. The routes are typically set manually and remain fixed, regardless of network
conditions.

1.3.2 Non-Adaptive Routing Algorithm (Static Routing)

Static routing algorithms involve predefined paths that do not change based on current network
conditions. Once the routes are configured, they remain fixed, and data is always routed along the
same path.

Types of Non-Adaptive Routing Algorithms:


1. Shortest Path Routing:
This method finds the shortest path between two nodes, often using metrics like the
number of hops or link delay.
Example: Dijkstra's algorithm, which finds the shortest path by evaluating all possible
routes and selecting the one with the least cost (number of hops, link delay).
2. Flooding:
Every incoming packet is sent out through every outgoing link except the one from which
it arrived. This creates redundancy and increases the possibility of packet duplication, but
it ensures the packet reaches its destination.
Issues: Flooding can generate an excessive number of duplicate packets unless measures
like hop counters are implemented.
3. Selective Flooding:
This is an optimized version of flooding. Routers send packets only along the lines that are
likely to lead to the destination. The goal is to reduce unnecessary packet propagation.
Uses: Often used in military and real-time data applications.
4. Flow-Based Routing:
It considers both topology and load. In flow-based routing, the capacity and flow of traffic
on each line are taken into account, which helps in routing decisions.

1.3.3 Dynamic Routing Algorithm (Adaptive)

Dynamic or adaptive routing algorithms adjust to the current state of the network. They use real-
time data (such as traffic load, link failure, etc.) to choose the best route. These algorithms
exchange information with other routers and update their routing tables accordingly.

Types of Dynamic Routing Algorithms:

1. Distance Vector Routing (Bellman-Ford Algorithm):


In distance vector routing, each router maintains a table of the best-known distances to all
other routers in the network. This table is shared with neighboring routers, and updates
are exchanged periodically.
Example: RIP (Routing Information Protocol).
Drawbacks: Susceptible to problems like the Count-to-Infinity problem, where routers
mistakenly propagate incorrect routing information for a long time before converging.
2. Link State Routing (Dijkstra’s Algorithm):
Each router has a complete view of the network topology. It builds a map of the entire
network and calculates the shortest path to each destination using algorithms like
Dijkstra's.
Example: OSPF (Open Shortest Path First).
Advantages: More reliable and faster convergence than distance vector routing.
Drawbacks: Requires more memory and CPU resources as routers need to store and
maintain the entire topology.

1.3.4 Comparison: Link State Versus Distance Vector Routing


Let's compare Link State Routing and Distance Vector Routing to understand their key
differences:

Feature Distance Vector Routing Link State Routing

Information Exchange Routers only share Routers share information


information with their with all routers in the
immediate neighbors. network.

Topology Knowledge Each router only knows its Routers know the entire
neighbors and distance to network topology.
them.

Convergence Speed Slower convergence due to Faster convergence, but


periodic updates and slow more computationally
propagation of changes. expensive.

Complexity Simpler and less resource- More complex and


intensive. resource-intensive.

Scalability Less scalable for larger Better scalability for


networks. larger networks.

Example RIP (Routing Information OSPF (Open Shortest Path


Protocol) First)

Key Differences:

Distance Vector relies on periodic updates and simpler, less resource-intensive routing
tables. However, it can suffer from slow convergence and routing loops, especially in larger
networks.
Link State provides more accurate routing by sharing detailed network information across
all routers. It is more efficient and scalable but comes at the cost of higher complexity and
resource usage.

Key Takeaways:

Static Routing uses predefined paths and does not adapt to network changes.
Dynamic Routing uses real-time data to adjust routing decisions based on network
conditions.
Distance Vector Routing is simpler but slower in convergence and more prone to errors.
Link State Routing is more efficient, faster, and scalable, but requires more resources.

Practice Questions:

1. Multiple Choice: Which of the following is a disadvantage of Distance Vector Routing?


A) Requires too many resources
B) Prone to the Count-to-Infinity problem
C) More complex than Link State Routing
D) Requires all routers to have full knowledge of the network topology
2. Short Answer: What is the key difference between Link State and Distance Vector routing
algorithms in terms of topology knowledge?
3. Long Answer: Explain the process of Distance Vector Routing. How does it update its
routing tables, and what are its limitations?

1.4 Congestion Control

Congestion occurs when a network or a part of a network is overwhelmed with too much data,
resulting in delayed packet delivery, dropped packets, and reduced network performance. The
goal of congestion control is to ensure that network resources are used efficiently without
overloading the system.

Causes of Congestion:

1. Too many input lines demanding the same output lines: When multiple devices send data
at the same time over a limited-capacity link, congestion can occur.
2. Slow receivers and fast senders: If a receiver is slower than the sender, data accumulates
and leads to congestion.
3. Low bandwidth lines: Slow transmission speeds can also cause congestion when large
amounts of data are sent over these links.
4. Congestion itself: Once congestion occurs, packets may start to get lost, exacerbating the
problem.
5. Burst traffic: A sudden surge in network traffic can easily overwhelm the available
bandwidth.

Congestion Control Mechanisms

There are two types of congestion control mechanisms: Open-loop and Closed-loop.

1. Open-loop Congestion Control:


This method tries to prevent congestion from occurring in the first place by setting up
good network designs. Once the system is set up, no further adjustments are made.
Examples: Proper network layout, traffic scheduling, etc.
2. Closed-loop Congestion Control:
In this approach, the network continuously monitors itself to detect congestion. When
congestion occurs, corrective actions are taken.
Steps:
Monitoring: Detect when congestion occurs.
Action: Pass this information to other nodes to take corrective actions.
Adjustment: Dynamically change system parameters to avoid congestion.

1.4.1 Algorithm for Congestion Control

Two major criteria for congestion control algorithms are:

1. Decrease load: Reduce the amount of data being sent when the network is congested.
2. Increase capacity: Increase the network’s ability to handle traffic, such as adding more
bandwidth.

Traffic Shaping is a key approach used to control congestion, particularly in ATM (Asynchronous
Transfer Mode) networks. It involves regulating the rate of traffic flow to prevent congestion.

Key Congestion Control Algorithms:

1. Leaky Bucket Algorithm:


Imagine a bucket with a small hole at the bottom. Packets enter the bucket at any rate, but
the outflow is at a constant rate. If the bucket fills up, additional packets are discarded.
Advantages:
Smoothens traffic flow and reduces burstiness.
Helps prevent congestion in the network.
Disadvantages:
If the bucket (buffer) is full, new packets are discarded, leading to potential data loss.
2. Diagram:
The leaky bucket essentially serves as a buffer that helps regulate the rate at which
packets are sent out, maintaining a smooth data flow.
3. Token Bucket Algorithm:
Similar to the leaky bucket, but with more flexibility. It allows burst traffic to occur up to a
certain limit (number of tokens in the bucket).
How it Works:
Tokens are generated at a fixed rate and stored in the bucket.
A packet can only be transmitted if it holds a token. If no tokens are available, the
packet must wait.
Advantages:
Allows burst transmission without exceeding the rate limit.
Flexible and does not discard packets unless absolutely necessary.
4. Diagram:
The token bucket algorithm is more adaptive and permits bursts of data transmission,
unlike the leaky bucket algorithm.
1.5 Network Addressing

Network addressing is used to uniquely identify devices on a network, enabling them to


communicate with one another. One of the most common methods is IP addressing, where each
device on the network is assigned a unique IP address.

1.5.1 Classful Addressing

Classful addressing is the older way of allocating and classifying IP addresses, which divides the
IP address space into distinct classes based on the leading bits.

There are five classes of IP addresses:

1. Class A:
Range: 0.0.0.0 to 127.255.255.255
Leading bit pattern: 0
Uses: Reserved for large networks (e.g., large corporations).
Subnet Mask: 255.0.0.0 (8 bits for the network part).
2. Class B:
Range: 128.0.0.0 to 191.255.255.255
Leading bit pattern: 10
Uses: Medium-sized networks (e.g., universities or ISPs).
Subnet Mask: 255.255.0.0 (16 bits for the network part).
3. Class C:
Range: 192.0.0.0 to 223.255.255.255
Leading bit pattern: 110
Uses: Small networks (e.g., small businesses).
Subnet Mask: 255.255.255.0 (24 bits for the network part).
4. Class D (Multicast):
Range: 224.0.0.0 to 239.255.255.255
Leading bit pattern: 1110
Uses: Reserved for multicast groups (not for standard unicast addressing).
5. Class E (Reserved):
Range: 240.0.0.0 to 255.255.255.255
Leading bit pattern: 1111
Uses: Reserved for experimental purposes.

Classful Addressing has limitations due to inefficient utilization of address space, leading to the
development of Classless Inter-Domain Routing (CIDR), which allows more flexible allocation.

1.5.2 NetID and HostID

An IP address is divided into two parts:


1. NetID (Network ID): Identifies the specific network that the device is a part of. This part of
the address is the same for all devices within the same network.
2. HostID (Host ID): Identifies the specific device (host) within a network. This part is unique
to each device in the network.

For example:

In Class A (e.g., IP address 10.1.1.1), the first byte (10) represents the NetID, and the
remaining bytes (1.1.1) represent the HostID.
In Class B (e.g., IP address 172.16.5.5), the first two bytes (172.16) represent the NetID, and
the last two bytes (5.5) represent the HostID.
In Class C (e.g., IP address 192.168.1.1), the first three bytes (192.168.1) represent the
NetID, and the last byte (1) represents the HostID.

Key Takeaways:

Congestion Control involves preventing or managing network congestion through


algorithms like Leaky Bucket and Token Bucket.
Classful Addressing divides IP addresses into classes based on size requirements, but it’s
inefficient for large networks.
NetID identifies the network, while HostID identifies the device within that network.
Traffic Shaping techniques, such as Leaky Bucket and Token Bucket, help manage
congestion by controlling data transmission rates.

Practice Questions:

1. Multiple Choice: Which algorithm allows burst traffic without exceeding the set rate limit?
A) Leaky Bucket
B) Token Bucket
C) Flooding
D) Distance Vector Routing
2. Short Answer: Explain the role of NetID and HostID in an IP address.
3. Long Answer: Compare and contrast Leaky Bucket and Token Bucket algorithms for
congestion control. What are the advantages and limitations of each?

1.7 Error Messaging Services

Error messaging services are crucial components in network communication, providing


mechanisms for reporting issues and ensuring that networks can handle faults. These protocols
assist in error reporting, diagnostics, and status updates related to the operation of network
devices. Two of the most important protocols in error messaging are ICMP (Internet Control
Message Protocol) and IGMP (Internet Group Management Protocol).

1.7.1 ICMP (Internet Control Message Protocol)


ICMP is a fundamental part of the IP (Internet Protocol) suite. It serves as a helper protocol for
IP, providing a mechanism for error reporting and diagnostic operations.

Purpose of ICMP:

Error Reporting: ICMP informs a sender if something goes wrong with their data
transmission, such as network congestion or unreachable destinations.
Diagnostic Functions: ICMP is used for troubleshooting purposes, such as determining
whether a network is reachable (e.g., using ping).

ICMP Message Types:

ICMP messages are divided into two categories:

1. Error Reporting Messages: These inform the sender about issues during the transmission
of data, such as packet loss, unreachable destinations, or timeouts.
Destination Unreachable: Reports that a packet could not reach its destination.
Time Exceeded: Indicates that the packet's TTL (Time to Live) has expired.
Parameter Problem: Reports issues with the packet’s header.
Source Quench: Tells the sender to slow down the transmission due to congestion.
Redirection: Informs the sender that the optimal path to the destination has changed.
2. Query Messages: These are used to obtain information about the network or about devices.
Echo Request/Reply: Used by ping to test connectivity between devices.
Timestamp Request/Reply: Provides synchronization of time between devices.
Address Mask Request/Reply: Used to retrieve the network mask (subnet mask) of a
device.
Router Solicitation and Advertisement: Devices can send a solicitation to discover the
routers in the network.

ICMP Packet Format:

The ICMP message consists of several fields that define the message type and carry additional
data about the error or query.

Type: 8 bits, specifies the type of ICMP message.


Code: 8 bits, provides further classification of the message.
Checksum: 16 bits, used for error detection to ensure the integrity of the ICMP message.
Data: Contains information specific to the message type. For example, in an Echo Request, it
will contain the sequence number and identifier for the message.

Common Example: Ping (Echo Request/Reply):

Ping is an ICMP command that sends an Echo Request message to a remote device, asking
for a response. The remote device sends back an Echo Reply.
This process helps verify if a device is reachable and measures network latency.
ICMP Limitations:

ICMP does not guarantee that the message will be delivered or that a control message will be
returned.
ICMP is primarily for error reporting and diagnostics, not for ensuring reliable delivery of
data. Higher layers (e.g., TCP) handle actual reliability and retransmission.

1.7.2 IGMP (Internet Group Management Protocol)

IGMP is used for managing multicast groups in an IP network. Multicasting is the process of
sending data to multiple recipients simultaneously, but only to those devices that need it.

Purpose of IGMP:

Multicast Group Management: IGMP allows devices to join or leave multicast groups. When
a device joins a multicast group, it can receive data sent to that group. When it leaves, it stops
receiving that data.
Multicast Routing: Routers use IGMP to learn which devices are interested in receiving
multicast traffic and to direct multicast packets to only those devices.

How IGMP Works:

Host-to-Router Communication: When a device (host) wants to receive multicast traffic for
a specific group, it sends an IGMP Join Request to the nearest router.
Router-to-Host Communication: The router periodically sends an IGMP Query to ask all
devices whether they still wish to remain in a particular multicast group. Devices that no
longer wish to receive the multicast traffic send an IGMP Leave Message.

IGMP Message Types:

1. Query: A router sends this to determine which devices on the network want to receive
multicast traffic.
2. Membership Report: When a device wants to join a multicast group, it sends a
Membership Report message to the router to indicate its interest.
3. Leave Report: When a device no longer wants to receive multicast traffic, it sends a Leave
Report message to inform the router that it should stop sending traffic to it.

IGMP Versions:

IGMPv1: The original version, which only supports basic group membership reporting.
IGMPv2: Added the ability for devices to leave multicast groups, improving network
efficiency.
IGMPv3: Introduced support for source-specific multicast (SSM), allowing a device to specify
the source of multicast traffic it is interested in.

IGMP Operation:
1. Joining a Group: A device sends an IGMP Membership Report to the router to express
interest in a multicast group.
2. Leaving a Group: When a device no longer wishes to receive multicast data, it sends an IGMP
Leave Report.
3. Querying for Group Members: The router periodically sends Query messages to check
which devices are still part of any multicast group.

Use Cases for IGMP:

Streaming Media: IGMP is heavily used in scenarios like live video streaming, where
multiple users may want to watch the same stream, but not everyone needs a separate copy
of the data.
Video Conferencing: Multiple participants can receive multicast data for a conference
without individual unicast sessions.

Key Takeaways:

ICMP provides error reporting and diagnostic functions in IP networks, helping to


troubleshoot and manage network health.
IGMP is used for managing multicast groups, allowing efficient delivery of data to multiple
recipients without wasting bandwidth.

Practice Questions:

1. Multiple Choice: What is the main function of ICMP in IP networks?


A) To route data between different networks
B) To report errors and provide diagnostics
C) To manage multicast group memberships
D) To ensure reliable packet delivery
2. Short Answer: What is the role of IGMP in multicast communications?
3. Long Answer: Explain how ICMP Echo Request/Reply works. How does this help in
network diagnostics, and what information can it provide about the network?

You might also like