SlideShare a Scribd company logo
1 of 23
1
Wireless Networks
Lecture 5
Error Detecting and Correcting Techniques (Part II)
Dr. Ghalib A. Shah
2
Outlines
 Review of previous lecture #3
 Block Codes
► Hamming
► BCH
► Reed Solmon
 ARQ
► Sliding window
► Go-back-N
 Summary of today’s lecture
3
Last Lecture Review
 Transmission Errors
 Parity Check
► Single-bit parity
► 2D parity
 Cyclic Redundancy Check
 Block Error Code
4
Hamming Code
 Designed to correct single bit errors
 Family of (n, k) block error-correcting codes with
parameters:
► Block length: n = 2m – 1
► Number of data bits: k = 2m – m – 1
► Number of check bits: n – k = m
► Minimum distance: dmin = 3
 Single-error-correcting (SEC) code
► SEC double-error-detecting (SEC-DED) code
5
Example of Error Detection/Correction
1 1 0 1 1
0 0 0 0 1
1 1 0 1 0
C1
C2
XOR
Hamming distance = 3
Received Codeword (Cr) = 1 0 0 1 1
1 1 0 1 1
1 0 0 1 1
0 1 0 0 0
C1
Cr
XOR
0 0 0 0 1
1 0 0 1 1
1 0 0 1 0
C2
Cr
XOR
6
Hamming Code Process
 Encoding: k data bits + (n -k) check bits
 Decoding: compares received (n -k) bits with
calculated (n -k) bits using XOR
► Resulting (n -k) bits called syndrome word
► Syndrome range is between 0 and 2(n-k)-1
► Each bit of syndrome indicates a match (0) or conflict (1)
in that bit position
7
Example of Hamming Encode
 Data = 00111001
Bit Position 12 11 10 9 8 7 6 5 4 3 2 1
Pos. Number 1100 1011 1010 1001 1000 0111 0110 0101 0100 0011 0010 0001
Trans. Block
Bit Position 12 11 10 9 8 7 6 5 4 3 2 1
Pos. Number 1100 1011 1010 1001 1000 0111 0110 0101 0100 0011 0010 0001
Trans. Block x x x X
Bit Position 12 11 10 9 8 7 6 5 4 3 2 1
Pos. Number 1100 1011 1010 1001 1000 0111 0110 0101 0100 0011 0010 0001
Trans. Block 0 0 1 1 x 1 0 0 x 1 x X
Bit Position 12 11 10 9 8 7 6 5 4 3 2 1
Pos. Number 1100 1011 1010 1001 1000 0111 0110 0101 0100 0011 0010 0001
Trans. Block 0 0 1 1 x 1 0 0 x 1 x X
Bit Position 12 11 10 9 8 7 6 5 4 3 2 1
Pos. Number 1100 1011 1010 1001 1000 0111 0110 0101 0100 0011 0010 0001
Trans. Block 0 0 1 1 x 1 0 0 x 1 X X
Check bits 0 1 1 1
Bit Position 12 11 10 9 8 7 6 5 4 3 2 1
Pos. Number 1100 1011 1010 1001 1000 0111 0110 0101 0100 0011 0010 0001
Trans. Block 0 0 1 1 0 1 0 0 1 1 1 1
Position Code
10 1010
9 1001
7 0111
3 0011
XOR 0111
8
Decoding Hamming
Bit Position 12 11 10 9 8 7 6 5 4 3 2 1
Pos. Number 1100 1011 1010 1001 1000 0111 0110 0101 0100 0011 0010 0001
Trans. Block 0 0 1 1 0 1 1 0 1 1 1 1
Position Code
10 1010
9 1001
7 0111
6 0110
3 0011
XOR 0110
Bit Position 12 11 10 9 8 7 6 5 4 3 2 1
Pos. Number 1100 1011 1010 1001 1000 0111 0110 0101 0100 0011 0010 0001
Trans. Block 0 0 1 1 0 1 0 0 1 1 1 1
9
BCH Codes
 BCH  Discoverer: Bose, Chaudhuri and
Hocquenghem.
 Multiple error correcting codes
 Generalization of Hamming Code.
 Flexibility in choice of parameters
► Block length, code rate
10
BCH Codes
 For positive pair of integers m and t, a (n, k)
BCH code has parameters:
► Block length: n = 2m – 1
► Number of check bits: n – k <= mt
► Minimum distance:dmin >= 2t + 1
 Correct combinations of t or fewer errors
 The generator polynomial can be constructed
from the factors of (X2m-1 +1)
11
Reed-Solomon Codes
 Subclass of nonbinary BCH codes
 Data processed in chunks of m bits, called
symbols
 An (n, k) RS code has parameters:
► Symbol length: m bits per symbol
► Block length: n = 2m – 1 symbols = m(2m – 1) bits
► Data length: k symbols
► Size of check code: n – k = 2t symbols = m(2t)
bits
► Minimum distance: dmin = 2t + 1 symbols
12
Automatic Repeat Request
 Mechanism used in data link control and transport
protocols
 Relies on use of an error detection code (such as
CRC)
 Flow Control
 Error Control
13
Flow Control
 Assures that transmitting entity does not overwhelm a
receiving entity with data
 Protocols with flow control mechanism allow multiple PDUs
in transit at the same time
 PDUs arrive in same order they’re sent
 Sliding-window flow control
► Transmitter maintains list (window) of sequence numbers allowed to
send
► Receiver maintains list allowed to receive
14
Flow Control
 Reasons for breaking up a block of data before
transmitting:
► Limited buffer size of receiver
► Retransmission of PDU due to error requires smaller
amounts of data to be retransmitted
► On shared medium, larger PDUs occupy medium for
extended period, causing delays at other sending stations
15
Flow Control
16
Error Control
 Mechanisms to detect and correct transmission
errors
 Types of errors:
► Lost PDU : a PDU fails to arrive
► Damaged PDU : PDU arrives with errors
17
Error Control Requirements
 Error detection
► Receiver detects errors and discards PDUs
 Positive acknowledgement
► Destination returns acknowledgment of received, error-free PDUs
 Retransmission after timeout
► Source retransmits unacknowledged PDU
 Negative acknowledgement and retransmission
► Destination returns negative acknowledgment to PDUs in error
18
Go-Back-N
 Improve Stop-and-Wait by not waiting!
 Keep channel busy by continuing to send frames
 Allow a window of up to Ws outstanding frames
 Use m-bit sequence numbering
 If ACK for oldest frame arrives before window is
exhausted, we can continue transmitting
 If window is exhausted, pull back and retransmit all
outstanding frames
 Alternative: Use timeout
19
► Frame transmission are pipelined to keep the channel busy
► Frame with errors and subsequent out-of-sequence frames are ignored
► Transmitter is forced to go back when window of 4 is exhausted
Go-Back-N ARQ
A
B
fr
0
Time
fr
1
fr
2
fr
3
fr
4
fr
5
fr
6
fr
3
A
C
K
1
out of sequence
frames
Go-Back-4: 4 frames are outstanding; so go back 4
fr
5
fr
6
fr
4
fr
7
fr
8
fr
9
A
C
K
2
A
C
K
3
A
C
K
4
A
C
K
5
A
C
K
6
A
C
K
7
A
C
K
8
A
C
K
9
Rnext 0 1 2 3 3 4 5 6 7 8 9
20
A
B
fr0
Time
f1 f2 f3 f0
Receiver is
looking for
Rnext=0
Out-of-
sequence
frames
Four frames are outstanding; so go back 4
f2 f3
f1 f4 f5 f6
Go-Back-N ARQ
A
C
K
1
A
C
K
2
A
C
K
3
A
C
K
4
A
C
K
5
A
C
K
6
Window size long enough to cover round trip time
A
B
Time
f0 f0
Time-out expires
f1
A
C
K
1
Stop-and-Wait ARQ
Receiver is
looking for
Rnext=0
21
Go-Back-N with Timeout
 Problem with Go-Back-N as presented:
► If frame is lost and source does not have frame to
send, then window will not be exhausted and
recovery will not commence
 Use a timeout with each frame
► When timeout expires, resend all outstanding frames
22
Receiver
Receive Window
Rnext
Frames
received
Receiver will only accept
a frame that is error-free and
that has sequence number Rnext
When such frame arrives Rnext is
incremented by one, so the
receive window slides forward by
one
Timer Slast
Slast+1
Srecent
Slast+Ws-1
Timer
Timer
Transmitter
...
Buffers
Slast Slast+Ws-1
...
Send Window
Srecent
Frames
transmitted
and ACKed
...
most recent
transmission
oldest un-
ACKed frame
max Seq #
allowed
Go-Back-N Transmitter & Receiver
23
Go-back-N ARQ
 Acknowledgments
► RR = receive ready (no errors occur)
► REJ = reject (error detected)
 Contingencies
► Damaged PDU
► Damaged RR
► Damaged REJ

More Related Content

Similar to Lecture 5 from virtual university of pakistan

Different protocols for data communication networks
Different protocols for data communication networks Different protocols for data communication networks
Different protocols for data communication networks Nt Arvind
 
Unit 4 data link layer
Unit 4 data link layerUnit 4 data link layer
Unit 4 data link layermekind
 
5-LEC- 5.pptxTransport Layer. Transport Layer Protocols
5-LEC- 5.pptxTransport Layer.  Transport Layer Protocols5-LEC- 5.pptxTransport Layer.  Transport Layer Protocols
5-LEC- 5.pptxTransport Layer. Transport Layer ProtocolsZahouAmel1
 
Data Communications- Unit-4.pptx
Data Communications- Unit-4.pptxData Communications- Unit-4.pptx
Data Communications- Unit-4.pptxHrushikeshDandu
 
CRC implementation
CRC implementation CRC implementation
CRC implementation ajay singh
 
Computer Networks Module II
Computer Networks Module IIComputer Networks Module II
Computer Networks Module IIAjit Nayak
 
Digital logic-formula-notes-final-1
Digital logic-formula-notes-final-1Digital logic-formula-notes-final-1
Digital logic-formula-notes-final-1Kshitij Singh
 
Data linkcontrol
Data linkcontrolData linkcontrol
Data linkcontrolBablu Shofi
 
Error detection methods-computer networks
Error detection methods-computer networksError detection methods-computer networks
Error detection methods-computer networksDHIVYADEVAKI
 
Solar Project C Test
Solar Project C TestSolar Project C Test
Solar Project C TestCharles Byun
 
chapter-3-data-link-layer.ppt
chapter-3-data-link-layer.pptchapter-3-data-link-layer.ppt
chapter-3-data-link-layer.pptYashikaAsrani
 
第四次课程 Chap8
第四次课程 Chap8第四次课程 Chap8
第四次课程 Chap8Emma2013
 
13-DataLink_02.ppt
13-DataLink_02.ppt13-DataLink_02.ppt
13-DataLink_02.pptWinterSnow16
 
Data link control & protocol concepts
Data link control & protocol conceptsData link control & protocol concepts
Data link control & protocol conceptsRaji Lakshmi
 

Similar to Lecture 5 from virtual university of pakistan (20)

Different protocols for data communication networks
Different protocols for data communication networks Different protocols for data communication networks
Different protocols for data communication networks
 
Data linklayer
Data linklayerData linklayer
Data linklayer
 
Arq protocol part 2
Arq protocol part 2Arq protocol part 2
Arq protocol part 2
 
Unit 4 data link layer
Unit 4 data link layerUnit 4 data link layer
Unit 4 data link layer
 
Lecture 21
Lecture 21Lecture 21
Lecture 21
 
5-LEC- 5.pptxTransport Layer. Transport Layer Protocols
5-LEC- 5.pptxTransport Layer.  Transport Layer Protocols5-LEC- 5.pptxTransport Layer.  Transport Layer Protocols
5-LEC- 5.pptxTransport Layer. Transport Layer Protocols
 
Data Communications- Unit-4.pptx
Data Communications- Unit-4.pptxData Communications- Unit-4.pptx
Data Communications- Unit-4.pptx
 
CRC implementation
CRC implementation CRC implementation
CRC implementation
 
Computer Networks Module II
Computer Networks Module IIComputer Networks Module II
Computer Networks Module II
 
Ntdd
NtddNtdd
Ntdd
 
Ntdd
NtddNtdd
Ntdd
 
Digital logic-formula-notes-final-1
Digital logic-formula-notes-final-1Digital logic-formula-notes-final-1
Digital logic-formula-notes-final-1
 
Data linkcontrol
Data linkcontrolData linkcontrol
Data linkcontrol
 
Error detection methods-computer networks
Error detection methods-computer networksError detection methods-computer networks
Error detection methods-computer networks
 
Solar Project C Test
Solar Project C TestSolar Project C Test
Solar Project C Test
 
chapter-3-data-link-layer.ppt
chapter-3-data-link-layer.pptchapter-3-data-link-layer.ppt
chapter-3-data-link-layer.ppt
 
第四次课程 Chap8
第四次课程 Chap8第四次课程 Chap8
第四次课程 Chap8
 
13-DataLink_02.ppt
13-DataLink_02.ppt13-DataLink_02.ppt
13-DataLink_02.ppt
 
Data links
Data links Data links
Data links
 
Data link control & protocol concepts
Data link control & protocol conceptsData link control & protocol concepts
Data link control & protocol concepts
 

Recently uploaded

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 

Recently uploaded (20)

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 

Lecture 5 from virtual university of pakistan

  • 1. 1 Wireless Networks Lecture 5 Error Detecting and Correcting Techniques (Part II) Dr. Ghalib A. Shah
  • 2. 2 Outlines  Review of previous lecture #3  Block Codes ► Hamming ► BCH ► Reed Solmon  ARQ ► Sliding window ► Go-back-N  Summary of today’s lecture
  • 3. 3 Last Lecture Review  Transmission Errors  Parity Check ► Single-bit parity ► 2D parity  Cyclic Redundancy Check  Block Error Code
  • 4. 4 Hamming Code  Designed to correct single bit errors  Family of (n, k) block error-correcting codes with parameters: ► Block length: n = 2m – 1 ► Number of data bits: k = 2m – m – 1 ► Number of check bits: n – k = m ► Minimum distance: dmin = 3  Single-error-correcting (SEC) code ► SEC double-error-detecting (SEC-DED) code
  • 5. 5 Example of Error Detection/Correction 1 1 0 1 1 0 0 0 0 1 1 1 0 1 0 C1 C2 XOR Hamming distance = 3 Received Codeword (Cr) = 1 0 0 1 1 1 1 0 1 1 1 0 0 1 1 0 1 0 0 0 C1 Cr XOR 0 0 0 0 1 1 0 0 1 1 1 0 0 1 0 C2 Cr XOR
  • 6. 6 Hamming Code Process  Encoding: k data bits + (n -k) check bits  Decoding: compares received (n -k) bits with calculated (n -k) bits using XOR ► Resulting (n -k) bits called syndrome word ► Syndrome range is between 0 and 2(n-k)-1 ► Each bit of syndrome indicates a match (0) or conflict (1) in that bit position
  • 7. 7 Example of Hamming Encode  Data = 00111001 Bit Position 12 11 10 9 8 7 6 5 4 3 2 1 Pos. Number 1100 1011 1010 1001 1000 0111 0110 0101 0100 0011 0010 0001 Trans. Block Bit Position 12 11 10 9 8 7 6 5 4 3 2 1 Pos. Number 1100 1011 1010 1001 1000 0111 0110 0101 0100 0011 0010 0001 Trans. Block x x x X Bit Position 12 11 10 9 8 7 6 5 4 3 2 1 Pos. Number 1100 1011 1010 1001 1000 0111 0110 0101 0100 0011 0010 0001 Trans. Block 0 0 1 1 x 1 0 0 x 1 x X Bit Position 12 11 10 9 8 7 6 5 4 3 2 1 Pos. Number 1100 1011 1010 1001 1000 0111 0110 0101 0100 0011 0010 0001 Trans. Block 0 0 1 1 x 1 0 0 x 1 x X Bit Position 12 11 10 9 8 7 6 5 4 3 2 1 Pos. Number 1100 1011 1010 1001 1000 0111 0110 0101 0100 0011 0010 0001 Trans. Block 0 0 1 1 x 1 0 0 x 1 X X Check bits 0 1 1 1 Bit Position 12 11 10 9 8 7 6 5 4 3 2 1 Pos. Number 1100 1011 1010 1001 1000 0111 0110 0101 0100 0011 0010 0001 Trans. Block 0 0 1 1 0 1 0 0 1 1 1 1 Position Code 10 1010 9 1001 7 0111 3 0011 XOR 0111
  • 8. 8 Decoding Hamming Bit Position 12 11 10 9 8 7 6 5 4 3 2 1 Pos. Number 1100 1011 1010 1001 1000 0111 0110 0101 0100 0011 0010 0001 Trans. Block 0 0 1 1 0 1 1 0 1 1 1 1 Position Code 10 1010 9 1001 7 0111 6 0110 3 0011 XOR 0110 Bit Position 12 11 10 9 8 7 6 5 4 3 2 1 Pos. Number 1100 1011 1010 1001 1000 0111 0110 0101 0100 0011 0010 0001 Trans. Block 0 0 1 1 0 1 0 0 1 1 1 1
  • 9. 9 BCH Codes  BCH  Discoverer: Bose, Chaudhuri and Hocquenghem.  Multiple error correcting codes  Generalization of Hamming Code.  Flexibility in choice of parameters ► Block length, code rate
  • 10. 10 BCH Codes  For positive pair of integers m and t, a (n, k) BCH code has parameters: ► Block length: n = 2m – 1 ► Number of check bits: n – k <= mt ► Minimum distance:dmin >= 2t + 1  Correct combinations of t or fewer errors  The generator polynomial can be constructed from the factors of (X2m-1 +1)
  • 11. 11 Reed-Solomon Codes  Subclass of nonbinary BCH codes  Data processed in chunks of m bits, called symbols  An (n, k) RS code has parameters: ► Symbol length: m bits per symbol ► Block length: n = 2m – 1 symbols = m(2m – 1) bits ► Data length: k symbols ► Size of check code: n – k = 2t symbols = m(2t) bits ► Minimum distance: dmin = 2t + 1 symbols
  • 12. 12 Automatic Repeat Request  Mechanism used in data link control and transport protocols  Relies on use of an error detection code (such as CRC)  Flow Control  Error Control
  • 13. 13 Flow Control  Assures that transmitting entity does not overwhelm a receiving entity with data  Protocols with flow control mechanism allow multiple PDUs in transit at the same time  PDUs arrive in same order they’re sent  Sliding-window flow control ► Transmitter maintains list (window) of sequence numbers allowed to send ► Receiver maintains list allowed to receive
  • 14. 14 Flow Control  Reasons for breaking up a block of data before transmitting: ► Limited buffer size of receiver ► Retransmission of PDU due to error requires smaller amounts of data to be retransmitted ► On shared medium, larger PDUs occupy medium for extended period, causing delays at other sending stations
  • 16. 16 Error Control  Mechanisms to detect and correct transmission errors  Types of errors: ► Lost PDU : a PDU fails to arrive ► Damaged PDU : PDU arrives with errors
  • 17. 17 Error Control Requirements  Error detection ► Receiver detects errors and discards PDUs  Positive acknowledgement ► Destination returns acknowledgment of received, error-free PDUs  Retransmission after timeout ► Source retransmits unacknowledged PDU  Negative acknowledgement and retransmission ► Destination returns negative acknowledgment to PDUs in error
  • 18. 18 Go-Back-N  Improve Stop-and-Wait by not waiting!  Keep channel busy by continuing to send frames  Allow a window of up to Ws outstanding frames  Use m-bit sequence numbering  If ACK for oldest frame arrives before window is exhausted, we can continue transmitting  If window is exhausted, pull back and retransmit all outstanding frames  Alternative: Use timeout
  • 19. 19 ► Frame transmission are pipelined to keep the channel busy ► Frame with errors and subsequent out-of-sequence frames are ignored ► Transmitter is forced to go back when window of 4 is exhausted Go-Back-N ARQ A B fr 0 Time fr 1 fr 2 fr 3 fr 4 fr 5 fr 6 fr 3 A C K 1 out of sequence frames Go-Back-4: 4 frames are outstanding; so go back 4 fr 5 fr 6 fr 4 fr 7 fr 8 fr 9 A C K 2 A C K 3 A C K 4 A C K 5 A C K 6 A C K 7 A C K 8 A C K 9 Rnext 0 1 2 3 3 4 5 6 7 8 9
  • 20. 20 A B fr0 Time f1 f2 f3 f0 Receiver is looking for Rnext=0 Out-of- sequence frames Four frames are outstanding; so go back 4 f2 f3 f1 f4 f5 f6 Go-Back-N ARQ A C K 1 A C K 2 A C K 3 A C K 4 A C K 5 A C K 6 Window size long enough to cover round trip time A B Time f0 f0 Time-out expires f1 A C K 1 Stop-and-Wait ARQ Receiver is looking for Rnext=0
  • 21. 21 Go-Back-N with Timeout  Problem with Go-Back-N as presented: ► If frame is lost and source does not have frame to send, then window will not be exhausted and recovery will not commence  Use a timeout with each frame ► When timeout expires, resend all outstanding frames
  • 22. 22 Receiver Receive Window Rnext Frames received Receiver will only accept a frame that is error-free and that has sequence number Rnext When such frame arrives Rnext is incremented by one, so the receive window slides forward by one Timer Slast Slast+1 Srecent Slast+Ws-1 Timer Timer Transmitter ... Buffers Slast Slast+Ws-1 ... Send Window Srecent Frames transmitted and ACKed ... most recent transmission oldest un- ACKed frame max Seq # allowed Go-Back-N Transmitter & Receiver
  • 23. 23 Go-back-N ARQ  Acknowledgments ► RR = receive ready (no errors occur) ► REJ = reject (error detected)  Contingencies ► Damaged PDU ► Damaged RR ► Damaged REJ