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

Computer Network Module-02 Search Creators

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

Computer Network Module-02 Search Creators

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

BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

MODULE-2

Chapter: -01- Data Link Layer

Error Detection and Correction:

Types of Errors:

 Single-bit Error: Only 1 bit changes (from 0 to 1 or 1 to 0).


 Burst Error: 2 or more bits change in the data unit.

Causes of Errors:

 Errors occur during data transmission due to interference, which alters the
signal.

Redundancy:

 Essential for error detection and correction.


 Extra bits (redundant bits) are added to the original data by the sender.
 These bits help the receiver identify or correct errors.

Detection vs. Correction:

Error Detection:

o Identifies if an error has occurred (yes/no).


o Does not determine the number or location of corrupted bits.
Search Creators... Page 1
BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

Error Correction:

o Requires knowledge of the exact number and location of corrupted bits.


o More complex due to the need to account for multiple possible error positions.

Complexity of Correction:

The number of error possibilities increases with the number of bits and errors:

o 1 error in 8 bits: 8 possible locations.


o 2 errors in 8 bits: 28 (28 combinations).
o 10 errors in 1000 bits greatly complicates the process.

Coding for Error Detection and Correction

Redundancy in Coding:

o Achieved through various coding schemes.


o Redundant bits create a relationship with actual data bits.
o The receiver uses these relationships to detect errors.

Importance of Ratios:

o The ratio of redundant bits to data bits is crucial.


o The robustness of the coding process affects error detection and correction
effectiveness.

Types of Coding Schemes:

Block Coding:

 Focus of this book.


 Involves encoding data in fixed-size blocks.

Convolution Coding:

Search Creators... Page 2


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

 More complex.
 Not covered in this book.

Block Coding

Concept of Block Coding:

o Messages are divided into blocks of k bits called datawords.


o r redundant bits are added to each block, creating n-bit codewords (where
n=k+rn = k + rn=k+r).
o Each codeword is a unique representation of a dataword.

Combinations of Datawords and Codewords:

o Datawords: 2k2^k2k possible combinations.


o Codewords: 2n2^n2n possible combinations.
o Since n>kn > kn>k, there are more codewords than datawords.

One-to-One Mapping:

o Each dataword is encoded to a specific codeword consistently.


o There are 2n−2k2^n - 2^k2n−2k invalid (or illegal) codewords that are not
used.

Error Detection:

Errors can be detected if two conditions are met:

1. The receiver has a list of valid codewords.


2. The received codeword has changed to an invalid codeword.
o If a received codeword matches a valid codeword, it is accepted, and the
corresponding dataword is extracted.
o If the received codeword does not match any valid codeword, it is discarded.

Search Creators... Page 3


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

Limitation:

o If a valid codeword is corrupted but still matches a valid codeword, the error will
go undetected.

Cyclic Codes

Definition:

Cyclic codes are a type of linear block code with the property that cyclic shifts (or
rotations) of a codeword result in another valid codeword.

Cyclic Shift Example:

o For a codeword like 1011000, a left cyclic shift results in 0110001.


o The bits are rearranged such that the last bit wraps around to the front.

Bit Shifting Representation:

If we denote bits in the original codeword as a0 to a6:

Search Creators... Page 4


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

Importance:

 The cyclic property of these codes simplifies error detection and correction
processes, making them robust for various applications.

Cyclic Redundancy Check (CRC)

Definition: CRC is a type of cyclic code used to detect errors in digital data
transmission.

Usage: Commonly employed in networks such as Local Area Networks (LANs) and
Wide Area Networks (WANs).

Properties:

o Linear Properties: CRC codes have linear characteristics, meaning that if


two code words are added together, the result is also a valid code word.
o Cyclic Properties: The code is cyclic; shifting the bits of a valid code word
results in another valid code word.

Error Detection: CRC can effectively identify accidental changes to raw data,
making it crucial for reliable data transmission.

Implementation: The CRC algorithm involves polynomial division of the data bits,
where the divisor is a predetermined polynomial.

Efficiency: CRCs provide a balance between error detection capability and


computational efficiency, making them suitable for real-time applications.

Example: Table 10.3 illustrates a specific CRC code, highlighting its linear and cyclic
properties.

Search Creators... Page 5


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

Polynomials in Cyclic Codes

Search Creators... Page 6


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

Search Creators... Page 7


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

Cyclic Code Encoder Using Polynomials

Dataword Representation:

o The dataword 1001 is represented as the polynomial x3 + 1.

Divisor Representation:

o The divisor 1011 is represented as x3 +x+ 1, referred to as the generator


polynomial t(x).

Augmented Dataword:

o To prepare for encoding, the dataword is left-shifted by the degree of the divisor
(3 bits), resulting in x6 + x3.

Polynomial Division:

o The division process starts by dividing the first term of the dividend (x6) by the
first term of the divisor (x3), resulting in x3.
Search Creators... Page 8
BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

o This quotient term is then multiplied by the divisor and subtracted from the
dividend to produce a new dividend.
o The division continues until the remainder's degree is less than that of the
divisor.

Simplification of Division:

o The polynomial representation simplifies the division process, avoiding the need
for handling all-0s divisors.
o This streamlined approach makes polynomial division more efficient compared to
binary division, where similar steps can also be eliminated.

Search Creators... Page 9


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

Cyclic Code Analysis

Search Creators... Page 10


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

Advantages of Cyclic Codes

Error Detection:

o Highly effective in detecting:


 Single-bit errors
 Double errors
 Odd number of errors
 Burst errors

Implementation:

o Easily implemented in both hardware and software.


o Particularly fast and efficient when implemented in hardware, making them
suitable for various applications.

Search Creators... Page 11


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

Simple Algebra:

o The cyclic codes discussed are straightforward, allowing for simple


calculations of check bits and syndromes.

Advanced Cyclic Codes:

o More powerful cyclic codes exist, based on abstract algebra and Galois fields,
though they are beyond this discussion.
o Notable examples include Reed-Solomon codes, which are used for both
error detection and correction.

Hardware Benefits:

o Hardware implementations of cyclic codes are cost-effective and utilize


minimal electronic components.
o Increases the speed of calculating check bits and syndrome bits.

Optional Content:

o The section on hardware implementation is optional and does not impact the
overall understanding of the chapter.

Search Creators... Page 12


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

Chapter: 2

Data link control

DLC Services:

o Manages communication between two adjacent nodes (node-to-node


communication).
o Functions include framing, flow control, and error control.

Framing:

o Bits transmitted in the physical layer need to be organized into frames in the
data-link layer.
o Frames help in distinguishing different messages and ensure correct
communication with sender and receiver addresses.

Frame Size:

o Frames can be fixed or variable in size.


o Fixed-size frames don’t require explicit delimiters, while variable-size frames do.

Character-Oriented Framing:

o Frames carry 8-bit characters (e.g., ASCII) with header and trailer containing
control information.
o Special flag characters are used to mark the beginning and end of frames.

Search Creators... Page 13


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

Issues with Character-Oriented Framing:

o If the flag character appears in the data, the receiver might incorrectly identify it
as the end of the frame.

Byte-Stuffing (Character Stuffing):

o To fix the flag issue, an escape character (ESC) is added before any data
matching the flag pattern.
o The receiver removes the ESC and treats the next character as part of the data.

Escape Character Problem in Byte Stuffing:

o If an escape character is followed by a byte with the same pattern as the flag,
the receiver could incorrectly interpret it as the end of the frame.
o Solution: If the escape character is part of the text, it is doubled to indicate that
it’s part of the data and not a delimiter.

Unicode Compatibility Issue:

o Character-oriented protocols face challenges with modern coding systems like


Unicode, which use 16-bit or 32-bit characters, conflicting with the 8-bit format
of these protocols.

Search Creators... Page 14


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

o As a result, the trend is moving toward bit-oriented protocols.

This process ensures smooth communication even when non-text data, such as
audio or video, are transmitted.

Bit-Oriented Framing:

o The data section of a frame is a sequence of bits (interpreted as text, graphics,


audio, video, etc.).
o A special 8-bit flag pattern (01111110) is used to define the beginning and
end of frames.

Bit Stuffing to Avoid Flag Confusion:

o To prevent confusion if the flag pattern appears in the data, a technique called
bit stuffing is used.
o After encountering five consecutive 1s, an extra 0 is inserted to avoid creating
the flag pattern by mistake.
o The stuffed bit is removed by the receiver during the decoding process.

Search Creators... Page 15


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

Ensuring Flag Detection:

o Even if the flag pattern (01111110) appears in the data, it is modified (via
stuffing) to 011111010, so the receiver does not mistake it for the real frame
delimiter.

This approach ensures reliable communication by avoiding false flags during


transmission while allowing flags to function as delimiters.

Flow and Error Control

Flow Control:

o Flow control manages the balance between production and consumption


rates of data between two entities.
o The goal is to prevent the receiver from becoming overwhelmed if data is
produced too quickly, avoiding data loss.
o In communication, flow control is feedback from the receiving node to the
sending node to stop or slow down the transmission rate if necessary.

Search Creators... Page 16


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

Communication Entities:

o At the data-link layer, four entities are involved: the network and data-link
layers at both the sending and receiving nodes.
o The focus is on flow control between the two data-link layers of the sending and
receiving nodes.

Flow Control Mechanism:

o The sending data-link layer pushes frames toward the receiving node’s data-
link layer.
o If the receiving node cannot process the frames fast enough, flow control signals
slow down or stop the transmission of frames.

Buffers:

o Buffers, used at both the sending and receiving data-link layers, are memory
locations to hold frames.
o When the buffer of the receiving data-link layer becomes full, it signals the
sending data-link layer to pause transmission until space is available in the
buffer again.

Flow control ensures data transmission efficiency by preventing data overflow at the
receiver, maintaining smooth communication between nodes.

Search Creators... Page 17


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

Example 11.1 and Discussion:

Single-Slot Buffer Flow Control (Example 11.1):

o Communication between producer and consumer can be simplified by using a


buffer with one memory slot.
o When the slot is empty, the receiving data-link layer signals the network layer to
send the next frame, easing flow control management.

Error Control:

o Error control ensures that corrupted frames are not delivered to the network
layer due to the unreliability of the physical layer.
o Two common methods of error control:
1. Silent Discarding: Corrupted frames are discarded, and uncorrupted
frames are delivered without acknowledgment (used in wired LANs like
Ethernet).
2. Acknowledgment-Based: Corrupted frames are discarded, but
uncorrupted frames prompt an acknowledgment sent to the sender (used
for both flow and error control).

Combination of Flow and Error Control:

o A single acknowledgment (ACK) can be used for both flow and error control.
o An ACK indicates successful and uncorrupted delivery of a frame, while no
acknowledgment implies a problem with the frame.

Connectionless and Connection Oriented

Connectionless Protocol:

o In a connectionless protocol, frames are independent of each other, with no


relationship or ordering.

Search Creators... Page 18


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

o Frames are not numbered and are sent without any logical connection. This is
typical for data-link protocols in LANs.

Connection-Oriented Protocol:

o In a connection-oriented protocol, a logical connection is established before


frame transmission.
o Frames are numbered, sent in order, and delivered sequentially to the network
layer once all related frames are received.
o This type of protocol is common in point-to-point protocols, wireless LANs,
and some WANs.

Flow and error control strategies ensure reliable and efficient communication
between nodes, handling corrupted frames and preventing data overflow while
maintaining orderly communication when needed.

Data-Link Layer Protocols

Traditional Protocols:

o Four main protocols: Simple, Stop-and-Wait, Go-Back-N, and Selective-Repeat.


o Current use: Simple and Stop-and-Wait protocols are still used at the data-link
layer, while Go-Back-N and Selective-Repeat have mostly disappeared.
o Full discussion of all four protocols is postponed to the transport layer.

Finite State Machine (FSM) for Protocol Behavior:

o FSM Definition: A machine with a finite number of states that switches


states based on events.
o Events and Actions: Each event triggers two reactions:
 A list of actions to be performed.
 Determination of the next state (could be the same or a different state).

Search Creators... Page 19


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

o Initial state: One state must be defined as the starting state when the machine
is activated.

FSM Example (Figure 11.6):

o Machine has three states.


o Events and actions:
 Starts in state I.
 Event 1: Performs actions 1 and 2, moves to state II.
 State II:
 If event 1 occurs, performs action 3, stays in state II.
 If event 3 occurs, performs no action, moves back to state I.

This FSM model helps visualize the behavior of data-link layer protocols through
state transitions based on events and actions.

Search Creators... Page 20


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

Simple Protocol

FSMs

In the Simple Protocol, the communication process between the sender and receiver
can be modeled using Finite State Machines (FSMs).

FSM for the Sender:

o The sender has one state: Ready.


o The sender stays in the "ready" state until a message is provided by the network
layer.
o When a message arrives from the network layer:
 The message is encapsulated into a frame.
 The frame is sent to the receiver.
 After sending, the sender goes back to the "ready" state.

Search Creators... Page 21


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

FSM for the Receiver:

o The receiver also has one state: Ready.


o The receiver stays in the "ready" state until a frame arrives from the sender.
o When a frame is received:
 The receiver decapsulates the frame to extract the message.
 The message is delivered to the network layer.
 After delivery, the receiver goes back to the "ready" state.

FSM Behavior:

 Both the sender and receiver operate in a single "ready" state, and they
transition based on the arrival of a message (sender side) or a frame
(receiver side).
 Sender: Transitions from waiting for a message to encapsulating and
sending a frame.
 Receiver: Transitions from waiting for a frame to decapsulating and
delivering the message to the network layer.

Search Creators... Page 22


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

This simple FSM structure reflects the minimal functionality of the protocol, with only
essential actions like sending and receiving messages.

Stop-and-Wait Protocol:

Protocol Overview:

o Combines flow control and error control.


o The sender sends one frame at a time and waits for an acknowledgment
(ACK) before sending the next frame.

Search Creators... Page 23


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

Error Detection:

o CRC (Cyclic Redundancy Check) is added to each frame for detecting


corruption.
o If the frame is corrupted, the receiver silently discards it.

Search Creators... Page 24


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

Sender Process:

o Starts a timer after sending each frame.


o If ACK is received before the timer expires, the timer is stopped, and the
next frame is sent.
o If the timer expires (ACK not received), the sender resends the frame.

Frame Resending:

o The sender retains a copy of the sent frame until it receives a valid ACK, at
which point the frame is discarded.

Receiver Process:

o Always in the ready state.


o If a correct frame arrives, it is delivered to the network layer, and an ACK
is sent.
o If the frame is corrupted, it is discarded.

Sender States:

o Ready State: Waits for a packet from the network layer, creates a frame,
sends it, and starts the timer.
o Blocking State:
Timeout: The sender resends the frame.
Corrupted ACK: Discarded.
Error-free ACK: Timer is stopped, and the next frame is sent.

Problems in Basic Stop-and-Wait:

o If an ACK is lost, the same frame may be resent, causing duplicate


frames at the receiver's network layer (Example 11.3).
Search Creators... Page 25
BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

Solution Using Sequence Numbers:

Sequence and Acknowledgment Numbers:

o Sequence numbers (0, 1, 0, 1, …) are added to frames.


o Acknowledgment numbers (1, 0, 1, 0, …) are added to ACKs,
specifying the sequence number of the next expected frame.

Example 11.4:

o Sequence numbers and acknowledgment numbers prevent duplicates.


Even if ACKs are lost, frames are not delivered twice to the network layer.

Search Creators... Page 26


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

Piggybacking

Unidirectional vs. Bidirectional Communication:

 Traditional protocols focus on unidirectional communication where data


flows in one direction, and acknowledgments (ACKs) flow in the opposite
direction.
 Piggybacking is designed for bidirectional communication, allowing data to
flow in both directions.

Piggybacking Concept:

 Efficiency: Acknowledgments from one node (e.g., Node A) are included (or
piggybacked) with the data being sent in the opposite direction (e.g., to Node B).
 This avoids sending separate ACK frames, improving the efficiency of
communication.

Challenges:

 Piggybacking increases complexity at the data link layer, which can make it
less commonly used in practice.

Further Discussion:

 Detailed examination of two-way communication and piggybacking occurs in


Chapter 23.

HDLC (High-level Data Link Control)

Protocol Overview:

o HDLC is a bit-oriented protocol used for communication over both point-to-


point and multipoint links.

Search Creators... Page 27


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

Implementation:

o HDLC implements the Stop-and-Wait protocol, which controls the flow of data
and manages error detection and correction.

Theoretical vs. Practical:

o Although HDLC is largely theoretical, many of its concepts are foundational for
other practical protocols.

Search Creators... Page 28


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

Applications:

o HDLC concepts serve as the basis for protocols like PPP (Point-to-Point
Protocol), discussed later.
o It also influences Ethernet protocols in wired LANs (discussed in Chapter 13)
and wireless LANs (Chapter 15).

HDLC Configurations, Transfer Modes, and Framing:

HDLC Configurations:

Normal Response Mode (NRM):


 Unbalanced configuration: One primary station sends commands, and
multiple secondary stations only respond.
 Used in both point-to-point and multipoint links.
Asynchronous Balanced Mode (ABM):
 Balanced configuration: Each station can act as both primary and
secondary, operating as peers.
 Typically used in point-to-point links and is the most common mode
today.

Framing in HDLC:

HDLC uses three types of frames, each serving specific purposes:

 Information Frames (I-frames): Carry user data and control information,


often involving piggybacking.
 Supervisory Frames (S-frames): Used only for control information (e.g.,
flow and error control).
 Unnumbered Frames (U-frames): Reserved for system management and
control of the communication link itself.

Search Creators... Page 29


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

Frame Structure:

Each HDLC frame may consist of up to six fields:

 Flag Field: Contains a synchronization pattern (01111110) marking the start


and end of the frame.
Search Creators... Page 30
BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

 Address Field: Identifies the secondary station; it may carry either the to or
from address depending on the source.
 Control Field: Specifies the type of frame (I-frame, S-frame, or U-frame) and its
functionality (flow/error control).
 Information Field: Holds user data from the network layer or management
information (variable length).
 Frame Check Sequence (FCS) Field: Used for error detection via a 2- or
4-byte CRC (Cyclic Redundancy Check).
 Ending Flag Field: Marks the end of the frame; in some cases, it can also serve
as the beginning flag of the next frame in consecutive transmission.

Control Field Format:

o The control field differs based on the frame type (I-frame, S-frame, U-frame),
defining the specific operations for flow control, error handling, or system
management

Control Field for HDLC Frames

Control Field for I-Frames (Information Frames):

 Purpose: I-frames carry user data from the network layer and may also include
flow and error control information through piggybacking.
 Subfields:
o First bit (Type): A value of 0 indicates that the frame is an I-frame.

Search Creators... Page 31


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

o N(S) (Next Send Sequence Number): The next 3 bits define the
sequence number of the frame (values between 0 and 7).
o P/F bit (Poll/Final): A single bit between N(S) and N(R) with two
functions:
 Poll (P): When the frame is sent by a primary station to a
secondary.
 Final (F): When the frame is sent by a secondary station to a
primary.
o N(R) (Next Receive Sequence Number): The last 3 bits represent the
acknowledgment number when piggybacking is used.

Control Field for S-Frames (Supervisory Frames):

Purpose: S-frames are used for flow control and error control when
piggybacking is not feasible. They do not contain an information field.

Subfields:

First two bits (Type): A value of 10 indicates that the frame is an S-frame.

Code (2 bits): Defines the specific type of S-frame, allowing for four possible
values:

1. Receive Ready (RR):


 Code: 00
 Acknowledges the receipt of a valid frame or group of
frames. The value of N(R) is the acknowledgment number.
2. Receive Not Ready (RNR):
 Code: 10
 Acknowledges receipt of a frame or group of frames but
informs the sender that the receiver is busy and cannot
accept more frames (used for congestion control).

Search Creators... Page 32


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

3. Reject (REJ):
 Code: 01
 A negative acknowledgment (NAK) used in Go-Back-N ARQ
to notify the sender that a frame is lost or corrupted
before the sender's timer expires. N(R) contains the negative
acknowledgment number.
4. Selective Reject (SREJ):
 Code: 11
 A NAK used in Selective Repeat ARQ, known as Selective
Reject in HDLC. It specifies the negative acknowledgment
number (N(R)).
 N(R): The last 3 bits in S-frames represent the acknowledgment number or
negative acknowledgment number depending on the type of S-frame.

Control Field for U-Frames (Unnumbered Frames)

Purpose:

 U-Frames are used for session management and control information


exchange between connected devices. Unlike S-frames, U-frames can carry an
information field (for system management, not user data).
 They are utilized for various tasks, such as connection establishment,
maintenance, and disconnection.

Control Field Structure:

 The control field in U-frames contains two code segments:


1. Prefix: A 2-bit segment before the P/F (Poll/Final) bit.
2. Suffix: A 3-bit segment after the P/F bit.
 The combination of the 2-bit prefix, P/F bit, and 3-bit suffix provides a total
of 32 possible U-frame types.

Search Creators... Page 33


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

P/F Bit:

 Similar to I-frames and S-frames, the P/F bit in U-frames indicates whether
the frame is acting as a Poll (P) or Final (F) signal.
o Poll (P): When the frame is sent by the primary station to the
secondary.
o Final (F): When the frame is sent by the secondary station to the
primary.

Common U-Frame Types:

 Set Asynchronous Balanced Mode (SABM): Used to establish a


connection.
 Unnumbered Acknowledgment (UA): Confirms a request, such as
connection establishment or disconnection.
 Disconnect (DISC): Used to terminate a connection between stations.

Example:

 Connection Establishment and Termination (Example 11.5):


o Node A initiates a connection with a SABM frame.
o Node B responds with an Unnumbered Acknowledgment (UA) frame,
confirming the connection.
o Data transfer begins after the connection is established.
o After data transfer, Node A sends a DISC frame to terminate the
connection, which is confirmed by Node B with a UA frame.

Search Creators... Page 34


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

Search Creators... Page 35


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

Chapter: - 3

Media Access Control

Random Access Protocols: Overview and ALOHA Protocol

Characteristics of Random Access Methods:

 Equal Access Rights: No station has superiority over another, and any station
can attempt transmission based on the state of the medium.
 Random Transmission: Stations transmit data when they wish, leading to
random access, with no predetermined order or schedule.
 Collision Handling: When multiple stations transmit simultaneously, collisions
occur, resulting in the need for procedures to resolve these conflicts.

In random-access methods, four questions must be addressed:

1. When can a station access the medium?


2. What happens if the medium is busy?
3. How is success or failure of the transmission determined?
4. What actions are taken if a collision occurs?

ALOHA Protocol:

The ALOHA protocol was one of the earliest random access methods, originally
designed for wireless communication but applicable to any shared medium.

Pure ALOHA:

 How it works: In pure ALOHA, stations transmit whenever they have data to
send, without sensing the medium for activity. This leads to potential collisions
between stations sending data at the same time.

Search Creators... Page 36


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

 Collisions: If two or more stations transmit simultaneously, their frames will


collide, causing the data to be destroyed. Even a small overlap of frames results
in complete destruction of both.
 Acknowledgments: Each station expects an acknowledgment from the receiver
after transmitting a frame. If no acknowledgment is received after a time-out
period, the station assumes the frame was lost and retransmits it.
 Backoff Time: To reduce the chance of repeated collisions, stations wait for a
random backoff time (TB) before attempting retransmission. This random
delay helps prevent consecutive collisions by staggering transmission attempts.
The backoff time is recalculated based on the number of retransmission
attempts.
 Binary Exponential Backoff: A common method for calculating backoff time.
After each collision, the random backoff window increases exponentially, helping
to manage congestion and reduce the likelihood of continuous collisions.

Collision and Resend Strategy:

 If a collision occurs, all stations involved wait for a time-out and then try
again after a random backoff time.

Search Creators... Page 37


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

 The station resends the frame a limited number of times (typically up to 15


retries or Kmax). After this limit, it gives up and retries later.

Performance and Efficiency:

 Pure ALOHA operates with relatively low efficiency due to the high possibility
of collisions. At best, pure ALOHA achieves around 18% throughput in an
ideal scenario, meaning only a small fraction of total transmission time is used
successfully.

Improved Versions:

To improve upon pure ALOHA, Carrier Sense Multiple Access (CSMA) was
introduced. It adds the ability to sense the medium before transmitting, reducing the
likelihood of collisions.

Carrier Sense Multiple Access (CSMA)

CSMA improves upon the ALOHA protocol by introducing a mechanism to sense the
medium before transmitting, aiming to reduce collisions and improve overall
efficiency.

How CSMA Works:

 Listen Before Talk: Before a station transmits data, it listens to the


communication medium to check whether it is idle or busy. This approach follows
the principle of "sense before transmit" or "listen before talk."
 Collision Reduction: By sensing the medium first, CSMA reduces the likelihood
of collisions. However, collisions can still occur due to propagation delay.

Propagation Delay and Collisions:

 Propagation Delay: Even though a station senses the medium, a collision


can still occur because of the time it takes for signals to propagate through
Search Creators... Page 38
BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

the network. If a station transmits a frame and another station does not
detect this transmission due to the delay in signal propagation, both may
transmit simultaneously, leading to a collision.
 Example: As illustrated, at time t1, station B senses the medium and finds it
idle, so it starts sending its frame. At a slightly later time t2 (where t2 > t1),
station C also senses the medium and detects it as idle because the first bit
from station B has not yet reached it. Both stations transmit simultaneously,
causing a collision and the destruction of both frames.

CSMA Types:

To further reduce collisions, variations of CSMA have been developed:

1-Persistent CSMA:

o After sensing the medium, the station sends data immediately if the medium is
idle. If the medium is busy, it continuously senses the medium until it becomes
idle.
o Drawback: This approach increases the chances of a collision if multiple stations
are waiting for the medium to become idle simultaneously.

Non-Persistent CSMA:

o After sensing the medium, if it is busy, the station waits for a random amount
of time before attempting to sense and transmit again.
o Advantage: It reduces the probability of collisions by preventing stations from
all attempting to send at the exact moment the medium becomes idle.

P-Persistent CSMA:

o Used mainly in slotted channels. After sensing the medium, if it is idle, the station
sends the frame with a probability of p or defers to the next slot with a
probability of 1-p.

Search Creators... Page 39


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

o Advantage: This balances the chance of immediate transmission with the


potential for random delays, reducing collisions and improving performance.

Collision Handling in CSMA:

Even with sensing, collisions can still occur due to propagation delays, and strategies
like CSMA with Collision Detection (CSMA/CD) and CSMA with Collision
Avoidance (CSMA/CA) have been developed to manage this.

 CSMA/CD (Collision Detection):


o Used in wired networks (e.g., Ethernet), CSMA/CD involves detecting
collisions during transmission. If a collision is detected, transmission is
aborted, and the station waits for a random backoff time before
attempting to retransmit.
o This method minimizes wasted time and bandwidth by stopping the
transmission as soon as a collision is detected.
 CSMA/CA (Collision Avoidance):
o More suitable for wireless networks, CSMA/CA tries to prevent
collisions before they occur. Instead of detecting collisions, stations use

Search Creators... Page 40


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

strategies like acknowledgments and random backoff intervals to


avoid simultaneous transmissions.
o Commonly used in Wi-Fi networks to manage the challenges of
wireless communication, where collision detection is difficult.

Vulnerable Time

The vulnerable time in Carrier Sense Multiple Access (CSMA) represents the
window of time during which a collision can occur. This time is directly related to the
propagation delay (Tp), which is the time it takes for a signal to travel from one
end of the network medium to the other.

Detailed Explanation:

 When a station (e.g., station A) starts sending a frame, it takes time for the
first bit of that frame to propagate to the furthest station (e.g., station D).
This propagation time is referred to as Tp.
 During this propagation time, the medium still appears idle to other stations
because the signal hasn't reached them yet. If another station (such as B, C,
or D) starts transmitting during this period, a collision will occur.
 Vulnerable time is thus defined as the propagation time, Tp, because that
is the period in which other stations might still attempt to transmit and cause
a collision.

Worst-Case Scenario:

 At time t1, station A begins transmitting a frame.


 The frame reaches the furthest station, D, at time t1 + Tp.
 Any other station trying to send a frame during the period between t1 and t1
+ Tp may collide with the ongoing transmission from station A.

Search Creators... Page 41


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

 Once the first bit of the frame reaches station D (or the furthest point on the
medium), all stations will be aware that the medium is busy, and no further
collisions will occur for this transmission.

Search Creators... Page 42


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

Search Creators... Page 43


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

CSMA/CD

Carrier Sense Multiple Access with Collision Detection (CSMA/CD) enhances


the basic CSMA protocol by introducing a mechanism for detecting and resolving
collisions when multiple stations transmit simultaneously.

This is crucial in shared network environments like Ethernet to improve efficiency


and reduce wasted bandwidth.

Search Creators... Page 44


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

How CSMA/CD Works:

1. Sense the Medium: Before sending data, a station first listens to the
communication medium to check if it is idle or busy.
2. Transmit the Frame: If the medium is idle, the station starts transmitting
its frame.
3. Monitor for Collision: While transmitting, the station keeps listening to the
medium to detect any possible collisions.
4. Collision Detection: A collision occurs when another station also begins
transmitting. The signals overlap, and the stations detect that a collision has
occurred.
5. Abort Transmission: Upon detecting a collision, the station immediately
stops transmitting to minimize data loss and avoid network congestion.
6. Random Backoff: After aborting, the station waits for a random backoff
period (using a method like binary exponential backoff) before trying to
retransmit the frame, thus reducing the likelihood of another immediate
collision.

Example of a Collision (Based on Figure 12.11):

 At time t1: Station A senses that the medium is idle and begins transmitting
its frame.
 At time t2: Station C, unaware that Station A has started transmitting (due
to propagation delay), also senses the medium as idle and begins transmitting
its frame.
 The first bits of both frames collide somewhere on the network medium.
 At time t3: Station C detects the collision upon receiving the first bit of
Station A's frame and immediately stops transmitting.
 At time t4: Station A also detects the collision when it receives the first bit of
Station C's frame and stops transmitting as well.

Search Creators... Page 45


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

Transmission Durations:

 A transmits from t1 to t4.


 C transmits from t2 to t3.

Both stations wait for a random period after the collision to avoid transmitting at the
same time again, then retransmit their frames.

Significance of CSMA/CD:

 Collision Detection: It allows stations to detect collisions early and stop


transmitting, reducing the amount of data that gets corrupted.
 Efficiency: By implementing collision detection and using random backoff,
the method optimizes the use of shared communication channels.
 Widely Used in Ethernet: CSMA/CD was the backbone of traditional
Ethernet networks before the adoption of modern switched Ethernet, where
collisions are eliminated entirely.

This method balances fairness in accessing the medium while minimizing


transmission collisions.

Search Creators... Page 46


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

In this scenario, CSMA/CD is managing a collision that occurs when two stations, A
and C, transmit data at the same time.

Here’s a breakdown of the events:

1. At time t1: Station A executes its persistence procedure and begins transmitting
its frame. It has successfully sensed the medium as idle, so it starts to send the
data.
2. At time t2: Station C, unaware that station A is transmitting (because of
propagation delay), senses the medium as idle and starts transmitting its own
frame. The signals from both stations begin propagating in both directions.
3. Collision Detection:
o At time t3: Station C detects a collision. This happens when the first bit
of Station A’s frame reaches C. Upon detecting the collision, C
immediately stops transmitting (or after a very short delay).
o At time t4: Station A detects the collision when the first bit of Station C's
frame reaches it. A also aborts transmission at this point.
4. Transmission Durations:
o Station A transmits for the time interval between t1 and t4. So, the
duration of A’s transmission is t4 − t1.
o Station C transmits for the time interval between t2 and t3. The duration
of C’s transmission is t3 − t2.
5. Collision Handling:
o Both stations detect that their transmissions failed, so they stop sending
data and will follow the CSMA/CD backoff algorithm, waiting a random
time before attempting to retransmit.

Key Observations:

 Propagation Delay: The reason Station C doesn’t detect the transmission of


A immediately is due to the propagation delay across the medium. This delay

Search Creators... Page 47


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

can cause a station to believe the medium is idle when it is not, leading to a
collision.
 Collision Detection: Both stations detect the collision after they have
already begun transmitting, but the time of detection differs based on their
positions and the propagation delay.

Significance of Graph in Figure 12.12:

The graph illustrates the timeline of events, showing the duration of transmission for
both stations and highlighting when each station detects the collision.

The timeline is essential for visualizing how collisions happen and how CSMA/CD
handles them by aborting transmissions and avoiding further collisions using a
backoff strategy.

Minimum Frame Size

In CSMA/CD (Carrier Sense Multiple Access with Collision Detection), the concept
of minimum frame size ensures that a station can detect collisions before finishing
its transmission. This requirement is based on the fact that the station must still be
transmitting when a collision occurs, in order to detect it and stop the transmission.

Search Creators... Page 48


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

The Core Idea

For collision detection to work effectively, the frame transmission time (Tfr) must be
at least twice the maximum propagation time (2Tp). The propagation time is the
time it takes for a signal to travel from one end of the network to the other.

Worst-Case Scenario:

 If two stations involved in a collision are the maximum possible distance


apart, it will take time Tp for the first station's signal to reach the second
station.
 The second station’s transmission, which collides with the first, will take
another Tp to propagate back and inform the first station about the collision.
 Thus, the first station must still be transmitting at least 2Tp time units after it
starts transmitting to detect the collision and abort the frame.

Example 12.5:

Given:

 Network bandwidth: 10 Mbps (10 million bits per second)


 Maximum propagation time: 25.6 µs

1. Frame Transmission Time (Tfr): The frame transmission time must be at


least 2 × Tp, which gives us:

Tfr = 2 × 25.6 µs = 51.2 µs

This means that the frame transmission time must be at least 51.2 µs.

2. Minimum Frame Size: To calculate the minimum frame size, we multiply


the bandwidth by the required frame transmission time:

Search Creators... Page 49


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

Minimum frame size = 10 Mbps × 51.2 µs = 512 bits = 64 bytes

This results in a minimum frame size of 64 bytes, which ensures that the station
can still detect collisions before the frame is fully transmitted. This frame size is also
the minimum frame size for Standard Ethernet.

Procedure

In CSMA/CD (Carrier Sense Multiple Access with Collision Detection), the procedure
for handling frame transmission and collisions is more sophisticated than in simpler
protocols like ALOHA, due to the inclusion of persistence mechanisms, collision
detection, and jamming signals.

Key Differences and Procedure:

1. Persistence Process:
o Before transmission begins, the station senses the channel using one of
the persistence processes:
 Nonpersistent: The station waits a random amount of time if
the channel is busy.
 1-persistent: The station keeps sensing and transmits as soon
as the channel is idle.
 p-persistent: The station transmits with a probability p if the
channel is idle, or waits for the next time slot if busy.
o These persistence processes help minimize collisions by controlling when
a station attempts to access the medium.
2. Frame Transmission with Continuous Collision Detection:
o Unlike in ALOHA where the entire frame is transmitted before checking
for acknowledgment, in CSMA/CD, transmission and collision detection
are continuous.

Search Creators... Page 50


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

o While transmitting, the station simultaneously monitors the medium


for collisions. If a collision is detected during transmission, the station
immediately stops transmitting.
o Dual ports or bidirectional ports are used to allow simultaneous
transmission and reception of data for collision monitoring.
3. Collision Handling:
o If a collision is detected, the transmission stops immediately.
o The station then sends a jamming signal to ensure all other stations
are aware of the collision. This prevents other stations from continuing
their transmissions after the collision.
4. Post-Collision Process:
o After sending the jamming signal, the station waits for a random backoff
time, calculated using algorithms like binary exponential backoff.
o The station then retries the transmission after the backoff period.
5. Success and Completion:
o If no collision is detected and the transmission completes successfully,
the station finishes transmitting and waits for an acknowledgment.

Flow Diagram (Figure 12.13 Overview):

 The flow diagram for CSMA/CD illustrates the procedure in a loop. The
station continuously monitors the medium while transmitting, checking for
one of two outcomes:
o Transmission completes successfully: The entire frame is sent,
and no collision is detected.
o Collision detected: Transmission stops, the jamming signal is sent,
and the process restarts after backoff.

Search Creators... Page 51


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

This procedure enables CSMA/CD to reduce collisions and efficiently manage


medium access in network environments like Ethernet.

Search Creators... Page 52


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

CSMA/CA

CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance) is primarily used
in wireless networks and is designed to prevent collisions before they happen.
Unlike CSMA/CD, which detects and manages collisions after they occur, CSMA/CA
uses a proactive approach to avoid collisions altogether.

CSMA/CA Strategies

Interframe Space (IFS):

o After a station finds the channel idle, it does not immediately start transmitting.
It waits for a brief period known as the Interframe Space (IFS).
o This waiting period is crucial because there might be a distant station that has
already started transmitting, but the signal hasn't reached the current station yet.
o The IFS time allows for any ongoing transmissions from other stations to be
detected before starting a new transmission.
o Prioritization: Stations or frame types with shorter IFS times are given higher
priority, meaning they can access the channel sooner.

Search Creators... Page 53


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

Contention Window:

o After the IFS period, the station waits for an additional time period called the
contention window. This window is divided into slots, and the station selects a
random number of slots as its wait time.
o The size of the contention window is dynamic, growing with each attempt to
access the medium, following the binary exponential backoff strategy. This
helps reduce congestion on the channel.
o During this period, the station continually senses the medium. If it detects that
the channel is busy, it pauses the timer and resumes once the channel is idle
again. This ensures that stations with the longest waiting time have priority
when the channel becomes free.

Acknowledgment:

o Despite all precautions, collisions or data corruption can still occur.


o To ensure that the transmitted frame is received correctly, CSMA/CA uses
positive acknowledgments from the receiver.
o If the sender does not receive an acknowledgment within a specified timeout
period, it assumes that the transmission failed and will attempt retransmission.

Search Creators... Page 54


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

Operation of CSMA/CA

 Sense the Channel: Before transmission, the station checks if the medium
is idle.
 Wait for IFS: Even if the channel is idle, the station waits for the IFS period
to allow any ongoing distant transmissions to be detected.
 Choose Random Slot in Contention Window: After the IFS, the station
chooses a random slot within the contention window to minimize the
likelihood of multiple stations transmitting simultaneously.
 Monitor Channel Continuously: The station checks the channel after each
time slot. If the channel becomes busy, it pauses the countdown and waits
until the channel is idle again.
 Transmit and Wait for Acknowledgment: If the channel remains idle, the
station transmits its frame and waits for an acknowledgment to ensure
successful transmission.

This combination of waiting periods (IFS and contention window) and


acknowledgments helps CSMA/CA avoid collisions and ensure reliable transmission
in wireless networks, where collision detection is more challenging due to signal
propagation and interference factors.

Frame Exchange Time Line

Search Creators... Page 55


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

Network Allocation Vector

In CSMA/CA, the Network Allocation Vector (NAV) is an essential feature that


helps stations avoid collisions by informing them when the channel is occupied and
for how long. Here's a detailed explanation:

Network Allocation Vector (NAV)

When a station initiates a transmission in CSMA/CA, it sends a Request to Send


(RTS) frame to notify other stations that it intends to transmit data. The RTS frame
contains a duration field specifying the amount of time the channel will be occupied.

Search Creators... Page 56


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

Any station that receives this RTS frame will set a timer known as the NAV
(Network Allocation Vector).

 Purpose of NAV: The NAV serves as a countdown timer, telling each station
how long it must wait before attempting to access the medium. While the
NAV is active, a station will defer from transmitting, even if it senses that
the physical channel is idle. This ensures that stations don't interfere with an
ongoing transmission, thus preventing collisions.
 Process: When a station sends an RTS, other stations in range start their
NAV timers based on the duration mentioned in the RTS frame. Before
checking the channel for idleness, a station first checks whether its NAV has
expired. If it has not expired, the station will not attempt to access the
medium.

Collision Avoidance through NAV

The NAV helps with the collision avoidance part of CSMA/CA by ensuring that
other stations remain silent for the required period, reducing the chance of collisions.
The process looks like this:

1. Station sends RTS: The station wanting to transmit data sends an RTS
(Request to Send) frame that includes the time it needs to occupy the
medium.
2. Other stations set NAV: All stations that receive this RTS start their NAV
timer, refraining from transmitting during this period.
3. Transmission proceeds: The transmitting station receives a Clear to Send
(CTS) frame from the receiver, allowing the data transfer to proceed.
4. NAV countdown: During the data transmission, the NAV of other stations
continues counting down. Once the timer expires, stations can check the
channel for idleness and try to access it again.

Search Creators... Page 57


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

Collision During Handshaking

During the handshaking period (when RTS or CTS frames are exchanged), collisions
can still occur.

If multiple stations send RTS frames simultaneously, these control frames may
collide because there is no mechanism for collision detection in wireless
networks.

 Handling collisions: If a station sends an RTS and does not receive a CTS
frame from the receiver, it assumes that a collision occurred. In response, the
station initiates a backoff process, waiting a random period before trying to
send the RTS again. This reduces the chance of repeated collisions.

Hidden Station Problem

The hidden station problem occurs when a station is out of range of other
stations communicating with the access point. In such cases, stations may
unknowingly transmit at the same time, leading to collisions.

 Solution via Handshaking (RTS/CTS): The RTS/CTS handshaking


mechanism helps mitigate this problem.
 Even if one station (e.g., Station C) does not hear an RTS from another
station (e.g., Station B), it will receive the CTS from the receiver (e.g., Station
A).
 Since the CTS contains the duration of the transmission from B to A, Station C
will know that the channel is in use and will refrain from transmitting until the
transmission is complete.

The combination of the NAV and the RTS/CTS handshake mechanism helps
CSMA/CA reduce collisions, particularly in wireless networks, where issues like
hidden terminals are common.

Search Creators... Page 58


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

CONTROLLED ACCESS

In controlled-access methods, stations collaborate to decide which one has the right
to send data. This approach ensures more organized communication and reduces
the chances of collision, as stations take turns or follow specific rules. Below are the
three main controlled-access methods: Reservation, Polling, and Token Passing.

Reservation Method

In the reservation method, time is divided into intervals, and within each interval,
a reservation frame precedes the transmission of data frames. The idea is that a
station must first reserve a time slot to transmit data by signaling its intention in a
"minislot" that belongs to it in the reservation frame.

 If there are N stations, the reservation frame will contain N minislots—one


for each station.
 Stations that need to send data mark their respective minislots to reserve
time for transmission.
 After the reservation frame is sent, the stations that have made reservations
proceed to send their data frames.

Example:

 In a system with 5 stations, a reservation frame has 5 minislots.


 If stations 1, 3, and 4 make reservations during a specific interval, only they
will transmit their data during that interval (as shown in Figure 12.18).

Search Creators... Page 59


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

 In the next interval, only station 1 makes a reservation, so it is the only one
that sends data in that time period.

The reservation method is particularly useful when traffic is predictable or there is a


need for real-time communication, as it ensures that stations with data to send
have dedicated slots, avoiding collisions.

Polling Method

The polling method is commonly used in systems where one device acts as a
primary station, and the other devices are secondary stations. The primary
station controls the communication process and decides which secondary station is
allowed to transmit data at any given time.

 The primary station initiates communication by sending a poll to a specific


secondary station, asking if it has data to send.
 If the secondary station has data, it sends it; if not, the primary moves on to
the next station.
 This centralized control prevents collisions, as only one station is allowed to
transmit at a time under the direction of the primary station.

Search Creators... Page 60


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

However, the major drawback of polling is that the entire system depends on
the primary station. If the primary station fails, communication stops, causing the
whole system to break down (as seen in Figure 12.19).

Polling Example:

 In a network, the primary station first polls secondary station A. If A has data
to send, it sends its data.
 Once A finishes, the primary polls station B, and the process continues in this
manner.

Polling is often used in star or point-to-point topologies where there is a central


controller.

Token Passing (Not explicitly mentioned but part of controlled-access


methods)

Token passing is another controlled-access method where stations are organized


in a logical or physical ring.

A token is passed around the network, and only the station that holds the token is
allowed to transmit data. Once the station finishes, it passes the token to the next
station in the sequence.

 This method ensures that only one station sends data at a time, eliminating
the possibility of collisions.
 It is efficient in networks with predictable or steady traffic, as stations get
regular chances to transmit.

Example:

 In a ring network, Station A holds the token and sends data. Once done, it
passes the token to Station B, which then transmits its data, and so on.

Search Creators... Page 61


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

This method is used in protocols like Token Ring and FDDI (Fiber Distributed
Data Interface).

Controlled Access Methods:

 Reservation: Stations reserve time slots before transmitting, ensuring


organized access to the channel.
 Polling: A primary station controls access by polling secondary stations,
preventing collisions but dependent on the primary station.
 Token Passing: A token circulates through the network, giving each station
a turn to transmit, ensuring collision-free communication.

Each method ensures controlled access and reduces the likelihood of collisions, but
they differ in complexity, scalability, and robustness based on the network structure
and requirements.

Select

In controlled access, polling and selecting are key functions used by the primary
device to manage communication with secondary devices.

Select Function

The select (SEL) function is used by the primary device whenever it has data to
send to a secondary device.

Since the primary controls the communication link, it knows that the link is available,
but it needs to ensure that the target secondary device is ready to receive data.

Steps:

1. The primary device sends a select (SEL) frame, which contains the address
of the intended secondary device.

Search Creators... Page 62


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

2. The secondary device receives the select frame and responds, indicating
whether it is ready to receive data.
3. If the secondary is ready, the primary device proceeds to send the data.

The select function ensures that data is only sent when the secondary device is
prepared to handle the transmission, preventing wasted communication attempts.

Poll Function

The poll function is used by the primary device to check whether any of the
secondary devices have data to send.

Steps:

1. The primary device sends a poll frame to a secondary device, asking if it has
data to send.
2. The secondary device responds with:
o A NAK (Negative Acknowledgment) frame if it has no data to
send.
o A data frame if it has data ready for transmission.
3. If the secondary device sends a data frame, the primary device receives the
data and sends an ACK (Acknowledgment) frame, confirming the
successful receipt of the data.
4. If the response is a NAK frame, the primary device moves on to poll the next
secondary device in the same manner.

Polling ensures that the primary device systematically checks with each secondary
device to see if any have data to send, maintaining orderly communication without
collisions.

Search Creators... Page 63


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

Comparison of Select and Poll:

 Select: Used when the primary device has data to send. It checks if the
secondary device is ready to receive.
 Poll: Used when the primary device is ready to receive data. It checks if
secondary devices have any data to send.

Both methods are crucial in maintaining an organized communication structure,


ensuring that data is transmitted efficiently between primary and secondary devices.

Token Passing

Token passing is a method of controlling access to a network where stations are


organized in a logical ring. In this setup:

 Each station has a predecessor (the station before it in the ring) and a
successor (the station after it).
 The right to access the channel is controlled by a special packet known as a
token.

How Token Passing Works

1. Token Circulation:
o The token circulates through the network. Possession of the token
grants a station the right to send data.
o When a station wants to send data, it waits to receive the token from
its predecessor.
o Once it receives the token, the station can send its data.
2. Passing the Token:
o After the data has been sent, the station releases the token, passing it
to the next logical station (its successor).
o If a station receives the token and has no data to send, it simply
passes the token to the next station.

Search Creators... Page 64


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

Token Management

Effective token management is essential to ensure reliable access:

 Token Limitation: Stations must be limited in how long they can hold the
token to prevent monopolization.
 Token Monitoring: Mechanisms are needed to detect if the token has been
lost or destroyed (e.g., if a station holding the token fails).
 Priority Assignment: Priorities can be assigned to stations and types of
data, ensuring that high-priority stations can access the token when needed.

Logical Ring

In a token-passing network, the logical arrangement of stations can differ from their
physical connections:

 Physical Ring Topology: Stations are connected in a physical ring, but if


one link fails, the entire network may become inoperable since the token
cannot circulate.

Search Creators... Page 65


BCS502 | COMPUTER NETWORKS | SEARCH CREATORS

 Dual Ring Topology: This design uses a secondary ring that operates in the
reverse direction. If the main ring fails, the two rings can combine to form a
temporary ring, ensuring continued operation. This topology is used in high-
speed networks like FDDI (Fiber Distributed Data Interface) and CDDI
(Copper Distributed Data Interface).
 Bus Ring Topology (Token Bus): Stations are connected to a single bus
but create a logical ring by knowing the addresses of their predecessors and
successors. When a station releases the token, it includes the address of its
successor. Only the station with the matching address can use the token.
 Star Ring Topology: Stations connect to a central hub, which creates a
logical ring. This design offers resilience against link failures; if one link goes
down, the hub can bypass it, allowing the network to continue functioning.
This topology is used in IBM's Token Ring LAN.

Advantages and Considerations

 Efficiency: Token passing reduces collisions since only one station can
transmit at a time.
 Predictability: Token management allows for orderly data transmission and
can provide guarantees for bandwidth and latency.
 Complexity: Maintaining the token and ensuring it is not lost requires
additional overhead and management.

Token passing is an effective method for managing access in networks, especially


when structured as a logical ring, allowing for efficient data transmission while
minimizing collisions and managing priorities.

Search Creators... Page 66

You might also like