Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Go Back N ARQ

O tehnică dezvoltată pentru a realiza retransmisia este Go-Back-N ARQ. Este un caz special de fereastră glisantă, în care transmitătorul are o fereastră N și receptorul 1. La receptor, orice segment care nu este așteptat este aruncat. Transmitătorul retransmite toate segmentele din fereastră la declanșarea unui timer.

Simularea urmatoare prezinta surprinde acest comportament. Pentru a pierde click pe un segment, apasati click pe acesta.

Pseudocodul aferent implementarii este urmatorul. Consideram ca segmentele se pierd, coruperea fiind detectata de nivelele inferioare si pachete fiind aruncate.

N  = window size
Rn = request number
Sn = sequence number
Sb = sequence base
Sm = sequence max

void receiver() {
    Rn = 0;
    while (1) {
        if the segment received = Rn then
            Accept the segment and send the payload to upper lever
            Rn := Rn + 1
        else
            Drop packet
        Send ACK with Sequence Number Rn
    }
}

void sender() {
    Sb := 0
    Sm := N + 1

    Transmit Sm segments
    while (1) {
        if you receive an ACK with Sequence number Rn > Sb then
            Transmit segments from Sm to Sm + Rn - Sb
            Sm := (Sm − Sb) + Rn
            Sb := Rn

        if Timeout Expired
            Transmis Sm backets from Sb
    }
}