Lec8 on Computer Networks by Tarun Mangla.pdf

ShivamSawarn2 11 views 19 slides Sep 11, 2024
Slide 1
Slide 1 of 19
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19

About This Presentation

Lec8 on Computer Networks by Tarun Mangla, IIT Delhi


Slide Content

Computer Networks
COL 334/672
Link Layer
Tarun Mangla
Slides adapted from KR
Sem 1, 2024-25

Quiz on Moodle
Password: wattlebird

§Framing
§Error detection
§Reliability
§Link access
Link Layer: Services

Error detection
EDC: error detection and correction bits (e.g., redundancy)
D: data protected by error checking, may include header fields
Error detection not 100%
reliable!
§protocol may miss
some errors, but rarely
§larger EDC field yields
better detection and
correction
datagram
DEDC
d data bits
bit-error prone link
D’EDC’
allbits in D’OK?
N
detected error
otherwise
datagram
Goal: maximize probability of detecting errors using only a small number of redundant bits

Cyclic Redundancy Check
Introduction: 1-5

§Based on finite fields
§A message of n+1-bits can be represented as polynomial of degree n
§Consider:
•M(x), a n+1 bits message to be sent
•C(x), a divisor polynomial of degree k that is known to both sender and
receiver
§Key Idea: Send P(x), n+1+k bits such that C(x) divides P(x)
•At the receiver, if P’(x) is exactly divisible by C(x) then less likelihood of error,
otherwise there is error
§How do you construct P(x) using M(x)?
Cyclic Redundancy Check (CRC)

•Any polynomial!(")can be divided by a divisor
polynomial#(")if!(")is of higher degree than#(")
•Any polynomial!(")can be divided once by a divisor
polynomial#(")if!(")is of the same degree as#(")
•The remainder obtained when!(")is divided by#(")is obtained by
performing the exclusive OR (XOR) operation on each pair of matching
coefficients
Some facts [for this course!]

1.Multiply$(")by"!; that is, add%zeros at the end of the
message. Call this zero-extended message&(").
2.Divide&(")by#(")and find the remainder.
3.Subtract the remainder from&(").
Algorithm to Obtain CRC Bits

§M(x) = 101110
§C(x) = 1001
§What is P(x)?
Cyclic Redundancy Check (CRC): Example

§How to pick C(x)?
•Transmitted message: P(x) + E(x)
•For errors to go undetected, E(x) should be divisible by C(x)
•Pick C(x) such that above is unlikely to happen for common errors
•Example, all single-bit errors, as long as the!!and!0terms in C(x) have
nonzero coefficients
Cyclic Redundancy Check (CRC)

§How to pick C(x)?
•Transmitted message: P(x) + E(x)
•For errors to go undetected, E(x) should be divisible by C(x)
•Pick C(x) such that above is unlikely to happen for common errors
•Example, all single-bit errors, as long as the!!and!0terms in C(x) have nonzero coefficients
§Ethernet protocol
oUses a 32-bit error check
§Where is CRC implemented?
Cyclic Redundancy Check (CRC)
Hardware

§Framing
§Error detection
§Reliability
§Link access
Link Layer: Services

§Error correction codes
§Acknowledgements and timeouts or Automatic Repeat request
(ARQ)
Reliability

§Also known as Forward Error Correction
§Using 2D parity
§Always useful?
•When cost of retransmissions are high
•When there are frequent bit errors
Error correction code
Can detect and correct errors
(without retransmission!)
§detect and correct single bit
errors
d1,1d2,1
di,1
. . .
d1,j+1d2,j+1
di,j+1
. . .
. . .
d1,jd2,j
di,j
. . .
di+1,1di+1,j+1di+1,j
. . .
. . .
. . .
. . .
row parity
column parity
1 0 1 0 1
0 1 1 1 0
1 0 1 0 1
1 1 1 1 0
1
0
1
0
no errors:parityerror
0 1 1 1 0 1
1 0 1 0 1 1
1 0 1 1 0 0
1 0 1 0 1 0
detectedandcorrectablesingle-biterror:

§Transmit one frame, wait for an
acknowledgement
•If no ack and timer expires, resend
ARQ Protocol: Stop and Wait

§Transmit one frame, wait for an
acknowledgement
•If no ack and timer expires, resend
§How to handle duplicate frames?
•Sequence numbers for duplicate frames
§Any limitation?
•Under-utilization of link
•Example, 4 Mbps link, RTT – 10ms, Frame size – 1 KB
•How to achieve full-link utilization?
•Bandwidth delay product
Stop and Wait

Sliding Window Protocol

§Framing
§Error detection
§Reliability
§Next class: link access
Link Layer: Services

Attendance
Tags