SlideShare a Scribd company logo
Communication at the data-link layer
Nodes and Links
6 nodes- host, destination, routers
1,3,5 link- 3 LAN
2,4 link- WAN
Services
A communication with only three nodes
Services
• Framing
• Flow Control
• Error Control
• Congestion Control
Two Categories of Links
• point-to-point link
• Broadcast link.
Two Sublayers
LINK-LAYER ADDRESSING
Three Types of addresses
Unicast Address
•Unicasting means one-to-one communication.
Multicast Address
•Multicasting means one-to-many communication
Broadcast Address
•A frame with a destination broadcast address is sent to
all entities in the link.
Address Resolution Protocol (ARP)
Position of ARP in TCP/IP protocol suite
Address Resolution Protocol (ARP)
ARP operation
Address Resolution Protocol (ARP)
Packet Format
Error Detection and Correction
Types of Errors
•The central concept in detecting or correcting errors is
redundancy
•Redundancy is achieved through various coding
schemes
Block Coding
• Divide our message into blocks, each of k bits, called
datawords
• Add r redundant bits to each block to make the
length n = k + r. n-bit blocks are called codewords.
• create a combination of 2k
datawords and create a
combination of 2n
codewords
• This means that we have 2n
− 2k
codewords that are
not used, call these codewords invalid or illegal
Error Detection
• The following two conditions are met, the receiver
can detect a change in the original codeword.
• The receiver has (or can find) a list of valid
codewords. The original codeword has changed to an
invalid one.
Error Detection- Example
• Let us assume that k = 2 and n = 3. Table shows the list of
datawords and codewords.
• sender encodes the dataword 01 as 011 and sends it
• The receiver receives 011. It is a valid codeword.
• 111 is received . This is not a valid codeword and is discarded
• Even data corrupted, 000 is received, So error undetectable
Hamming Distance
• The Hamming distance between two words is the number of
differences between the corresponding bits
• Hamming distance between two words x and y as d(x, y)
• For example, if the codeword 00000 is sent and 01101 is
received, 3 bits are in error
• Hamming distance between the two is d(00000, 01101) = 3
• Hamming distance not zero, the codeword is corrupted, The
Hamming distance is found by apply the XOR operation ( )
⊕
Hamming Distance - Example
• Let us find the Hamming distance between two pairs of words
• The Hamming distance d(000, 011) is 2 because (000 011)
⊕
is 011 (two 1s).
• The Hamming distance d(10101, 11110) is 3 because (10101
11110) is 01011 (three 1s).
⊕
Minimum Hamming Distance for Error
Detection
• The minimum Hamming distance is the smallest Hamming
distance between all possible pairs of codewords.
• Now let us find the minimum Hamming distance in a code if
we want to be able to detect up to s errors.
• This means that dmin must be an integer greater than s or
dmin = s + 1
Linear Block Codes
• Subset of block codes called linear block codes.
• linear block code is a code in which the exclusive OR (addition
modulo-2) of two valid codewords creates another valid
codeword
• The minimum Hamming distance is the number of 1s in the
nonzero valid codeword with the smallest number of 1s
• In our first code table, the numbers of 1s in the nonzero
codewords are 2, 2, and 2. So the minimum Hamming
distance is dmin = 2.
Parity-Check Code
• n = k + 1
• r0 = a3 + a2 + a1 + a0 (modulo-2)
• s0 = b3 + b2 + b1 + b0 + q0 (modulo-2)
• syndrome is 0, there is no detectable error ,syndrome is 1, the
data portion of the received codeword is discarded
CYCLIC CODES
• In a cyclic code, if a codeword is cyclically shifted (rotated),
the result is another codeword
• For example, if 1011000 is a codeword and we cyclically left-
shift, then 0110001 is also a codeword
Cyclic Redundancy Check
Cyclic Redundancy Check
• The dataword has k bits (4 here); the codeword has n bits (7).
• The size of the dataword is by adding n − k (3 here) 0s in right
• The n-bit result is fed into the generator.
• The generator uses a divisor of size n − k + 1 (4 here)
• The generator divides the dataword by the divisor (modulo-2)
• The quotient of the division is discarded, the remainder
(r2r1r0) is appended to the dataword to create the codeword.
Cyclic Redundancy Check
Cyclic Redundancy Check
Cyclic Redundancy Check
Polynomials
Degree of a Polynomial- x6 + x + 1 is 6
Adding and Subtracting Polynomials- adding x5 + x4 + x2 and x6 +
x4 + x2 gives just x6 + x5
Multiplying or Dividing Terms- x3 × x4 is x7, x5/x2 is x3
Polynomials
Multiplying Two Polynomials-
(x5 + x3 + x2 + x)(x2 + x + 1) = x7 + x6 + x5 + x5 + x4 + x3 + x4 + x3
+ x2 + x3 + x2 + x = x7 + x6 + x3 + x
Shifting-
Shifting left 3 bits:
10011 becomes 10011000
x4 + x + 1 becomes x7 + x4 + x3
Shifting right 3 bits:
10011 becomes 10
x4 + x + 1 becomes x
Polynomials
Multiplying Two Polynomials-
(x5 + x3 + x2 + x)(x2 + x + 1) = x7 + x6 + x5 + x5 + x4 + x3 + x4 + x3
+ x2 + x3 + x2 + x = x7 + x6 + x3 + x
Shifting-
Shifting left 3 bits:
10011 becomes 10011000
x4 + x + 1 becomes x7 + x4 + x3
Shifting right 3 bits:
10011 becomes 10
x4 + x + 1 becomes x
Cyclic Code Encoder Using Polynomials
• The dataword 1001 is represented as x3 + 1. The divisor 1011
is represented as x3 + x + 1.
• To find the augmented dataword, we have left-shifted the
dataword 3 bits (multiplying by x3).
• The result is x6 + x3 . Division is straightforward.
• We divide the first term of the dividend, x6 , by the first term
of the divisor, x3
• Then we multiply x3 by the divisor and subtract
Cyclic Code Encoder Using Polynomials
Cyclic Code Encoder Using Polynomials
• We define the following, where f(x) is a polynomial with binary
coefficients
• In a cyclic code,
1. If s(x) ¦ 0, one or more bits is corrupted.
2. If s(x) = 0, either
a. No bit is corrupted, or
b. Some bits are corrupted, but the decoder failed
to detect them.
Cyclic Code Encoder Using Polynomials
• Dataword: d(x) Codeword: c(x) Generator: g(x) Syndrome: s(x)
Error: e(x)
• Received codeword = c(x) + e(x)
• The receiver divides the received codeword by g(x) to get the
syndrome.
• If this term does not have a remainder (syndrome = 0), either
e(x) is 0 or e(x) is divisible by g(x)
Cyclic Code Encoder Using Polynomials
Single-Bit Error
•If the generator has more than one term and the coefficient of x0
is 1, all single-bit errors can be caught.
•If a generator cannot divide xt
+ 1 (t between 0 and n - 1), then
all isolated double errors can be detected.
•A generator that contains a factor of x + 1 can detect all odd-
numbered errors
Cyclic Code Encoder Using Polynomials
Burst Errors
L is the length of the error
r is check bits
Checksum
For example, if the set of numbers is (7, 11, 12, 0, 6), we send (7,
11, 12, 0, 6, 36)
Forward Error Correction
Using Hamming Distance
•To detect s errors, the minimum Hamming distance should be
dmin = s + 1.
•For error detection, we definitely need more distance.
•It can be shown that to detect t errors, we need to have dmin=2t
+ 1
Forward Error Correction
Using XOR
R = P1 P2 … Pi … PN → Pi = P1 P2 … R …
⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕
PN
•we apply the exclusive OR operation on N data items (P1 to PN),
•replacing the one to be created by the result of the previous operation (R).
•This means that we can divide a packet into N chunks, create the exclusive OR
of all the chunks and send N + 1 chunks.
•If any chunk is lost or corrupted, it can be created at the receiver site
Forward Error Correction
Chunk Interleaving
DLC Services- data link control (DLC)
• Data link control functions include framing and flow and error
control
Framing
Character-Oriented Framing
DLC Services- data link control (DLC)
Byte stuffing and unstuffing
Byte stuffing is the process of adding one extra byte whenever there is a flag
or escape character in the text.
DLC Services- data link control (DLC)
Bit-Oriented Framing
DLC Services- data link control (DLC)
Bit stuffing and unstuffing
Bit stuffing is the process of adding one extra 0 whenever five
consecutive 1s follow a 0 in the data, so that the receiver does
not mistake the pattern 0111110 for a flag.
DLC Services- data link control (DLC)
Flow Control
Flow control in this case can be feedback from the receiving
node to the sending node to stop or slow down pushing frames
DLC Services- data link control (DLC)
Buffers
•Flow control can be implemented in several ways, one of the
solutions is normally to use two buffers;
•one at the sending data-link layer and the other at the receiving
data-link layer
•A buffer is a set of memory locations that can hold packets at the
sender and receiver.
•When the buffer of the receiving data-link layer is full, it informs
the sending data-link layer to stop pushing frames
DLC Services- data link control (DLC)
Error Control
A CRC is added to the frame header by the sender and checked
by the receiver.
Flow control is implemented using two methods
•In the first method, if the frame is corrupted, it is silently
discarded; if it is not corrupted, the packet is delivered to the
network layer
•In the second method, if the frame is corrupted, it is silently
discarded; if it is not corrupted, an acknowledgment is sent to the
sender
Data-link Layer Protocols
Traditionally four protocols have been defined for the data-link
layer to deal with flow and error control:
•Simple,
•Stop-and-Wait,
•Go-Back-N,
•Selective-Repeat
Data-link Layer Protocols
The behavior of a data-link-layer protocol can be better shown as
a finite state machine (FSM)
Simple Protocol
simple protocol with neither flow nor error control
Simple Protocol
FSMs for the simple protocol
Stop-and-Wait Protocol
Stop-and-Wait protocol, which uses both flow and error control
Stop-and-Wait Protocol
FSM for the Stop-and-Wait protocol
High-level Data Link Control (HDLC)
• It is a bit-oriented protocol for communication over point-to-
point and multipoint links.
• It implements the Stop-and-Wait protocol
• HDLC provides two common transfer modes that can be used
in different configurations:
 Normal response mode (NRM)
 Asynchronous balanced mode (ABM)
High-level Data Link Control (HDLC)
Normal response mode
Asynchronous balanced mode
HDLC frames
Information frames (I-frames)- used to data-link user data and
control information relating to user data
supervisory frames (S-frames)- used only to transport control
information
unnumbered frames (U-frames)- reserved for system
management
HDLC frames
Flag field- synchronization pattern 01111110
Address field- the secondary station
Control field- one or two bytes used for flow and error control
Information field- the user’s data from the network layer
FCS field- The frame check sequence (FCS) error detection field, It
can contain either a 2- or 4-byte CRC
Control field formats
N(S)- define the sequence number of the frame
N(R)- correspond to the acknowledgment number
P/F(Poll/Final)- 1- Poll, sender to receiver ( Receiver address)
0-Final Receiver to sender (sender address)
Control Field for S-Frames
Code 2 bits- used to define type of S frame
Code 2 bits- used to define type of S frame
The last 3 bits, called N(R), correspond to the (ACK) or (NAK),
depending on the type of S-frame
The 2 bits called code represents type of S frame
Receive ready (RR). If the value of the code subfield is 00
Receive not ready (RNR). If the value of the code subfield is 10
Reject (REJ). If the value of the code subfield is 01
Selective reject (SREJ). If the value of the code subfield is 11
POINT-TO-POINT PROTOCOL (PPP)
• PPP defines the format of the frame to be exchanged between
devices.
• It also defines how two devices can negotiate the
establishment of the link and the exchange of data.
• PPP is designed to accept payloads from several network
layers (not only IP).
• The new version of PPP, called Multilink PPP, provides
connections over multiple links
Framing
Address. The address field in this protocol is a constant value and
set to 11111111 (broadcast address)
Control. This field is set to the constant value 00000011
Protocol. The protocol field defines what is being carried in the
data field: either user data or other information
Payload field. This field carries either the user data or other
information
Transition Phases
Wired LANs: Ethernet
IEEE standard for LANs
Ethernet Evolution
Ethernet frame
Implementation of standard Etherne
Efficiency of Standard Ethernet
• The efficiency of the Ethernet is defined as the ratio of the
time used by a station to send data to the time the medium is
occupied by this station.
• The practical efficiency of standard Ethernet has been
measured to be
• in which the parameter “a” is the number of frames that can
fit on the medium
• It can be calculated as a = (propagation delay)/(transmission
delay)
Efficiency of Standard Ethernet
Example
In the Standard Ethernet with the transmission rate of 10 Mbps,
we assume that the length of the medium is 2500 m and the size
of the frame is 512 bits. The propagation speed of a signal in a
cable is normally 2 × 108 m/s.
Implementation
10Base5: Thick Ethernet
10Base2: Thin Ethernet
Implementation
10Base-T: Twisted-Pair Ethernet
10Base-F: Fiber Ethernet
Bridged Ethernet
Switched Ethernet
Full-Duplex Ethernet
FAST ETHERNET (100 MBPS)
Wireless LANs
Characteristics
• Attenuation
• Interference
• Multipath Propagation
• Error
Access Control
IEEE 802.11 PROJECT
The standard defines two kinds of services:
• the basic service set (BSS)
• the extended service set (ESS)
Basic service sets (BSSs)
IEEE 802.11 PROJECT
Extended service set (ESS)
IEEE 802.11 PROJECT
Extended service set (ESS)
MAC Sublayer
IEEE 802.11 defines two MAC sublayers:
•the distributed coordination function (DCF)
•point coordination function (PCF)
Distributed Coordination Function
DIFS- distributed interframe space, SIFS- short interframe
space
Point Coordination Function (PCF)
Frame Format
Bluetooth
Scatternet
Bluetooth Layers
L2CAP data packet format
Frame Format
Ad

More Related Content

Similar to Data Link layer in computer networks cse (20)

linear codes and cyclic codes
linear codes and cyclic codeslinear codes and cyclic codes
linear codes and cyclic codes
saigopinadh bodigiri
 
Data linklayer
Data linklayerData linklayer
Data linklayer
sheikhshakir
 
Ch3 datalink
Ch3 datalinkCh3 datalink
Ch3 datalink
Ramesh Kumar
 
Chapter 10: Error Correction and Detection
Chapter 10: Error Correction and DetectionChapter 10: Error Correction and Detection
Chapter 10: Error Correction and Detection
JeoffnaRuth
 
CRC Error coding technique
CRC Error coding techniqueCRC Error coding technique
CRC Error coding technique
Mantra VLSI
 
15CS46 - Data communication or computer networks 1_Module-3.ppt
15CS46 - Data communication or computer networks 1_Module-3.ppt15CS46 - Data communication or computer networks 1_Module-3.ppt
15CS46 - Data communication or computer networks 1_Module-3.ppt
ranjan317165
 
Error detection and correction
Error detection and correctionError detection and correction
Error detection and correction
Abdul Razaq
 
Skr+3200+chapter+3+(kweh)
Skr+3200+chapter+3+(kweh)Skr+3200+chapter+3+(kweh)
Skr+3200+chapter+3+(kweh)
Ammar Shafiq
 
4_Datalink__Error_Detection_and Correction.pdf
4_Datalink__Error_Detection_and Correction.pdf4_Datalink__Error_Detection_and Correction.pdf
4_Datalink__Error_Detection_and Correction.pdf
kenilpatel65
 
ERROR DETECTION IN DATA COMMUNICATION AND NETWORKING-1.pptx
ERROR DETECTION IN DATA COMMUNICATION AND NETWORKING-1.pptxERROR DETECTION IN DATA COMMUNICATION AND NETWORKING-1.pptx
ERROR DETECTION IN DATA COMMUNICATION AND NETWORKING-1.pptx
Asoa Anaaba Joseph
 
Data links
Data links Data links
Data links
EshaAfzal5
 
13-DataLink_02.ppt
13-DataLink_02.ppt13-DataLink_02.ppt
13-DataLink_02.ppt
WinterSnow16
 
5. Error Coding
5. Error Coding5. Error Coding
5. Error Coding
Napier University
 
Lec8 on Computer Networks by Tarun Mangla.pdf
Lec8 on Computer Networks by Tarun Mangla.pdfLec8 on Computer Networks by Tarun Mangla.pdf
Lec8 on Computer Networks by Tarun Mangla.pdf
ShivamSawarn2
 
Chapter 10
Chapter 10Chapter 10
Chapter 10
bheemsain
 
Unit-4.pptx
Unit-4.pptxUnit-4.pptx
Unit-4.pptx
4NM19EC140ROHITHUACH
 
Data link layar
Data link layarData link layar
Data link layar
jaysanshrestha
 
Data link layar
Data link layarData link layar
Data link layar
jaysanshrestha
 
05 directnets errors
05 directnets errors05 directnets errors
05 directnets errors
jyang1983
 
linear block code.pptxjdkdidjdjdkdkidndndjdj
linear block code.pptxjdkdidjdjdkdkidndndjdjlinear block code.pptxjdkdidjdjdkdkidndndjdj
linear block code.pptxjdkdidjdjdkdkidndndjdj
urawaashish3
 
Chapter 10: Error Correction and Detection
Chapter 10: Error Correction and DetectionChapter 10: Error Correction and Detection
Chapter 10: Error Correction and Detection
JeoffnaRuth
 
CRC Error coding technique
CRC Error coding techniqueCRC Error coding technique
CRC Error coding technique
Mantra VLSI
 
15CS46 - Data communication or computer networks 1_Module-3.ppt
15CS46 - Data communication or computer networks 1_Module-3.ppt15CS46 - Data communication or computer networks 1_Module-3.ppt
15CS46 - Data communication or computer networks 1_Module-3.ppt
ranjan317165
 
Error detection and correction
Error detection and correctionError detection and correction
Error detection and correction
Abdul Razaq
 
Skr+3200+chapter+3+(kweh)
Skr+3200+chapter+3+(kweh)Skr+3200+chapter+3+(kweh)
Skr+3200+chapter+3+(kweh)
Ammar Shafiq
 
4_Datalink__Error_Detection_and Correction.pdf
4_Datalink__Error_Detection_and Correction.pdf4_Datalink__Error_Detection_and Correction.pdf
4_Datalink__Error_Detection_and Correction.pdf
kenilpatel65
 
ERROR DETECTION IN DATA COMMUNICATION AND NETWORKING-1.pptx
ERROR DETECTION IN DATA COMMUNICATION AND NETWORKING-1.pptxERROR DETECTION IN DATA COMMUNICATION AND NETWORKING-1.pptx
ERROR DETECTION IN DATA COMMUNICATION AND NETWORKING-1.pptx
Asoa Anaaba Joseph
 
13-DataLink_02.ppt
13-DataLink_02.ppt13-DataLink_02.ppt
13-DataLink_02.ppt
WinterSnow16
 
Lec8 on Computer Networks by Tarun Mangla.pdf
Lec8 on Computer Networks by Tarun Mangla.pdfLec8 on Computer Networks by Tarun Mangla.pdf
Lec8 on Computer Networks by Tarun Mangla.pdf
ShivamSawarn2
 
05 directnets errors
05 directnets errors05 directnets errors
05 directnets errors
jyang1983
 
linear block code.pptxjdkdidjdjdkdkidndndjdj
linear block code.pptxjdkdidjdjdkdkidndndjdjlinear block code.pptxjdkdidjdjdkdkidndndjdj
linear block code.pptxjdkdidjdjdkdkidndndjdj
urawaashish3
 

Recently uploaded (20)

Artificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptxArtificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptx
aditichinar
 
Smart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineeringSmart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineering
rushikeshnavghare94
 
IntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdfIntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdf
Luiz Carneiro
 
some basics electrical and electronics knowledge
some basics electrical and electronics knowledgesome basics electrical and electronics knowledge
some basics electrical and electronics knowledge
nguyentrungdo88
 
AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)
Vəhid Gəruslu
 
International Journal of Distributed and Parallel systems (IJDPS)
International Journal of Distributed and Parallel systems (IJDPS)International Journal of Distributed and Parallel systems (IJDPS)
International Journal of Distributed and Parallel systems (IJDPS)
samueljackson3773
 
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdffive-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
AdityaSharma944496
 
Introduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptxIntroduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptx
AS1920
 
Compiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptxCompiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptx
RushaliDeshmukh2
 
Raish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdfRaish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdf
RaishKhanji
 
Machine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptxMachine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptx
rajeswari89780
 
railway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forgingrailway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forging
Javad Kadkhodapour
 
15th International Conference on Computer Science, Engineering and Applicatio...
15th International Conference on Computer Science, Engineering and Applicatio...15th International Conference on Computer Science, Engineering and Applicatio...
15th International Conference on Computer Science, Engineering and Applicatio...
IJCSES Journal
 
Degree_of_Automation.pdf for Instrumentation and industrial specialist
Degree_of_Automation.pdf for  Instrumentation  and industrial specialistDegree_of_Automation.pdf for  Instrumentation  and industrial specialist
Degree_of_Automation.pdf for Instrumentation and industrial specialist
shreyabhosale19
 
new ppt artificial intelligence historyyy
new ppt artificial intelligence historyyynew ppt artificial intelligence historyyy
new ppt artificial intelligence historyyy
PianoPianist
 
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Journal of Soft Computing in Civil Engineering
 
The Gaussian Process Modeling Module in UQLab
The Gaussian Process Modeling Module in UQLabThe Gaussian Process Modeling Module in UQLab
The Gaussian Process Modeling Module in UQLab
Journal of Soft Computing in Civil Engineering
 
Data Structures_Introduction to algorithms.pptx
Data Structures_Introduction to algorithms.pptxData Structures_Introduction to algorithms.pptx
Data Structures_Introduction to algorithms.pptx
RushaliDeshmukh2
 
Process Parameter Optimization for Minimizing Springback in Cold Drawing Proc...
Process Parameter Optimization for Minimizing Springback in Cold Drawing Proc...Process Parameter Optimization for Minimizing Springback in Cold Drawing Proc...
Process Parameter Optimization for Minimizing Springback in Cold Drawing Proc...
Journal of Soft Computing in Civil Engineering
 
Avnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights FlyerAvnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights Flyer
WillDavies22
 
Artificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptxArtificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptx
aditichinar
 
Smart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineeringSmart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineering
rushikeshnavghare94
 
IntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdfIntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdf
Luiz Carneiro
 
some basics electrical and electronics knowledge
some basics electrical and electronics knowledgesome basics electrical and electronics knowledge
some basics electrical and electronics knowledge
nguyentrungdo88
 
AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)
Vəhid Gəruslu
 
International Journal of Distributed and Parallel systems (IJDPS)
International Journal of Distributed and Parallel systems (IJDPS)International Journal of Distributed and Parallel systems (IJDPS)
International Journal of Distributed and Parallel systems (IJDPS)
samueljackson3773
 
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdffive-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
AdityaSharma944496
 
Introduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptxIntroduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptx
AS1920
 
Compiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptxCompiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptx
RushaliDeshmukh2
 
Raish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdfRaish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdf
RaishKhanji
 
Machine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptxMachine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptx
rajeswari89780
 
railway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forgingrailway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forging
Javad Kadkhodapour
 
15th International Conference on Computer Science, Engineering and Applicatio...
15th International Conference on Computer Science, Engineering and Applicatio...15th International Conference on Computer Science, Engineering and Applicatio...
15th International Conference on Computer Science, Engineering and Applicatio...
IJCSES Journal
 
Degree_of_Automation.pdf for Instrumentation and industrial specialist
Degree_of_Automation.pdf for  Instrumentation  and industrial specialistDegree_of_Automation.pdf for  Instrumentation  and industrial specialist
Degree_of_Automation.pdf for Instrumentation and industrial specialist
shreyabhosale19
 
new ppt artificial intelligence historyyy
new ppt artificial intelligence historyyynew ppt artificial intelligence historyyy
new ppt artificial intelligence historyyy
PianoPianist
 
Data Structures_Introduction to algorithms.pptx
Data Structures_Introduction to algorithms.pptxData Structures_Introduction to algorithms.pptx
Data Structures_Introduction to algorithms.pptx
RushaliDeshmukh2
 
Avnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights FlyerAvnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights Flyer
WillDavies22
 
Ad

Data Link layer in computer networks cse

  • 1. Communication at the data-link layer
  • 2. Nodes and Links 6 nodes- host, destination, routers 1,3,5 link- 3 LAN 2,4 link- WAN
  • 3. Services A communication with only three nodes
  • 4. Services • Framing • Flow Control • Error Control • Congestion Control
  • 5. Two Categories of Links • point-to-point link • Broadcast link.
  • 8. Three Types of addresses Unicast Address •Unicasting means one-to-one communication. Multicast Address •Multicasting means one-to-many communication Broadcast Address •A frame with a destination broadcast address is sent to all entities in the link.
  • 9. Address Resolution Protocol (ARP) Position of ARP in TCP/IP protocol suite
  • 10. Address Resolution Protocol (ARP) ARP operation
  • 11. Address Resolution Protocol (ARP) Packet Format
  • 12. Error Detection and Correction Types of Errors •The central concept in detecting or correcting errors is redundancy •Redundancy is achieved through various coding schemes
  • 13. Block Coding • Divide our message into blocks, each of k bits, called datawords • Add r redundant bits to each block to make the length n = k + r. n-bit blocks are called codewords. • create a combination of 2k datawords and create a combination of 2n codewords • This means that we have 2n − 2k codewords that are not used, call these codewords invalid or illegal
  • 14. Error Detection • The following two conditions are met, the receiver can detect a change in the original codeword. • The receiver has (or can find) a list of valid codewords. The original codeword has changed to an invalid one.
  • 15. Error Detection- Example • Let us assume that k = 2 and n = 3. Table shows the list of datawords and codewords. • sender encodes the dataword 01 as 011 and sends it • The receiver receives 011. It is a valid codeword. • 111 is received . This is not a valid codeword and is discarded • Even data corrupted, 000 is received, So error undetectable
  • 16. Hamming Distance • The Hamming distance between two words is the number of differences between the corresponding bits • Hamming distance between two words x and y as d(x, y) • For example, if the codeword 00000 is sent and 01101 is received, 3 bits are in error • Hamming distance between the two is d(00000, 01101) = 3 • Hamming distance not zero, the codeword is corrupted, The Hamming distance is found by apply the XOR operation ( ) ⊕
  • 17. Hamming Distance - Example • Let us find the Hamming distance between two pairs of words • The Hamming distance d(000, 011) is 2 because (000 011) ⊕ is 011 (two 1s). • The Hamming distance d(10101, 11110) is 3 because (10101 11110) is 01011 (three 1s). ⊕
  • 18. Minimum Hamming Distance for Error Detection • The minimum Hamming distance is the smallest Hamming distance between all possible pairs of codewords. • Now let us find the minimum Hamming distance in a code if we want to be able to detect up to s errors. • This means that dmin must be an integer greater than s or dmin = s + 1
  • 19. Linear Block Codes • Subset of block codes called linear block codes. • linear block code is a code in which the exclusive OR (addition modulo-2) of two valid codewords creates another valid codeword • The minimum Hamming distance is the number of 1s in the nonzero valid codeword with the smallest number of 1s • In our first code table, the numbers of 1s in the nonzero codewords are 2, 2, and 2. So the minimum Hamming distance is dmin = 2.
  • 20. Parity-Check Code • n = k + 1 • r0 = a3 + a2 + a1 + a0 (modulo-2) • s0 = b3 + b2 + b1 + b0 + q0 (modulo-2) • syndrome is 0, there is no detectable error ,syndrome is 1, the data portion of the received codeword is discarded
  • 21. CYCLIC CODES • In a cyclic code, if a codeword is cyclically shifted (rotated), the result is another codeword • For example, if 1011000 is a codeword and we cyclically left- shift, then 0110001 is also a codeword
  • 23. Cyclic Redundancy Check • The dataword has k bits (4 here); the codeword has n bits (7). • The size of the dataword is by adding n − k (3 here) 0s in right • The n-bit result is fed into the generator. • The generator uses a divisor of size n − k + 1 (4 here) • The generator divides the dataword by the divisor (modulo-2) • The quotient of the division is discarded, the remainder (r2r1r0) is appended to the dataword to create the codeword.
  • 27. Polynomials Degree of a Polynomial- x6 + x + 1 is 6 Adding and Subtracting Polynomials- adding x5 + x4 + x2 and x6 + x4 + x2 gives just x6 + x5 Multiplying or Dividing Terms- x3 × x4 is x7, x5/x2 is x3
  • 28. Polynomials Multiplying Two Polynomials- (x5 + x3 + x2 + x)(x2 + x + 1) = x7 + x6 + x5 + x5 + x4 + x3 + x4 + x3 + x2 + x3 + x2 + x = x7 + x6 + x3 + x Shifting- Shifting left 3 bits: 10011 becomes 10011000 x4 + x + 1 becomes x7 + x4 + x3 Shifting right 3 bits: 10011 becomes 10 x4 + x + 1 becomes x
  • 29. Polynomials Multiplying Two Polynomials- (x5 + x3 + x2 + x)(x2 + x + 1) = x7 + x6 + x5 + x5 + x4 + x3 + x4 + x3 + x2 + x3 + x2 + x = x7 + x6 + x3 + x Shifting- Shifting left 3 bits: 10011 becomes 10011000 x4 + x + 1 becomes x7 + x4 + x3 Shifting right 3 bits: 10011 becomes 10 x4 + x + 1 becomes x
  • 30. Cyclic Code Encoder Using Polynomials • The dataword 1001 is represented as x3 + 1. The divisor 1011 is represented as x3 + x + 1. • To find the augmented dataword, we have left-shifted the dataword 3 bits (multiplying by x3). • The result is x6 + x3 . Division is straightforward. • We divide the first term of the dividend, x6 , by the first term of the divisor, x3 • Then we multiply x3 by the divisor and subtract
  • 31. Cyclic Code Encoder Using Polynomials
  • 32. Cyclic Code Encoder Using Polynomials • We define the following, where f(x) is a polynomial with binary coefficients • In a cyclic code, 1. If s(x) ¦ 0, one or more bits is corrupted. 2. If s(x) = 0, either a. No bit is corrupted, or b. Some bits are corrupted, but the decoder failed to detect them.
  • 33. Cyclic Code Encoder Using Polynomials • Dataword: d(x) Codeword: c(x) Generator: g(x) Syndrome: s(x) Error: e(x) • Received codeword = c(x) + e(x) • The receiver divides the received codeword by g(x) to get the syndrome. • If this term does not have a remainder (syndrome = 0), either e(x) is 0 or e(x) is divisible by g(x)
  • 34. Cyclic Code Encoder Using Polynomials Single-Bit Error •If the generator has more than one term and the coefficient of x0 is 1, all single-bit errors can be caught. •If a generator cannot divide xt + 1 (t between 0 and n - 1), then all isolated double errors can be detected. •A generator that contains a factor of x + 1 can detect all odd- numbered errors
  • 35. Cyclic Code Encoder Using Polynomials Burst Errors L is the length of the error r is check bits
  • 36. Checksum For example, if the set of numbers is (7, 11, 12, 0, 6), we send (7, 11, 12, 0, 6, 36)
  • 37. Forward Error Correction Using Hamming Distance •To detect s errors, the minimum Hamming distance should be dmin = s + 1. •For error detection, we definitely need more distance. •It can be shown that to detect t errors, we need to have dmin=2t + 1
  • 38. Forward Error Correction Using XOR R = P1 P2 … Pi … PN → Pi = P1 P2 … R … ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ PN •we apply the exclusive OR operation on N data items (P1 to PN), •replacing the one to be created by the result of the previous operation (R). •This means that we can divide a packet into N chunks, create the exclusive OR of all the chunks and send N + 1 chunks. •If any chunk is lost or corrupted, it can be created at the receiver site
  • 40. DLC Services- data link control (DLC) • Data link control functions include framing and flow and error control Framing Character-Oriented Framing
  • 41. DLC Services- data link control (DLC) Byte stuffing and unstuffing Byte stuffing is the process of adding one extra byte whenever there is a flag or escape character in the text.
  • 42. DLC Services- data link control (DLC) Bit-Oriented Framing
  • 43. DLC Services- data link control (DLC) Bit stuffing and unstuffing Bit stuffing is the process of adding one extra 0 whenever five consecutive 1s follow a 0 in the data, so that the receiver does not mistake the pattern 0111110 for a flag.
  • 44. DLC Services- data link control (DLC) Flow Control Flow control in this case can be feedback from the receiving node to the sending node to stop or slow down pushing frames
  • 45. DLC Services- data link control (DLC) Buffers •Flow control can be implemented in several ways, one of the solutions is normally to use two buffers; •one at the sending data-link layer and the other at the receiving data-link layer •A buffer is a set of memory locations that can hold packets at the sender and receiver. •When the buffer of the receiving data-link layer is full, it informs the sending data-link layer to stop pushing frames
  • 46. DLC Services- data link control (DLC) Error Control A CRC is added to the frame header by the sender and checked by the receiver. Flow control is implemented using two methods •In the first method, if the frame is corrupted, it is silently discarded; if it is not corrupted, the packet is delivered to the network layer •In the second method, if the frame is corrupted, it is silently discarded; if it is not corrupted, an acknowledgment is sent to the sender
  • 47. Data-link Layer Protocols Traditionally four protocols have been defined for the data-link layer to deal with flow and error control: •Simple, •Stop-and-Wait, •Go-Back-N, •Selective-Repeat
  • 48. Data-link Layer Protocols The behavior of a data-link-layer protocol can be better shown as a finite state machine (FSM)
  • 49. Simple Protocol simple protocol with neither flow nor error control
  • 50. Simple Protocol FSMs for the simple protocol
  • 51. Stop-and-Wait Protocol Stop-and-Wait protocol, which uses both flow and error control
  • 52. Stop-and-Wait Protocol FSM for the Stop-and-Wait protocol
  • 53. High-level Data Link Control (HDLC) • It is a bit-oriented protocol for communication over point-to- point and multipoint links. • It implements the Stop-and-Wait protocol • HDLC provides two common transfer modes that can be used in different configurations:  Normal response mode (NRM)  Asynchronous balanced mode (ABM)
  • 54. High-level Data Link Control (HDLC) Normal response mode Asynchronous balanced mode
  • 55. HDLC frames Information frames (I-frames)- used to data-link user data and control information relating to user data supervisory frames (S-frames)- used only to transport control information unnumbered frames (U-frames)- reserved for system management
  • 56. HDLC frames Flag field- synchronization pattern 01111110 Address field- the secondary station Control field- one or two bytes used for flow and error control Information field- the user’s data from the network layer FCS field- The frame check sequence (FCS) error detection field, It can contain either a 2- or 4-byte CRC
  • 57. Control field formats N(S)- define the sequence number of the frame N(R)- correspond to the acknowledgment number P/F(Poll/Final)- 1- Poll, sender to receiver ( Receiver address) 0-Final Receiver to sender (sender address) Control Field for S-Frames
  • 58. Code 2 bits- used to define type of S frame Code 2 bits- used to define type of S frame The last 3 bits, called N(R), correspond to the (ACK) or (NAK), depending on the type of S-frame The 2 bits called code represents type of S frame Receive ready (RR). If the value of the code subfield is 00 Receive not ready (RNR). If the value of the code subfield is 10 Reject (REJ). If the value of the code subfield is 01 Selective reject (SREJ). If the value of the code subfield is 11
  • 59. POINT-TO-POINT PROTOCOL (PPP) • PPP defines the format of the frame to be exchanged between devices. • It also defines how two devices can negotiate the establishment of the link and the exchange of data. • PPP is designed to accept payloads from several network layers (not only IP). • The new version of PPP, called Multilink PPP, provides connections over multiple links
  • 60. Framing Address. The address field in this protocol is a constant value and set to 11111111 (broadcast address) Control. This field is set to the constant value 00000011 Protocol. The protocol field defines what is being carried in the data field: either user data or other information Payload field. This field carries either the user data or other information
  • 62. Wired LANs: Ethernet IEEE standard for LANs
  • 66. Efficiency of Standard Ethernet • The efficiency of the Ethernet is defined as the ratio of the time used by a station to send data to the time the medium is occupied by this station. • The practical efficiency of standard Ethernet has been measured to be • in which the parameter “a” is the number of frames that can fit on the medium • It can be calculated as a = (propagation delay)/(transmission delay)
  • 67. Efficiency of Standard Ethernet Example In the Standard Ethernet with the transmission rate of 10 Mbps, we assume that the length of the medium is 2500 m and the size of the frame is 512 bits. The propagation speed of a signal in a cable is normally 2 × 108 m/s.
  • 75. Characteristics • Attenuation • Interference • Multipath Propagation • Error
  • 77. IEEE 802.11 PROJECT The standard defines two kinds of services: • the basic service set (BSS) • the extended service set (ESS) Basic service sets (BSSs)
  • 78. IEEE 802.11 PROJECT Extended service set (ESS)
  • 79. IEEE 802.11 PROJECT Extended service set (ESS)
  • 80. MAC Sublayer IEEE 802.11 defines two MAC sublayers: •the distributed coordination function (DCF) •point coordination function (PCF)
  • 81. Distributed Coordination Function DIFS- distributed interframe space, SIFS- short interframe space