You are on page 1of 110

21CS52 -

COMPUTER NETWORKS
Textbooks:
1. Computer-Networks- Andrew S. Tanenbaum and David J. Wetherall, Pearson Education,
5th-Edition. (www.pearsonhighered.com/tanenbaum)
2. Computer Networking A Top-Down Approach -James F. Kurose and Keith W.
RossPearson Education 7th Edition.
Reference Books:
1. Behrouz A Forouzan, Data and Communications and Networking, Fifth Edition, McGraw
Hill,Indian Edition
2. Larry L Peterson and Brusce S Davie, Computer Networks, fifth edition, ELSEVIER
(As per VTU Syllabus)

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
CREDITS – 4 (3 T + 2 L)
CIE (Continuous Internal Evaluation) MARKS – 50
SEE (Semester End Examination) MARKS – 50

Course Learning Objectives:


CLO1. Fundamentals of data communication networks.

CLO2. Software and hardware interfaces

CLO3. Application of various physical components and protocols

CLO4. Communication challenges and remedies in the networks.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS

Course Outcomes:
CO1. Learn the basic needs of communication system.
CO2. Interpret the communication challenges and its solution.
CO3. Identify and organize the communication system
network components
CO4. Design communication networks for user requirements.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Assessment Details (both CIE and SEE)

Continuous Internal Evaluation:

Three Unit Tests each of 20 Marks (duration 01 hour)

1. First test at the end of 5th week of the semester


2. Third test at the end of the 15th week of the semester

Two assignments each of 10 Marks

1. First assignment at the end of 4th week of the semester


2. Second assignment at the end of 9th week of the semester

Practical Sessions need to be assessed by appropriate rubrics and viva-voce


method.
This will contribute to 20 marks.

2/26/2024 ELAIYARAJA P
Program Outcomes:
PROGRAM OUTCOMES

PO's PO Description
Engineering knowledge: Apply the knowledge of mathematics, science, engineering
PO1 fundamentals, and an engineering specialization to the solution of complex
engineering problems.
Problem analysis: Identify, formulate, review research literature, and analyze
PO2 complex engineering problems reaching substantiated conclusions using first
principles of mathematics, natural sciences, and engineering sciences.
Design/development of solutions: Design solutions for complex engineering
problems and design system components or processes that meet the specified needs
PO3
with appropriate consideration for the public health and safety, and the cultural,
societal, and environmental considerations.
Conduct investigations of complex problems: Use research-based knowledge and
PO4 research methods including design of experiments, analysis and interpretation of
data, and synthesis of the information to provide valid conclusions.
Modern tool usage: Create, select, and apply appropriate techniques, resources, and
PO5 modern engineering and IT tools including prediction and modeling to complex
engineering activities with an understanding of the limitations.
The engineer and society: Apply reasoning informed by the contextual knowledge
PO6 to assess societal, health, safety, legal and cultural issues and the consequent
responsibilities relevant to the professional engineering practice.
Environment and sustainability: Understand the impact of the professional
PO7 engineering solutions in societal and environmental contexts, and demonstrate the
knowledge of, and need for sustainable development.
Ethics: Apply ethical principles and commit to professional ethics and
PO8
responsibilities and norms of the engineering practice.

2/26/2024 ELAIYARAJA P
Program Outcomes:
Individual and team work: Function effectively as an individual, and as a member
PO9
or leader in diverse teams, and in multidisciplinary settings.
Communication: Communicate effectively on complex engineering activities with
the engineering community and with society at large, such as, being able to
PO10
comprehend and write effective reports and design documentation, make effective
presentations, and give and receive clear instructions.
Project management and finance: Demonstrate knowledge and understanding of
the engineering and management principles and apply these to one’s own work, as a
PO11
member and leader in a team, to manage projects and in multidisciplinary
environments.
Life-long learning: Recognize the need for, and have the preparation and ability to
PO12 engage in independent and life-long learning in the broadest context of technological
change.

2/26/2024 ELAIYARAJA P
Program Specific Outcomes:

PROGRAM SPECIFIC OUTCOMES

PSO's PSO Description


An ability to design and analyze algorithms by applying theoretical concepts to build
PSO1 complex and computer- based systems in the domain of System Software, Computer
Networks & Security, Web technologies, Data Science and Analytics.
Be able to develop various software solutions by applying the techniques of Data
PSO2 Base Management, Complex Mathematical Models, Software Engineering practices
and Machine Learning with Artificial Intelligence.

2/26/2024 ELAIYARAJA P
21CS52 –
COMPUTER NETWORKS

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS

➢ Module 2 - The Data link layer,

The medium access control sublayer

Laboratory Component:
1. Implement simple ESS and with transmitting nodes in wire-less LAN by
simulation and determine the throughput with respect to transmission of
packets .
2. Write a program for error detecting code using CRC-CCITT (16- bits).

2/26/2024 ELAIYARAJA P
Module 2 –
The Data link layer,
The medium access control sublayer

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS

➢ Module 2 - The Data link layer, The medium access control

sublayer

The Data link layer: Design issues of DLL, Error


detection and correction, Elementary data link
protocols, Sliding window protocols.
The medium access control sublayer: The channel
allocation problem, Multiple access protocols.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
Link layer: introduction
mobile network
terminology: national or global ISP

▪ hosts, routers: nodes


▪ communication channels that
connect adjacent nodes along
communication path: links
• wired , wireless
• LANs
▪ layer-2 packet: frame, encapsulates datacenter
network
datagram

link layer has responsibility of enterprise


network
transferring datagram from one node
to physically adjacent node over a link
2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

DATA LINK LAYER DESIGN ISSUES


The data link layer uses the services of the physical layer to
send and receive bits over communication channels. It has a
number of functions, including:
1. Providing a well-defined service interface to the network layer.
2. Dealing with transmission errors.
3. Regulating the flow of data so that slow receivers are not
swamped by fast senders.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

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.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

services are provided by the Data Link Layer:

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

•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.

•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.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

•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.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

•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.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Data Link Layer Design Issues


•Network layer services
•Framing
•Error control
•Flow control

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Data Link Layer


Algorithms for achieving:
Reliable, +
Efficient,
communication of a whole units – frames (as opposed to bits – Physical
Layer) between two machines.
Two machines are connected by a communication channel that acts
conceptually like a wire (e.g., telephone line, coaxial cable, or wireless
channel).
Essential property of a channel that makes it “wire-like” connection is that the
bits are delivered in exactly the same order in which they are sent.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Data Link Layer


For ideal channel (no distortion, unlimited bandwidth and
no delay) the job of data link layer would be trivial.
However, limited bandwidth, distortions and delay makes
this job very difficult.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Services Provided to the Network Layer by Data link Layer


The data link layer can be designed to offer various services.
The actual services that are offered vary from protocol to
protocol. Three reasonable possibilities that we will consider in
turn are:

1. Unacknowledged connectionless service.

2. Acknowledged connectionless service.

3. Acknowledged connection-oriented service.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
Data Link Layer
Unacknowledged connectionless service
• It consists of having the source machine send independent
frames to the destination machine without having the
destination machine acknowledge them.
• Example: Ethernet, Voice over IP, etc. in all the
communication channel were real time operation is more
important that quality of transmission.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
Data Link Layer
Acknowledged Connectionless Service
• Each frame send by the Data Link layer is acknowledged and
the sender knows if a specific frame has been received or lost.
• Typically the protocol uses a specific time period that if has
passed without getting acknowledgment it will re-send the
frame.
• This service is useful for commutation when an unreliable
channel is being utilized (e.g., 802.11 WiFi).

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Data Link Layer


Acknowledged Connectionless Service
• Network layer does not know frame size of the packets
and other restriction of the data link layer. Hence it
becomes necessary for data link layer to have some
mechanism to optimize the transmission.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Data Link Layer


Acknowledged Connection Oriented Service
• Source and Destination establish a connection first.
• Each frame sent is numbered
o Data link layer guarantees that each frame sent is indeed received.
o It guarantees that each frame is received only once and that all
frames are received in the correct order.
Examples:
Satellite channel communication,
Long-distance telephone communication, etc.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Data Link Layer


Acknowledged Connection Oriented Service
Three distinct phases:
1. Connection is established by having both side initialize
variables and counters needed to keep track of which frames
have been received and which ones have not.
2. One or more frames are transmitted.
3. Finally, the connection is released – freeing up the variables,
buffers, and other resources used to maintain the
connection.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
Data Link Layer
Framing
• To provide service to the network layer the data link layer must use the
service provided to it by physical layer.

• Stream of data bits provided to data link layer is not guaranteed to be


without errors.

• Errors could be:

– Number of received bits does not match number of transmitted bits


(deletion or insertion)

– Bit Value

• It is up to data link layer to correct the errors if necessary.


2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
Data Link Layer
Framing
• Transmission of the data link layer starts with breaking up the bit
stream
o into discrete frames
o Computation of a checksum for each frame, and
o Include the checksum into the frame before it is transmitted.
• Receiver computes its checksum error for a receiving frame and if it is
different from the checksum that is being transmitted will have to deal
with the error.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
Data Link Layer
Framing

1. Byte count.
2. Flag bytes with byte stuffing.
3. Flag bits with bit stuffing.
4. Physical layer coding violations.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Data Link Layer -Framing


Byte Count Framing Method
• It uses a field in the header to specify the number of bytes in the frame.

• Once the header information is being received it will be used to determine end
of the frame.

• See figure in the next slide:

• Trouble with this algorithm is that when the count is incorrectly received the
destination will get out of synch with transmission.

– Destination may be able to detect that the frame is in error but it does not
have a means (in this algorithm) how to correct it.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Data Link Layer -Framing


Byte Count Framing Method

A byte stream. (a) Without errors. (b) With one error.


2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Data Link Layer -Framing


Flag Bytes with Byte Stuffing Framing Method
• This methods gets around the boundary detection of the frame by having each
appended by the frame start and frame end special bytes.

• If they are the same (beginning and ending byte in the frame) they are called flag
byte.

• In the next slide figure this byte is shown as FLAG.

• If the actual data contains a byte that is identical to the FLAG byte (e.g., picture,
data stream, etc.) the convention that can be used is to have escape character
inserted just before the “FLAG” character.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Data Link Layer -Framing


Flag Bytes with Byte Stuffing Framing Method

a) A frame delimited by flag bytes.


b) Four examples of byte sequences before and after byte stuffing.
2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Data Link Layer -Framing


Flag Bits with Bit Stuffing Framing Method
• This methods achieves the same thing as Byte Stuffing method by using Bits (1)
instead of Bytes (8 Bits).

• It was developed for High-level Data Link Control (HDLC) protocol.

• Each frames begins and ends with a special bit patter:

• 01111110 or 0x7E <- 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.

• USB uses bit stuffing.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Data Link Layer -Framing


Flag Bits with Bit Stuffing Framing Method

Bit stuffing. (a) The original data. (b) The data as they appear on
the line. (c) The data as they are stored in the receiver’s memory after
destuffing.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Data Link Layer -Framing


• Many data link protocols use a combination of presented
methods for safety. For example in Ethernet and 802.11 each
frame begin with a well-defined pattern called a preamble.

• Preamble is typically 72 bits long.

• It is then followed by a length fileld.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Data Link Layer -Error Control


• After solving the marking of the frame with start and end the
data link layer has to handle eventual errors in transmission
or detection.

– Ensuring that all frames are delivered to the network


layer at the destination and in proper order.

• Unacknowledged connectionless service: it is OK for the


sender to output frames regardless of its reception.

• Reliable connection-oriented service: it is NOT OK.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Data Link Layer -Error Control


• Reliable connection-oriented service usually will provide a sender with
some feedback about what is happening at the other end of the line.

• Receiver Sends Back Special Control Frames.

• If the Sender Receives positive Acknowledgment it will know that the


frame has arrived safely.

• Timer and Frame Sequence Number for the Sender is Necessary to


handle the case when there is no response (positive or negative) from
the Receiver .

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Data Link Layer -Flow Control


• Important Design issue for the cases when the sender is running on a
fast powerful computer and receiver is running on a slow low-end
machine.

• Two approaches:

• Feedback-based flow control

• Rate-based flow control

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Data Link Layer –


Feedback-based Flow Control
• Receiver sends back information to the sender giving it permission to
send more data, or

• Telling sender how receiver is doing.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Data Link Layer –


Rate-based Flow Control
• Built in mechanism that limits the rate at which sender may transmit
data, without the need for feedback from the receiver.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
Data Link Layer-
Error Detection and Correction
Two basic strategies to deal with errors:
1. Include enough redundant information to enable the receiver
to assume what the transmitted data must have been.
Error correcting codes.
2. Include only enough redundancy to allow the receiver to
assume that an error has occurred (but not which error).
Error detecting codes.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
Data Link Layer-
Error Detection

1. Parity checking.
2. Internet checksum .
3. Cyclic Redundancy Check (CRC).

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Error detection
EDC: error detection and correction bits (e.g., redundancy)
D: data protected by error checking, may include header fields

Error detection not


datagram datagram 100% reliable!
otherwise ▪ protocol may miss
all
N
some errors, but
bits in D’
OK detected rarely
? error
d data bits ▪ larger EDC field
D EDC D’ EDC’ yields better
detection and
bit-error lying link correction

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
Parity checking Can detect and correct errors
(without retransmission!)
single bit parity:
▪ two-dimensional parity:
▪ detect single bit errors
detect and correct single bit
0111000110101011 1 errors row parity
d1,1 ... d1,j d1,j+1
d data bits
d2,1 ... d2,j d2,j+1
parity bit ... ... ... ...
Even/odd parity: set parity di,1 ... di,j di,j+1
column
bit so there is an even/odd parity di+1,1 ... di+1,j di+1,j+1
number of 1’s
no errors: 1 0 1 0 1 1 detected 10101 1
At receiver: 11110 and
0 correctable 10110 0
parity
error
▪ compute parity of d received bits 0 1 1 1 0 1 single-bit 01110 1
▪ compare with received parity bit 0 0 1 0 1 0 error: 00101 0
– if different than error detected parity
error

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Parity checking

Interleaving of parity bits to detect a burst error.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Internet checksum: example


example: add two 16-bit integers
1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0
1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

wraparound 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1

sum 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 0
checksum 1 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1
complement

Note: when adding numbers, a carryout from the most


significant bit needs to be added to the result

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Cyclic Redundancy Check (CRC)


▪ more powerful error-detection coding
▪ D: data bits (given, think of these as a binary number)
▪ G: bit pattern (generator), of r+1 bits (given, specified in CRC standard)
r CRC bits
d data bits
D R bits to send
<D,R> = D*2r XOR R formula for these bits
sender: compute r CRC bits, R, such that <D,R> exactly divisible by G (mod 2)
• receiver knows G, divides <D,R> by G. If non-zero remainder: error
detected!
• can detect all burst errors less than r+1 bits
• widely used in practice (Ethernet, 802.11 WiFi)
2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Example calculation of the CRC


2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
Data Link Layer-
Error Detection & Correction
1. Hamming codes.
2. Binary convolutional codes.
3. Reed-Solomon codes.
4. Low-Density Parity Check codes.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

•All the codes presented in previous slide add redundancy


to the information that is being sent.
•A frame consists of
–m data bits (message) and
–r redundant bits (check).
•Block code - the r check bits are computed solely as
function of the m data bits with which they are associated.

•Systemic code – the m data bits are send directly along


with the check bits.
•Linear code – the r check bits are computed as a linear
function of the m data bits.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Hamming codes
▪ One cannot perform double errors and at the same time
detect quadruple errors.
▪ Error correction requires evaluation of each candidate
codeword which may be time consuming search.
▪ Through design this search time can be minimized.
▪ In theory if n = m + r, this requirement becomes:
(m + r + 1) ≤ 2r

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Hamming codes
• Codeword: b1 b2 b3 b4 ….

• Check bits: The bits that are powers of 2 (p1, p2, p4,
p8, p16, …).

• The rest of bits (m3, m5, m6, m7, m9, …) are filled
with m data bits.

• Example of the Hamming code with m = 7 data bits


and r = 4 check bits.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
Hamming codes
Consider a message having four data bits (D) which is to be
transmitted as a 7-bit codeword by adding three error control
bits. This would be called a (7,4) code. The three bits to be
added are three EVEN Parity bits (P), where the parity of each is
computed on different subsets of the message bits as shown
below. 7 6 5 4 3 2 1

D D D P D P P 7-BIT CODEWORD

D - D - D - P (EVEN PARITY)
D D - - D P - (EVEN PARITY)
D D D P - - - (EVEN PARITY)
2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
Hamming codes
•It may now be observed that if an error occurs in any of the seven
bits, that error will affect different combinations of the three parity
bits depending on the bit position.

•For example, suppose the above message 1100110 is sent and a


single bit error occurs such that the codeword 1110110 is received:

transmitted message received message


1100110 ------------> 1110110
BIT: 7 6 5 4 3 2 1 BIT: 7 6 5 4 3 2 1

The above error (in bit 5) can be corrected by examining which of


the three parity bits was affected by the bad bit:

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
Hamming codes

7 6 5 4 3 2 1
1 1 1 0 1 1 0 7-BIT CODEWORD
1 - 1 - 1 - 0 (EVEN PARITY) NOT! 1
1 1 - - 1 1 - (EVEN PARITY) OK! 0
1 1 1 0 - - - (EVEN PARITY) NOT! 1

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
Hamming codes
•In fact, the bad parity bits labeled 101 point directly to the bad bit since
101 binary equals 5. Examination of the 'parity circles' confirms that any
single bit error could be corrected in this way.
•The value of the Hamming code can be summarized:
1. Detection of 2 bit errors (assuming no correction is attempted);
2. Correction of single bit errors;
3. Cost of 3 bits added to a 4-bit message.
•The ability to correct single bit errors comes at a cost which is less than
sending the entire message twice. (Recall that simply sending a message
twice accomplishes no error correction.)

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Binary convolutional codes


▪ Not a block code
▪ There is no natural message size or encoding boundary as in a
block code.
▪ The output depends on the current and previous input bits.
Encoder has memory.
▪ The number of previous bits on which the output depends is
called the constraint length of the code.
▪ They are deployed as part of the
GSM mobile phone system
Satellite Communications, and 802.11

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
A convolutional code can be represented as (n,k, K) where
• k is the number of bits shifted into the encoder at one time.
Generally, k = 1.
• n is the number of encoder output bits corresponding to k
information bits.
• The code-rate, Rc = k/n .
• The encoder memory, a shift register of size k, is the constraint
length.
• n is a function of the present input bits and the contents of K.
• The state of the encoder is given by the value of (K - 1) bits.
2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Binary convolutional codes


Example of Generating a Convolutional Code
Let us consider a convolutional encoder with k = 1, n = 2 and
K = 3. The code-rate, Rc = k/n = 1/2 .

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Binary convolutional codes


The input string is streamed from right to left into the encoder.
When the first bit, 1, is streamed in the encoder, the contents of encoder
will be −

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Binary convolutional codes


When the next bit, 1 is streamed in the encoder, the contents of encoder
will be −

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Binary convolutional codes


When the next bit, 0 is streamed in the encoder, the contents of encoder
will be −

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Binary convolutional codes


When the last bit, 1 is streamed in the encoder, the contents of encoder
will be −

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Binary convolutional codes


For the binary convolution encoder given in the example −
The set of inputs = {0, 1}
The set of outputs = { 00, 10, 11}
The set of states = { 00, 01, 10, 11}
The corresponding state transition diagram will be −

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Reed-Solomon codes.
Reed-Solomon codes are block-based error correcting codes
with a wide range of applications in digital communications
and storage. Reed-Solomon codes are used to correct errors in
many systems including: Storage devices (including Storage
tape, Compact Disk,DVD,Blueray disk, barcodes, etc)

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Reed-Solomon codes.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Low-Density Parity Check codes.


Low-Density Parity Check (LDPC) codes represent a class of
error correcting codes that may be employed for providing error
correction of transmission errors in communication systems.
A low - density parity check (LFPC) code is specified by a
parity-check matrix containing mostly 0s and a low density of
1s. The rows of the matrix represent the equations and the
columns represent the bits in the codeword,

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Low-Density Parity Check codes.


Example 1 − Parity Check Matrix of Hamming Code
The following parity check matrix Hamming code having , with 4 information bits
followed by 3 even parity bits. The check digits are diagonally 1. The parity
equations are given alongside

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
Elementary Data Link Protocols

• Utopian Simplex Protocol


• Simplex Stop-and-Wait Protocol
• Error-Free Channel
• Simplex Stop-and-Wait Protocol
• Noisy Channel

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
Elementary Data Link Protocols
• Utopian Simplex Protocol
There is one direction of data transmission only from sender to
receiver. Here we assume the communication channel to be error-free and
the receiver will infinitely quickly process the input. The sender pumps out
the data onto the line as fast as it can.
Data are transmitted in one direction only. Both transmitting and
receiving network layers are always ready. Processing time can be ignored.
Infinite buffer space is available. This thoroughly unrealistic protocol,
which we will nickname “Utopia”,

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
Elementary Data Link Protocols
• Utopian Simplex Protocol

It is hypothetical protocol designed for unidirectional data


transmission over an ideal channel, i.e. a channel through which
transmission can never go wrong.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
Elementary Data Link Protocols
• Utopian Simplex Protocol

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
Elementary Data Link Protocols
• Simplex Stop-and-Wait Protocol
• Error-Free Channel
This protocol takes into account the fact that the receiver has
a finite processing speed. If data frames arrive at the receiver’s end at
a rate which is greater than its rate of processing, frames be dropped
out.
In order to avoid this, the receiver sends an acknowledgement
for each frame upon its arrival. The sender sends the next frame only
when it has received a positive acknowledgement from the receiver
that it is available for further data processing.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
Elementary Data Link Protocols
• Simplex Stop-and-Wait Protocol
• Error-Free Channel

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
Elementary Data Link Protocols
• Simplex Stop-and-Wait Protocol
• Noisy Channel
Simplex Stop – and – Wait protocol for noisy channel is data
link layer protocol for data communications with error control and
flow control mechanisms. It is popularly known as Stop – and –Wait
Automatic Repeat Request (Stop – and –Wait ARQ) protocol.
It adds error control facilities to Stop – and – Wait protocol.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
• Simplex Stop-and-Wait Protocol -Noisy Channel

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Implementation of the physical, data link, and network layers.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
One-Bit Sliding Window Protocol

Two scenarios for protocol 4. (a) Normal case. (b) Abnormal


case. The notation is (seq, ack, packet number). An asterisk indicates where a network layer
accepts a packet

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Pipelined protocols
pipelining: sender allows multiple, “in-flight”, yet-
to-be-acknowledged pkts
▪ range of sequence numbers must be increased
▪ buffering at sender and/or receiver

❖ two generic forms of pipelined protocols: go-Back-N,


selective repeat
2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

❖ e.g.: 1 Gbps link, 15 ms prop. delay, 8000 bit packet:

L 8000 bits
Dtrans = R = = 8 microsecs
109 bits/sec

▪ U sender: utilization – fraction of time sender busy sending

L/R .008
U sender = = 30.008 = 0.00027
RTT + L / R

▪ if RTT=30 msec, 1KB pkt every 30 msec: 33kB/sec thruput


over 1 Gbps link
❖ network protocol limits use of physical resources!

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

rdt3.0: stop-and-wait operation


sender receiver
first packet bit transmitted, t = 0
last packet bit transmitted, t = L / R

first packet bit arrives


RTT last packet bit arrives, send ACK

ACK arrives, send next


packet, t = RTT + L / R

U L/R .008
sender = = = 0.00027
RTT + L / R 30.008

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Pipelining: increased utilization


sender receiver
first packet bit transmitted, t = 0
last bit transmitted, t = L / R

first packet bit arrives


RTT last packet bit arrives, send ACK
last bit of 2nd packet arrives, send ACK
last bit of 3rd packet arrives, send ACK
ACK arrives, send next
packet, t = RTT + L / R
3-packet pipelining increases
utilization by a factor of 3!

U 3L / R .0024
sender = = = 0.00081
RTT + L / R 30.008

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
Pipelined protocols: overview
Go-back-N: Selective Repeat:
❖ sender can have up to N ❖ sender can have up to N
unacked packets in unack’ed packets in
pipeline pipeline
❖ receiver only sends ❖ receiver sends individual
cumulative ack ack for each packet
▪ doesn’t ack packet if
there’s a gap
❖ sender has timer for ❖ sender maintains timer for
oldest unacked packet each unacked packet
▪ when timer expires, ▪ when timer expires,
retransmit all unacked retransmit only that
packets unacked packet

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
sender window (N=4) sender receiver
012345678 send pkt0
012345678 send pkt1
012345678 send pkt2 receive pkt0, send ack0
012345678 send pkt3 Xloss receive pkt1, send ack1
(wait)
receive pkt3, discard,
012345678 rcv ack0, send pkt4 (re)send ack1
012345678 rcv ack1, send pkt5 receive pkt4, discard,
(re)send ack1
ignore duplicate ACK receive pkt5, discard,
(re)send ack1
pkt 2 timeout
012345678 send pkt2
012345678 send pkt3
012345678 send pkt4 rcv pkt2, deliver, send ack2
012345678 send pkt5 rcv pkt3, deliver, send ack3
rcv pkt4, deliver, send ack4
rcv pkt5, deliver, send ack5
GBN in action
2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
Selective repeat
sender receiver
data from above: pkt n in [rcvbase, rcvbase+N-1]
❖ if next available seq # in ❖ send ACK(n)
window, send pkt ❖ out-of-order: buffer
timeout(n): ❖ in-order: deliver (also
❖ resend pkt n, restart timer deliver buffered, in-order
pkts), advance window to
ACK(n) in [sendbase,sendbase+N]: next not-yet-received pkt
❖ mark pkt n as received
pkt n in [rcvbase-N,rcvbase-1]
❖ if n smallest unACKed pkt,
advance window base to ❖ ACK(n)
next unACKed seq # otherwise:
❖ ignore

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
Selective repeat in action
sender window (N=4) sender receiver
012345678 send pkt0
012345678 send pkt1
012345678 send pkt2 receive pkt0, send ack0
012345678 send pkt3 Xloss receive pkt1, send ack1
(wait)
receive pkt3, buffer,
012345678 rcv ack0, send pkt4 send ack3
012345678 rcv ack1, send pkt5 receive pkt4, buffer,
send ack4
record ack3 arrived receive pkt5, buffer,
send ack5
pkt 2 timeout
012345678 send pkt2
012345678 record ack4 arrived
012345678 rcv pkt2; deliver pkt2,
record ack5 arrived
012345678 pkt3, pkt4, pkt5; send ack2

Q: what happens when ack2 does not arrive?

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
sender window receiver window
Module 2 - The Data link layer, The (after receipt) (after receipt)
medium access control sublayer
pkt0
Selective repeat: dilemma 0123012
pkt1
example: 0123012 0123012
0123012 pkt2 0123012
❖ seq #’s: 0, 1, 2, 3 pkt3
0123012
0123012
❖ window size=3 0123012
X
pkt0
❖ receiver sees no will accept packet
with seq number 0
difference in two (a) no problem
scenarios! receiver can’t see sender side.
❖ duplicate data receiver behavior identical in both cases!
something’s (very) wrong!
accepted as new in
(b) 0123012 pkt0
0123012 pkt1 0123012
pkt2
Q: what relationship 0123012
X
0123012

between seq # size


0123012
X
and window size to timeout
retransmit pkt0 X
avoid problem in (b)? 0123012 pkt0
will accept packet
A: window size <= ½(seq# size) (b) issue with seq number 0

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
THE CHANNEL ALLOCATION PROBLEM

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, then
Frequency Division Multiplexing can be used as it is a simple and
efficient channel bandwidth allocating technique.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

1. Static Channel Allocation in LANs and MANs:


▪ It is the classical or traditional approach of allocating a single channel
among multiple competing users using Frequency Division Multiplexing
(FDM). if there are N users, the frequency channel is divided into N equal
sized portions (bandwidth), each user being assigned one portion. since each
user has a private frequency band, there is no interference between users.
▪ However, it is not suitable in case of a large number of users with variable
bandwidth requirements.
▪ It is not efficient to divide into fixed number of chunks.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

T = 1/(U*C-L)

T(FDM) = N*T(1/U(C/N)-L/N)

T = mean time delay,


C = capacity of channel,
L = arrival rate of frames,
1/U = bits/frame,
N = number of sub channels,
T(FDM) = Frequency Division Multiplexing Time

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
2. Dynamic Channel Allocation in LANs and MANs:

There are five key assumptions, described below.

Station Model.
The model consists of N independent stations (e.g., computers, telephones, or
personal communicators), each with a program or user that generates frames for
transmission. Stations are sometimes called terminals. The probability of a frame
being generated in an interval of length Dt is lDt, where l is a constant (the
arrival rate of new frames). Once a frame has been generated, the station is
blocked and does nothing until the frame has been successfully transmitted.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
2. Dynamic Channel Allocation in LANs and MANs

Single Channel Assumption. A single channel is available for all


communication. All stations can transmit on it and all can receive from it. As
far as the hardware is concerned, all stations are equivalent, although protocol
software may assign priorities to them.
Collision Assumption. If two frames are transmitted simultaneously, they
overlap in time and the resulting signal is garbled. This event is called a
collision. All stations can detect collisions. A collided frame must be
transmitted again later. There are no errors other than those generated by
collisions.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
2. Dynamic Channel Allocation in LANs and MANs

4a. Continuous Time. Frame transmission can begin at any instant.


There is no master clock dividing time into discrete intervals.
4b. Slotted Time. Time is divided into discrete intervals (slots). Frame
transmissions always begin at the start of a slot. A slot may contain 0,
1, or more frames, corresponding to an idle slot, a successful
transmission, or a collision, respectively.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
2. Dynamic Channel Allocation in LANs and MANs

5a. Carrier Sense. Stations can tell if the channel is in use before
trying to use it. If the channel is sensed as busy, no station will
attempt to use it until it goes idle.
5b. No Carrier Sense. Stations cannot sense the channel before
trying to use it. They just go ahead and transmit. Only later can they
determine whether the transmission was successful.

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
Multiple access protocols
▪ single shared broadcast channel
▪ two or more simultaneous transmissions by nodes:
interference
• collision if node receives two or more signals at the same
time

multiple access protocol


▪ distributed algorithm that determines how nodes share
channel, i.e., determine when node can transmit
▪ communication about channel sharing must use channel
itself!
• no out-of-band channel for coordination

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
Random access protocols
▪ when node has packet to send
• transmit at full channel data rate R
• no a prior coordination among nodes
▪ two or more transmitting nodes: “collision”
▪ random access protocol specifies:
• how to detect collisions
• how to recover from collisions (e.g., via delayed
retransmissions)
▪ examples of random access MAC protocols:
• ALOHA, slotted ALOHA
• CSMA, CSMA/CD, CSMA/CA

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
Slotted ALOHA
t0 t0+1
operation:
assumptions:
▪ when node obtains fresh frame,
▪ all frames same size transmits in next slot
▪ time divided into equal size slots • if no collision: node can send
(time to transmit 1 frame) new frame in next slot
▪ nodes start to transmit only slot • if collision: node retransmits
beginning frame in each subsequent slot
▪ nodes are synchronized with probability p until success
▪ if 2 or more nodes transmit in slot,
all nodes detect collision
randomization – why?
2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
Slotted ALOHA
node 1 1 1 1 1

node 2 2 2 2
C: collision
S: success
node 3 3 3 3
E: empty
C E C S E C E S S
Pros: Cons:
▪ single active node can ▪ collisions, wasting slots
continuously transmit at full rate of
channel ▪ idle slots
▪ highly decentralized: only slots in ▪ nodes may be able to
nodes need to be in sync detect collision in less than
▪ simple time to transmit packet
▪ clock synchronization
2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
Slotted ALOHA: efficiency
efficiency: long-run fraction of successful slots (many
nodes, all with many frames to send)
▪ suppose: N nodes with many frames to send, each
transmits in slot with probability p
• prob that given node has success in a slot = p(1-p)N-1
• prob that any node has a success = Np(1-p)N-1
• max efficiency: find p* that maximizes Np(1-p)N-1
• for many nodes, take limit of Np*(1-p*)N-1 as N goes to
infinity, gives:
max efficiency = 1/e = .37
▪ at best: channel used for useful transmissions
37% of time!
2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
Pure ALOHA
▪ unslotted Aloha: simpler, no synchronization
• when frame first arrives: transmit immediately
▪ collision probability increases with no synchronization:
• frame sent at t0 collides with other frames
sent in [t0-1,t0+1]
will overlap will overlap
with start of with end of
i’s frame i’s frame

t0 - 1 t0 t0 + 1
▪ pure Aloha efficiency: 18% !
2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

CSMA (carrier sense multiple access)


simple CSMA: listen before transmit:
• if channel sensed idle: transmit entire frame
• if channel sensed busy: defer transmission
▪ human analogy: don’t interrupt others!
CSMA/CD: CSMA with collision detection
• collisions detected within short time
• colliding transmissions aborted, reducing channel
wastage
• collision detection easy in wired, difficult with wireless
▪ human analogy: the polite conversationalist
2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer
spatial layout of nodes
CSMA: collisions
▪ collisions can still occur
with carrier sensing:
• propagation delay means
two nodes may not hear
each other’s just-started
transmission
▪ collision: entire packet
transmission time wasted
• distance & propagation
delay play role in in
determining collision
probability

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

CSMA/CD: spatial layout of nodes

▪ CSMA/CD reduces the


amount of time wasted in
collisions

• transmission aborted on
collision detection

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

Ethernet CSMA/CD algorithm


1. Ethernet receives datagram from network layer, creates frame
2. If Ethernet senses channel:
if idle: start frame transmission.
if busy: wait until channel idle, then transmit
3. If entire frame transmitted without collision - done!
4. If another transmission detected while sending: abort, send
jam signal
5. After aborting, enter binary (exponential) backoff:
• after mth collision, chooses K at random from {0,1,2, …,
2m-1}. Ethernet waits K·512 bit times, returns to Step 2
• more collisions: longer backoff interval
2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer, The medium access control sublayer

CSMA/CD efficiency
▪ Tprop = max prop delay between 2 nodes in LAN
▪ ttrans = time to transmit max-size frame
1
efficiency =
1 + 5t prop /ttrans
▪ efficiency goes to 1
• as tprop goes to 0
• as ttrans goes to infinity
▪ better performance than ALOHA: and simple, cheap,
decentralized!

2/26/2024 ELAIYARAJA P
21CS52 - COMPUTER NETWORKS
Module 2 - The Data link layer,
The medium access control sublayer
THE END

2/26/2024 ELAIYARAJA P

You might also like