COMPUTER NETWORKS
B.Tech: III Year – II Sem
UNIT 2
DATA LINK LAYER
Presented by
Dr. B.Rajalingam
Associate Professor & HOD
Department of Artificial Intelligence and Data Science (AI&DS)
St.Martin’s Engineering College
1
•
UNIT 2 - Data link layer
Data link layer:
• Design issues
• Framing
• Error detection and correction
• Elementary data link protocols:
• simplex protocol
• A simplex stop and wait protocol for an error free channel
• A simplex stop and wait protocol for noisy channel
• Sliding Window protocols:
• A one-bit sliding window protocol
• A protocol using Go-Back-N
• A protocol using Selective Repeat
• Example data link protocols
• Medium Access sub layer:
• The channel allocation problem
• Multiple access protocols:
• ALOHA
• Carrier sense multiple access protocols
• Collision free protocols.
• Wireless LANs, Data link layer switching
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 2
Data Link Layer
• In the OSI model, the data link layer is a 4th layer from the top and 2nd layer from the
bottom.
• The communication channel that connects the adjacent nodes is known as links, and in order
to move the datagram from source to the destination, the datagram must be moved across an
individual link.
• The main responsibility of the Data Link Layer is to transfer the datagram across an
individual link.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 3
(DL)Cont…
• The Data link layer protocol defines the format of the packet exchanged across the nodes as
well as the actions such as Error detection, retransmission, flow control, and random access.
• The Data Link Layer protocols are Ethernet, token ring, FDDI and PPP.
• An important characteristic of a Data Link Layer is that datagram can be handled by different
link layer protocols on different links in a path.
• For example, the datagram is handled by Ethernet on the first link, PPP on the second link.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 4
Following services are provided by the Data Link Layer:
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 5
DLL (Cont…)
• Framing & Link access:
• Data Link Layer protocols encapsulate each network frame within a Link layer frame before the
transmission across the link.
• A frame consists of a data field in which network layer datagram is inserted and a number of data
fields.
• It specifies the structure of the frame as well as a channel access protocol by which frame is to be
transmitted over the link.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 6
DLL (Cont…)
• Reliable delivery:
• Data Link Layer provides a reliable delivery service, i.e., transmits the network layer datagram
without any error.
• A reliable delivery service is accomplished with transmissions and acknowledgements.
• A data link layer mainly provides the reliable delivery service over the links as they have higher error
rates and they can be corrected locally, link at which an error occurs rather than forcing to retransmit
the data.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 7
DLL (Cont…)
• Flow control:
• A receiving node can receive the frames at a faster rate than it can process the frame.
• Without flow control, the receiver's buffer can overflow, and frames can get lost.
• To overcome this problem, the data link layer uses the flow control to prevent the sending node on one
side of the link from overwhelming the receiving node on another side of the link.
• Error detection:
• Errors can be introduced by signal attenuation and noise.
• Data Link Layer protocol provides a mechanism to detect one or more errors.
• This is achieved by adding error detection bits in the frame and then receiving node can perform an
error check.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 8
DLL (Cont…)
• Error correction:
• Error correction is similar to the Error detection, except that receiving node not only detect the
errors but also determine where the errors have occurred in the frame.
• Half-Duplex & Full-Duplex:
• In a Full-Duplex mode, both the nodes can transmit the data at the same time.
• In a Half-Duplex mode, only one node can transmit the data at the same time.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 9
OVERVIEW OF DLL
• The data link layer transforms the physical layer, a raw transmission facility, to a
link responsible for node-to-node (hop-to-hop) communication.
• Specific responsibilities of the data link layer include framing, addressing, flow
control, error control, and media access control.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 10
Data Link Layer Design Issues
• Providing a well-defined service interface to the network layer.
• Dealing with transmission errors.
• Regulating the flow of data so that slow receivers are not swamped by fast
senders
For this, the data link layer takes the packets it gets from the network layer and encapsulates them into frames for
transmission. Each frame contains a frame header, a payload field for holding the packet, and a frame trailer
1
1
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 11
Services Provided to the Network Layer
• The function of the data link layer is to provide services to the network layer. The principal
service is transferring data from the network layer on the source machine to the network layer
on the destination machine.
• The data link layer can be designed to offer various services. The actual services offered can
vary from system to system. Three reasonable possibilities that are commonly provided are
1. Unacknowledged Connectionless service
2. Acknowledged Connectionless service
3. Acknowledged Connection-Oriented service
1
2
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 12
Unacknowledged Connectionless Service
• Unacknowledged connectionless service consists of having the source machine
send independent frames to the destination machine without having the
destination machine acknowledge them.
• No logical connection is established beforehand or released afterward.
• If a frame is lost due to noise on the line, no attempt is made to detect the loss or
recover from it in the data link layer.
• This class of service is appropriate when the error rate is very low so that
recovery is left to higher layers.
• It is also appropriate for real- time traffic, such as voice, in which late data are
worse than bad data.
• Most LANs use unacknowledged connectionless service in the data link layer.
1
3
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 13
Acknowledged Connectionless Service
• When this service is offered, there are still no logical connections used, but each frame
sent is individually acknowledged.
• In this way, the sender knows whether a frame has arrived correctly.
• If it has not arrived within a specified time interval, it can be sent again.
• This service is useful over unreliable channels, such as wireless systems.
• Adding Ack in the DLL rather than in the Network Layer is just an optimization and not
a requirement.
• If individual frames are acknowledged and retransmitted, entire packets get through
much faster.
• On reliable channels, such as fiber, the overhead of a heavyweight data link protocol
may be unnecessary, but on wireless channels, with their inherent unreliability, it is well
worth the cost.
1
4
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 14
Acknowledged Connection-oriented Service
• The source and destination machines establish a connection before any data are transferred.
• Each frame sent over the connection is numbered, and the data link layer guarantees that each
frame sent is indeed received.
• Furthermore, it guarantees that each frame is received exactly once and that all frames are
received in the right order.
• When connection-oriented service is used, transfers go through three distinct
phases.
• In the first phase, the connection is established by having both sides initialize variables and
counters needed to keep track of which frames have been received and which ones have
not.
• In the second phase, one or more frames are actually transmitted.
• In the third and final phase, the connection is released, freeing up the variables, buffers, and
other resources used to maintain the connection.
8
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 15
Framing
DLL translates the physical layer's raw bit stream into discrete units
(messages) called frames.
How can frame be transmitted so the receiver can detect frame boundaries?
That is, how can the receiver recognize the start and end of a frame?
Character Count
Flag byte with Byte Stuffing
Starting and ending flag with bite stuffing
Encoding Violations
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 16
Framing – Character Count
The first framing method uses a field in the header to specify the number of characters in
the frame.
When the data link layer at the destination sees the character count, it knows how many
characters follow and hence where the end of the frame is.
The trouble with this algorithm is that the count can be garbled by a transmission error.
11
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 17
Framing – Bit Stuffing
• This technique allows data frames to contain an arbitrary number of bits and allows character codes with an
arbitrary number of bits per character. It works like this. Each frame begins and ends with a special bit pattern,
01111110 (in fact, a flag byte).
• Whenever the sender's data link layer encounters five consecutive 1s in the data, it automatically stuffs a 0 bit
into the outgoing bit stream.
• This bit stuffing is analogous to byte stuffing, in which an escape byte is stuffed into the outgoing character
stream before a flag byte in the data. When the receiver sees five consecutive incoming 1 bits, followed by a 0
bit, it automatically destuffs (i.e., deletes) the 0 bit
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 18
Bit Stuffing Example
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 19
Bit stuffing and unstuffing
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 20
Framing – Byte Stuffing
Use reserved characters to indicate the start and end of a frame. For instance, use the two-character sequence
DLE STX (Data-Link Escape, Start of TeXt) to signal the beginning of a frame, and the sequence DLE ETX
(End of TeXt) to flag the frame's end.
The second framing method, Starting and ending character stuffing, gets around the problem of
resynchronization after an error by having each frame start with the ASCII character sequence
DLE STX and end with the sequence DLE ETX.
Problem: What happens if the two-character sequence DLE ETX
happens to appear in the frame itself?
Solution: Use character stuffing; within the frame, replace every occurrence of DLE with the two-character
sequence DLE DLE. The receiver reverses the processes, replacing every occurrence of DLE DLE with a
single DLE.
Example: If the frame contained ``A B DLE D E DLE'', the characters transmitted over the channel would be
``DLE STX A B DLE DLE D E DLE DLE DLE ETX''.
Disadvantage: character is the smallest unit that can be operated on; not all
architectures are byte oriented.
12
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 21
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 22
Byte stuffing and unstuffing
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 23
Physical Layer Coding Violations
This Framing Method is used only in those networks in which Encoding on the Physical Medium
contains some redundancy.
Some LANs encode each bit of data by using two Physical Bits
i.e. Manchester coding is Used. Here, Bit 1 is encoded into high-
low(10) pair and Bit 0 is encoded into low-high(01) pair.
The scheme means that every data bit has a transition in the middle, making it easy for the receiver
to locate the bit boundaries. The combinations high-high and low-low are not used for data but are
used for delimiting frames in some protocols.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 24
Error Control
Error control is concerned with insuring that all frames are eventually delivered (possibly in order) to a
destination. How? Three items are required.
Acknowledgements: Typically, reliable delivery is achieved using the “acknowledgments with
retransmission" paradigm, whereby the receiver
returns a special acknowledgment (ACK) frame to the sender indicating the correct receipt of a frame.
o In some systems, the receiver also returns a negative acknowledgment (NACK) for incorrectly-
received frames. This is nothing more than a hint to the sender so that it can retransmit a frame right
away without waiting for a timer to expire.
Timers: One problem that simple ACK/NACK schemes fail to address is recovering from a frame that
is lost, and as a result, fails to solicit an ACK or NACK. What happens if an ACK or NACK becomes
lost?
Retransmission timers are used to resend frames that don't produce an ACK. When sending a frame,
schedule a timer to expire at some time after the ACK should have been returned. If the timer goes o,
retransmit the frame.
Sequence Numbers: Retransmissions introduce the possibility of duplicate frames. To suppress
duplicates, add sequence numbers to each frame, so tha1t 9a receiver can distinguish between new
frames and old copies.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 25
Flow Control
Flow control deals with throttling the speed of the sender to match that of the receiver.
Two Approaches:
feedback-based flow control, the receiver sends back information to the sender
giving it permission to send more data or at least telling the sender how the receiver
is doing
rate-based flow control, the protocol has a built-in mechanism that limits the rate at
which senders may transmit data, without using feedback from the receiver.
Various Flow Control schemes uses a common protocol that contains well-defined
rules about when a sender may transmit the next frame. These rules often prohibit frames
from being sent until the receiver has granted permission, either implicitly or explicitly.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 26
Error Correction and Detection
• It is physically impossible for any data recording or transmission medium to be 100% perfect
100% of the time over its entire expected useful life.
In data communication, line noise is a fact of life (e.g., signal attenuation, natural
phenomenon such as lightning, and the telephone repairman).
• As more bits are packed onto a square centimeter of disk storage, as communications
transmission speeds increase, the likelihood of error increases-- sometimes geometrically.
• Thus, error detection and correction is critical to accurate data transmission, storage and
retrieval.
• Detecting and correcting errors requires redundancy -- sending additional information along
with the data.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 27
Types of Errors
There are two main types of errors in transmissions:
1. Single bit error : It means only one bit of data unit is changed from 1 to 0 or from 0 to 1.
2. Burst error : It means two or more bits in data unit are changed from 1 to 0 from 0 to 1. In burst error, it is
not necessary that only consecutive bits are changed. The length of burst error is measured from first
changed bit to last changed bit
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 28
Error Detection Vs Error Correction
There are two types of attacks against errors:
Error Detecting Codes: Include enough redundancy bits to detect
errors and use ACKs and retransmissions to recover from the errors.
Error Correcting Codes: Include enough redundancy to detect and correct errors. The use of
error-correcting codes is often referred to as forward error correction.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 29
Error Detection
Error detection means to decide whether the received data is correct or not without having a
copy of the original message.
Error detection uses the concept of redundancy, which means adding extra bits for
detecting errors at the destination.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 30
Vertical Redundancy Check (VRC)
Append a single bit at the end of data block such that the number of ones is even
Even Parity (odd parity is similar)
0110011 01100110
0110001 01100011
VRC is also known as Parity Check. Detects all odd-number errors in a data block
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 31
Example of VRC
The problem with parity is that it can only detect odd numbers of bit substitution errors, i.e. 1 bit,
3bit, 5, bit, etc. errors. If there two, four, six, etc. bits which are transmitted in error, using VRC
will not be able to detect the error.
26
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 32
Longitudinal Redundancy Check (LRC)
Longitudinal Redundancy Checks (LRC) seek to overcome the weakness of simple, bit-oriented, one-
directional parity checking.
LRC adds a new character (instead of a bit) called the Block Check Character (BCC) to each block of data.
Its determined like parity, but counted longitudinally through the message (also vertically)
Its has better performance over VRC as it detects 98% of the burst errors (>10 errors) but less capable of
detecting single errors
If two bits in one data units are damaged and two bits in exactly the same positions in another data unit are
also damaged, the LRC checker will not detect an error.
11100111 11011101 00111001 10101001
11100111
11011101
00111001
10101001
10101010
27
11100111 11011101 00111001 10101001 10101010
Original Data LRC
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 33
Two Dimensional Parity Check
Upon receipt, each character is checked according to its VRC parity value and then the entire block
of characters is verified using the LRC block check character.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 34
Cyclic Redundancy Check (CRC)
The cyclic redundancy check, or CRC, is a technique for detecting errors in digital data, but
not for making corrections when errors are detected.
It is used primarily in data transmission
In the CRC method, a certain number of check bits, often called a checksum, are appended to
the message being transmitted.
The receiver can determine whether or not the check bits agree with the data, to ascertain
with a certain degree of probability whether or not an error occurred in transmission
The CRC is based on polynomial arithmetic, in particular, on computing the remainder of
dividing one polynomial in GF(2) (Galois field with two elements) by another.
Can be easily implemented with small amount of hardware
Shift registers
XOR (for addition and subtraction).
31
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 35
Generator Polynomial
A cyclic redundancy check (CRC) is a non-secure hash function designed to detect accidental
changes to raw computer data, and is commonly used in digital networks and storage devices
such as hard disk devices.
CRCs are so called because the check (data verification) code is a redundancy (it adds zero
information) and the algorithm is based on cyclic codes.
The term CRC may refer to the check code or to the function that calculates it, which accepts
data streams of any length as input but always outputs a fixed- length code
The divisor in a cyclic code is normally called the generator polynomial or simply the
generator. The proper
1. It should have at least two terms.
2. The coefficient of the term x0 should be 1.
3. It should not divide xt + 1, for t between 2 and n − 1.
4. It should have the factor x + 1.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 36
CRC Calculation
Given a k-bit frame or message, the transmitter generates an n-bit sequence, known as a frame
check sequence (FCS), so that the resulting frame, consisting of (k+n) bits, is exactly divisible by
some predetermined number.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 37
Cyclic Redundancy Check
Let M(x) be the message polynomial
Let P(x) be the generator polynomial
P(x) is fixed for a given CRC scheme
P(x) is known both by sender and receiver
Create a block polynomial F(x) based on M(x) and P(x) such that F(x) is divisible by P(x)
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 38
Cyclic Redundancy Check
Sending
1. Multiply M(x) by xn
2. Divide xnM(x) by P(x)
3. Ignore the quotient and keep the reminder C(x)
4. Form and send F(x) = xnM(x)+C(x)
Receiving
1. Receive F’(x)
2. Divide F’(x) by P(x)
3. Accept if remainder is 0, reject otherwise
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 39
Example of CRC
Consider a message 110010 represented by the polynomial M(x) = x5 + x4 + x Consider a generating
polynomial G(x) = x3 + x2 + 1 (1101)
This is used to generate a 3 bit CRC = C(x) to be appended to M(x).
Steps:
1. Multiply M(x) by x3 (highest power in G(x)). i.e. Add 3 zeros. 110010000
2. Divide the result by G(x). The remainder = C(x).
1101 long division into 110010000 (with subtraction mod 2)
= 100100 remainder 100
3. Transmit 110010000 + 100
To be precise, transmit: T(x) = x3M(x) + C(x)
= 110010100
4. Receiver end: Receive T(x). Divide by G(x), should have remainder 0.
Note if G(x) has order n - highest power is xn, then G(x) will cover (n+1) bits and the remainder will
cover n bits. i.e. Add n bits to message.
36
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 40
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 41
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 42
CRC Division in Polynomial Form
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 43
CRC Standard Polynomials
CRC PERFORMANCE
CRC is a very effective error detection technique. If the divisor is chosen according to the previously
mentioned rules, its performance can be summarized as follows:
CRC can detect all single-bit errors
CRC can detect all double-bit errors (three 1’s)
CRC can detect any odd number of errors (X+1)
CRC can detect all burst errors of less than the degree of the polynomial.
CRC detects most of the larger burst errors with a high probability.
For example CRC-12 detects 99.97% of errors with a length 12 or more. 42
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 44
Checksum
• Checksum is the error detection scheme used in IP, TCP & UDP.
• Here, the data is divided into k segments each of m bits.
• In the sender’s end the segments are added using 1’s complement arithmetic to get the sum.
• The sum is complemented to get the checksum.
• The checksum segment is sent along with the data segments
• At the receiver’s end, all received segments are added using 1’s complement arithmetic to get the sum.
• The sum is complemented. If the result is zero, the received data is accepted; otherwise discarded
• The checksum detects all errors involving an odd number of bits. It also detects most errors involving
even number of bits.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 45
Checksum
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 46
Checksum Example
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 47
Q) For a pattern of, 10101001 00111001 00011101 Find out whether any
transmission errors have occurred or not
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 48
Example of checksum
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 49
Checksum VS CRC
• CRC is more thorough as opposed to Checksum in checking for errors and
reporting.
• Checksum is the older of the two programs.
• CRC has a more complex computationas opposed to checksum.
• Checksum mainly detects single-bit changes in data while CRC can check and
detect double-digit errors.
• CRC can detect more errors than checksum due to its more complex function.
• A checksum is mainly employed in data validation when implementing software.
• A CRC is mainly used for data evaluation in analogue da5t0a transmission.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 50
Error Correction
Once detected, the errors must be corrected
Two Techniques for error correction
Retransmission (aka Backward error correction)
Simplest, effective and most commonly used technique –
involves correction by retransmission of data by the sender
Popularly called Automatic Repeat Request (ARQ)
Forward Error Correction (FEC)
Receiving device can correct the errors itself
51
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 51
Error Correction
Messages (frames) consist of m data (message) bits and r redundancy bits, yielding an n = (m+r)-
bit codeword.
Hamming Distance. Given any two codewords, we can determine how many of the bits differ.
Simply exclusive or (XOR) the two words, and count the number of 1 bits in the result.
Significance? If two codewords are d bits apart, d errors are required to convert one to the other.
A code's Hamming Distance is defined as the minimum Hamming Distance between any two of
its legal codewords (from all possible codewords).
To detect d 1-bit errors requires having a Hamming Distance of at
least d+1 bits.
To correct d errors requires 2d+1 bits. Intuitively, after d errors, the garbled messages is still closer
to the original message than any other legal codeword.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 52
Functions and Requirements of the Data Link Protocols
• The basic function of the layer is to transmit frames over a physical communication link.
• Transmission may be half duplex or full duplex.
• To ensure that frames are delivered free of errors to the destination station (IMP) a number of
requirements are placed on a data link protocol.
• The protocol (control mechanism) should be capable of performing:
• The identification of a frame (i.e. recognise the first and last bits of a frame).
• The transmission of frames of any length up to a given maximum. Any bit pattern is permitted in
a frame.
• The detection of transmission errors.
• The retransmission of frames which were damaged by errors.
• The assurance that no frames were lost.
• In a multidrop configuration -> Some mechanism must be used for preventing conflicts caused
by simultaneous transmission by many stations.
• The detection of failure or abnormal situations for control and monitoring purposes.
60
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 53
Elementary Data Link Protocols
• Protocols in the data link layer are designed so that this layer can perform its
basic functions: framing, error control and flow control.
• Framing is the process of dividing bit - streams from physical layer into data
frames whose size ranges from a few hundred to a few thousand bytes.
• Error control mechanisms deals with transmission errors and retransmission of
corrupted and lost frames.
• Flow control regulates speed of delivery and so that a fast sender does not
drown a slow receiver.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 54
Types of Data Link Protocols
• Data link protocols can be broadly divided into two categories, depending on
whether the transmission channel is noiseless or noisy.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 55
Simplex Protocol
• The Simplex protocol is hypothetical protocol designed for unidirectional data
transmission over an ideal channel, i.e. a channel through which transmission
can never go wrong.
• It has distinct procedures for sender and receiver.
• The sender simply sends all its data available onto the channel as soon as they
are available its buffer.
• The receiver is assumed to process all incoming data instantly.
• It is hypothetical since it does not handle flow control or error control.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 56
An Unrestricted Simplex Protocol
In order to appreciate the step by step development of efficient and complex protocols we
will begin with a simple but unrealistic protocol.
In this protocol: Data are transmitted in one direction only
The transmitting (Tx) and receiving (Rx) hosts are always ready
Processing time can be ignored
Infinite buffer space is available
No errors occur; i.e. no damaged frames and no lost frames (perfect channel)
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 57
Stop – and – Wait Protocol
• Stop – and – Wait protocol is for noiseless channel too.
• It provides unidirectional data transmission without any error control facilities.
• However, it provides for flow control so that a fast sender does not drown a slow
receiver.
• The receiver has a finite buffer size with finite processing speed.
• The sender can send a frame only when it has received indication from the
receiver that it is available for further data processing.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 58
Stop & Wait Protocol
• The sender sends one frame and waits for feedback from the receiver.
• When the ACK arrives, the sender sends the next frame
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 59
To overcome this problem it is required that the receiver be able to distinguish a frame that it is
seeing for the first time from a retransmission.
One way to achieve this is to have the sender put a sequence number in the header of each frame
it sends.
The receiver then can check the sequence number of each arriving frame to see if it is a new
frame or a duplicate to be discarded.
The receiver needs to distinguish only 2 possibilities: a new frame or a duplicate; a 1-bit sequence
number is sufficient.
At any instant the receiver expects a particular sequence number.
Any wrong sequence numbered frame arriving at the receiver is rejected as a duplicate.
A correctly numbered frame arriving at the receiver is accepted, passed to the host, and the
expected sequence number is incremented by 1 (modulo 2). 67
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 60
Flow Diagram of a Stop & Wait Protocol
68
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 61
After transmitting a frame and starting the timer, the sender waits for something exciting to
happen.
Only three possibilities exist: an acknowledgement frame arrives undamaged, a damaged acknowledgement
frame staggers in, or the timer expires.
If a valid acknowledgement comes in, the sender fetches the next packet from its network layer and
puts it in the buffer, overwriting the previous packet.
It also advances the sequence number.
If a damaged frame arrives or no frame at all arrives, neither the buffer nor the sequence number is
changed so that a duplicate can be sent.
When a valid frame arrives at the receiver, its sequence number is checked to see if it is a duplicate.
If not, it is accepted, passed to the network layer, and an acknowledgement is generated.
Duplicates and damaged frames are not passed to the network layer.
69
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 62
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 63
Stop – and – Wait ARQ
• Stop – and – wait Automatic Repeat Request (Stop – and – Wait ARQ) is a
variation of the above protocol with added error control mechanisms,
appropriate for noisy channels.
• The sender keeps a copy of the sent frame.
• It then waits for a finite time to receive a positive acknowledgement from
receiver.
• If the timer expires or a negative acknowledgement is received, the frame is
retransmitted.
• If a positive acknowledgement is received then the next frame is sent.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 64
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 65
Sliding Window Protocol
• The sliding window is a technique for sending multiple frames at a time.
• It controls the data packets between the two devices where reliable and gradual
delivery of data frames is needed.
• It is also used in TCP (Transmission Control Protocol).
• In this technique, each frame has sent from the sequence number.
• The sequence numbers are used to find the missing data in the receiver end.
• The purpose of the sliding window technique is to avoid duplicate data, so it
uses the sequence number.
Types of Sliding Window Protocol
Sliding window protocol has two types:
• Go-Back-N ARQ
• Selective Repeat ARQ
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 66
Go – Back – N ARQ
• Go – Back – N ARQ provides for sending multiple frames before receiving the
acknowledgement for the first frame.
• It uses the concept of sliding window, and so is also called sliding window
protocol.
• The frames are sequentially numbered and a finite number of frames are sent.
• If the acknowledgement of a frame is not received within the time period, all
frames starting from that frame are retransmitted.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 67
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 68
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 69
Selective Repeat ARQ
• This protocol also provides for sending multiple frames before receiving the
acknowledgement for the first frame.
• However, here only the erroneous or lost frames are retransmitted, while the
good frames are received and buffered.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 70
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 71
Difference between the Go-Back-N ARQ and Selective Repeat ARQ?
Go-Back-N ARQ Selective Repeat ARQ
If a frame is corrupted or lost in it,all In this, only the frame is sent again, which is
subsequent frames have to be sent again. corrupted or lost.
If it has a high error rate, it wastes a lot of There is a loss of low bandwidth.
bandwidth.
It is less complex. It is more complex because it has to do sorting and
searching as well. And it also requires more
storage.
It does not require sorting. In this, sorting is done to get the frames in the
correct order.
It does not require searching. The search operation is performed in it.
It is used more. It is used less because it is more complex.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 72
MAC Layer in the OSI Model
• OSI model is a layered networking framework that conceptualizes how communications
should be done between heterogeneous systems.
• The data link layer is the second lowest layer. It is divided into two sublayers −
• The logical link control (LLC) sublayer
• The medium access control (MAC) sublayer
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 73
Medium Access Control Sublayer (MAC sublayer)
The medium access control (MAC) is a sublayer of the data link layer of the
open system interconnections (OSI) reference model for data transmission.
It is responsible for flow control and multiplexing for transmission medium.
It controls the transmission of data packets via remotely shared channels.
It sends data over the network interface card.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 74
Functions of MAC Layer
• It provides an abstraction of the physical layer to the LLC and upper layers of the OSI
network.
• It is responsible for encapsulating frames so that they are suitable for transmission via the
physical medium.
• It resolves the addressing of source station as well as the destination station, or groups of
destination stations.
• It performs multiple access resolutions when more than one data frame is to be
transmitted. It determines the channel access methods for transmission.
• It also performs collision resolution and initiating retransmission in case of collisions.
• It generates the frame check sequences and thus contributes to protection against
transmission errors.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 75
MAC Addresses
MAC address or media access control address is a unique identifier allotted to a network
interface controller (NIC) of a device.
It is used as a network address for data transmission within a network segment like
Ethernet, Wi-Fi, and Bluetooth.
MAC address is assigned to a network adapter at the time of manufacturing.
It is hardwired or hard-coded in the network interface card (NIC).
A MAC address comprises of six groups of two hexadecimal digits, separated by hyphens,
colons, or no separators. An example of a MAC address is 00:0A:89:5B:F0:11.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 76
Channel Allocation Problem in Computer Network
Channel allocation is a process in which a single channel is divided and allotted to
multiple users in order to carry user specific tasks.
There are user’s quantity may vary every time the process takes place.
If there are N number of users and channel is divided into N equal-sized sub channels,
Each user is assigned one portion.
If the number of users are small and don’t vary at times, than Frequency Division
Multiplexing can be used as it is a simple and efficient channel bandwidth allocating
technique.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 77
Static Channel Allocation in LANs and MANs
It is the classical or traditional approach of allocating a single channel among
multiple competing users Frequency Division Multiplexing (FDM).
If there are N users, the bandwidth is divided into N equal sized portions each
user being assigned one portion. since each user has a private frequency band,
there is no interface between users.
It is not efficient to divide into fixed number of chunks.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 78
Dynamic Channel Allocation
Station Model:
Assumes that each of N stations independently produce frames.
The probability of producing a packet in the interval IDt where I is the constant arrival rate
of new frames.
Single Channel Assumption:
In this allocation all stations are equivalent and can send and receive on that channel.
Collision Assumption:
If two frames overlap in time-wise, then that’s collision. Any collision is an error, and both
frames must re transmitted. Collisions are only possible error.
• Time can be divided into Slotted or Continuous.
• Stations can sense a channel is busy before they try it.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 79
Multiple Access Protocol
When a sender and receiver have a dedicated link to transmit data packets, the data link
control is enough to handle the channel.
Suppose there is no dedicated path to communicate or transfer the data between two
devices.
In that case, multiple stations access the channel and simultaneously transmits the data
over the channel.
It may create collision and cross talk.
Hence, the multiple access protocol is required to reduce the collision and avoid crosstalk
between the channels.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 80
For example,
Suppose that there is a classroom full of students.
When a teacher asks a question, all the students (small channels) in the class start
answering the question at the same time (transferring the data simultaneously).
All the students respond at the same time due to which data is overlap or data lost.
Therefore it is the responsibility of a teacher (multiple access protocol) to manage the
students and make them one answer.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 81
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 82
Random Access Protocol
In this protocol, all the station has the equal priority to send the data over a channel.
In random access protocol, one or more stations cannot depend on another station nor
any station control another station.
Depending on the channel's state (idle or busy), each station transmits the data frame.
However, if more than one station sends the data over a channel, there may be a collision
or data conflict.
Due to the collision, the data frame packets may be lost or changed. And hence, it does
not receive by the receiver end.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 83
ALOHA Random Access Protocol
It is designed for wireless LAN (Local Area Network) but can also be used in a shared
medium to transmit data.
Using this method, any station can transmit data across a network simultaneously when a
data frameset is available for transmission.
Aloha Rules
1.Any station can transmit data to a channel at any time.
2.It does not require any carrier sensing.
3. data frames may be lost during the transmission of data through multiple stations.
4.Acknowledgment of the frames exists in Aloha. Hence, there is no collision detection.
5.It requires
Apr 21, 2025retransmission of data after some random2) amount of time.
Dr. B.Rajalingam(CN-Unit 84
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 85
Pure Aloha
Whenever data is available for sending over a channel at stations
In pure Aloha, when each station transmits data to a channel without checking whether
the channel is idle or not, there is a chance for collision may occur, and the data frame
can be lost.
When any station transmits the data frame to a channel, the pure Aloha waits for the
receiver's acknowledgment.
If it does not acknowledge the receiver end within the specified time, the station waits
for a random amount of time, called the backoff time (Tb).
And the station may assume the frame has been lost or destroyed. Therefore, it
retransmits the frame until all the data are successfully transmitted to the receiver.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 86
The total vulnerable time of pure Aloha is 2 * Tfr.
Maximum throughput occurs when G = 1/ 2 that is 18.4%.
Successful transmission of data frame is S = G * e ^ - 2 G.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 87
As we can see in the figure above, there are four stations for accessing a shared channel
and transmitting data frames.
Some frames collide because most stations send their frames at the same time.
Only two frames, frame 1.1 and frame 2.2, are successfully transmitted to the receiver
end. At the same time, other frames are lost or destroyed.
Whenever two frames fall on a shared channel simultaneously, collisions can occur, and
both will suffer damage.
If the new frame's first bit enters the channel before finishing the last bit of the second
frame.
Both frames are completely finished, and both stations must retransmit the data frame.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 88
Slotted Aloha
The slotted Aloha is designed to overcome the pure Aloha's deficiency because pure
Aloha has a very high possibility of frame hitting.
In slotted Aloha, the shared channel is divided into a fixed time interval called slots.
So that, if a station wants to send a frame to a shared channel, the frame can only be sent
at the beginning of the slot, and only one frame is allowed to be sent to each slot.
And if the stations are unable to send data to the beginning of the slot, the station will
have to wait until the beginning of the slot for the next time.
However, the possibility of a collision remains when trying to send a frame at the
beginning of two or more station time slot.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 89
1. Maximum throughput occurs in the slotted Aloha when G = 1 that is 37%.
2. The probability of successfully transmitting the data frame in the slotted Aloha is
S = G * e ^ - 2 G.
3. The total vulnerable time required in slotted Aloha is Tfr.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 90
CSMA (Carrier Sense Multiple Access)
It is a carrier sense multiple access based on media access protocol to sense the traffic
on a channel (idle or busy) before transmitting the data.
It means that if the channel is idle, the station can send data to the channel.
Otherwise, it must wait until the channel becomes idle.
Hence, it reduces the chances of a collision on a transmission medium.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 91
CSMA Access Modes
1-Persistent (Continuing to exist): In the 1-Persistent mode of CSMA that defines
each node, first sense the shared channel and if the channel is idle, it immediately sends
the data.
Else it must wait and keep track of the status of the channel to be idle and broadcast the
frame unconditionally as soon as the channel is idle.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 92
Non-Persistent:
It is the access mode of CSMA that defines before transmitting the data, each node
must sense the channel, and if the channel is inactive, it immediately sends the data.
Otherwise, the station must wait for a random time (not continuously), and when the
channel is found to be idle, it transmits the frames.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 93
P-Persistent:
It is the combination of 1-Persistent and Non-persistent modes.
The P-Persistent mode defines that each node senses the channel, and if the channel is
inactive, it sends a frame with a P probability.
If the data is not transmitted, it waits for a (q = 1-p probability) random time and
resumes the frame with the next time slot.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 94
O - Persistent:
It is an O-persistent method that defines the superiority of the station before the
transmission of the frame on the shared channel.
If it is found that the channel is inactive, each station waits for its turn to retransmit the
data.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 95
CSMA/ CD
It is a carrier sense multiple access/ collision detection network protocol to transmit data
frames.
The CSMA/CD protocol works with a medium access control layer.
Therefore, it first senses the shared channel before broadcasting the frames, and if the
channel is idle, it transmits a frame to check whether the transmission was successful.
If the frame is successfully received, the station sends another frame.
If any collision is detected in the CSMA/CD, the station sends a jam/ stop signal to the
shared channel to terminate data transmission.
After that, it waits for a random time before sending a frame to a channel.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 96
CSMA/ CA
It is a carrier sense multiple access/collision avoidance network protocol for carrier
transmission of data frames.
It is a protocol that works with a medium access control layer.
When a data frame is sent to a channel, it receives an acknowledgment to check whether
the channel is clear.
If the station receives only a single (own) acknowledgments, that means the data frame has
been successfully transmitted to the receiver.
But if it gets two signals (its own and one more in which the collision of frames), a
collision of the frame occurs in the shared channel.
Detects the collision of the frame when a sender receives an acknowledgment signal.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 97
Controlled Access Protocol
It is a method of reducing data frame collision on a shared channel.
In the controlled access method, each station interacts and decides to send a data frame
by a particular station approved by all other stations.
It means that a single station cannot send the data frames unless all other stations are not
approved.
It has three types of controlled access: Reservation, Polling, and Token Passing.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 98
Channelization Protocols
It is a channelization protocol that allows the total usable bandwidth in a shared channel
to be shared across multiple stations based on their time, distance and codes.
It can access all the stations at the same time to send the data frames to the channel.
FDMA (Frequency Division Multiple Access)
TDMA (Time Division Multiple Access)
CDMA (Code Division Multiple Access)
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 99
FDMA
It is a frequency division multiple access (FDMA) method used to divide the available
bandwidth into equal bands so that multiple users can send data through a different
frequency to the sub channel.
Each station is reserved with a particular band to prevent the crosstalk between the
channels and interferences of stations.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 100
TDMA
Time Division Multiple Access (TDMA) is a channel access method. It allows the same
frequency bandwidth to be shared across multiple stations.
To avoid collisions in the shared channel, it divides the channel into different frequency
slots that allocate stations to transmit the data frames.
The same frequency bandwidth into the shared channel by dividing the signal into various
time slots to transmit it.
TDMA has an overhead of synchronization(organization/Management) that specifies each
station's time slot by adding synchronization bits to each slot.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 101
CDMA
The code division multiple access (CDMA) is a channel access method.
In CDMA, all stations can simultaneously send the data over the same channel.
It means that it allows each station to transmit the data frames with full frequency on the
shared channel at all times.
It does not require the division of bandwidth on a shared channel based on time slots.
If multiple stations send data to a channel simultaneously, their data frames are separated
by a unique code sequence.
Each station has a different unique code for transmitting the data over a shared channel.
For example, there are multiple users in a room that are continuously speaking.
Data is received by the users if only two-person interact with each other using the same
language.
Similarly, in the network, if different stations communicate with each other simultaneously
with different code language.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 102
High-level Data Link Control (HDLC)
• High-level Data Link Control (HDLC) is a group of communication protocols of the data
link layer for transmitting data between network points or nodes.
• Since it is a data link protocol, data is organized into frames.
• A frame is transmitted via the network to the destination that verifies its successful arrival.
• It is a bit - oriented protocol that is applicable for both point - to - point and multipoint
communications. 103
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2)
Transfer Modes
• HDLC supports two types of transfer modes, normal response mode and asynchronous
balanced mode.
1. Normal Response Mode (NRM) − Here, two types of stations are there, a primary
station that send commands and secondary station that can respond to received
commands. It is used for both point - to - point and multipoint communications.
2. Asynchronous Balanced Mode (ABM) − Here, the configuration is balanced, i.e. each
station can both send commands and respond to commands. It is used for only point - to -
point communications.
104
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2)
Normal Response Mode (NRM)
105
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2)
Asynchronous Balanced Mode (ABM)
106
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2)
HDLC Frame format
107
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2)
HDLC Frame
• HDLC is a bit - oriented protocol where each frame contains up to six fields. The structure
varies according to the type of frame. The fields of a HDLC frame are −
• Flag − It is an 8-bit sequence that marks the beginning and the end of the frame. The bit
pattern of the flag is 01111110.
• Address − It contains the address of the receiver. If the frame is sent by the primary station, it
contains the address(es) of the secondary station(s). If it is sent by the secondary station, it
contains the address of the primary station. The address field may be from 1 byte to several
bytes.
• Control − It is 1 or 2 bytes containing flow and error control information.
• Payload − This carries the data from the network layer. Its length may vary from one network
to another.
• FCS − It is a 2 byte or 4 bytes frame check sequence for error detection. The standard code
used is CRC (cyclic redundancy code)
108
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2)
Types of HDLC Frames
• There are three types of HDLC frames. The type of frame is determined by the control field of
the frame −
• I-frame − I-FRAMES or information frames carry user data from the network layer.
• They also include flow and error control information that is piggybacked on user data.
• The first bit of control field of i-frame is 0.
• S-frame − S-FRAMES or supervisory frames do not contain information field.
• They are used for flow and error control when piggybacking is not required.
• The first two bits of control field of s-frame is 10.
• U-frame − U-FRAMES or un-numbered frames are used for myriad miscellaneous
• functions, like link management.
• It may contain an information field, if required.
• The first two bits of control field of u-frame is 11.
109
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2)
110
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2)
Point-to-Point Protocol (PPP)
• Point - to - Point Protocol (PPP) is a communication protocol of the data link layer that is used
to transmit multiprotocol data between two directly connected (point-to-point) computers.
• It is a byte - oriented protocol that is widely used in broadband communications having heavy
loads and high speeds.
• Since it is a data link layer protocol, data is transmitted in frames.
• It is also known as RFC 1661.
111
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2)
Services Provided by PPP
• The main services provided by Point - to - Point Protocol are −
• Defining the frame format of the data to be transmitted.
• Defining the procedure of establishing link between two points and exchange of
data.
• Stating the method of encapsulation of network layer data in the frame.
• Stating authentication rules of the communicating devices.
• Providing address for network communication.
• Providing connections over multiple links.
• Supporting a variety of network layer protocols by providing a range os services.
112
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2)
Components of PPP
• Point - to - Point Protocol is a layered protocol having three components −
• Encapsulation Component − It encapsulates the datagram so that it can be transmitted over
the specified physical layer.
• Link Control Protocol (LCP) − It is responsible for establishing, configuring, testing,
maintaining and terminating links for transmission.
• It also imparts negotiation for set up of options and use of features by the two endpoints of the
links.
• Authentication Protocols (AP) − These protocols authenticate endpoints for use of services.
The two authentication protocols of PPP are −
1. Password Authentication Protocol (PAP)
2. Challenge Handshake Authentication Protocol (CHAP) 113
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2)
Components of PPP
• Network Control Protocols (NCPs) − These protocols are used for negotiating the parameters and
facilities for the network layer.
• For every higher-layer protocol supported by PPP, one NCP is there. Some of the NCPs of PPP are −
1. Internet Protocol Control Protocol (IPCP)
2. OSI Network Layer Control Protocol (OSINLCP)
3. Internetwork Packet Exchange Control Protocol (IPXCP)
4. DECnet Phase IV Control Protocol (DNCP)
5. NetBIOS Frames Control Protocol (NBFCP)
6. IPv6 Control Protocol (IPV6CP) 114
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2)
PPP Frame Format
• PPP is a byte - oriented protocol where each field of the frame is composed of one or more
bytes. The fields of a PPP frame are −
• Flag − 1 byte that marks the beginning and the end of the frame.
• The bit pattern of the flag is 01111110.
• Address − 1 byte which is set to 11111111 in case of broadcast.
• Control − 1 byte set to a constant value of 11000000.
• Protocol − 1 or 2 bytes that define the type of data contained in the payload field.
• Payload − This carries the data from the network layer.
• The maximum length of the payload field is 1500 bytes.
• However, this may be negotiated between the endpoints of communication.
• FCS − It is a 2 byte or 4 bytes frame check sequence for error detection.
• The standard code used is CRC (cyclic redundancy code)
115
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2)
PPP Frame format
116
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2)
Collision-Free Protocols
• Almost collisions can be avoided in CSMA/CD.
• They can still occur during the contention period.
• The collision during contention period adversely affects the system performance, this happens when the cable is
long and length of packet are short.
• Pure and slotted Aloha, CSMA and CSMA/CD are Contention based Protocols:
• Try-if collide-Retry
• No guarantee of performance
• What happen if the network load is high?
Types of Collision Free Protocols:
1. Bit-map Protocol
2. Binary Countdown
3. Limited Contention Protocols
4. The Adaptive Tree Walk Protocol
• Collision Free Protocols:
• Pay constant overhead to achieve performance guarantee
• Good when network load is high
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 117
1. Bit-map Protocol
• Bit map protocol is collision free Protocol In bitmap protocol method, each contention period
consists of exactly N slots.
• if any station has to send frame, then it transmits a 1 bit in the respective slot.
• For example if station 2 has a frame to send, it transmits a 1 bit during the second slot.
• In general Station 1 Announce the fact that it has a frame questions by inserting a 1 bit into slot
1.
• In this way, each station has complete knowledge of which station wishes to transmit.
• There will never be any collisions because everyone agrees on who goes next.
• Protocols like this in which the desire to transmit is broadcasting for the actual transmission are
called Reservation Protocols.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 118
1. Bit-map Protocol
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 119
2. Binary Countdown
• Binary countdown protocol is used to overcome the overhead 1 bit per binary station.
• In binary countdown, binary station addresses are used.
• A station wanting to use the channel broadcast its address as binary bit string starting with the high order
bit.
• All addresses are assumed of the same length.
• In this method, different station addresses are ORed together who decide the priority of transmitting.
• If these stations 0001, 1001, 1100, 1011 all are trying to seize the channel for transmission.
• All the station at first broadcast their most significant address bit that is 0, 1, 1, 1 respectively.
• The most significant bits are ORed together.
• Station 0001 see the 1MSB in another station addresses and knows that a higher numbered station is
competing for the channel, so it gives up for the current round.
• Other three stations 1001, 1100, 1011 continue.
• The next bit is 1 at station 1100, swiss station 1011 and 1001 give up.
• Then station 110 starts transmitting a frame, after which another bidding cycle starts.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 120
2. Binary Countdown
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 121
3. Adaptive Tree Walk Protocol
• Partition the group of station and limit the contention for each slot.
• Under light load, everyone can try for each slot like aloha
• Under heavy load, only a group can try for each slot
How do we do it:
• Treat every stations as the leaf of a binary tree
• First slot (after successful transmission), all stations
can try to get the slot(under the root node).
• If no conflict, fine
• In case of conflict, only nodes under a subtree get to try for the next one. (Depth first
search)
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 122
Adaptive Tree Walk Protocol
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 123
Adaptive Tree Walk Protocol
Slot-0: C*, E*, F*, H* (all nodes under node 0 can try which are going to send), conflict
Slot-1: C* (all nodes under node 1can try}, C sends
Slot-2: E*, F*, H*(all nodes under node 2 can try}, conflict
Slot-3: E*, F* (all nodes under node 5 can try to send), conflict
Slot-4: E* (all nodes under E can try), E sends
Slot-5: F* (all nodes under F can try), F sends
Slot-6: H* (all nodes under node 6 can try to send), H sends.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 124
Introduction to Wireless LAN
• Wireless LAN stands for Wireless Local Area Network.
• It is also called LAWN (Local Area Wireless Network).
• WLAN is one in which a mobile user can connect to a Local Area Network (LAN) through a
wireless connection.
• The IEEE 802.11 group of standards defines the technologies for wireless LANs.
• For path sharing, 802.11 standard uses the Ethernet protocol and CSMA/CA (carrier sense multiple
access with collision avoidance).
• It also uses an encryption method i.e. wired equivalent privacy algorithm.
• Wireless LANs provide high speed data communication in small areas such as building or an office.
• WLANs allow users to move around in a confined area while they are still connected to the network.
• In some instance wireless LAN technology is used to save costs and avoid laying cable, while in
other cases, it is the only option for providing high-speed internet access to the public.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 125
Components of WLANs
Stations (STA):
• Stations comprises of all devices and equipment that are connected to the wireless LAN.
• Each station has a wireless network interface controller.
• A station can be of two types −
• Wireless Access Point (WAP or AP)
• Client
Basic Service Set (BSS):
• A basic service set is a group of stations communicating at the physical layer level.
• BSS can be of two categories −
• Infrastructure BSS
• Independent BSS
Extended Service Set (ESS):
• It is a set of all connected BSS.
Distribution System (DS):
• It connects access points in ESS.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 126
Types of WLANS
• WLANs, as standardized by IEEE 802.11, operates in two basic modes, infrastructure, and ad
hoc mode.
Infrastructure Mode:
• Mobile devices or clients connect to an access point (AP) that in turn connects via a bridge to
the LAN or Internet.
• The client transmits frames to other clients via the AP.
Ad Hoc Mode:
• Clients transmit frames directly to each other in a peer-to-peer fashion.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 127
Advantages of WLANs
• Flexibility: Within radio coverage, nodes can communicate without further restriction. Radio
waves can penetrate walls, senders and receivers can be placed anywhere.
• Planning: Only wireless ad-hoc networks allow for communication without previous planning,
any wired network needs wiring plans.
• Design: Wireless networks allow for the design of independent, small devices which can for
example be put into a pocket. Cables not only restrict users but also designers of small notepads,
PDAs, etc.
• Robustness: Wireless networks can handle disasters, e.g., earthquakes, flood etc. whereas,
networks requiring a wired infrastructure will usually break down completely in disasters.
• Cost: The cost of installing and maintaining a wireless LAN is on average lower than the cost of
installing and maintaining a traditional wired LAN, for two reasons.
• Ease of Use: Wireless LAN is easy to use and the users need very little new information to take
advantage of WLANs.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 128
Disadvantages of WLANs
• Quality of Services: Quality of wireless LAN is typically lower than wired networks. The main reason for this is
the lower bandwidth due to limitations is radio transmission, higher error rates due to interference and higher
delay/delay variation due to extensive error correction and detection mechanisms.
• Proprietary Solutions: Due to slow standardization procedures, many companies have come up with proprietary
solutions offering standardization functionality plus many enhanced features.
• Restrictions: Several govt. and non-govt. institutions world-wide regulate the operation and restrict frequencies to
minimize interference.
• Global operation: Wireless LAN products are sold in all countries so, national and international frequency
regulations have to be considered.
• Low Power: Devices communicating via a wireless LAN are typically power consuming, also wireless devices
running on battery power.
• License free operation: LAN operators don't want to apply for a special license to be able to use the product.
• Robust transmission technology: If wireless LAN uses radio transmission, many other electrical devices can
interfere with them (such as vacuum cleaner, train engines, hair dryers, etc.).Wireless LAN transceivers cannot be
adjusted for perfect transmission is a standard office or production environment.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 129
What is Data Link Layer Switching?
• Network switching is the process of forwarding data frames or packets from one port to another
leading to data transmission from source to destination.
• Data link layer is the second layer of the Open System Interconnections (OSI) model whose
function is to divide the stream of bits from physical layer into data frames and transmit the
frames according to switching requirements.
• Switching in data link layer is done by network devices called bridges.
• Network switching is the process of forwarding data frames or packets from one port to another
leading to data transmission from source to destination.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 130
Data link layer switching
• When a user accesses the internet or another computer network outside their immediate
location, messages are sent through the network of transmission media.
• This technique of transferring the information from one computer network to another network
is known as switching.
• Switching in a computer network is achieved by using switches.
• A switch is a small hardware device which is used to join multiple computers together with
one local area network (LAN).
• Network switches operate at layer 2 (Data link layer) in the OSI model.
• Switching is transparent to the user and does not require any configuration in the home
network.
• Switches are used to forward the packets based on MAC addresses.
• A Switch is used to transfer the data only to the device that has been addressed.
• It verifies the destination address to route the packet appropriately.
• It is operated in full duplex mode.
• Packet collision is minimum as it directly communicates between source and destination.
• It does not broadcast the message as it works with limited bandwidth.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 131
Switching concept is developed because of the following reasons:
Bandwidth:
• It is defined as the maximum transfer rate of a cable.
• It is a very critical and expensive resource.
• Therefore, switching techniques are used for the effective utilization of the bandwidth of a
network.
Collision:
• Collision is the effect that occurs when more than one device transmits the message over the
same physical media, and they collide with each other.
• To overcome this problem, switching technology is implemented so that packets do not
collide with each other.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 132
Advantages of Switching
• Switch increases the bandwidth of the network.
• It reduces the workload on individual PCs as it sends the information to only that device
which has been addressed.
• It increases the overall performance of the network by reducing the traffic on the network.
• There will be less frame collision as switch creates the collision domain for each
connection.
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 133
Bridges
• A data link layer bridge connects multiple LANs (local area networks) together to form a larger
LAN.
• This process of aggregating networks is called network bridging.
• A bridge connects the different components so that they appear as parts of a single network.
• The following diagram shows connection by a bridge −
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 134
Switching by Bridges
• When a data frame arrives at a particular port of a bridge, the bridge examines the frame’s data link
address, or more specifically, the MAC address.
• If the destination address as well as the required switching is valid, the bridge sends the frame to the
destined port.
• Otherwise, the frame is discarded.
• The bridge is not responsible for end to end data transfer.
• It is concerned with transmitting the data frame from one hop to the next.
• Hence, they do not examine the payload field of the frame.
• Due to this, they can help in switching any kind of packets from the network layer above.
• Bridges also connect virtual LANs (VLANs) to make a larger VLAN.
• If any segment of the bridged network is wireless, a wireless bridge is used to perform the switching.
• There are three main ways for bridging − Simple bridging, Multi-port bridging & Learning or
transparent bridging
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 135
Thank You
Apr 21, 2025 Dr. B.Rajalingam(CN-Unit 2) 136