ch4flow and error control

Upload: thedemonizer-pratik

Post on 06-Jul-2018

227 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/16/2019 Ch4Flow and Error Control

    1/87

    Flow and ErrorControl

    Chapter- 4

    5/19/16 1

  • 8/16/2019 Ch4Flow and Error Control

    2/87

    Need of ow & error control

    •  For reliable and efcient datacommunication a great deal ocoordination is necessary between at

    least two machines.•  Constraints:

     –Both sender and receiver have

    limited speed –Both sender and receiver have

    limited memory

    5/19/16

  • 8/16/2019 Ch4Flow and Error Control

    3/87

    Requirements:

     –! ast sender should not overwhelm a slow

    receiver" which must perorm a certainamount o processing beore passing thedata on to the higher#level sotware.

     – $ error occur during transmission" it is

    necessary to devise mechanism to correct it %he most important unctions o &ata 'in(

    layer to satisy the above re)uirements areerror control and ow control.

     *ollectively" these unctions are (nown asdata lin( control

    5/19/16 +

  • 8/16/2019 Ch4Flow and Error Control

    4/87

    Flow Control•

    Flow *ontrol is a techni)ue so that transmitterand receiver with di,erent speed characteristicscan communicate with each other.

    • Flow control ensures that a transmitting station"

    such as a server with higher processingcapability" does not overwhelm a receivingstation" such as a des(top system" with lesserprocessing capability.

     %his is where there is an orderly -ow otransmitted data between the source and thedestination.

    5/19/16

  • 8/16/2019 Ch4Flow and Error Control

    5/87

    •  is a set o procedures that tells the sender howmuch data it can transmit beore it must wait or

    an ac(nowledgment rom the receiver.•  %he -ow o data should not be allowed to

    overwhelm the receiver.

    •  eceiver should also be able to inorm the

    transmitter beore its limits 0this limit may beamount o memory used to store the incomingdata or the processing power at the receiver endare reached and the sender must send ewer

    rames.• 2ence" Flow control reers to the set o

    procedures used to restrict the amount o datathe transmitter can send beore waiting orac(nowledgment.

    5/19/16 5

  • 8/16/2019 Ch4Flow and Error Control

    6/87

    Flow *ontrol• Flow control coordinates the amount o data that can be

    sent beore receiving ac(nowledgement

    • $t is one o the most important unctions o data lin( layer.

    • Flow control is a set o procedures that tells the senderhow much data it can transmit beore it must wait or an

    ac(nowledgement rom the receiver.• eceiver has a limited speed at which it can process

    incoming data and a limited amount o memory in whichto store incoming data.

    • eceiver must inorm the sender beore the limits are

    reached and re)uest that the transmitter to send ewerrames or stop temporarily.

    • 3ince the rate o processing is oten slower than the rateo transmission" receiver has a bloc( o memory 0bu,er

    or storing incoming data until they are processed.

    5/19/16 6

  • 8/16/2019 Ch4Flow and Error Control

    7/87

     Flow control techniques

    1. Stop-and-wait

    3top#and#wait is also (nown as e)uest/replysometimes.

    e)uest/reply 03top#and#wait -ow control re)uireseach data pac(et to be ac(nowledged by theremote host beore the ne4t pac(et is sent.

    . Slidin!-window.

     3liding window algorithms" used by %*" permit

    multiple data pac(ets to be in simultaneoustransit" ma(ing more efcient use o networ(bandwidth .

    5/19/16

  • 8/16/2019 Ch4Flow and Error Control

    8/87

    5/19/16 7

  • 8/16/2019 Ch4Flow and Error Control

    9/87

    Stop and "ait

    • 3ource transmits rame• &estination receives rame and replies with

    ac(nowledgement

    • 3ource waits or !*8 beore sending ne4trame

    • &estination can stop -ow by not send !*8 

    • #a$or draw%ac

     –  only one rame can be in transmission at a time"this leads to inefciency i propagation delay ismuch longer than the transmission delay.

    5/19/16 9

  • 8/16/2019 Ch4Flow and Error Control

    10/87

    Stop and "ait

    5/19/16 1:

  • 8/16/2019 Ch4Flow and Error Control

    11/87

    'in (tili)ation in Stop-and-"ait

     %ransmission time %he time it ta(es or a stationto transmit a rame 0normali;ed to a value o 1.

    • ropagation delay %he time it ta(es or a bit totravel rom sender to receiver 0e4pressed as a. –

    a < 1 %he rame is sufciently long such that the =rstbits o the rame arrive at the destination beore thesource has completed transmission o the rame.

     – a > 1 3ender completes transmission o the entirerame beore the leading bits o the rame arrive at

    the receiver.•  %he lin( utili;ation ? @ 1/01Aa"

     – a @ ropagation time / transmission time

    5/19/16 11

  • 8/16/2019 Ch4Flow and Error Control

    12/87

    lin utili)ation*cont++..,

    lin( utili;ation is strongly dependent on theratio o the propagation time to thetransmission time.

    • hen the propagation time is small" as in

    case o '!C environment" the lin( utili;ation isgood .

    •  But" in case o long propagation delays" as incase o satellite communication" the utili;ation

    can be very poor .•  %o improve the lin( utili;ation" we can use the

    sliding#window protocol instead o using stop#and#wait protocol.

    5/19/16 1

  • 8/16/2019 Ch4Flow and Error Control

    13/87

  • 8/16/2019 Ch4Flow and Error Control

    14/87

    Slidin! "indow*sender,•

     %o (eep trac( o the rames" sender station sendsse)uentially numbered rames.

    •  3ince the se)uence number to be used occupiesa =eld in the rame" it should be o limited si;e.

     $ the header o the rame allows ( bits" these)uence numbers range rom : to ( 1.

    •  3ender maintains a list o se)uence numbersthat it is allowed to send 0sender window.

     %he si;e o the senderGs window is at most ( 1.

    •  %he sender is provided with a bu,er e)ual tothe window si;e.

    5/19/16 1

  • 8/16/2019 Ch4Flow and Error Control

    15/87

    Slidin!"indow*Receier,

     %he receiver ac(nowledges a rame by sendingan !*8 rame that includes the se)uencenumber o the ne4t rame e4pected.

    •  %his also e4plicitly announces that it is prepared

    to receive the ne4t C rames" beginning with thenumber speci=ed.

    •  %his scheme can be used to ac(nowledgemultiple rames. $t could receive rames " +"

    but withhold !*8 until rame has arrived.• By returning an !*8 with se)uence number 5" it

    ac(nowledges rames " +" in one go.

    •  %he receiver needs a bu,er o si;e 1.

    5/19/16 15

  • 8/16/2019 Ch4Flow and Error Control

    16/87

    Sender Slidin! "indow

    5/19/16 16

  • 8/16/2019 Ch4Flow and Error Control

    17/87

    Receier Slidin! "indow

    5/19/16 1

  • 8/16/2019 Ch4Flow and Error Control

    18/87

    Slidin! "indow Eample

    5/19/16 17

  • 8/16/2019 Ch4Flow and Error Control

    19/87

    Sender

    5/19/16 19

  • 8/16/2019 Ch4Flow and Error Control

    20/87

    Receier

    5/19/16 :

  • 8/16/2019 Ch4Flow and Error Control

    21/87

     lin utili)ation in Slidin! "indow

    • ? @ 1" or C > a A 1

    C /01Aa" or C < a A 1

    here C @ the window si;e"and a @ ropagation time /

    transmission time

    EH. 8@5 then C@I5#1@+1a@1: then ?@1 J

    hen a@1:: then ?@+1/01A::

    5/19/16 1

  • 8/16/2019 Ch4Flow and Error Control

    22/87

    Error /etection andCorrection

    • 01pes of Errors

    /etection• Correction

  • 8/16/2019 Ch4Flow and Error Control

    23/87

    2asic concepts

    • Cetwor(s must be able to transerdata rom one device to another withcomplete accuracy.

     &ata can be corrupted duringtransmission.

     For reliable communication" errors

    must be detected and corrected. Error detection and correction are

    implemented either at the data lin(

    layer or the transport layer o the D3$5/19/16 +

  • 8/16/2019 Ch4Flow and Error Control

    24/87

    01pes of Errors

    5/19/16

  • 8/16/2019 Ch4Flow and Error Control

    25/87

    Sin!le-%it error

    5/19/16 5

  • 8/16/2019 Ch4Flow and Error Control

    26/87

      Sin!le %it errors are the leastliel1 type o errors in serial data

    transmission because the noise musthave a very short duration which isvery rare. 2owever this (ind o errorscan happen in parallel transmission.

    Example:$ data is sent at 1Kbps then each bit

    lasts only 1/1":::"::: sec. or 1 Ls.

    For a single#bit error to occur" thenoise must have a duration o only 1Ls" which is very rare.

    5/19/16 6

  • 8/16/2019 Ch4Flow and Error Control

    27/87

    2urst error

    5/19/16

  • 8/16/2019 Ch4Flow and Error Control

    28/87

    5/19/16 7

  • 8/16/2019 Ch4Flow and Error Control

    29/87

     %he term %urst error means thattwo or more bits in the data unit

    have changed rom 1 to : or rom: to 1.

    2urst errors does not necessarily mean that the errors occur inconsecutie %its" the length o

    the burst is measured rom the=rst corrupted bit to the lastcorrupted bit. 3ome bits inbetween may not have been

    5/19/16 9

  • 8/16/2019 Ch4Flow and Error Control

    30/87

    2urst error is most liel1 tohappen in serial transmission since

    the duration o noise is normally longerthan the duration o a bit.

     %he number o bits a,ected depends

    on the data rate and duration o noise.Example:$ data is sent at rate @ 18bps then a noise

    o 1/1:: sec can a,ect 1: bits.01/1::M1:::

    $ same data is sent at rate @ 1Kbps then anoise o 1/1:: sec can a,ect 1:"::: bits.01/1::M1:6

    5/19/16 +:

  • 8/16/2019 Ch4Flow and Error Control

    31/87

    Error detection

    Error detection means to decidewhether the received data is corrector not without having a copy o the

    original message.

    Error detection uses the concept of

    redundanc1" which means addinge4tra bits or detecting errors at thedestination.

    5/19/16 +1

  • 8/16/2019 Ch4Flow and Error Control

    32/87

    Redundanc1

    5/19/16 +

  • 8/16/2019 Ch4Flow and Error Control

    33/87

    Error detectiontechniques:

    opular techni)ues are1.3imple arity chec(

    .%wo#dimensional aritychec(+.*hec(sum

    .*yclic redundancy chec(

    5/19/16 ++

  • 8/16/2019 Ch4Flow and Error Control

    34/87

    ur t1pes of redundanc1 checs are use

     in data communications

    5/19/16 +

  • 8/16/2019 Ch4Flow and Error Control

    35/87

    *3, arit1 Checin!:

     – 3imple or %wo &imensional

     – $n parity chec(" a parity bit is added toevery data unit so that the total number

    o 1s is even or odd.

    5/19/16 +5

  • 8/16/2019 Ch4Flow and Error Control

    36/87

    *3, arit1 Checin!:

    5/19/16 +6

  • 8/16/2019 Ch4Flow and Error Control

    37/87

    *3, arit1 Checin!:

    • 3uppose the sender wants to send theword world . $n !3*$$ the =ve charactersare coded as

    • 3335333 3353333 33355353353355 3355355

    •  %he ollowing shows the actual bits sent

    •  111:1115  11:11115  111::1:5 11:11::5  11::1::3

    5/19/16 +

    i%l 4 %it d t d d

  • 8/16/2019 Ch4Flow and Error Control

    38/87

     ossi%le 4-%it data words andcorrespondin! code words

    5/19/16 +7

  • 8/16/2019 Ch4Flow and Error Control

    39/87

    *3, arit1 Checin!:•  %wo#dimensional parity

    • $n two#dimensional parity chec(" a bloc( o bits isdivided into rows and a redundant row o bits isadded to the whole bloc(.

     – erormance can be improved by using two#dimensional parity chec(" which organi;es thebloc( o bits in the orm o a table.

     –  arity chec( bits are calculated or each row"which is e)uivalent to a simple parity chec( bit.

     – arity chec( bits are also calculated or all

    columns then both are sent along with the data.

     –  !t the receiving end these are compared withthe parity bits calculated on the received data

    5/19/16 +9

  • 8/16/2019 Ch4Flow and Error Control

    40/87

    5/19/16 :

  • 8/16/2019 Ch4Flow and Error Control

    41/87

    0wo-dimension arit1 Checin!

    5/19/16 1

    6ertical Redundanc1 Chec

  • 8/16/2019 Ch4Flow and Error Control

    42/87

    6ertical Redundanc1 Chec 6RC

    5/19/16

  • 8/16/2019 Ch4Flow and Error Control

    43/87

    erformance

    $t can detect single bit error

    $t can detect burst errors only i thetotal number o errors is odd.

    5/19/16 +

  • 8/16/2019 Ch4Flow and Error Control

    44/87

    'on!itudinal Redundanc1 Chec 'RC

    5/19/16

  • 8/16/2019 Ch4Flow and Error Control

    45/87

    erformance

    '* increases the li(elihood odetecting burst errors.

    $ two bits in one data units aredamaged and two bits in e4actlythe same positions in another data

    unit are also damaged" the '*chec(er will not detect an error.

    5/19/16 5

  • 8/16/2019 Ch4Flow and Error Control

    46/87

    6RC and 'RC

    5/19/16 6

  • 8/16/2019 Ch4Flow and Error Control

    47/87

    *, Checsum – 0he sender follows these steps:

    •  %he unit is divided into ( sections" each o n bits.

    • !ll sections are added using oneGs complement to getthe sum.

    •  %he sum is complemented and becomes the

    chec(sum.•  %he chec(sum is sent with the data.

     – 0he receier follows these steps:•  %he unit is divided into ( sections" each o n bits.

    • !ll sections are added using oneGs complement to getthe sum.

    •  %he sum is complemented.

    • $ the result is ;ero" the data are accepted otherwise"reNected.

    5/19/16

  • 8/16/2019 Ch4Flow and Error Control

    48/87

    Eample art 3

    • 3uppose the ollowing bloc( o 16 bits is to be sentusing a chec(sum o 7 bits.

    •   1:1:1::1 ::111::1

    •  %he numbers are added using oneGs complement

    •   1:1:1::1

    •   ::111::1  ############3um 111:::1:

    • *hec(sum 55533353

    •  %he pattern sent is 1:1:1::1 ::111::155533353

    5/19/16 7

  • 8/16/2019 Ch4Flow and Error Control

    49/87

    Eample part • Cow suppose the receiver receives the pattern sent in

    E4ample and there is no error.

    • 1:1:1::1 ::111::1 :::111:1

    • hen the receiver adds the three sections" it will get all 1s"which" ater complementing" is all :s and shows that there

    is no error.

    • 1:1:1::1

    • ::111::1

    • :::111:1

    • 3um11111111

    • *omplement 55555555  means that the pattern is D8.

    5/19/16 9

  • 8/16/2019 Ch4Flow and Error Control

    50/87

    C1clic Redundanc1 Checs *CRC,

    •  %his is the most powerul and easy to implement

    techni)ue.• ?nli(e chec(sum scheme" which is based on addition"

    ** is based on binary division.

    •  $n **" a se)uence o redundant bits" called cyclicredundancy chec( bits" are appended to the end o dataunit so that the resulting data unit becomes e4actlydivisible by a second" predetermined binary number.

    •  !t the destination" the incoming data unit is divided bythe same number.

    • $ at this step there is no remainder" the data unit isassumed to be correct and is thereore accepted.

    •  ! remainder indicates that the data unit has beendamaged in transit and thereore must be reNected

    5/19/16 5:

    C1clic Redundanc1

  • 8/16/2019 Ch4Flow and Error Control

    51/87

    C1clic Redundanc1Chec • Oiven a (#bit rame or message"

    the transmitter generates an n#bitse)uence" (nown as a frame checksequence  (FCS) , so that the resultingrame" consisting o 0(An bits" ise4actly divisible by somepredetermined number.

     %he receiver then divides theincoming rame by the samenumber and" i there is noremainder" assumes that there was

    no error.5/19/16 51

  • 8/16/2019 Ch4Flow and Error Control

    52/87

    C1clic Redundanc1 Chec*CRC,

    5/19/16 5

  • 8/16/2019 Ch4Flow and Error Control

    53/87

    2asic scheme for C1clic Redundanc1 Checin!

    5/19/16 5+

  • 8/16/2019 Ch4Flow and Error Control

    54/87

    • $n mathematical operation dividing a sample #bitnumber by 1:11" using the modulo# arithmetic.

    •  Kodulo# arithmetic is a binary addition process

    without any carry over" which is Nust theE4clusive#D operation.

    • *onsider the case where (@11:1. 2ence we haveto divide 11:1::: 0i.e. ( appended by + ;eros by

    1:11" which produces the remainder r@::1" sothat the bit rame 0(Ar @11:1::1 is actuallybeing transmitted through the communicationchannel.

     !t the receiving end" i the received number" i.e."11:1::1 is divided by the same generatorpolynomial 1:11 to get the remainder as :::" itcan be assumed that the data is ree o errors.

    5/19/16 5

  • 8/16/2019 Ch4Flow and Error Control

    55/87

    2inar1 /iision

    5/19/16 55

  • 8/16/2019 Ch4Flow and Error Control

    56/87

     

     Division in CRC encoder 

    5/19/16 56

  • 8/16/2019 Ch4Flow and Error Control

    57/87

      Division in the CRC decoder for two cases

    5/19/16 5

  • 8/16/2019 Ch4Flow and Error Control

    58/87

    Error Control

    • Error control includes both error detectionand error correction.

    • $t allows the receiver to inorm the sender i arame is lost or damaged during transmission

    and coordinates the retransmission o thoserames by the sender.

    • Error control in the data lin( layer is based onautomatic repeat re)uest 0!P. henever

    an error is detected" speci=ed rames areretransmitted.

    5/19/16 57

    0 i th d f

  • 8/16/2019 Ch4Flow and Error Control

    59/87

    0wo main methods of errorcorrection

     Forward error correction is the process in whichthe receiver tries to guess the message byusing redundant bits.

    •  %his is possible" i the number o errors is small.

    •*orrection by retransmission is a techni)ue inwhich the receiver detects the occurrence o anerror and as(s the sender to resend themessage.

    esending is repeated until a message arrivesthat the receiver believes is error#ree 0usually"not all errors can be detected.

    5/19/16 59

  • 8/16/2019 Ch4Flow and Error Control

    60/87

    Error Correction can %e handled intwo wa1s.

    •  Dne is when an error is discoveredQthe receiver can have the senderretransmit the entire data unit. %his is

    (nown as %acward errorcorrection.

    •  $n the other" receiver can use an error#correcting code" which automaticallycorrects certain errors. %his is (nownas forward error correction.

    5/19/16 6:

  • 8/16/2019 Ch4Flow and Error Control

    61/87

    5/19/16 61

  • 8/16/2019 Ch4Flow and Error Control

    62/87

    5/19/16 6

  • 8/16/2019 Ch4Flow and Error Control

    63/87

    Error Control 0echniques

    • hen an error is detected in a message" thereceiver sends a re)uest to the transmitterto retransmit the ill#ated message orpac(et.

    •  %he most popular retransmission scheme is(nown as !utomatic#epeat#e)uest 0!P.

    • 3uch schemes" where receiver as(stransmitter to re#transmit i it detects anerror" are (nown as reverse error correctiontechni)ues.

    5/19/16 6+

  • 8/16/2019 Ch4Flow and Error Control

    64/87

    Error control techniques

    5/19/16 6

  • 8/16/2019 Ch4Flow and Error Control

    65/87

    Error Control #echanisms

    • 3top#and#ait

    • Oo#Bac(#C !P

    3elective#epeat !P

    5/19/16 65

    - -"ait

      3ender (eeps a copy o the last

  • 8/16/2019 Ch4Flow and Error Control

    66/87

    "aitp py

    rame until it receives anac(nowledgement.

    For identi=cation" both data ramesand ac(nowledgements 0!*8 ramesare numbered alternatively : and 1.

    3ender has a control variable 03 that

    holds the number o the recently sentrame. 0: or 1

    eceiver has a control variable R

    that holds the number o the ne4trame e4pected 0: or 1.

    3ender starts a timer when it sends a

    rame. $ an !*8 is not receivedwithin a allocated time period" the

    sender assumes that the rame waslost or damaged and resends it

    eceiver send only positive !*8 ithe rame is intact.

    !*8 number always de=nes thenumber o the ne4t e4pected rame

    5/19/16 66

    3top#and#ait !P" lost

  • 8/16/2019 Ch4Flow and Error Control

    67/87

    3top and ait !P" lostrame

    • hen a receiverreceives adamaged rame" itdiscards it and

    (eeps its value o.

    • !ter the timer atthe sender

    e4pires" anothercopy o rame 1 issent.

    5/19/16 6

    78C9 frame

  • 8/16/2019 Ch4Flow and Error Control

    68/87

    8C9 frame

    • $ the sender

    receives a damaged!*8" it discards it.

    • hen the timer othe sender e4pires"the sender

    retransmits rame 1.• eceiver has

    already receivedrame 1 ande4pecting to receive

    rame : 0@:. %hereore it discardsthe second copy orame 1.

    5/19/16 67

    78C9 frame

  • 8/16/2019 Ch4Flow and Error Control

    69/87

    8C9 frame•  %he !*8 can be

    delayed at the

    receiver or due tosome problem

    • $t is received ater thetimer or rame : hase4pired.

    • 3ender retransmitted

    a copy o rame :.2owever" @1 meansreceiver e4pects tosee rame 1. eceiverdiscards the duplicaterame :.

    • 3ender receives !*8s" it discards thesecond !*8.

    5/19/16 69

    i!!1%acin!

  • 8/16/2019 Ch4Flow and Error Control

    70/87

    i!!1%acin!• ! method to

    combine a data

    rame with !*8.• 3tation ! and B

    both have data tosend.

    • $nstead o sending

    separately" station! sends a datarame that includesan !*8.

    • 3tation B does the

    same thing.• iggybac(ing saves

    bandwidth.

    5/19/16 :

    &isadvantage o 3top#and#

  • 8/16/2019 Ch4Flow and Error Control

    71/87

    &isadvantage o 3top#and#ait• $n stop#and#wait" at any point in time" there

    is only one rame that is sent and waiting tobe ac(nowledged.

     %his is not a good use o transmissionmedium.

    •  %o improve efciency" multiple ramesshould be in transition while waiting or !*8.

    •  %wo protocol use the above concept" – o-2ac-N 8R;

     – Selectie Repeat 8R;

    5/19/16 1

  • 8/16/2019 Ch4Flow and Error Control

    72/87

    Oo#Bac(#C !P

    • e can send up to rames beoreworrying about !*8s.

    • e (eep a copy o these rames until

    the !*8s arrive.•  %his procedure re)uires additional

    eatures to be added to 3top#and#

    ait !P.

    5/19/16

  • 8/16/2019 Ch4Flow and Error Control

    73/87

    3e)uence Cumbers

    • Frames rom a sender are numbered se)uentially.

    • e need to set a limit since we need to include these)uence number o each rame in the header.

    • $ the header o the rame allows m bits or

    se)uence number" the se)uence numbers rangerom : to m  1. or m @ +" se)uence numbersare :"1" " +" " 5" 6" .

    • e can repeat the se)uence number.

    • 3e)uence numbers are:" 1" " +" " 5" 6" " :" 1" " +" " 5" 6" " :" 1" S

    5/19/16 +

     "indow

  • 8/16/2019 Ch4Flow and Error Control

    74/87

    "indow• !t the sending site"

    to hold the

    outstanding ramesuntil they areac(nowledged" weuse the concept o a

    window.•  %he si;e o the

    window is at mostm #1 where m is the

    number o bits orthe se)uencenumber.

    • 3i;e o the windowcan be variable" e.g.

     %*.5/19/16

     "indow

  • 8/16/2019 Ch4Flow and Error Control

    75/87

    "indow• 3i;e o the window

    at the receivingsite is always 1 inthis protocol.

    • eceiver is alwaysloo(ing or a

    speci=c rame toarrive in a speci=corder.

    • !ny rame arriving

    out o order isdiscarded andneeds to be resent.

    • eceiver window

    slides as shown in5/19/16 5

    Control 6aria%les

  • 8/16/2019 Ch4Flow and Error Control

    76/87

    • 3ender has + variables 3" 3F" and 3'

    • 3 holds the se)uence number o recently sent rame

    • 3F holds the se)uence number o the =rst rame

    • 3' holds the se)uence number o the last rame

    • eceiver only has the one variable" " that holds these)uence number o the rame it e4pects to receive.$ the se). no. is the same as the value o " therame is accepted" otherwise reNected.

    5/19/16 6

    !c(nowledgement

  • 8/16/2019 Ch4Flow and Error Control

    77/87

    !c(nowledgement• eceiver sends positive !*8 i a rame arrived sae and in

    order.

    • $ the rames are damaged/out o order" receiver is silent anddiscard all subse)uent rames until it receives the one it ise4pecting.

    •  %he silence o the receiver causes the timer o the

    unac(nowledged rame to e4pire.•  %hen the sender resends all rames" beginning with the one

    with the e4pired timer.

    • For e4ample" suppose the sender has sent rame 6" but the

    timer or rame + e4pires 0i.e. rame + has not been

    ac(nowledged" then the sender goes bac( and sendsrames +" " 5" 6 again. %hus it is called Oo#Bac(#C#!P

    •  %he receiver does not have to ac(nowledge each ramereceived" it can send one cumulative !*8 or several rames.

    5/19/16

    o-2ac-N 8R;7 normal operation

  • 8/16/2019 Ch4Flow and Error Control

    78/87

    •  %he sender (eeps trac( o the outstandingrames and updates the variables and

    windows as the !*8s arrive.

    5/19/16 7

  • 8/16/2019 Ch4Flow and Error Control

    79/87

    o-2ac-N 8R;7dama!ed or lost frame

    • Frame islost

    hen thereceiverreceivesrame +" itdiscards

    rame + as itis e4pectingrame 0according to

    window.• !ter the

    timer orrame

    e4pires at the5/19/16 9

    Frames in error in !o-

  • 8/16/2019 Ch4Flow and Error Control

    80/87

    !2ac-N 8R;

    5/19/16 7:

    'ost Frames in o-2ac-

  • 8/16/2019 Ch4Flow and Error Control

    81/87

    N 8R;

    5/19/16 71

    o-2ac-N 8R; dama!ed

  • 8/16/2019 Ch4Flow and Error Control

    82/87

    o-2ac-N 8R;7 dama!ed

  • 8/16/2019 Ch4Flow and Error Control

    83/87

    8R;

    5/19/16 7+

    o-2ac-N 8R;7 sender window si)e

  • 8/16/2019 Ch4Flow and Error Control

    84/87

    • 3i;e o the sender window must be less than m.3i;e o the receiver is always 1. $ m @ " window

    si;e @ m

      1 @ +.• Fig compares a window si;e o + and .

    !cceptsas the1st rame inthe ne4t

    cycle#an5/19/16 7  receier windows

  • 8/16/2019 Ch4Flow and Error Control

    85/87

    • Oo#Bac(#C !P simpli=es the process at the receiver site.eceiver only (eeps trac( o only one variable" and there is noneed to bu,er out#o#order rames" they are simply discarded.

    • 2owever" Oo#Bac(#C !P protocol is inefcient or noisy lin(. $tbandwidth inefcient and slows down the transmission.

    • $n 3elective epeat !P" only the damaged rame is resent.Kore bandwidth efcient but more comple4 processing atreceiver.

    • $t de=nes a negative !*8 0C!8 to report the se)uencenumber o a damaged rame beore the timer e4pires.

    5/19/16 75

    Selectie Repeat 8R;7 lost frame• Frames :and 1 are

  • 8/16/2019 Ch4Flow and Error Control

    86/87

    and 1 areacceptedwhen

    receivedbecausethey are inthe rangespeci=ed bythe receiverwindow.3ame orrame +.

    • eceiversends a

    C!8 toshow thatrame hasnot beenreceived and

    then sender5/19/16 76

    Selectie Repeat 8R;7 sender window si)e

    3i th d d i i d t b t t

  • 8/16/2019 Ch4Flow and Error Control

    87/87

    • 3i;e o the sender and receiver windows must be at most one#hal o m. $ m @ " window si;e should be m / @ . Figcompares a window si;e o with a window si;e o +. indow

    si;e is + and all !*8s are lost" sender sends duplicate o rame:" window o the receiver e4pect to receive rame : 0part o thewindow" so accepts rame :" as the 1st rame o the ne4t cycle an error.