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

Computer Network Unit 2 (Easy Notes ) Edushine Classes

The Data Link Layer is the second layer of the OSI model, responsible for error-free data delivery between computers in the same network by framing messages with MAC addresses and error-checking bits. Framing divides data into smaller units called frames, which include control information, actual data, and error-checking bits to ensure integrity during transmission. Various framing techniques, such as character count, character/byte stuffing, and bit stuffing, are employed to manage data transmission effectively and detect errors using methods like parity checks, checksums, and cyclic redundancy checks.
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)
123 views

Computer Network Unit 2 (Easy Notes ) Edushine Classes

The Data Link Layer is the second layer of the OSI model, responsible for error-free data delivery between computers in the same network by framing messages with MAC addresses and error-checking bits. Framing divides data into smaller units called frames, which include control information, actual data, and error-checking bits to ensure integrity during transmission. Various framing techniques, such as character count, character/byte stuffing, and bit stuffing, are employed to manage data transmission effectively and detect errors using methods like parity checks, checksums, and cyclic redundancy checks.
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/ 101

Computer Network (BCS603)

Unit -2 Data Link Layer

Edushine Classes

Follow Us
Download Notes : https://rzp.io/rzp/wshN6Xm
https://telegram.me/rrsimtclasses/
Computer Network (BCS603)

 Introduction to Data Link layer :


👉 The Data Link Layer is the 2nd layer in the OSI Model.
Its job is to ensure error-free and orderly delivery of data from one computer to
another within the same network.
💡 Think of It Like This:
Imagine you’re sending a letter by post 📬.
• You put your letter in an envelope.
• You write the receiver’s address.
• The postman makes sure it goes to the right person and doesn’t get lost.
The Data Link Layer is like that postman:
• It wraps the message into a frame (envelope).
• It adds the MAC address (receiver's address).
• It checks if the message gets delivered without errors.
- - Download Notes : https://rzp.io/rzp/wshN6Xm
Computer Network (BCS603)

- - Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

📦 Example:
Imagine 3 computers are connected in a LAN (Local Area Network):
• You (Computer A) want to send a file to Computer B.
• Data Link Layer adds Computer B’s MAC address to the frame.
• It checks for errors and sends it.
• If there's any problem, it asks to resend.

Now let discuss exactly what is Framing 

- - Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

 What is Framing?
👉 Framing is a method used in the Data Link Layer of the OSI model to divide the full
message (data) into smaller, manageable units called frames.
Each frame carries:
• A piece of the original data
• Address information (who is sending and who should receive)
• Error checking bits (to detect if anything got changed during transmission)

Frames

- Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

Sdfdg
From Sending Machine to Receiving
df Machine using Frames
Let’s Breakdown above diagram to clear understanding

- - Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

🎯 1. What is a Packet?
At the start, the sending machine (your computer or any device) has data to
send. This data is packaged into a packet by the Network Layer.
👉 Example: You’re sending a message “HELLO” to a friend.
📦 2. What Happens in the Data Link Layer?
The Data Link Layer takes that packet and wraps it into a frame.
Look at the structure of the frame in your diagram:

- - Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

 Header (Start of the Frame) 📨 Payload Field (Main


 Contains control Data) Trailer (End of the Frame)
information: • This is the actual data • Contains error checking
• Source MAC address (who (message) you're trying to info like CRC or checksum.
sent it) send. • Helps detect if the data
• Destination MAC address • Also called the packet was changed or corrupted
(who should receive it) from network layer. during transmission.
• Frame type, sequence • Example: The word ✅ Ensures data integrity.
number, etc. "HELLO"
✅ Helps the receiver know ✅ It’s the real content of
where the data is from and the message.
where it’s going.

- - Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

➡️ 3. Frames Travel Across the Network


Now the entire frame (Header + Payload + Trailer) is sent over the network.
Multiple such frames can be sent if the original data is large.
⬅️ 4. Receiving Machine
The receiving device gets these frames. It does three main things:
1.Reads Header: To know if the message is for it.
2.Checks Trailer: Verifies if data is safe (no corruption).
3.Extracts Payload: Sends the actual message to the Network Layer above it.
Once all frames are received and reassembled, your friend finally gets the message
“HELLO”.

RRSIMT CLASSES WHATSAPP - 9795358008 Follow Us


Computer Network (BCS603)

📌 Why is Framing Needed?


Let’s understand this with real-life situations.
📬 Real-Life Example:
You want to send a big book by courier to your friend.
• If you send it all in one box, it’s too heavy, may get lost or damaged.
• So you break it into smaller parcels (frames).
You label each parcel with:
• Your friend’s address (destination)
• Part number (1 of 5, 2 of 5…)
• A note inside to confirm content
This way: ✅ The courier (network) can handle it easily
✅ If one parcel is damaged, only that one is resent
✅ Your friend can reassemble the book in correct order
That’s what framing does with digital data.
RRSIMT CLASSES WHATSAPP - 9795358008 Follow Us
Computer Network (BCS603)

 Types of Framing :
1. Character Count Framing
The first field of the frame tells the number of characters (bytes) in that frame.
🔧 Example:
[06][D][A][T][A][1][2]

Here, 06 means the frame has 6 characters.


✅ Advantage:
• Simple and easy to understand.
❌ Disadvantage:
• If the count is corrupted during transmission, entire frame becomes useless.

- - Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

🔲 2. Character/Byte Stuffing:
It means inserting a special byte called ESC (Escape character) before any accidental
FLAG that appears in the data.
✅ Why?
To make sure the receiver knows: “Hey, this is not a real FLAG, it’s just part of the
data.”
Escape = ESC
FLAG [Header Payload Trailer] FLAG
End Delimeter End Delimeter

Original Data After Stuffing


[A FLAG B] [A ESC FLAG B]
[A ESC B] [A ESC ESC B]
[A ESC FLAG B] [A ESC ESC ESC FLAG B]

- - Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

Let’s understand with an example

Data : [41 7D 42 7E 50 70 46] , Here FLAG = 7E and ESC=7D.

Now,
[7E 41 7D 42 7E 50 70 46 7E]

FLAG FLAG

Final Frame : [7E 41 7D 7D 42 7D 7E 50 70 46 7E]

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

💻 3. Bit Stuffing
Used in bit-oriented protocols.
A special pattern like 01111110 is used to indicate frame boundaries.
If 5 continuous 1’s appear in data, a 0 is “stuffed” after them to avoid confusion.
Example: ✅ Advantage:
Data: 011111 → Stuff a 0 → 0111110 •Works with all types of data (text,
Final frame: images, files).
[01111110]Data with bit stuffing[01111110] •Very reliable for bit-level
communication.
❌ Disadvantage:
•Adds extra bits, increasing the frame
size.

- - Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

💥 What is an Error in Networking?


In computer networks, an error happens when the data sent from the sender gets
changed or corrupted while reaching the receiver.
This can be due to:
• Noise in the communication medium
• Weak signals
• Hardware issues
Example:
Suppose a sender sends this binary data:
10110011
But the receiver gets:
10010011
👉 One bit changed! This is called a bit error.
- - Download Notes : https://rzp.io/rzp/wshN6Xm
Computer Network (BCS603)
Types of Errors :
There are two main types of errors in networking:

1. Single-bit Error 2. Burst Error


• Definition: Only one bit of the data is • Definition: Two or more bits in a data
changed. unit are changed.
• Cause: Usually due to a small noise or glitch. • Can be consecutive or within a short
📌 Example: Sent: 10110011 group of bits.
Received: 10100011 📌 Example: Sent: 10110011
Only the 3rd bit changed. Received: 10001011
✅ Easy to detect and correct. Here, multiple bits are incorrect.
❌ Harder to detect and correct than single-
bit errors.

- - Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

Error Detection :
1. Single Parity Check Error Correction :
2. Two Dimensional Parity 1. Hamming Code
Check 2. Binary Convolution
3. Checksum 3. Reed Solomon
4. Cyclic redundancy check 4. Low desigty parity check

- - Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

1. Single Parity Check?


Single Parity Check is an error detection method. It helps us find out if an error
happened while sending data from one computer to another.
It adds one extra bit, called the parity bit, to the original data. This bit tells whether the
number of 1s in the data is even or odd.
✅ Two Types of Parity(Two Rules )
i. Even Parity:
In Even Parity, We count the number of 1’s in original data if count is odd then we add
parity bit 1 to make even number of 1’s otherwise add 0.
i. Odd Parity:
In Even Parity, We count the number of 1’s in original data if count is odd then we add
parity bit 0 to make odd number of 1’s otherwise add 1.

- Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

🔢 Example of Even Parity (Working )

Sender Receiver
Suppose we want to send this 4-bit data: What does the receiver do?
 Data: 1011 Receiver receives: 10111
Count the number of 1s: • It again counts the number of 1s:
 1 + 0 + 1 + 1 = 3 (odd number) 1 + 0 + 1 + 1 + 1 = 4 (even)
To make it even, we add a parity bit = 1 ✅ So, data is correct (no error).
So, the data becomes:

Sent Data: 1011 1 (parity bit is 1) ❌ What if there's an error?


Let's say one bit changed due to noise:

- - Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

Sent: 1 0 111
Received: 1 1 111
Now, count 1s:
1 + 1 + 1 + 1 + 1 = 5 (odd)
❌ So, error is detected.

⚠Important Note:
Single parity can only detect odd number of errors (like 1, 3, 5 errors).
It cannot detect if two bits(Even Bits) are wrong this is the major
disadvantages of this methods.

- Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

2. Two-Dimensional Parity Check?


Two-dimensional parity is an advanced version of single parity check.
It adds parity bits in both row-wise and column-wise direction (just like a table or
grid of data).
Example:
Let’s say we want to send this 3x3 data (just 0s and 1s):

- Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

Now, Add Row parity(RP) & Column Parity (CP)

Now send the full matrix with row and column parity bits.(Data Sent)

- - Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

❌ What if an Error Happens? 🎯 Advantages:


Suppose one bit changes during • Better than single parity
transmission, like: • Can detect AND correct single-bit errors
• R2 C2 = 1 becomes 0 • Can detect many types of multiple-bit errors
Now the receiver will check:
• Row 2 parity is wrong ⚠Limitation:
• Column 2 parity is wrong • It can't detect all multi-bit errors
So, error is in Row 2, Column 2 • It uses extra bits, so a little more space is needed
→ easy to find and correct it!

- Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

3.Checksum
Checksum is a method used to detect errors in data during transmission (like sending
data from sender to receiver).
If the data changes even a little, the summary (checksum) will also change.
️ Basic Steps:
• Divide data into equal-size blocks (usually in 8 bits or 16 bits).
• Add all the blocks together using binary addition.
• Take the 1’s complement of the result (flip all 0s to 1s and 1s to 0s).
• That result is called the checksum.
• Sender sends both data + checksum.
• Receiver adds all data blocks + checksum.
• If the result is all 1s, the data is correct. Otherwise, error detected!

- Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

📄 Simple Example: 11001100


10101010 -> Block 1 Add
Let’s take 3 blocks of 8-bit data: ---------------------
01110110
+1 Receiver:
11001100 10101010 11110000 11000011 ------------------
00101100
01110111 (intermediate Sum)
Data Block 1: 11001100 11110000 -> Block 3 Add 11010011
-------------------- ---------------------
Data Block 2: 10101010 01100111 11111111
Data Block 3: 11110000 +1
Data Block 4: 11000011 --------------------- Now take 1’s
01101000 (intermediate Sum) 00000000 (data is correct)
11000011
----------------
00101011
+1
-----------------------
00101100 -> Final Sum of all block
1’s - >11010011 ->Know as Checksum

- Download
DownloadNotes
Notes: :https://rzp.io/rzp/wshN6Xm
https://rzp.io/rzp/wshN6Xm
Computer Network (BCS603)

⚠️Limitations:
• Cannot detect all types of errors.
• Not useful for large or very sensitive data.
• Cannot correct errors — only detects them.

- Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

4. What is CRC (Cyclic Redundancy Check)?


CRC is an error-detecting technique used in data communication.
It helps check whether the data received is correct or has any errors during
transmission.
When data is sent, a special CRC code is added to it. The receiver checks this code.
If it matches what is expected, the data is correct. If not, there was an error during
transmission.
📦 Real-life Example:
• Imagine you're sending a parcel and you seal it with a unique sticker (CRC code).
If the receiver sees the seal is not matching or is broken, they know something is
wrong.
• Similarly, in networks, CRC is that “sticker” added to the data to check its correctness.

- Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

✅ CRC generation
• Find length of Divisor (L)
• Append (L-1) bits '0' to original msg
• Perform binary division operation
• Remainder of division = CRC ←
• Transmitted msg = msg bit + CRC ←
 CRC is verified at Receiver end:
• Received data is divided by divisor
• If no remainder, the data is correct and accepted.
• Otherwise data is rejected.

Now let understand with easy example ->

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

Example –
Msg = 100100
Divisor = 1101
Solution 
• Find length of Divisor (L) = 4
• Append (L-1) bits '0' to original msg.
• L-1 = 3 (000) append in msg
 Now Msg Becomes 100100000

Now Perform binary division operation

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)
Computer Network (BCS603)

💡 Advantages of CRC:
• Can detect most common errors
• More reliable than parity or simple checksums
• Widely used in network protocols and storage devices
⚠️ Disadvantages:
• It can only detect errors, not fix them
• Slightly more complex than parity/checksum

Q. Find the CRC for data 1101011111 using the divisor x⁴ + x + 1 (V.V.IMP)

Hint -
x⁴ + x3 + x2 + x1 + x0
x4 + x 3 + x 2 + x + 1
1 0 0 1 Download 1( Now 10011 use
Notes previous step and find CRC)
: https://rzp.io/rzp/wshN6Xm
Computer Network (BCS603)

Error Correction :
1. Backward Error Detection
2. Forward error detection

 What is Hamming Code?


Hamming Code is an error detection and correction technique used in communication
systems.
✅ It can:
• Detect 1-bit and 2-bit errors
• Correct only 1-bit error
It’s better than CRC and Parity when you also want to correct the error (not just detect
it).

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

✅ Hamming Code Encoding:


• Calculation of redundant bit (2^r > m + r + 1)
• Positioning of redundant bit (…23, 22 21, 20)
Calculation of value at redundant bit:
i. P₁: 1, 3, 5, 7, ...
ii. P₂: 2-3, 6-7, 10-11, ...
iii. P₄: 4,-7, 12–15, 20–30, ...

 Hamming Code Decoding:


• Parity check in received message
• Error detecting and correcting

Now let’s understand with an easy example 

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

Example –
Msg – 1000001
M=7
Solution :
1. Calculation of redundant bit (2^r > m + r + 1)

r = 4 (redundant bit)
Transmitted Msg = M + r
= 7 + 4 = 11 bit

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

2. Positioning of redundant bit (…23, 22 21, 20) Msg – 1000001

20 = 1
21 = 2 1 0 0 r 0 0 0 r 1 r r
22 = 4
23 = 8
P1 = r 1 0 0 0 1 = 0 (To make even
3. Calculation of value at redundant bit: 1’s)
P2 = r 1 0 0 0 1 = 0 (To make even
p8 p4 p2 p1 1’s)
P4 = r 0 0 0 = 0 (To make even 1’s)

P8 = r 0 0 1 = 1 (To make even 1’s)

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

1 0 0 0

Transmitted msg : 10010000100

Hamming Code Decoding(Receiver end )


Received MSG = 10010000100
 Parity check in received message P1 = 0 1 0 0 0 1 = 0 (To make even 1’s)
P2 = 0 1 0 0 0 1 = 0 (To make even 1’s)
P4 = 0 0 0 0 = 0 (To make even 1’s)
Here, (0)10
P8 = 1 0 0 1 = 0 (To make even 1’s) (no error)

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

 Error Control Mechanism ( AKTU 2022-23)(V.IMP)


isme kuch naya nahi hai bus whi Error detection + Error Correction
likhna hai with their types yahi hai Error Control Mechanism.

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

 Flow Control :
Flow control is a technique used in the Data Link Layer to make sure that:
👉 The sender does not send data faster than the receiver can process.
If the sender is very fast and the receiver is slow, then the receiver may miss or lose
data. So flow control is important to prevent data loss.

🔹 Simple Example:
Imagine you are filling a water bottle with a tap.
• If the tap is too fast and the bottle is small and slow to fill, the water will overflow.
• The same happens in networking — if sender sends too fast, the receiver overflows.

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

🔸 Why Flow Control is Needed?


• The receiver has limited buffer (memory).
• If the sender keeps sending data without control, the receiver’s memory may get
full.
• This can cause data loss or data to be overwritten.
Protocol

Noiseless Channel Protocol Noisy Channel Protocol


Stop & Wait ARQ
Simplest
Sliding Go back N ARQ
Stop & Wait window
protocol Selective repeat ARQ

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

 Noiseless Channel Protocol :


Ideal channel, no Frame is lost, no duplicated or corrupted.
1. Simplest protocol :
• No Flow & error control.
• Unidirectional (Sender Receiver)
• No acknowledgement.
Frame 1
Sender Frame 2 Receiver
Frame 3

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

2. Stop & Wait Protocol – (AKTU 2021-22 )


• The sender sends one data frame.
• Then waits for an acknowledgment (ACK) from the receiver.
• Only after getting ACK, it sends the next frame.
🔹 Pros:
 Simple and easy to implement
 Reliable
🔹 Cons:
 Very slow
 Sender stays idle most of the time

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

 Noisy Channel Protocol – (AKTU 2023-24)


1. Stop and Wait ARQ(Automatic Repeat Request) :
• Stop-and-Wait ARQ is an error-control method used in networking.
It ensures the receiver gets each data frame correctly before sending the next
one.
• ARQ = Automatic Repeat Request
👉 Means: If there’s a problem (like no ACK or error), the sender
automatically repeats the request (frame).
• If ACK does not come in time, sender will timeout and resend the frame.
• This method uses timeout + sequence number to handle errors and avoid confusion
between old and new frames.

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

🔹 How it works (step by step):


1. Sender sends one frame.
2. Sender waits for an Acknowledgment (ACK) from the receiver.
3. If the ACK is received, the sender sends the next frame.
4. If the ACK is not received within some time, the sender assumes that the frame or
ACK is lost.
5. The sender resends the same frame again.
This repeats until the frame is acknowledged correctly.
🔷 Real-Life Example (Easy):
🎾 Imagine you’re throwing balls to your friend (one at a time).
• You throw one ball.
• You wait for a thumbs-up (ACK) from your friend.
• If you don’t get the thumbs-up in time, you think the ball was missed.
• So, you throw that same ball again until you get a thumbs-up.
That’s Stop-and-Wait ARQ.
Computer Network (BCS603)

 Advantages:
✔️ Simple to understand and use
✔️ Reliable for error checking
✔️ Ensures correct delivery

 Disadvantages:
❌ Slow (only one frame at a time)
❌ Wastes time waiting
❌ Not efficient for long-distance
communication
Computer Network (BCS603)

 Sliding Window Protocol :- Go Back –N ARQ Protocol , Selective Repeat


protocol.
2. Go Back –N ARQ Protocol – (AKTU 2022-23)
• Go-Back-N ARQ uses concept of pipeline i.e. sender send multiple frame before
receiving Ack of first frame.
• The number of frame depends on size of window (N).
• If Ack not received of a frame within time timeout → all the frame in current window
are retransmitted.
• The size of window determine the sequence number of frame.
The sender can send multiple frames continuously without waiting for ACK of each
frame.
But… if one frame fails, the sender goes back and resends that frame and all the next
ones (even if some were correct).
Eg – Number of frame 10 and window size is 2 then
If window size = 2, sender can send 2 frames at once.
 Sequence no is = 0,1 0,1 0,1 0,1 0,1
Computer Network (BCS603)

Exmple : Number of frame 11 and window size is 4 then


If window size = 4, sender can send 4 frames at once.
 Sequence no is = 0,1,2,3
0
10 9 8 7 6 5 4 3 2 1 0 1
2
✅ Advantages: 3
✔️ Better than Stop-and-Wait (more
4
efficient)
✔️ Uses pipelining — multiple frames in 5
transit
❌ Disadvantages:
❌ If one frame fails, many others may also be
resent (even if correct) Sender Receiver
❌ Wastes bandwidth
Computer Network (BCS603)
3. Selective Repeat protocol – (AKTU 2022-23)
Selective Repeat ARQ is a method used in computer networks to detect and
correct errors during data transmission.
It works by:
• Sending multiple frames at once (like a pipeline).
• But instead of resending all frames when an error happens (like Go-Back-N), it
only resends the frame that has an error.
📦 Example (Simple Story):
Imagine you're sending 5 boxes (frames) to your friend:
You send Box 1, 2, 3, 4, 5. ✅ Box 4 → OK
Your friend receives: ✅ Box 5 → OK
✅ Box 1 → OK Now, instead of sending Box 2 to 5 again, you
❌ Box 2 → Damaged just re-send Box 2 only.
✅ Box 3 → OK This saves time and bandwidth!
Download Notes : https://rzp.io/rzp/wshN6Xm
Computer Network (BCS603)

Example : Number of frame 11 and window


size is 4 then
If window size = 4, sender can send 4 frames at
once.
 Sequence no is = 0,1,2,3

10 9 8 7 6 5 4 3 2 1 0

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

📊 Advantages:
• ✅ Saves bandwidth.
• ✅ More efficient than Go-Back-N.
• ✅ Faster transmission when errors are few.

❌ Disadvantages:
• ❌ More complex to implement.
• ❌ Requires more memory/buffers to handle out-of-order frames.

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

🌐 Sublayers of Data Link Layer :


The Data Link Layer in the OSI model is divided into two sublayers:
1. Logical Link Control (LLC)
Also called Data Link Control (DLC)
2. Medium Access Control (MAC)

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

📍 1. Logical Link Control (LLC / DLC)


• Handles communication between Network Layer and MAC sublayer.
• Provides flow control (controls speed of data between sender and receiver).
• Allows multipoint communication (many devices on a network can talk).
• Adds sequence numbers to frames to keep them in correct order.
Example:
Imagine you're sending a series of pages to a printer. LLC ensures:
• Pages are numbered correctly.
• Printer receives pages in order.
• If the printer is slow, the sender pauses until it’s ready.

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

 What is Medium Access Control (MAC)?


When multiple computers/devices are connected to the same network cable or
Wi-Fi, they share the same medium to send data.
Problem?
👉 If all devices try to send data at the same time — data gets mixed (collision)!
So, we use MAC protocols to decide:
🗣️ “Kaun pehle bolega (send karega)?”
🕒 “Kab bolega?”
❌ “Collision kaise avoid hoga?”
MAC sublayer decides “who will send data and when” over a shared
communication medium (like a cable or Wi-Fi).

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

MAC Protocol

Controlled Access Control Channelization Protocol


Random Access Protocol
Pure Reservation FDMA
ALOHA
CSMA Slotted Polling
TDMA
CSMA/CD Token passing
CSMA/CA CDMA

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

1.Random Access Protocol


• 📌 “Jo pehle aaye, pehle try kare” — but risk of collision hota hai.
• No one has priority, everyone tries to send whenever they want.
• If two send at the same time, there’s a collision.
• In random access protocol, one or more stations cannot depend on another station
nor any station control another station
• Random Access Protocol is a type of Media Access Control (MAC) protocol used in
computer networks. It allows multiple devices to send data without taking
permission. Each device transmits whenever it has data, which may lead to data
collisions if more than one device sends at the same time.
Example:
Soch tu aur tera dost dono ek hi time par teacher se kuch puchne lag jaate ho — dono ki
baat samajh nahi aati, teacher confuse ho jaati hai.
Yehi hota hai collision in Random Access Protocol.
Download Notes : https://rzp.io/rzp/wshN6Xm
Computer Network (BCS603)

2. ✍️ Controlled Access Protocol :


Controlled Access Protocol is a Media Access Control (MAC) method where devices
take turns to use the communication channel.
In this method, a central control or a system decides which device can send data and
when, so that no collision happens.

✅ Key Points:
i. Turn-based system – Only one device is allowed to send at a time.
ii. No collisions – Since access is controlled, devices don’t interfere.
iii. It is more efficient than Random Access when many devices are present.
iv. Common in LANs (Local Area Networks).

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

Example:
Soch tu aur tere doston ko teacher ne bola:
"Ek-ek karke apna answer bolo."
Ab sabko apna number milta hai, koi ek time pe bolta hai.
Na koi interfere karta hai, na teacher confuse hoti hai.
Yehi hota hai Controlled Access – sabko turn milta hai, collision nahi hota.

3. ✍️ Channelization Access Protocol :


Channelization Protocol is a method in which the available bandwidth (data-carrying
capacity) of a channel is divided among multiple users, so they can communicate at
the same time without collision.
It is mainly used in Cellular Networks and Wireless Communication.

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

✅ Key Points:
• Bandwidth is divided into channels.
• Each user gets a separate channel, so no interference.
• All users can send data simultaneously.
• Best suited for wireless networks like mobile phones.
Example:
Soch ek sadak hai jahan se log guzarte hain.
Agar sab log ek hi raste se chalein, to bheed ho jaayegi (collision).
To kya kiya jaata hai? Alag-alag lanes bana diye jaate hain — jaise bike lane, car lane,
truck lane.
Bas yahi hota hai Channelization Protocol — har user ko ek alag lane milti hai taaki
sab safe aur smooth travel karein 🛣️.

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

 Pure ALOHA (Additive Links On-line Hawaii Area) :


Pure ALOHA is a random access protocol used in computer networks to send data
without checking if the channel is free.
It was developed by the University of Hawaii to connect computers on different islands
using radio.
In Pure ALOHA, any device can send data at any time, and then waits for an
acknowledgment. If the acknowledgment is not received (due to collision), the sender
waits for some time and resends the data.
 📉 Efficiency of Pure ALOHA:
• It has very low efficiency – only 18.4%.
• This means only 18.4% of total time is used to send successful data. Baaki time data
loss hota hai due to collision.

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

Example:
Soch ek classroom hai jahan sab
students bina permission ke ek saath
bolte hain.
Agar do ya zyada students ek saath
bolenge, to teacher kuch bhi nahi sun
paayegi — yehi hota hai collision.
Fir teacher bolegi "dobara bolo ek-ek
karke", to bachche random time baad
firse bolte hain.
Yehi hota hai Pure ALOHA ka system.
Computer Network (BCS603)
🔁 Step-by-step :
i. Start
→ The process begins — the device is ready to send data.
ii. Set backoff to zero
→ Backoff time means the waiting time after a collision. Initially,
it's set to 0.
iii. Send the data packet
→ The device sends its data packet to the network.
iv. Wait
→ After sending, the device waits for an acknowledgment (ACK)
from the receiver.
v. Received ACK?
i. If Yes → data is successfully received 🎉 → Success.
ii. If No → that means collision happened 💥.
Download Notes : https://rzp.io/rzp/wshN6Xm
Computer Network (BCS603)

vi. Increment backoff


→ Since there was a collision, the device increases the backoff count (how many times it
has retried).
vii. Reached limit?
i. If Yes → Too many retries → Abort ❌ (stop trying).
ii. If No → Wait for some backoff time (random delay), then go back and try sending again.
viii. Repeat from step 3 after waiting.
❌ Disadvantages of Pure ALOHA:
✅ Advantages of Pure ALOHA:
i. High chance of collision.
i. Very simple and easy to implement.
ii. Low efficiency (only 18.4%).
ii. Good for low-traffic networks.
iii. Not suitable for high-traffic environments.

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

 Slotted ALOHA?
Slotted ALOHA is an improved version of Pure ALOHA that reduces the chances of
collision.
👉 Main Idea:
In Slotted ALOHA, time is divided into slots and devices can only send data at the
beginning of a time slot, not anytime they want (like Pure ALOHA).
Slotted ALOHA is a multiple access protocol where the time is divided into fixed-size
slots, and a station can only send data at the beginning of these slots. This helps in
reducing collisions and improving efficiency.
📊 Efficiency:
• Slotted ALOHA Efficiency ≈ 36%
Means out of 100 attempts, around 36 can succeed if all work properly.

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)
🔄 Let’s go Slot-by-Slot:
✅ Slot 1:
• Only Station 1 sends Frame 1.1 → No one else sends → ✅ Success.
✅ Slot 2:
• Only Station 2 sends Frame 2.1 → ✅ Success.
❌ Slot 3:
• Collision occurs!
• Station 1 sends Frame 1.2
• Station 3 sends Frame 3.1
• Both send at the same time slot → ❌ Collision (Data is lost)
✅ Slot 4:
• Only Station 4 sends Frame 4.1 → ✅ Success
✅ Slot 5:
• Only Station 2 sends Frame 2.2 → ✅ Success
Download Notes : https://rzp.io/rzp/wshN6Xm
Computer Network (BCS603)

❌ Slot 6:
• Another collision!
• Station 3 sends Frame 3.2
• Station 4 sends Frame 4.2
• Both sent in the same slot → ❌ Collision
Important Point:
• In Slotted ALOHA, if two or more stations choose the same slot, collision will
happen, and both data frames will be lost.
• If only one station uses a slot → the data is sent successfully.

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

 CSMA (Career sense multiple access) :


• CSMA stands for Carrier Sense Multiple Access, a network protocol that controls
how devices transmit data on a shared network. CSMA helps prevent collisions when
multiple devices try to send data at the same time.
• Sense before transmit.

Check Channel is idle or busy state

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

Simple Imagination / Example:


📞 Think of a Phone Call:
Suppose you and your friends are talking on a group call.
• Only one person can talk at a time.
• Before talking, you will listen first if anyone else is already speaking.
• If the line is clear, you start speaking.
• If someone is already talking, you wait for the line to become free.
This is exactly how CSMA works.
🚦 Types of CSMA:
There are two types of CSMA :-
1. Persistent
2. No Persistent

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

1. CSMA with Persistence : 2. CSMA with No Persistence :

Sense Career
Sense Career

YES
Wait random
YES Busy time
NO
Msg transmit

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

🌐 CSMA/CD (Carrier Sense Multiple Access with Collision Detection) –(VIMP)


CSMA/CD is a network protocol used in wired Ethernet to avoid and handle collisions
during data transmission. It ensures that only one device sends data at a time on the
network channel.
📌 Key Points:
i. Carrier Sense: Listen to the channel before sending.
ii. Multiple Access: All devices share the same communication channel.
iii. Collision Detection: Detect if two devices send data at the same time.
📘 Real-life Example for Understanding:
Imagine a classroom where many students want to speak (send data):
• Each student first checks if no one is speaking (carrier sense).
• If the room is silent, the student speaks (sends data).
• If two students speak at once, they realize the collision and say “sorry” (jam signal).
• They wait for some time (backoff), and then try again.

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)
Computer Network (BCS603)

🔄 Working Steps of CSMA/CD:


1. Start
The device wants to send data on the network.
2. Monitor the Medium
The device first listens to the network channel to check if it is free or busy.
3. Check if Medium is Free:
If free, it proceeds to send the data.
If busy, it waits and keeps checking again.
4. Send Data
When the medium is found free, the device sends its data.
5. Collision Detection
While sending, the device monitors the channel to check if a collision (data clash)
occurs.

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

6. If No Collision:
The data is successfully transmitted.
The process ends.
7. If Collision Detected:
The device sends a JAM signal to inform all devices about the collision.
This helps other devices know that the data was not transmitted successfully.
8. Check Retry Limit:
If retry limit is not reached, the device waits for a random backoff time (this prevents
repeated collision), and then tries again.
If retry limit is exceeded, the device stops trying and gives up the transmission.

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

✅ Advantages:
• Network pe collision detect ho jaata hai
• Wired medium ke liye best hai
• Bandwidth waste hone se bachti hai
❌ Disadvantages:
• Wireless networks mein use nahi ho sakta
(kyunki wireless mein hum detect nahi kar paate easily ke kisi aur ka data aa raha hai)
• High traffic mein still delays ho sakte hain

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

📡 CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance)(V.IMP)


• CSMA/CA is a network protocol used to avoid data collisions before they happen.
It is commonly used in wireless networks (like Wi-Fi) where detecting collisions is
difficult.
• CSMA/CA is a method used to minimize data collisions in networks, especially in
wireless communication, by reserving the medium before transmission. It uses
RTS/CTS messages to coordinate data transfer and ensures more reliable
communication.
• CSMA/CA focuses on avoiding collisions, unlike CSMA/CD which detects them after
they happen.

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

📘 Real-life Example:
Imagine a group of students in a classroom:
• A student wants to speak (send data).
• He first checks if the teacher (channel) is listening.
• Before speaking, he raises his hand (RTS).
• If the teacher gives permission (CTS), he speaks.
• After he finishes, the teacher says "okay" (ACK).

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)
Computer Network (BCS603)

🔄 Working Steps of CSMA/CA:


1.Start
A device wants to send data over the wireless medium.
2.Check if Medium is Free
The device listens to the channel to check whether the medium is currently free or
busy.
3.If Medium is Busy:
1. The device waits until the channel becomes free.
2. After it becomes free, it waits for a random backoff time (this helps avoid
collision with other devices also waiting).
4.Send Request to Send (RTS) Signal:
The device sends an RTS (Request To Send) signal to the receiver.

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

5. Receive Clear to Send (CTS) Signal:


If the receiver is ready, it replies with a CTS (Clear To Senda) signal.
6. Send Data
Once CTS is received, the device starts sending data.
7. Acknowledgement (ACK)
After receiving the data successfully, the receiver sends an ACK (Acknowledgment) to
confirm successful delivery.

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

📘 What is Channel Allocation?


Channel Allocation refers to the process of assigning available communication channels
(frequencies) to different users in a network so they can transmit data without
interference.
Just like in a classroom, each student gets their turn to speak—similarly, in a network,
each user is assigned a specific channel to communicate efficiently.
 Why is Channel Allocation Important?
• To avoid interference between users
• To make efficient use of bandwidth
• To ensure smooth and reliable communication
🔁 Types of Channel Allocation Schemes:
There are two main types of channel allocation:

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

1. Fixed Channel Allocation (FCA)


• In this method, each user or base station is permanently assigned a specific
frequency channel.
• Even if the user is not actively communicating, the channel remains reserved and
cannot be used by others.
📌 Example: Like a reserved seat in a train. Even if the person doesn’t sit, no one else
can take it.
✅ Advantages:
• Simple and easy to implement
• No delay in channel assignment
❌ Disadvantages:
• Wastes channels if users are inactive
• Not suitable for traffic that changes frequently

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

2. Dynamic Channel Allocation (DCA)


• In this method, channels are not fixed. They are assigned dynamically whenever a user
wants to communicate.
• After communication is complete, the channel is released and can be used by others.
📌 Example: Like booking an Uber or Ola taxi. You get a car when you need it, and after
the ride, it becomes available for the next user.
✅ Advantages:
• Efficient use of available channels
• Better suited for networks with changing traffic patterns
❌ Disadvantages:
• More complex system
• May cause delay in assigning channels

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

🔰 What is a Standard in Networking?


A standard in networking is like a set of rules or guidelines that everyone follows to
communicate properly over a network.
🔹 Imagine if every phone company used a different language, phones wouldn’t work
together, right?
👉 So, to make sure all devices can connect and understand each other, we need
standard rules — these are called LAN Standards.
💡 Why Standards are Important?
✅ Devices from different companies can work together (e.g., HP laptop connects to TP-
Link router)
✅ Communication becomes reliable and fast
✅ Helps in managing, securing, and designing networks

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

Now let’s learn the Top 5 LAN Standards one by one


✅ 1. IEEE 802.3 (Ethernet - Wired LAN) :
IEEE 802.3 is the most widely used standard for Local Area Networks (LANs).
It defines how devices on a wired network communicate using Ethernet cables.

🔷 How It Works:
• Uses CSMA/CD (Carrier Sense Multiple Access with Collision Detection)
• Devices check if the cable is free
• If free → send data
• If two devices send together → collision happens
• Devices wait random time and try again

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

🔷 Characteristics:
• Speed: 10 Mbps to 10 Gbps or more
• Cable: Twisted Pair, Coaxial, Fiber Optic
• Topology: Star / Bus
• Very reliable and low-latency
✅ Real-World Example:
Used in offices, schools, data centers where high-speed internet and security are
important.

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

📦 What is Ethernet Frame Format?(IMP)


Ethernet Frame is the standard format of data used when one computer sends data to
another over a wired LAN using the IEEE 802.3 standard (released in 1983).
Imagine it like a courier package:
• It has address (who is sending and receiving)
• It has the actual message (data)
• It also has some important tags/checks to avoid damage or misdelivery.

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

✅ 2. IEEE 802.11 – Wireless LAN (Wi-Fi)


IEEE 802.11 is the standard used for wireless networking, which we call Wi-Fi.
🔷 How It Works:
• Uses CSMA/CA (Collision Avoidance instead of Detection)
• Devices listen before sending
• If medium is busy → wait and try later
•Can use RTS/CTS (Request to Send / Clear to Send) to avoid collisions
🔷 Types of 802.11:
• 802.11a – 54 Mbps, 5 GHz
• 802.11b – 11 Mbps, 2.4 GHz
• 802.11g – 54 Mbps, 2.4 GHz
• 802.11n – up to 600 Mbps (dual-band)
• 802.11ac – up to several Gbps (modern Wi-Fi)
Download Notes : https://rzp.io/rzp/wshN6Xm
Computer Network (BCS603)

🔷 Characteristics:
• No cables, more flexibility
• Limited range
• Used in homes, cafes, colleges, etc.
✅ Real-World Example:
Your mobile, laptop, or smart TV connected to your Wi-Fi router – that’s 802.11 in
action.

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

✅ 3. IEEE 802.5 – Token Ring


IEEE 802.5 is an older LAN standard developed by IBM.
Here, devices are connected in a ring topology and pass a token to control who can send
data.
🔷 How It Works:
• Only the device with the token can transmit
• Token moves from one device to another in a circle
• This avoids collisions
🔷 Characteristics:
• Speed: 4 Mbps or 16 Mbps
• Topology: Logical Ring, but often physically wired as Star
• No collision, but slower than Ethernet

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

✅ Real-World Example:
Think of it like a group discussion where only the person holding the mic can speak.
Used in old banking networks, but now replaced by Ethernet.
✅ 4. IEEE 802.4 – Token Bus
Token Bus is similar to Token Ring but uses a bus topology instead of a ring.
🔷 How It Works:
• Devices connected in a bus (single main cable)
• A token is passed logically (not physically)
• Only the device with the token can transmit
🔷 Characteristics:
• Used in industrial control systems
• Prevents collision like Token Ring
• Slower adoption in modern networks
Download Notes : https://rzp.io/rzp/wshN6Xm
Computer Network (BCS603)

✅ Real-World Example:
Factory automation systems use Token Bus where timing is important and communication
must be well-organized.
✅ 5. IEEE 802.1 – LAN Management Standard
This standard doesn’t define how devices send data, but how to manage and control the
network.
🔷 Features of IEEE 802.1:
• VLAN (Virtual LANs): Divide one network into small virtual parts
• Spanning Tree Protocol (STP): Prevent looping in switches
• Network security protocols
• Bridging and routing between LANs

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

✅ Real-World Example:
Big companies use VLANs to separate departments like HR, IT, and Finance, even if they
are using the same network cables.

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

Difference between 802.3 802.4 and 802.5 IEEE Standards.


Feature IEEE 802.3 IEEE 802.4 IEEE 802.5
📜 Name Ethernet Token Bus Token Ring
CSMA/CD (Carrier Sense
🔗 Access Method Multiple Access with Collision Token Passing on a Bus Token Passing in a Ring
Detection)
🔌 Topology Bus or Star Bus Ring
📶 Transmission Broadcast Broadcast Unicast (one by one)
⚡ Speed 10 Mbps to 400 Gbps 1 to 10 Mbps 4 Mbps or 16 Mbps
Anyone can try to send Only device with token sends Only device with token sends
📍 Who sends data?
anytime data data
🔁 Token Used? ❌ No token used ✅ Yes ✅ Yes
⚠️ Collision Possibility Yes (handled by CSMA/CD) No No
Most common networks (LANs,
📅 Used in Industrial networks (rare now) IBM networks (mostly old now)
Internet)
Like kids shouting in class — if
Like passing a talking stick on a Like passing a chit in circular
️ Easy Example Download Notes : https://rzp.io/rzp/wshN6Xm
2 shout together, teacher stops
bench order
them (collision)
Computer Network (BCS603)

🔁 Bridge –
A bridge is a network device used to connect two or more LAN segments and make them
work as a single network. It filters data and forwards only necessary traffic to the correct
segment.
Example -
Soch lo do alag-alag classrooms hain, aur dono mein students hain (devices).
Bridge ek teacher hai jo sirf un messages ko dusre class mein bhejta hai jo zaroori hote
hain.
• Agar Class A ka student Class B ke student ko message bhejna chahta hai, to bridge
check karega aur sirf wohi message dusri class mein forward karega.
🛠️ Features of Bridge:
• Works at Data Link Layer (Layer 2).
• Uses MAC addresses to forward data.
Download Notes : https://rzp.io/rzp/wshN6Xm
Computer Network (BCS603)

• Reduces traffic by filtering unnecessary data.


• Cheaper and simpler than routers.
🔀 Link Layer Switch –
A Link Layer Switch is an advanced version of a bridge with multiple ports. It connects
many devices in a LAN and forwards data based on MAC addresses.
Example :
Soch lo ek classroom mein har desk ke liye ek personal teacher ho (switch ke ports).
Agar student A ko student C se baat karni hai, to teacher (switch) seedha A ke message
ko C tak bhejta hai – bina dusre students ko disturb kiye.
🛠️ Features of Switch:
• Also works at Data Link Layer (Layer 2).
• Uses MAC address table to forward frames to the correct device.
• Much faster and smarter than a bridge.
• Commonly used in modern networks (LAN).
• Reduces collision and increases speed.
Computer Network (BCS603)

🔗 What is a Learning Bridge?


A Learning Bridge is a type of bridge (Layer 2 device) that automatically learns
the MAC addresses of devices connected to its ports. It builds a table (called a
MAC Address Table or Forwarding Table) to decide where to send incoming
frames.
Easy Real-Life Example :
Soch lo ek teacher hai (Learning Bridge), aur uske paas teen doors (ports) hain.
• Jab bhi koi student (device) ek message bhejta hai, teacher dekhta hai:
"Yeh student kaunse door se bol raha hai?"
Fir us student ka naam (MAC address) likh leta hai us door ke against.
• Agli baar jab kisi aur student ne us student ko message bhejna ho,
teacher seedha usi door se message bhej deta hai – bina sabko disturb kiye.

️ Summary of This Example:


Download Notes : https://rzp.io/rzp/wshN6Xm
Computer Network (BCS603)

⚙️ How It Works (Step-by-Step):


• Frame Receive – Bridge receives a data frame.
• Learn Source Address – It notes the MAC address of sender and the port from which it
came.
• Update MAC Table – It saves this info in the MAC table.
• Check Destination – It checks if it knows the destination MAC address.
• Forward or Broadcast:
• If found → Forwards the frame to the correct port.
• If not found → Broadcasts to all ports except the incoming one.

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

🌲 What is Spanning Tree Algorithm?


The Spanning Tree Algorithm (STA) is a method used in networking to prevent loops when
multiple bridges/switches are used in a LAN.
It helps in forming a loop-free logical topology even if the physical network has loops.
️ Real-Life Example: Bhool Bhulaiyaa (Maze Game)
Soch ek maze hai (your LAN), jisme kai raste (bridges/switches) ek hi jagah tak le jaate hain.
Agar sab raste khule honge, to koi banda (data packet) ghoomta hi rahega — ek loop ban
jayega.
👉 Isiliye maze ka ek guide (STA) hota hai, jo decide karta hai:
• Kaunsa rasta open rahega,
• Kaunsa close hoga (backup ke liye),
• Taaki har jagah bas ek hi safe rasta ho without any loops.

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

💡 Why We Need STA?


In networks with multiple switches, loops can:
• Confuse devices (data goes in circles),
• Cause duplicate data,
• Crash the entire network due to broadcast storms.
So STA creates a structure like a tree, where:
• All devices are connected,
• But there is no cycle/loop.

Download Notes : https://rzp.io/rzp/wshN6Xm


Computer Network (BCS603)

Thank You…

- Download Notes : https://rzp.io/rzp/ DtpXaWbv

You might also like