0% found this document useful (0 votes)
7 views23 pages

TCP Flow and Congestion Control Explained

The document provides an in-depth explanation of the Transmission Control Protocol (TCP) and its mechanisms for flow control and congestion control, emphasizing the adaptive sliding window technique and the importance of managing data transmission rates to prevent network overload. It also discusses the Address Resolution Protocol (ARP) and Reverse Address Resolution Protocol (RARP), which facilitate the mapping between IP addresses and MAC addresses, essential for data transmission in networks. Finally, it touches on the Internet Protocol (IP), specifically IPv4 and IPv6, detailing their addressing structures and functions within the network layer.

Uploaded by

vishalakashhh123
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)
7 views23 pages

TCP Flow and Congestion Control Explained

The document provides an in-depth explanation of the Transmission Control Protocol (TCP) and its mechanisms for flow control and congestion control, emphasizing the adaptive sliding window technique and the importance of managing data transmission rates to prevent network overload. It also discusses the Address Resolution Protocol (ARP) and Reverse Address Resolution Protocol (RARP), which facilitate the mapping between IP addresses and MAC addresses, essential for data transmission in networks. Finally, it touches on the Internet Protocol (IP), specifically IPv4 and IPv6, detailing their addressing structures and functions within the network layer.

Uploaded by

vishalakashhh123
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

1) SIMPLE EXPLANATION (Very easy)

TCP uses a smart version of the sliding-window idea so sender and receiver stay in sync and the
network is not overloaded.

 The receiver tells the sender how much buffer it has (the Advertised Window). The sender
never keeps more unacknowledged bytes than that.

 The sender keeps bytes in a send buffer (acknowledged, unacknowledged, and not-yet-sent).
The receiver keeps bytes in a receive buffer so it can handle out-of-order arrival.

 TCP also has congestion control (slow start, AIMD, fast retransmit/recovery) and congestion-
avoidance helpers like DEC bit and RED.

The Transmission Control Protocol (TCP) is a reliable, connection-oriented, byte-stream protocol


operating at the transport layer, responsible for providing full transport layer services to applications.
As a critical function of the transport layer, TCP implements mechanisms for both Flow control and
Congestion control.

1. TCP Flow Control

Flow control is the mechanism that manages the rate of data transmission between two nodes to
prevent a fast sender from overwhelming a slow receiver. In TCP, flow control is performed end-to-
end rather than across a single link.

Mechanism: Adaptive Sliding Window

TCP employs an adaptive flow control mechanism, which is a variant of the sliding window
technique. This mechanism guarantees the reliable and ordered delivery of data and enforces flow
control at the sender.

The flow control is primarily driven by the receiver limiting how much data the sender can transmit
at a given time:

1. Advertised Window (AdvertisedWindow): The receiver informs the sender about its current
available buffer space by using the AdvertisedWindow field in the TCP header. The sender is
prohibited from having unacknowledged data greater than this advertised window size.

2. Send Buffer: The sending TCP maintains a send buffer containing acknowledged data,
unacknowledged data, and data waiting to be transmitted. To prevent overflowing its
maximum size (MaxSendBuffer), the sender ensures that the amount of data written but not
yet acknowledged is limited by the constraint: LastByteWritten − LastByteAcked ≤
MaxSendBuffer.

3. Receive Buffer: The receiving TCP uses a receive buffer to hold incoming data, even if
segments arrive out-of-order. To prevent overflow of its maximum size (MaxRcvBuffer), the
receiver ensures the constraint: LastByteRcvd − LastByteRead ≤ MaxRcvBuffer. Data cannot
be read by the application until that byte and all preceding bytes have been received.

Preventing Low Efficiency


Two related problems concerning inefficient transmission of small segments are addressed in TCP
flow control:

 Silly Window Syndrome (SWS): This issue arises when either the sending application
produces data slowly (e.g., 1 byte at a time) or the receiving application consumes data
slowly, resulting in the transmission of many very small segments. This greatly reduces
operational efficiency. The solution involves forcing the sending TCP to wait and collect
enough data to send in a larger block, preventing byte-by-byte transmission.

 Nagle’s Algorithm: This algorithm was introduced to solve the problem of sending small
segments, often related to SWS. It suggests introducing a timer and transmitting available
data only when the timer expires, or a sufficiently large segment (Maximum Segment Size,
MSS) is available, balancing delay with efficiency.

2. TCP Congestion Control

Congestion in a network occurs when the load (the number of packets sent) exceeds the capacity of
the network. When load exceeds capacity, routers start discarding packets as queues become full,
and throughput sharply declines. Congestion control mechanisms prevent the sender from
overloading the network and are concerned with how the host and network interact.

TCP employs a specific variable, the Congestion Window (CongestionWindow), for each connection
to manage the rate of transmission based on perceived network congestion.

The main congestion control mechanisms implemented by TCP are:

A. Additive Increase / Multiplicative Decrease (AIMD)

AIMD is a core mechanism used to adjust the CongestionWindow based on network feedback.

 Multiplicative Decrease: TCP interprets timeouts (lack of acknowledgement) as a sign of


congestion and reduces the transmission rate. On a timeout, the source reduces its
CongestionWindow by half (e.g., from 16 packets to 8 packets).

 Additive Increase: When an Acknowledgment (ACK) arrives, indicating successful


transmission, the CongestionWindow is incremented marginally. The increment is calculated
as Increment = MSS × (MSS / CongestionWindow).

 The continuous increase and decrease of the CongestionWindow over the lifetime of a
connection results in a distinctive saw-tooth pattern when plotted against time.

B. Slow Start

Slow start is used to increase the CongestionWindow exponentially when a connection begins ("cold
start").

1. The source TCP initially sets CongestionWindow to one packet.

2. On successful transmission, TCP doubles the number of packets sent every Round Trip Time
(RTT). For instance, after the first ACK arrives, the CongestionWindow is incremented by 1,
and two packets are sent. When two ACKs arrive, the CongestionWindow increases by 2, and
four packets are sent, and so on.
3. Because TCP starts with no prior knowledge of network capacity, it increases the
CongestionWindow rapidly until a timeout occurs.

4. Upon a timeout, a Congestion Threshold is set to half the current CongestionWindow, and
the CongestionWindow is reset to 1. Slow start then repeats until the CongestionWindow
reaches this threshold, after which the process reverts to an additive increase pattern.

C. Fast Retransmit and Fast Recovery

These heuristics address situations where a lost packet is detected before a full timer expiration,
thereby avoiding the costly full slow start process.

 Fast Retransmit: When a packet arrives out of order, the receiving TCP resends the same
acknowledgment (a duplicate ACK) it previously sent. If the sender receives three duplicate
ACKs, it infers that the corresponding packet is lost due to congestion and immediately
retransmits that packet without waiting for the regular timeout.

 Fast Recovery: When packet loss is detected via fast retransmit, the connection avoids the
initial slow start phase. Instead of setting the CongestionWindow to one packet, the method
immediately transitions to the AIMD (additive increase/multiplicative decrease) pattern,
using the ACKs already "in the pipe" to clock the sending of new packets. Slow start is
reserved only for the very beginning of a connection or following a regular timeout.

Congestion-avoidance helpers (router assistance)

 DECbit: routers set a congestion bit in packet headers when average queue length crosses a
threshold; the destination copies that bit into ACKs, and the source adjusts its sending rate
based on the fraction of ACKs with DECbit set. If ≥50% of ACKs show congestion, reduce
sending rate; otherwise increase.

 RED (Random Early Detection): routers probabilistically drop/mark packets before queues fill
to give early signals to TCP senders to slow down (described in your notes as a queue-based
avoidance technique).

To solidify the understanding of flow control and congestion control in TCP:

Flow control in TCP acts like a water dam at the receiver, ensuring incoming data (the water flow)
never exceeds the reservoir capacity (the receive buffer), preventing the system from being
overwhelmed. Meanwhile, Congestion control acts like a traffic light system distributed across the
network, automatically regulating the speed of the sender (source of traffic) based on real-time
feedback (timeouts or duplicate ACKs) about road conditions (network capacity) to prevent gridlock.

KEY POINTS: TCP FLOW CONTROL

1. Purpose

 Prevents a fast sender from overwhelming a slow receiver.

 Works end-to-end, not link by link.

2. Mechanism
 Uses an adaptive sliding window.

 Receiver advertises its buffer space using AdvertisedWindow.

 Sender cannot send more unacknowledged data than this window.

3. Buffers

 Send Buffer: Stores sent but unacknowledged data and data waiting to be sent.
Condition: LastByteWritten − LastByteAcked ≤ MaxSendBuffer

 Receive Buffer: Stores incoming data (even out of order).


Condition: LastByteRcvd − LastByteRead ≤ MaxRcvBuffer

4. Efficiency Problems++++

Silly Window Syndrome (SWS):


Sending or receiving tiny segments reduces efficiency.

Fix: Wait and send data in bigger chunks.

Nagle’s Algorithm:
Send small data only if no previous unacknowledged data exists. Otherwise wait and accumulate.

KEY POINTS: TCP CONGESTION CONTROL

1. Purpose

 Prevents overloading the network, not the receiver.

 Uses Congestion Window (cwnd) for each connection.

A. AIMD (Additive Increase, Multiplicative Decrease)

 Timeout / Loss → Multiplicative Decrease:


cwnd is cut in half.

 Successful ACKs → Additive Increase:


cwnd increases slowly each RTT.

 Produces a saw-tooth pattern.

B. Slow Start

 Starts with cwnd = 1 packet.

 cwnd doubles every RTT (exponential growth).

 Stops when:

o Timeout occurs, or

o cwnd reaches ssthresh (congestion threshold).


 After threshold, switches to additive increase.

C. Fast Retransmit and Fast Recovery

Fast Retransmit

 On 3 duplicate ACKs, sender assumes packet loss.

 Immediately retransmits without waiting for timeout.

Fast Recovery

 Avoids going back to cwnd = 1.

 Reduces cwnd moderately and continues with AIMD.

The Address Resolution Protocol (ARP) and the Reverse Address Resolution Protocol (RARP) are
crucial protocols operating within the Network Layer (Unit III) of the TCP/IP suite. Their primary
function is to facilitate the necessary address mapping between the logical addressing system (IP
addresses) used by applications and the physical addressing system (MAC addresses) required for
actual data transmission over a network.

I. Address Resolution Protocol (ARP)

ARP is the protocol responsible for converting a 32-bit IP address (Logical address) into a 48-bit MAC
Address (Physical address). Since computer programs use logical addresses, but actual
communication occurs over physical addresses, both are required to send a datagram over a
network.

ARP Operational Mechanism

ARP enables each host to dynamically build and maintain a table that maps IP addresses to their
corresponding physical addresses, known as the ARP cache table. ARP is fundamentally a request
and response protocol that relies on broadcast support from physical networks.

The steps for ARP operation are as follows:

1. Cache Check: Before a host (System A) attempts to send an IP datagram, it first checks its
ARP cache table for the required IP-to-MAC address mapping.

2. ARP Query Broadcast: If the mapping is not found, System A invokes the Address Resolution
Protocol by broadcasting an ARP query onto the network. This query contains the target IP
address (e.g., System B’s IP address).

3. Host Reception and Update: Every host on the network receives the broadcast query and
checks if the target IP address matches its own. All nodes except the destination update their
own ARP table based on the source information in the query, and then discard the packet.

4. ARP Response Unicast: The destination host (System B), upon recognizing its IP address,
constructs an ARP Response packet. This response contains System B’s link-layer address
(MAC Address) and is unicast (sent directly) back to the originator (System A).
5. Cache Update: System A receives the ARP Response and stores the target Logical and
Physical address pair in its ARP table.

6. Router Intervention: If the target node does not exist on the same local network, the ARP
request is sent to the default router instead.

ARP Message Format (Types)

ARP messages are divided into two essential types that facilitate the mapping:

1. ARP Request: Sent as a broadcast message containing the target IP address, asking for the
corresponding physical address.

2. ARP Reply: Sent as a unicast message from the target host, containing its physical (MAC)
address.

II. Reverse Address Resolution Protocol (RARP)

RARP is the inverse of ARP, designed to solve the opposite problem of address mapping.

RARP Function and Purpose

The primary function of RARP is to allow a host to convert its MAC address (Physical address) into
the corresponding IP address (Logical address).

RARP is typically used by diskless workstations or devices that know their own physical address
(burned into their Network Interface Card by the manufacturer) but need to acquire their necessary
network layer address (IP address) upon booting up, usually from a dedicated RARP server on the
network.

ARP and RARP, though distinct in their direction of mapping, are both fundamental to networking
because they link the logical structure of the internetwork with the physical reality of the underlying
data links.

Here is the ELI5 (explain like I’m 5) version. Super simple.

ARP (Address Resolution Protocol) – ELI5

Imagine you want to give a toy to your friend in school, but you only know their name, not their
classroom number.

Your friend’s name = IP address


Your friend’s classroom number = MAC address

To deliver the toy, you must know the classroom.

How ARP works:

1. You first check your notebook to see if you already wrote your friend’s name and classroom.
(This is the ARP cache.)
2. If you don’t find it, you shout in the school hall:
“Who is Rahul? Which classroom are you in?”
(This is the ARP Request broadcast.)

3. Every kid hears your shout. Only Rahul answers.


(All computers hear the broadcast, only the right one responds.)

4. Rahul walks to you and quietly tells you his classroom number.
(This is the unicast ARP Reply.)

5. You write it in your notebook so you don’t have to shout again.


(Cache update.)

That’s ARP.

RARP (Reverse Address Resolution Protocol) – ELI5

Now imagine a kid who knows their classroom number, but doesn’t know their name on the
attendance sheet.

They ask the teacher:

“Teacher, this is my classroom number. What’s my name on the list?”

Teacher looks it up and tells them.

That is RARP.

In computer terms:

 Computer knows its MAC address (like its classroom number).

 It asks a server, “What is my IP address?”

 Server tells it the correct IP.

Super short summary

ARP:
“I know your name. Tell me your home.”
(IP → MAC)

RARP:
“I know my home. Tell me my name.”
(MAC → IP)

The Internet Protocol (IP) operates within the Network Layer (also called the Internet Layer in the
TCP/IP model) and is the key protocol used to build scalable, heterogeneous internetworks. The
functions of the network layer include logical addressing, routing, and forwarding of packets from
source to destination. The two primary versions of the Internet Protocol addressed in networking
curricula are IPv4 and IPv6.
IPv4 (Internet Protocol Version 4)

IPv4 is the fourth version of the Internet Protocol and was the first version of the protocol to be
widely deployed.

Addressing and Structure

1. Address Size and Space: An IPv4 address is a 32-bit address that uniquely and universally
defines a connection to the Internet. The total address space is $2^{32}$, or 4,294,967,296
(more than four billion) devices.

2. Notation: IPv4 addresses are commonly displayed using dotted-decimal notation (base 256),
where decimal points separate the four bytes (octets).

3. Hierarchy: An IPv4 address is hierarchical, divided into two parts: the prefix (Net ID) which
defines the network, and the suffix (Host ID) which defines the node.

4. Addressing Schemes: IPv4 originally used Classful Addressing (Class A, B, C, D, E) which


relied on a fixed-length prefix. However, this scheme became obsolete due to address
depletion and inefficient distribution, resulting in many addresses being unused. To address
this, Classless Addressing was introduced, utilizing variable-length blocks and variable prefix
lengths (ranging from 0 to 32), often referred to as CIDR (Classless Interdomain Routing).

5. Special Addresses: IPv4 defines special addresses for specific purposes, including the
limited-broadcast address ([Link]/32) and the loopback address (block
[Link]/8).

IPv6 (Internet Protocol Version 6)

IPv6 is the next generation IP, evolved specifically to solve the address space problem caused by IPv4
depletion, while also offering a richer set of services.

Addressing and Notation

1. Address Size and Space: IPv6 provides a massive 128-bit address space, allowing it to handle
up to $2^{128}$ nodes.

2. Addressing Scheme: IPv6 uses classless addressing where classification is based on the Most
Significant Bits (MSBs).

3. Notation: The standard representation uses eight groups of 16-bit hexadecimal addresses
separated by colons (x : x : x : x : x : x : x : x). To conserve space, IPv6 allows discarding leading
zeros and replacing consecutive sections of zeros with a double colon (::).

4. Address Aggregation: IPv6 supports address aggregation by assigning prefixes at the


continental level, which helps to reduce the burden on routers by consolidating routing
information.

Key Features and Header Format

IPv6 features a restructured header format to enhance performance and functionality compared to
IPv4:

1. Header Structure: The IPv6 base header is 40 bytes long. It uses a new header format where
options are separated from the base header and inserted as Extension Headers between the
base header and the data payload. This design simplifies routing because routers generally
do not need to check most options.

2. Extension and Flexibility: IPv6 allows for extensions, ensuring the protocol can be adapted
for new technologies. It provides greater functionality through its six extension headers.

3. Resource Allocation: Unlike IPv4, IPv6 natively supports resource allocation (Quality of
Service) through two new fields: Traffic Class and Flow Label. These fields enable the source
to request special handling for packets, supporting traffic types like real-time audio and
video.

4. Fragmentation: In IPv6, only the source host can fragment packets. The source typically uses
a path MTU discovery technique to determine the smallest MTU along the path.

5. Autoconfiguration and Security: IPv6 supports autoconfiguration (plug and play), allowing
hosts to automatically configure their IP addresses without needing a DHCP server.
Furthermore, IPv6 incorporates enhanced security features, providing encryption and
authentication options for confidentiality and integrity.

Here are the key points from your IPv4 and IPv6 explanation. Clean, crisp, and exam-ready.

KEY POINTS: IPv4

Addressing

 IPv4 uses a 32-bit address.

 Total space: 4.29 billion addresses (2³²).

 Written in dotted-decimal notation (e.g., [Link]).

Structure

 Address is split into:

o Prefix / Net ID – identifies network

o Suffix / Host ID – identifies device

Addressing Methods

 Classful Addressing: Classes A, B, C, D, E (now obsolete).

 Classless Addressing (CIDR): Variable prefix length, efficient allocation.

Special IPv4 Addresses

 [Link] – limited broadcast

 [Link]/8 – loopback

KEY POINTS: IPv6

Addressing
 IPv6 uses a 128-bit address.

 Supports 2¹²⁸ unique addresses (almost unlimited).

Notation

 Written as eight 16-bit hexadecimal blocks.

 Leading zeros can be removed.

 Long zero sequences can be replaced with ::.

Design and Features

 Uses classless addressing (based on MSBs).

 Supports address aggregation for routing efficiency.

 Fixed 40-byte base header → faster processing.

 Extension headers provide flexibility and cleaner options handling.

Quality of Service

 Includes Traffic Class and Flow Label fields for special handling (audio, video).

Fragmentation

 Only the source host can fragment packets.

 Uses Path MTU discovery.

Autoconfiguration & Security

 Supports stateless autoconfiguration (plug and play).

 Provides built-in encryption and authentication options.

Based on the sources, both the Dynamic Host Configuration Protocol (DHCP) and the Internet Control
Message Protocol (ICMP) are essential protocols operating at the Network Layer (Unit III) of the
TCP/IP protocol suite.

Here is an overview of DHCP and ICMP:

1. Dynamic Host Configuration Protocol (DHCP)

DHCP is used to simplify the installation and maintenance of networked computers. It addresses the
need for hosts to acquire configuration information, particularly unique IP addresses, automatically
when connecting to a network.

Purpose and Operation

1. Goal: The main goal of DHCP is to minimize the amount of manual configuration required
for a host. When a new computer is connected to a network, DHCP can provide it with all the
necessary information for full system integration.
2. Client/Server Model: DHCP operates based on a client/server model. DHCP clients send a
request to a DHCP server, which then responds with an IP address.

3. DHCP Server Role: The DHCP server is responsible for providing configuration information to
hosts. There must be at least one DHCP server for an administrative domain. This server
maintains a pool of available addresses that it hands out to hosts on demand.

4. Discovery Process:

o A newly booted or attached host sends a DHCPDISCOVER message to the IP


broadcast address ([Link]). This message is received by all hosts and
routers on that network.

o DHCP uses the concept of a relay agent, where at least one exists on each network.
The relay agent, configured with the IP address of the DHCP server, receives the
broadcast DHCPDISCOVER message and unicasts it to the DHCP server.

5. Message Transport: DHCP packets are sent using the User Datagram Protocol (UDP).

Importance

Since IP addresses must be unique on a given internetwork and reflect its structure, relying solely on
manual configuration has drawbacks, such as excessive work in large networks and the risk of two
hosts receiving the same IP address. Automated configuration via DHCP solves these issues.

2. Internet Control Message Protocol (ICMP)

ICMP is a network-layer protocol that serves as a companion to the IP protocol. It defines a


collection of error messages sent back to the source host whenever a router or host cannot
successfully process an IP datagram.

ICMP Message Categories

ICMP messages are divided into two main categories: error-reporting messages and query
messages.

A. Error-Reporting Messages

These messages report problems encountered by a router or destination host when processing an IP
packet.

 Destination Unreachable: Sent when a router cannot route a datagram, causing the
datagram to be discarded.

 Source Quench: Sent to the source host when a router or host discards a datagram due to
congestion. This message acts as flow control.

 Time Exceeded: Sent to the source host when a router discards a datagram because the
Time to Live (TTL) field has reached 0.

 Parameter Problem: Sent to the source if a router finds an ambiguous or missing value in any
field of the datagram, causing it to discard the datagram.
 Redirection: Sent by the default router to inform the source host to update its forwarding
table if the packet was routed on a wrong path.

B. Query Messages

These messages help a host or network manager obtain specific information from a router or
another host.

 Echo Request & Reply: Used in combination to determine whether two systems can
communicate.

 Timestamp Request & Reply: Used by two machines to determine the Round-Trip Time
(RTT).

 Address Mask Request & Reply: Used by a host to obtain its subnet mask from a router.

 Router Solicitation/Advertisement: A host broadcasts a solicitation message to learn about a


router, which responds with an advertisement message containing its routing information.

ICMP Debugging Tools

ICMP is the foundation for several essential network debugging tools:

 Ping: Uses ICMP echo-request messages to determine if a host is alive and responding, and
calculates the round-trip time (RTT) by embedding the sending time in the data section.

 Traceroute (or Tracert): Used to trace the path of a packet from source to destination,
finding the IP addresses of all routers visited along the path.

ICMP Message Format

An ICMP message includes an 8-byte header and a variable-size data section. Key fields in the header
include:

 Type: Defines the message type.

 Code: Specifies the reason for the particular message type.

 Checksum: Used for error detection.

 Identifier and Sequence Number: Used to match the request with the reply.

To think of the relationship between DHCP and ICMP, consider a large office building (the network):

DHCP acts like the Building Manager who assigns each new occupant (host) a unique office number
(IP address) automatically upon arrival, ensuring no two people claim the same space and that their
mail can be correctly routed within the building.

ICMP acts like the Building's Communication System used for status reports and troubleshooting. If
an important document (datagram) fails to reach a specific office, ICMP sends a notification back to
the sender explaining why (e.g., "Destination Unreachable"). It also allows maintenance staff
(network managers) to check if an office is responding (Ping) or trace the route of an elevator
(Traceroute).
The Border Gateway Protocol (BGP) is a critical routing protocol operating in the Network Layer (Unit
IV: Routing) of the TCP/IP suite. It is fundamentally associated with inter-domain routing, which
concerns the forwarding of packets between large, independent networks.

Classification and Core Function

BGP4 (Border Gateway Protocol Version 4) is the only interdomain routing protocol used in the
Internet today.

 Algorithm Class: BGP is based on the Path-vector routing algorithm. Path-vector routing is
an asynchronous and distributed routing algorithm primarily designed to route packets
between Internet Service Providers (ISPs).

 Routing Goal: Unlike distance vector or link state algorithms which seek the lowest-cost
path, path-vector routing is not based on least-cost routing. Instead, the best route is
determined by the source applying policies to the available paths, allowing the source to
control the path taken.

Internet Structure and BGP Operation

BGP views the entire Internet as a collection of Autonomous Systems (AS) interconnected arbitrarily.

1. Autonomous Systems (AS): The internet is seen as a set of interconnected AS. Each AS
contains a border router (gateway) through which packets enter and leave that AS.

2. BGP Speakers: One router within each autonomous system is designated as the BGP
speaker. These BGP speakers exchange reachability information with other BGP speakers via
an external BGP session.

3. Path Advertising (Path Vector): BGP advertises network reachability information by


providing the complete path needed to reach a particular network. This path is given as an
enumerated list of AS.

o A path must be without any loop. This loop prevention is inherent because the AS
list in the path vector must be unique.

o For example, a backbone network might advertise that network 128.96 can be
reached along the path <AS1, AS2, AS4>.

4. Route Selection (Policy-Based): If a BGP speaker finds multiple routes available to a


destination, it chooses the preferred route based on policy. Speakers are not obligated to
advertise every route they know, even if one exists.

5. Route Maintenance:

o If a link or node along an advertised path fails, BGP sends a negative advertisement
known as a withdrawn route to cancel the path.

o If there is no change in routing information, BGP speakers send keep alive messages
instead of repeatedly sending full route updates.

Interior BGP (iBGP)

Once a BGP speaker learns routing information (prefixes and paths) from other external BGP
speakers, it needs to share this information with the routers inside its own autonomous system. This
task is handled by interior BGP (iBGP). The purpose of iBGP is to ensure that every router within the
AS is able to determine the appropriate next hop for all prefixes known externally.

The Distance Vector Multicast Routing Protocol (DVMRP) is a significant protocol within the
Network Layer (Unit IV: Routing), specifically categorized under Multicast Routing.

DVMRP is designed to facilitate the transportation of IP multicast packets among networks and
historically formed the basis of the Internet's multicast backbone. It is an extension of distance
vector routing tailored to support multicast routing.

1. Core Characteristics and Structure

1. Multicast Routing Protocol: DVMRP is one of the major multicast routing protocols,
alongside Protocol Independent Multicast (PIM).

2. Source-Based Trees: DVMRP is associated with the construction of Source-Based Trees for
multicast distribution. For each combination of (source, group), this involves creating a
shortest path spanning tree.

3. Components: DVMRP consists of two major components: a conventional distance-vector


routing protocol (like RIP) and a dedicated protocol for determining how to forward
multicast packets based on the routing table.

4. Flood-and-Prune Protocol: DVMRP is widely known as the flood-and-prune protocol.

2. DVMRP Operational Mechanism (Flood-and-Prune)

The basic multicast logic within DVMRP involves incrementally adding multicasting capabilities to
distance-vector routing through four defined stages:

A. Flooding

In the initial stage, a router that receives a multicast packet from a source ($S$) forwards the packet
on all outgoing links. The drawback of simple flooding is that it transmits packets throughout the
network, even to networks that have no members for that specific group, and can lead to duplicate
flooding.

B. Reverse Path Forwarding (RPF)

RPF is introduced to eliminate the problem of looping that occurs during flooding. The RPF
mechanism ensures that a router only forwards a multicast packet if the packet arrived from the
specific interface that provides the shortest path from the source to the router. If the packet arrives
on any other path, it is discarded. This eliminates looping but does not fully optimize transmission
efficiency.

C. Reverse-Path Broadcasting (RPB)

RPB builds upon RPF to guarantee that each destination receives one and only one copy of the
packet by creating a shortest path broadcast tree from the source to each destination.

To prevent a network from receiving multiple copies of a packet when connected to more than one
router, RPB designates one router as the parent (called the Designated Router, or DR). Only the
parent router forwards multicast packets from the source $S$ to the attached network; any other
router receiving the multicast packet that is not the parent simply drops the packet.
D. Reverse-Path Multicasting (RPM)

RPM is the final stage that adds efficiency by ensuring the multicast packet reaches only those
networks that have active members for the specific group. It achieves this by adding two dynamic
features to RPB: pruning and grafting.

1. Pruning: Routers that receive multicast traffic but have no active group members send a "prune"
message. This prunes the distribution tree and stops needless data from being sent to those
branches.

2. Grafting: Grafting is used to reinstate a pruned branch. A router sends a "graft" message if a host
within its network joins a multicast group. This message travels router-to-router until it reaches
a router that is currently active on the multicast group, thereby restoring the necessary path.

Packet Forwarding in DVMRP

A DVMRP router forwards a packet only if the packet arrived from the link used to reach the source
of the packet and if downstream links have not pruned the tree.

Definition

 DVMRP is a multicast routing protocol based on distance vector routing and is known as a
flood-and-prune protocol.

 It formed the basis of the early Internet multicast backbone.

Core Features

 Builds source-based trees for each (source, group) pair.

 Uses path-vector/distance-vector logic for multicast forwarding.

 Operates using flooding, RPF, RPB, and RPM stages.

Stages of DVMRP Operation

1. Flooding

o Forward multicast packets on all outgoing links.

o Causes duplicates and wastes bandwidth.

2. RPF (Reverse Path Forwarding)

o Forward packet only if it arrived on the interface that is on the shortest path to the
source.

o Prevents loops.

3. RPB (Reverse Path Broadcasting)

o Ensures each destination receives exactly one copy.

o Uses a designated router (parent router) per LAN.

4. RPM (Reverse Path Multicasting)

o Adds pruning (stop sending to unwanted networks).


o Adds grafting (restore traffic when new member joins).

o Produces an efficient multicast distribution tree.

Packet Forwarding Rule

 A DVMRP router forwards packets only if:

1. The packet arrives on the RPF interface (correct path from source).

2. The downstream links are not pruned.

The OSI Model (Open System Interconnection) is a foundational reference model that describes how
information moves from a software application in one computer through a physical medium to an
application in another computer.

Developed by the International Organization for Standardization (ISO) in 1984, the OSI model is
considered an architectural model for inter-computer communications. Its core principle is protocol
layering, which divides the complex communication task into seven smaller and manageable tasks,
with each layer assigned a particular task that can be performed independently.

Structure and Functions of the Seven OSI Layers

The OSI model consists of seven layers. The structure and function of these layers are as follows,
moving from the physical connection up to the user interface:

1. Physical Layer

The Physical Layer coordinates the functions required to transmit a bit stream over a physical
medium.

 Functions: Defines the physical characteristics of interfaces and media, the representation
of bits (encoding), the Data Rate or Transmission rate (number of bits sent per second),
Synchronization of bits, Line Configuration (point-to-point or multipoint), and the
Transmission Mode (simplex, half-duplex, or full-duplex).

2. Data Link Layer

This layer is responsible for transmitting data units called frames from one node to the next node.

 Functions:

o Framing: Divides the stream of bits into data units called frames.

o Physical Addressing: Adds a header to the frame defining the sender and receiver if
frames are distributed across different systems on the network.

o Flow control: Imposes a mechanism to control the rate of data production by the
sender versus the rate of absorption by the receiver.

o Error control: Detects and retransmits damaged or lost frames and prevents
duplication, often achieved through a trailer added to the end of the frame.
o Medium Access Control: Determines which device controls the link at any given
time.

3. Network Layer

This layer is responsible for the delivery of packets from source to destination. It determines the
best path to move data based on network conditions and other factors.

 Functions:

o Logical addressing: Introduces an addressing system (logical address) required when


a packet passes the network boundary to identify the device on the internet.

o Routing: The major component, which determines the best optimal path out of
multiple available paths from source to destination.

4. Transport Layer

The Transport Layer is the fourth layer of the OSI model and is considered the first true end-to-end
layer, implemented in all End Systems (ES). It is responsible for Process-to-Process delivery (source-
to-destination delivery of the entire message) and ensuring the message arrives in order.

 Functions:

o Port addressing / Service Point addressing: The header includes an address to get
the entire message to the correct process on that computer.

o Segmentation and reassembly: The message is divided into segments, assigned


sequence numbers, and correctly arranged on the arrival side.

o Connection control: Can be connectionless (each segment is individual) or


connection-oriented (connection established and terminated).

o Flow control and Error control: Both are performed end-to-end rather than across a
single link.

5. Session Layer

This layer establishes, manages, and terminates connections between applications.

 Functions:

o Dialog control: Acts as a dialog controller, allowing communication between two


processes to be either half-duplex or full-duplex.

o Synchronization: Adds checkpoints during data transmission so that if an error


occurs, transmission can resume from the last checkpoint, aiding recovery.

6. Presentation Layer

It is concerned with the syntax and semantics of information exchanged between two systems.

 Functions:

o Translation: Responsible for interoperability between different computer encoding


systems, changing the message into a common format.
o Encryption and decryption: Sender transforms (encrypts) the original information,
and the receiver reverses the transformation (decrypts).

o Compression and expansion: Compression reduces the number of bits in the


information (especially text, audio, and video).

7. Application Layer

This layer enables the user to access the network.

 Functions: Handles issues such as network transparency and resource allocation. It provides
services such as FTAM (File Transfer, Access, Management), Mail services (email forwarding
and storage), and Directory services (accessing database information about resources).

Comparison with TCP/IP Model

The OSI model is a protocol-independent standard, whereas the TCP/IP model is a protocol-
dependent standard that was defined after the advent of the Internet. The TCP/IP architecture is a 4-
layer model that combines the functions of several OSI layers:

Here is a full 13-mark answer ONLY for “Flow Control Mechanism in the Data Link Layer”, written
clearly, exam-ready, and based strictly on your uploaded notes (meaning unchanged).

⭐ 13 MARK ANSWER

Flow Control Mechanism in the Data Link Layer

Flow control in the Data Link Layer is a set of procedures used to regulate the amount of data a
sender can transmit before receiving an acknowledgment. Since the receiving station has limited
processing speed and a limited buffer, it must be protected from being overwhelmed. The Data Link
Layer ensures that the sender transmits data at a rate the receiver can safely handle.

Flow control requires the presence of a buffer — a block of memory at the receiver used for
temporarily storing frames until they are processed. If the sender keeps transmitting without control,
the buffer may overflow, causing frame loss. To prevent this, the Data Link Layer uses structured flow
control mechanisms. The two main flow control methods are Stop-and-Wait and Sliding Window.

1. Stop-and-Wait Flow Control

Stop-and-Wait is the simplest type of flow control.

Working

 The sender transmits one frame at a time.

 After sending a frame, the sender waits for an acknowledgment (ACK) from the receiver.

 Only after receiving the ACK does the sender send the next frame.

This ensures that the receiver processes each frame before receiving the next one.

Limitations

Stop-and-Wait does not efficiently use the transmission medium, especially when:
 Propagation delay is high

 Frame size is small

Only one frame is on the link at any moment, leaving the channel underutilized.

Error Handling

Stop-and-Wait also helps with error control:

 If the sender does not receive an ACK within the timeout period, it assumes the frame or the
ACK was lost.

 The sender retransmits the frame.

 Retransmission occurs if the frame is damaged, the frame is lost, the ACK is lost, or the ACK is
delayed.

This ensures reliability even with a simple mechanism.

2. Sliding Window Flow Control

Sliding Window is a more efficient method that allows the sender to transmit multiple frames before
receiving an ACK.

Key Concepts

Sliding Window uses two imaginary windows:

1. Sender Window

2. Receiver Window

These windows control how many frames can be in transit at the same time.

Sender Window

 Holds a range of frame numbers that the sender is allowed to transmit.

 When a frame is sent, the window shrinks by one.

 When an ACK arrives, the window expands to include new frames to send.

Receiver Window

 Holds the range of frame numbers the receiver is prepared to accept.

 As a frame arrives, the window shrinks.

 After acknowledging, the window expands again.

Frame Numbering

Frames are numbered using modulo-n, with numbers from 0 to n-1.


The size of both windows is n − 1, meaning the sender can transmit up to n − 1 frames before waiting
for an ACK.

Acknowledgment
 The receiver sends an ACK containing the number of the next frame it expects.

 When the sender receives this ACK, it knows all frames up to that number minus one have
been received correctly.

This mechanism allows for continuous flow of frames and improved channel utilization.

3. Piggybacking

To increase efficiency, piggybacking is used when both stations have data to send.

How It Works

Instead of sending a separate ACK:

 When station A sends a data frame to station B,

 It includes an ACK for the frame that B sent earlier.

This combines data and acknowledgment into a single frame, reducing overhead and saving
bandwidth.

⭐ Summary (Exam Line)

Flow control in the Data Link Layer ensures that the sender does not overwhelm the receiver. Stop-
and-Wait provides simple control but is inefficient, while Sliding Window allows multiple frames in
transit for higher efficiency. Piggybacking further improves performance by combining
acknowledgments with outgoing data.

Below is your complete 13-mark answer ONLY for “Error Detection Techniques”, written using only
the content from your notes, with no outside points added, but made clear, structured, and exam-
ready.

⭐ 13 MARK ANSWER

ERROR DETECTION TECHNIQUES

Error detection is a major part of error control in the Data Link Layer. During data transmission, bits
can change due to noise or other impairments, resulting in single-bit errors or burst errors. To detect
these errors, additional bits are added to the data before transmission. At the receiver, these extra
bits help determine if the received data is correct or corrupted.

The primary error detection methods described in the notes are:


Parity Check, Cyclic Redundancy Check (CRC), and Internet Checksum.
Each technique helps the receiver identify whether the frame has been altered during transmission.

1. Parity Check
The parity check is the simplest and most widely used error detection method.

Mechanism

 A single bit, called the parity bit, is added to every data unit.

 The purpose is to make the total number of 1s in the data either even (even parity) or odd
(odd parity).

Example

If the data word is 1011 and even parity is used:

 There are three 1s → odd count

 A parity bit 1 is added to make the total number of 1s even.

 Transmitted pattern = 1011 1

Receiver Side

 The receiver counts the number of 1s.

 If the count matches the parity rule (even or odd), the data is accepted.

 If not, an error is detected.

Notes Highlighted

 Parity check is the least complex method.

 It can detect single-bit errors effectively but may not detect burst errors.

2. Cyclic Redundancy Check (CRC)

CRC is a highly reliable error detection method based on polynomial division.


It is effective at detecting burst errors and commonly used in real networks.

Concept

The sender and receiver both agree on a divisor polynomial ( C(x) ).


The data is treated as a polynomial ( M(x) ) in binary form.

Sender Side Steps

1. Let the data word be ( M(x) ) of k bits.

2. Let the divisor be ( C(x) ) of n+1 bits.

3. Append n zeros to ( M(x) ) → this forms the zero-extended message ( T(x) ).

4. Divide ( T(x) ) by ( C(x) ) using XOR operations.

5. The remainder of this division is the CRC value.

6. Append this remainder to ( M(x) ) to form the final codeword for transmission.

Receiver Side
 The receiver divides the received codeword by the same divisor.

 If the remainder = 0, no error is detected.

 If the remainder ≠ 0, an error has occurred.

Notes Highlighted

 CRC is “simple to implement”, “easy to analyze mathematically”, and “good at detecting


common transmission errors”.

3. Internet Checksum

The checksum is another method of detecting errors by performing arithmetic on the data.

Mechanism

 A checksum value is computed by the sender.

 The receiver performs the same calculation to check data integrity.

Example Protocol: UDP

The UDP protocol uses a checksum calculated over:

1. The UDP header

2. The data

3. A pseudoheader taken from the IP header


(contains fields like source and destination IP addresses, protocol number, and UDP length)

Error Handling

 If the checksum is incorrect, the receiver identifies an error.

 In UDP, the datagram is silently discarded without notifying the sender.

Notes Highlighted

 Checksum is used in network protocols to ensure data integrity.

 It detects errors but does not correct them.

⭐ Conclusion (Exam Sentence)

Parity Check, CRC, and Internet Checksum are the three key error detection techniques used in the
Data Link Layer. These techniques analyze data using extra bits, polynomial division, or arithmetic
checks to identify corrupted frames, ensuring that errors are detected before further processing.

If you want, I can also create:


✔ A 7-mark version
✔ A short note version
✔ A diagram-based explanation

You might also like