Unit 9
Unit 9
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.
Circuit Switching
Message Switching
Packet Switching (further categorized into Virtual Circuit Switching and Datagram
Switching)
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.
Key Takeaways:
Practice Questions:
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.
Routing algorithms can be classified into two broad categories based on how they select paths:
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.
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.
Topology Knowledge Each router only knows its Routers know the entire
neighbors and distance to network topology.
them.
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:
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.
There are two types of congestion control mechanisms: Open-loop and Closed-loop.
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.
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.
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.
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:
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?
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).
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.
The ICMP message consists of several fields that define the message type and carry additional
data about the error or query.
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.
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.
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.
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.
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:
Practice Questions: