Packet

Packet~ Packet

A class that represents a network packet.

Constructor

new Packet(options)

Creates a new packet.

Parameters:
Name Type Description
options Object

Options for the constructor.

Properties
Name Type Attributes Default Description
seqNum number

The sequence number of the packet.

sender AbstractARQNode

The sender of the packet.

receiver AbstractARQNode

The receiver of the packet.

isAck boolean <optional>
false

true if the packet is an acknowledgment.

ackNum boolean <optional>
null

The sequence number to acknowledge.

wasReSent boolean <optional>
false

true if the packet was re-sent.

isCAck boolean <optional>
false

true if the packet is a cumulative acknowledgment.

Source:

Members

ackNum :number

The sequence number to acknowledge.

Source:

isAck :boolean

true if the packet is an acknowledgment, false otherwise.

Source:

isCAck :boolean

true if the packet is a cumulative acknowledgment.

Source:

isCorrupted :booblean

true if the packet is corrupted, false if not.

Source:

receiver :AbstractARQNode

The receiver of the packet.

Source:

sender :AbstractARQNode

The sender of the packet.

Source:

seqNum :number

The sequence number of the packet.

Source:

wasReSent :boolean

true if the packet was re-sent.

Source:

Methods

damage()

Turns packet.isCorrupted true.

Source: