GBNSender

goBackN. GBNSender

A class that represents a go-back-n sender.

Constructor

new GBNSender(options)

Creates a new GBNSender instance.

Parameters:
Name Type Description
options Object

The constructor options.

Properties
Name Type Description
receiver GBNReceiver

The go-back-n receiver.

timeout number

The time to wait for an acknowledgment from the receiver.

channel Channel

The channel through which to send the packets.

windowSize number

The size of the sliding window.

Source:

Extends

  • AbstractWindowedSender

Methods

(protected) _checkReceivedPkt(packet) → {boolean}

Tests whether a received packet is correct or not. A packet is correct if it's an acknowledgment, it's not corrupted and the acknowledged sequence number corresponds to one of the sequences in the set of sent packets from the current window.

Parameters:
Name Type Description
packet Packet

The packet to test.

Source:

(protected) _onTimeout(seqNum)

Resends the previously sent packets from the current window, and restarts the timeout.

Parameters:
Name Type Description
seqNum number

The sequence number for which the timeout passed.

Source:

(protected) _processExpectedPkt(packet)

Processes a correctly received packet, confirming the acknowledged sequence and all previous ones. It moves the window and stops the timeout or, if there are still unacknowledged sequences in the window, resets it.

Parameters:
Name Type Description
packet Packet

The packet to process.

Source:

(protected) _processSending()

Sends a packet and starts a timeout if it is the first of the window.

Source: