CN & NP Unit 2
CN & NP Unit 2
Greater Noida
https://onlinecourses.nptel.ac.in/noc21_cs18/preview
https://nptel.ac.in/courses/106105081
https://elearn.nptel.ac.in/shop/nptel/computer-networks-
and-internet-protocol/
https://archive.nptel.ac.in/courses/106/105/106105080/
Course Objective
Byte-oriented Framing:
In byte-oriented framing, data is organized into frames using sequences of bytes.
Each frame begins and ends with specific byte patterns, which define the boundaries of the frame.
Bit-oriented Framing:
Bit-oriented framing involves framing data using individual bits.
Delimiters are identified based on specific bit patterns, indicating the start and end of each frame.
Fixed-Size Framing:
In fixed-size framing, each frame is of a predetermined and constant size.
Regardless of the amount of data being transmitted, each frame occupies the same amount of space.
Variable-Size Framing:
Variable-size framing allows frames to vary in size based on the amount of data being transmitted.
Frames may be larger or smaller depending on the size of the payload.
What is an Error?
A condition when the receiver’s information does not match with the sender’s information.
During transmission, digital signals suffer from noise that can introduce errors in the binary bits traveling from sender to
receiver.
Unlike the checksum scheme, which is based on addition, CRC is based on binary division.
In CRC, a sequence of redundant bits, called cyclic redundancy check bits, are appended to the end of the data unit so that the
resulting data unit becomes exactly divisible by a second, predetermined binary number.
At the destination, the incoming data unit is divided by the same number. If at this step there is no remainder, the data unit is
A remainder indicates that the data unit has been damaged in transit and therefore must be rejected.
Error Correction
Error correction is the process of detecting errors in transmitted messages and reconstructing the original error-free data.
Error correction ensures that corrected and error-free messages are obtained at the receiver side.
Error correction is the additional ability to reconstruct the original, error-free data.
In Error correction, we need to know the exact number of bits that are corrupted as well as their location in the message.
Hamming Code is an error-correcting code technique used in computer networks and communication systems to detect and correct
It is widely used in digital communication systems, including Ethernet networks, Wi-Fi, and satellite communication.
Hamming Code is a powerful error-correction technique that helps improve the reliability and accuracy of data transmission in
communication systems.
It is commonly used in conjunction with other error detection and correction methods to ensure robust communication over noisy
or unreliable channels.
Hamming Code Numerical
parity & odd parity seven-bit hamming code for this data.
Disadvantages:
Sliding Window :
In sliding window protocols the sender's data link layer maintains a 'sending window' which consists of a set of sequence
Similarly, the receiver maintains a 'receiving window' corresponding to the set of frames it is permitted to accept.
The window size is dependent on the retransmission policy and it may differ in values for the receiver's and the sender's
window.
Elementary Data Link Protocols
Elementary data link protocols are basic communication protocols used in computer networks to establish a reliable
communication link between devices.
These protocols typically operate at the data link layer of the OSI model and are responsible for framing error detection, and
flow control.
In elementary data link protocols, flow control is often achieved using a simple mechanism such as stop-and-wait ARQ
(Automatic Repeat reQuest).
In this mechanism:
The sender transmits a frame to the receiver and waits for an acknowledgment (ACK) from the receiver.
If the sender receives the ACK within a specified timeout period, it sends the next frame. Otherwise, it retransmits the same
frame.
The receiver sends an ACK to confirm the successful receipt of the frame. If the receiver detects an error, it sends a negative
acknowledgment (NAK), prompting the sender to retransmit the frame.
Sliding Window Protocols
Sliding window protocols are more sophisticated flow control mechanisms used in computer networks, especially in data link
layer protocols like HDLC (High-Level Data Link Control) and TCP (Transmission Control Protocol).
In sliding window protocols, both the sender and receiver maintain a "window" of frames that can be transmitted or received at
any given time.
The window size determines the number of frames that can be outstanding at once.
There are two main types of sliding window protocols:
Go-Back-N (GBN): In the Go-Back-N protocol, the sender is allowed to transmit multiple frames without waiting for
individual acknowledgments. However, if an acknowledgment is not received within a certain timeout period, the sender
retransmits all unacknowledged frames from the beginning of the window.
Selective Repeat: In the Selective Repeat protocol, the sender is allowed to transmit multiple frames, and the receiver
acknowledges each frame individually. If an acknowledgment for a particular frame is not received, only that frame is
retransmitted, while the other frames remain in the window.
Medium Access Control
Medium Access Control (MAC) is a sublayer of the Data Link Layer (Layer 2) of the OSI model in computer networking.
It is responsible for controlling access to the transmission medium, such as a shared communication channel, in a network
where multiple devices need to communicate concurrently.
The primary function of the MAC sublayer is to coordinate the transmission of data frames between devices sharing the same
physical medium, ensuring that data is transmitted efficiently and without collisions.
MAC protocols define rules and procedures for how devices contend for access to the medium, how collisions are detected and
managed, and how data frames are addressed and delivered.
Frame Synchronization:
MAC protocols ensure that data frames are synchronized and correctly formatted for transmission over the physical
medium. This involves adding framing information, such as start and end delimiters, to each frame to delineate its
boundaries and facilitate accurate reception by the receiving device.
It is superior to fixed assignment when there are a large number of bursts stations.
Its performance becomes worse as the data traffic on the channel increases.
It is used to detect collisions on the network which happen when two stations attempt to transmit at the same time.
CSMA/CD is a set of rules that determines how network devices respond when two devices attempt to use a data channel
simultaneously.
CSMA/CA is a multiple access protocol used in wireless networks to regulate access to the shared communication medium, such as
a wireless channel.
Unlike CSMA/CD (Carrier Sense Multiple Access with Collision Detection), which is used in wired Ethernet networks, CSMA/CA is
specifically designed for wireless communication where collision detection is not feasible due to the hidden terminal problem and
Channel allocation refers to the process of assigning communication channels to different devices within a LAN to facilitate
communication.
Frequency Division Multiple Access (FDMA): Divides the available frequency spectrum into multiple non-overlapping
Time Division Multiple Access (TDMA): Divides the available time slots in a time frame into multiple time slots, with each
Code Division Multiple Access (CDMA): Assigns a unique spreading code to each device, allowing multiple devices to
LAN standards define the protocols and specifications for LAN technologies, ensuring interoperability and compatibility among
Ethernet:
The most widely used LAN technology, which specifies the physical and data link layers of the OSI model.
Ethernet standards include 10BASE-T, 100BASE-TX, and Gigabit Ethernet (IEEE 802.3 standards).
Wi-Fi standards include 802.11a, 802.11b, 802.11g, 802.11n, 802.11ac, and 802.11ax (Wi-Fi 6).
Link Layer Switches & Bridges
Link layer switches and bridges are network devices used to connect multiple devices within a LAN and forward data frames
between them.
They operate at the data link layer of the OSI model and use MAC addresses to forward frames to their destination.
Bridges:
Connects multiple LAN segments or network segments together and forwards frames between them based on MAC
addresses.
Bridges help reduce network collisions and improve network performance.
Switches:
Similar to bridges but with multiple ports, switches have the ability to learn MAC addresses by inspecting the source
address of incoming frames.
They build and maintain a MAC address table (also known as a forwarding table) to efficiently forward frames only to the
intended recipient, reducing network congestion and improving bandwidth utilization.
Network Layer
The network layer is a crucial part of the internet where data packets are routed between different devices.
Its primary job is to manage the addressing, routing, and forwarding of data packets across various networks.
Think of it as a post office sorting and directing letters to their destinations based on addresses.
Protocols like IP (Internet Protocol) operate at this layer, ensuring that data travels efficiently and securely across different
The Point-to-point networks, also referred to as point-to-point connections or links, are a type of network topology where two
devices are directly connected to each other through a dedicated communication link.
In a point-to-point network:
Two Devices: There are only two devices involved: a sender (source) and a receiver (destination).
Dedicated Link: The communication link between the sender and receiver is dedicated exclusively to their communication,
Physical Connection: The physical connection between the sender and receiver can take various forms, including wired
connections (e.g., Ethernet, serial connections) or wireless connections (e.g., point-to-point microwave links).
Simple Configuration: Point-to-point networks are relatively simple to configure and manage compared to other network
IPv4, or Internet Protocol version 4, is a foundational protocol in computer networking that facilitates communication between
It provides the addressing and routing mechanisms necessary for data transmission.
These addresses are represented in dotted-decimal notation (e.g., 192.168.0.1) and consist of a network portion and a host
portion.
IPv4 uses routing tables maintained by routers to determine the optimal path for forwarding packets between networks.
IPv4 faces challenges due to its limited address space, allowing for approximately 4.3 billion unique addresses.
IPv6
It is designed to address the limitations of IPv4, particularly the scarcity of available IP addresses.
These addresses are represented in hexadecimal notation (e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334) and provide
approximately 340 un-decillion unique addresses, ensuring an abundance of addresses for future growth.
Routing
Routing refers to the process of determining the optimal path for data packets to travel from a source device to a destination
In other words, it is the process of selecting a path in a network along which to send network traffic.
It involves making decisions about the network segment to forward packets towards their final destination.
It is performed for many kinds of networks, including telephone networks, and electronic data networks like the Internet and
Transportation Networks.
Routing is mainly concerned with electronic data networks using packet-switching technology.
Routing directs forward the logically addressed packets from their source to their destination via intermediate nodes in packet
switching networks.
Forwarding & Delivery Process
In computer networks, forwarding and delivery are two essential processes involved in routing packets from a source device to a
destination device:
1. Forwarding:
Forwarding refers to the process of passing packets from one network interface to another within the same router or network
device.
When a router receives an incoming packet, it examines the packet's destination IP address and consults its routing table to
determine the appropriate outbound interface or next-hop router for forwarding the packet towards its destination.
Forwarding involves making decisions at the data link layer (Layer 2) based on the destination MAC address in the packet's
Ethernet frame.
2. Delivery:
Delivery, on the other hand, refers to the ultimate receipt of packets by the destination device.
Once a packet is forwarded to the correct network segment or next-hop router, it traverses through the network until it reaches
the destination device.
The final delivery of the packet involves the process of receiving and processing the packet at the destination's network interface.
This process typically occurs at the data link layer (Layer 2) of the OSI model, where the destination device extracts the packet's
payload and processes the data contained within.
Routing Algorithms & Protocols
Routing algorithms are algorithms used by routers to determine the best path for forwarding packets from a source to a
destination across interconnected networks.
These algorithms calculate the optimal route based on various factors such as network topology, link cost, and routing metrics.
Different routing algorithms employ different strategies for route calculation and packet forwarding.
Advantages of Flooding:
It requires no network information.
It is highly robust.
This property finds applications in the military where the robustness of flooding is very much desirable.
It is also useful in distributed databases where it is necessary to update the database concurrently.
Disadvantages of Flooding:
The total traffic load that this technique generates is directly proportional to the connectivity of the network.
Flooding requires much large bandwidth.
Flow-Based Routing Algorithm
Flow-based routing algorithm is a method used to manage the flow of data packets based on specific criteria such as available
bandwidth, congestion levels, or quality of service requirements.
Think of it like managing traffic on a highway, Different vehicles have different needs and priorities - some may require faster lanes,
some may need to avoid congested areas, and some may have special requirements like wider lanes.
Flow-based routing algorithm works similarly by directing data packets along paths that best suit their needs.
In this algorithm, routers or switches make routing decisions based on the current state of the network and the requirements of
the data packets.
They consider factors like the available bandwidth on different paths, the delay along each route, and any constraints imposed by
network policies.
For example, if a data packet requires high bandwidth and low latency, the router may choose a path with minimal congestion and
the highest available bandwidth.
Alternatively, if the packet requires a secure connection, the router may prioritize paths with encryption capabilities.
Flow-based routing algorithms aim to optimize the performance and efficiency of data transmission in computer networks by
dynamically adapting routing decisions to the changing conditions of the network and the specific needs of the data packets.
Distance Vector Routing Algorithm
It is the type of routing protocol that was originally used on the internet.
In distance vector routing, each router periodically shares its knowledge about the entire network with its neighbors.
In this routing, each router maintains a routing table containing one entry for each router in the subnet.
A route using a distance vector routing protocol does not know the entire path to a destination network.
Advantages of Distance Vector Routing:
Simple and efficient in small networks.
The algorithm required to calculate routing tables from the routing information received from other routers is simple.
Simple implementation and maintenance.
Low resource requirements.
Disadvantages of Distance Vector Routing:
Slow Convergence.
Limited Scalability.
Routing Loops.
Heavy Administrative Burden.
Link State Routing Algorithm
It is more robust and used more widely in larger networks.
Link State Routing Protocols can transmit routing information to all other routers running the same protocol, not just directly
connected neighbors.
The Link State Routing is simple and each router performs the following functions:
Discover its neighbors and obtain their network addresses.
Measures the delay or cost to each of its neighbors.
Construct a packet containing the network addresses and the cost/delay of all the neighbors.
Send this packet to all other routers.
Compute the shortest path to every other router & Dijkstra’s algorithm is used for this purpose.
Advantages of Link State Routing:
Link State Routing reacts more quickly, and in a bounded amount of time, to connectivity changes.
Low network overhead.
Low convergence time.
The ability to scale to large and very large networks.
Changes in topology can be sent out immediately, so convergence can be quicker.
Disadvantages of Link State Routing:
More complex and difficult to configure.
Requires additional memory to create and maintain the link state database.
Requires more CPU processing than distance vector routing protocol.
Requires more storage and more computing to run.
Hierarchical Routing Algorithm
It is a technique commonly used while building large networks.
As a network grows, the resource requirements for the network’s management and control functions also grow.
With the increase in the growth of the network size, the size of the routing table also increases and the router can’t handle
network traffic as efficiently.
In Hierarchical Routing, the network is divided into regions and every router maintains the details of those routers which are
present in the same region.
It does not know anything about the internal structure of other regions.
Routers just save one record in their table for every other region.
Hierarchical Routing is a natural way for routing to scale size, network administration, and governance.
It is important because the internet is an interconnection of unequal networks.
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.
Every autonomous system has an autonomous system number (ASN) that it receives by registering with the Internet Assigned
Numbers Authority.
Congestion
Congestion:
Rushing too many packets to a node or a part of the network may sometimes affect the network.
The network performance may degrade because of this.
Such a situation is called Congestion.
Congestion in a network may occur if the load on the network is greater than the capacity of the network.
Congestion Control:
It refers to the mechanisms and techniques to control the congestion and keep the load below the capacity.