Error Detection & Correction in Data Comm: CRC, Seq Numbers, & 3-way Handshake, Slides of Computer Science

Various error detection and correction techniques used in data communication, including crc, sequence numbers, and the 3-way handshake. Topics include different types of packet errors, their causes, and methods for detecting and correcting them. The document also covers the importance of efficiency and the role of sequence numbers in packet transmission.

Typology: Slides

2012/2013

Uploaded on 03/27/2013

agarkar
agarkar 🇮🇳

4.3

(26)

372 documents

1 / 32

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Error control
An Engineering Approach to Computer Networking
An Engineering Approach to Computer Networking
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20

Partial preview of the text

Download Error Detection & Correction in Data Comm: CRC, Seq Numbers, & 3-way Handshake and more Slides Computer Science in PDF only on Docsity!

Error control

An Engineering Approach to Computer Networking An Engineering Approach to Computer Networking

CRC nn

DetectsDetects

u u

all single bit errors all single bit errors

u u

almost all 2-bit errors almost all 2-bit errors

uu

any odd number of errors any odd number of errors

uu

all bursts up to M, where generator length is M all bursts up to M, where generator length is M

u u

longer bursts with probability 2^-m longer bursts with probability 2^-m

Software schemes nn

Efficiency is importantEfficiency is important

u u

touch each data byte only once touch each data byte only once

n n

CRCCRC

nn

TCP/UDP/IPTCP/UDP/IP

uu

all use same scheme all use same scheme

u u

treat data bytes as 16-bit integers treat data bytes as 16-bit integers

u u

add with end-around carry add with end-around carry

uu

one’s complement = checksum one’s complement = checksum

uu

catches all 1-bit errors catches all 1-bit errors

u u

longer errors with longer errors with prob

prob 1/

Packet errors nn

Different from bit errorsDifferent from bit errors

u u

types types

FF

not just erasure, but also duplication, insertion,etc.not just erasure, but also duplication, insertion,etc.

u u

correction correction

F F

retransmission, instead of redundancyretransmission, instead of redundancy

Types of packet errors (cont.) nn

DuplicationDuplication

u u

same packet received twice same packet received twice

FF

usually due to retransmissionusually due to retransmission

n n

InsertionInsertion

uu

packet from some other conversation received packet from some other conversation received

F F

header corruptionheader corruption

nn

ReorderingReordering

u u

packets received in wrong order packets received in wrong order

FF

usually due to retransmissionusually due to retransmission

FF

some routers also reordersome routers also reorder

Packet error detection and correction nn

DetectionDetection

u u

Sequence numbers Sequence numbers

u u

Timeouts Timeouts

nn

CorrectionCorrection

uu

Retransmission Retransmission

Using sequence numbers nn

LossLoss

u u

gap in sequence space allows gap in sequence space allows

receiver to detect lossreceiver

to detect loss

FF

e.g. received 0,1,2,5,6,7 => lost 3,4e.g. received 0,1,2,5,6,7 => lost 3,

u u

acks acks carry

carry

cumulative cumulative seq

seq #

uu

redundant information redundant information

uu

if no if no ack

ack for a while,

for a while,

sender sender suspects loss

suspects loss

n n

ReorderingReordering

nn

DuplicationDuplication

nn

InsertionInsertion

u u

if the received if the received seq

seq

is “very different” from what is expected

is “very different” from what is expected

FF

more on this latermore on this later

Sequence number size nn

Long enough so that sender does not confuse sequenceLong enough so that sender does not confuse sequencenumbers onnumbers on acks

acks

n n

E.g, sending at < 100 packets/sec (R)E.g, sending at < 100 packets/sec (R)

u u

wait for 200 wait for 200 secs

secs before giving up (T)

before giving up (T)

uu

receiver may dally up to 100 sec (A) receiver may dally up to 100 sec (A)

uu

packet can live in the network up to 5 minutes (300 s) packet can live in the network up to 5 minutes (300 s)

maximum packet lifetime) maximum packet lifetime)

u u

can get an can get an ack

ack as late as 900 seconds after packet sent out

as late as 900 seconds after packet sent out

u u

sent out 900100 = 90,000 packets sent out 900100 = 90,000 packets

uu

if if seqence

seqence space smaller, then can have confusion

space smaller, then can have confusion

uu

so, sequence number > log (90,000), at least 17 bits so, sequence number > log (90,000), at least 17 bits

n n

In general 2^seqIn general 2^

seq_size > R(2 MPL + T + A)

_size > R(2 MPL + T + A)

Sequence number size (cont.) nn

If noIf no acks

acks, then size depends on two things

, then size depends on two things

u u

reordering span: how much packets can be reordered reordering span: how much packets can be reordered

FF

e.g. span of 128 =>e.g. span of 128 => seq

seq # > 7 bits

> 7 bits

u u

burst loss span: how many consecutive burst loss span: how many consecutive pkts

pkts. can be lost

. can be lost

F F

e.g. possibility of 16 consecutive lost packets => seqe.g. possibility of 16 consecutive lost packets =>

seq # > 4 bits

> 4 bits

uu

In practice, hope that technology becomes In practice, hope that technology becomes obselete

obselete before

before

worst case hits! worst case hits!

Packet insertion nn

Receiver should be able to distinguish packets from otherReceiver should be able to distinguish packets from otherconnectionsconnections

n n

Why?Why?

u u

receive packets on VCI 1 receive packets on VCI 1

uu

connection closes connection closes

uu

new connection also with VCI 1 new connection also with VCI 1

u u

delayed packet arrives delayed packet arrives

u u

could be accepted could be accepted

nn

SolutionSolution

uu

flush packets on connection flush packets on connection clos

clos

u u

can’t do this for connectionless networks like the Internet can’t do this for connectionless networks like the Internet

Solutions nn

Per-connectionPer-connection

incarnation number incarnation number

u u

incremented for each connection from each host incremented for each connection from each host

u u

  • takes up header space
  • takes up header space

uu

  • on a crash, we may repeat
  • on a crash, we may repeat

F F

need stable storage, which is expensiveneed stable storage, which is expensive

nn

Reassign port numbers only after 1 MPLReassign port numbers only after 1 MPL

u u

  • needs stable storage to survive crash
  • needs stable storage to survive crash

Solutions (cont.) nn

Assign port numbers serially: new connections have new portsAssign port numbers serially: new connections have new ports

u u

Unix starts at 1024 Unix starts at 1024

u u

this fails if we wrap around within 1 MPL this fails if we wrap around within 1 MPL

uu

also fails of computer crashes and we restart with 1024 also fails of computer crashes and we restart with 1024

nn

Assign initial sequence numbers seriallyAssign initial sequence numbers serially

u u

new connections may have same port, but new connections may have same port, but seq

seq # differs

differs

u u

fails on a crash fails on a crash

nn

Wait 1 MPL after boot up (30s to 2 min)Wait 1 MPL after boot up (30s to 2 min)

uu

this flushes old packets from network this flushes old packets from network

u u

used in most Unix systems used in most Unix systems

3-way handshake nn

Problem really is thatProblem really is that SYNs

SYNs themselves are not protected with

themselves are not protected with

sequence numberssequence numbers

n n

3-way handshake protects against delayed SYNs3-way handshake protects against delayed

SYNs

Loss detection nn

At receiver, from a gap in sequence spaceAt receiver, from a gap in sequence space

u u

send a send a

nack nack to the sender

to the sender

n n

At sender, by looking at cumulative acksAt sender, by looking at cumulative

acks, and

, and timeing

timeing out if no

out if no

ack for a whileack

for a while

uu

need to choose timeout interval need to choose timeout interval