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

? Computer Networks Unit 2

Uploaded by

pnamitesh9873
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

? Computer Networks Unit 2

Uploaded by

pnamitesh9873
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

📘 Computer Networks – Unit 2 Full Notes

✅ Part 1: Link Layer

🔹 1. Framing

Definition:
Framing is the process of dividing a continuous stream of bits into smaller, manageable units called
frames for data transmission. It ensures that the receiver can correctly detect the start and end of
each frame.

Keywords: framing, frame boundaries, synchronization

Framing Methods:

 Length Field: Specifies the length of the frame.

 Byte Stuffing: Special bytes (e.g., FLAG, ESC) are used to mark frame boundaries. ESC is used
to differentiate between data and control characters.

 Bit Stuffing: After every five consecutive 1s, a 0 is inserted. This avoids confusion with
control sequences.

🔹 2. Error Detection and Correction

A. Error Detection:
Detects whether an error has occurred during transmission.

Techniques:

 Parity Bit: Adds 1 or 0 to make the number of 1s either even (even parity) or odd (odd
parity).

 Checksum: The sender adds all the data units and sends the sum. The receiver re-computes
the sum to verify integrity.

 CRC (Cyclic Redundancy Check): Uses polynomial division to generate a code; receiver
divides again to check for remainder.

Keywords: integrity, parity, checksum, CRC, error detection

B. Error Correction:

Fixes errors automatically without retransmission.

 Hamming Code: Adds multiple redundant bits to data to detect and correct single-bit errors.

Keywords: redundant bits, hamming, correction


🔹 3. Flow Control

Ensures the sender does not overwhelm the receiver with data.

Elementary Protocols:

 Stop-and-Wait Protocol: Sender sends one frame, waits for ACK.

 Noisy Channel Protocol: Sender resends frame if ACK is not received or NAK (negative
acknowledgment) is received.

Sliding Window Protocol:

Definition:
Allows multiple frames to be sent before needing acknowledgment.

 Each frame has a sequence number.

 A window controls how many frames can be sent.

 Receiver sends ACKs, and the window "slides" forward.

Keywords: window, sequence number, ACK, efficient

🧠 Flow Diagram – Sliding Window Protocol:

mathematica

CopyEdit

Sender: [Frame 1] → [Frame 2] → [Frame 3]

↓ ↓ ↓

ACK ACK ACK

Receiver: Accepts multiple frames → Sends ACKs → Window slides

✅ Part 2: Medium Access Control and LANs

🔹 1. Channel Allocation

Definition:
Decides how devices share a common transmission medium.

 Static Allocation: Fixed resources (e.g., FDMA, TDMA)

 Dynamic Allocation: Devices compete for channel (e.g., ALOHA, CSMA)


🔹 2. Multiple Access Protocols

Enable multiple devices to communicate over a shared channel.

ALOHA:

 Pure ALOHA: Devices send data randomly → high collision chance.

 Slotted ALOHA: Time divided into slots → devices transmit at start of slot → fewer collisions.

CSMA (Carrier Sense Multiple Access):

Devices listen before transmitting.

 CSMA/CD (Collision Detection): Used in Ethernet. Detects collision → stops → waits →


resends.

 CSMA/CA (Collision Avoidance): Used in Wi-Fi. Tries to avoid collision using RTS/CTS signals.

🔹 3. LAN Standards

 Ethernet (IEEE 802.3): Wired LAN using CSMA/CD.

 Wi-Fi (IEEE 802.11): Wireless LAN using CSMA/CA.

 Token Ring (IEEE 802.5): Uses a token passed between devices to grant permission to send
data.

🔹 4. Link Layer Devices: Switches & Bridges

Switch:

 Operates at Layer 2 (Data Link Layer).

 Forwards frames based on MAC addresses.

 Uses a MAC address table to decide where to forward the frame.

Bridge:

 Connects two different LAN segments.

 Filters traffic using MAC addresses.

 Reduces collision domain.


🔹 5. Learning Bridge

 A bridge that learns which MAC addresses belong to which ports by inspecting incoming
frames.

 Builds a forwarding table dynamically.

🔹 6. Spanning Tree Algorithm (STA)

Purpose: Prevents loops in network with multiple bridges/switches.

Process:

1. Select a root bridge (lowest MAC address).

2. Calculate shortest path to root from all bridges.

3. Disable redundant links → Create loop-free tree.

🧠 Flow Diagram – Spanning Tree Algorithm:

arduino

CopyEdit

[Bridge 1 (Root)]

[Bridge 2]------[Bridge 3]

\___________/

(Redundant links are disabled by STA)

🎯 Summary Keywords

 Framing: Data segmentation, synchronization.

 Error Control: Detection (Parity, CRC), Correction (Hamming).

 Flow Control: Stop-and-Wait, Sliding Window.

 MAC Protocols: ALOHA, CSMA/CD, CSMA/CA.

 LAN: Ethernet, Token Ring, Wi-Fi.

 Switch & Bridge: MAC forwarding, filtering.

 STA: Prevent loops, root bridge, tree topology.

You might also like