User Manual, Developers Guide and API Documentation

wns::ldk::arq::GoBackN Class Reference

GoBackN implementation of the ARQ interface. More...

#include <ldk/arq/GoBackN.hpp>

Inheritance diagram for wns::ldk::arq::GoBackN:

Inheritance graph
[legend]
Collaboration diagram for wns::ldk::arq::GoBackN:

Collaboration graph
[legend]

List of all members.

Public Member Functions

void calculateSizes (const CommandPool *commandPool, Bit &commandPoolSize, Bit &sduSize) const
 Calculate the sizes of the PDU.
virtual wns::ldk::CompoundPtr getACK ()
 Return an acknowledgement Compound for transmission.
virtual wns::ldk::CompoundPtr getData ()
 in retransmissionState: returns the HOL packet of toRetransmit queue in normal state: returns the (HOL) packet stored in activeCompound
 GoBackN (fun::FUN *fuNet, const wns::pyconfig::View &config)
virtual const wns::ldk::CompoundPtr hasACK () const
 hasACK() is asked by lower layer FU's
virtual bool hasCapacity () const
 hasCapacity() is true if we 1. don't have an active PDU we are processing 2. aren't occupied with retransmissions 3. don't exceed the sending window So the gate is only open if we are free for something new All other queueing must happen in a unit above us
virtual const wns::ldk::CompoundPtr hasData () const
 hasData() is asked by lower layer FU's
virtual void onTimeout ()
 Your callback. Implement this.
virtual void processIncoming (const CompoundPtr &compound)
 Upstack on receiver side.
virtual void processOutgoing (const CompoundPtr &sdu)
 Downstack on transmitter side.
virtual ~GoBackN ()

Protected Member Functions

virtual void doDelayDelivery ()
virtual void doDeliver ()
void onACKFrame (const CompoundPtr &compound)
void onIFrame (const CompoundPtr &compound)
void onNAKFrame (const CompoundPtr &compound)
virtual bool onSuspend () const
void prepareRetransmission ()
void removeACKed (const ARQCommand::SequenceNumber ackedNS, CompoundContainer &container)
bool retransmissionState () const
 return whether we are in retransmission mode (Retransmit queue nonempty)
void show_seqnr_list (const char *name, CompoundContainer &compoundList) const
 logger output of sequence numbers

Protected Attributes

CompoundContainer ackPDUs
 list of ACK PDU to be sent (Rx side).
CompoundPtr activeCompound
 PDU to be sent (Tx side).
int bitsPerACKFrame
 Number of bits added to the header for each ACK-Frame.
int bitsPerIFrame
 Number of bits added to the header for each I-Frame.
ARQCommand::SequenceNumber delayedDeliveryNR
bool delayingDelivery
ARQCommand::SequenceNumber LA
 Sequence number of the last ACK received in order (Tx side).
logger::Logger logger
ARQCommand::SequenceNumber NR
 Sequence number of the last packet received in order (Rx side).
ARQCommand::SequenceNumber NS
 Sequence number of the last packet sent (Transmitter side).
CompoundContainer receivedPDUs
 received compounds (Rx side).
double resendTimeout
 Time between two transmissions of the same PDU.
bool sendNow
 Remember to send the activeCompound (transmit buffer nonidle).
CompoundContainer sentPDUs
 The packets sent but not acknowledged yet (Tx side).
int sequenceNumberSize
 Divisor/Modulo for Sequence Numbers (>=2*windowSize). Power of 2.
CompoundContainer toRetransmit
 List of packets to be retransmit (Tx side).
wns::probe::bus::ContextCollectorPtr transmissionAttempts
 probe to count the number of retransmissions needed.
int windowSize
 Window size (so many packets may be sent without ACKs).

Private Types

typedef std::list< CompoundPtrCompoundContainer

Friends

class ::wns::ldk::arq::tests::GoBackNTest


Detailed Description

Author:
Rainer Schoenen <rs@comnets.rwth-aachen.de>

Definition at line 119 of file GoBackN.hpp.


Member Typedef Documentation

Definition at line 129 of file GoBackN.hpp.


Constructor & Destructor Documentation

GoBackN::GoBackN ( fun::FUN fuNet,
const wns::pyconfig::View config 
)

Definition at line 50 of file GoBackN.cpp.

GoBackN::~GoBackN (  )  [virtual]

Definition at line 84 of file GoBackN.cpp.


Member Function Documentation

void GoBackN::calculateSizes ( const CommandPool commandPool,
Bit commandPoolSize,
Bit dataSize 
) const [virtual]

During size calculation, each FunctionalUnit is asked for the size of the PCI and SDU. Calculation begins with the layer the PDU last visited. To be able to calculate the sizes, a FunctionalUnit may in turn need to know the sizes as calculated by the FunctionalUnit right above itself.

It can do that by simply asking the CommandProxy, giving itself as questioner. The CommandProxy will then delegate the calculation request to the next higher FunctionalUnit in the path of the PDU.

Implements wns::ldk::CommandTypeSpecifierInterface.

Definition at line 487 of file GoBackN.cpp.

void GoBackN::doDelayDelivery (  )  [protected, virtual]

Implements wns::ldk::DelayedDeliveryInterface.

Definition at line 580 of file GoBackN.cpp.

void GoBackN::doDeliver (  )  [protected, virtual]

Implements wns::ldk::DelayedDeliveryInterface.

Definition at line 587 of file GoBackN.cpp.

wns::ldk::CompoundPtr GoBackN::getACK (  )  [virtual]

getACK will only get called after a call to hasACK. Every implementation of this interface /must/ return the same Compound for subsequent hasACK/getACK calls.

Implements wns::ldk::arq::ARQ.

Definition at line 163 of file GoBackN.cpp.

wns::ldk::CompoundPtr GoBackN::getData (  )  [virtual]

Implements wns::ldk::arq::ARQ.

Definition at line 182 of file GoBackN.cpp.

const wns::ldk::CompoundPtr GoBackN::hasACK (  )  const [virtual]

Implements wns::ldk::arq::ARQ.

Definition at line 134 of file GoBackN.cpp.

bool GoBackN::hasCapacity (  )  const [virtual]

Implements wns::ldk::DelayedInterface.

Definition at line 95 of file GoBackN.cpp.

const wns::ldk::CompoundPtr GoBackN::hasData (  )  const [virtual]

Implements wns::ldk::arq::ARQ.

Definition at line 146 of file GoBackN.cpp.

void GoBackN::onACKFrame ( const CompoundPtr compound  )  [protected]

Definition at line 385 of file GoBackN.cpp.

void GoBackN::onIFrame ( const CompoundPtr compound  )  [protected]

Definition at line 288 of file GoBackN.cpp.

void GoBackN::onNAKFrame ( const CompoundPtr compound  )  [protected]

Definition at line 447 of file GoBackN.cpp.

bool GoBackN::onSuspend (  )  const [protected, virtual]

Implements wns::ldk::SuspendSupport.

Definition at line 574 of file GoBackN.cpp.

void GoBackN::onTimeout (  )  [virtual]

The deriver is forced to implement this method. It gets called, whenever the timer fires.

Implements wns::events::CanTimeout.

Definition at line 246 of file GoBackN.cpp.

void GoBackN::prepareRetransmission (  )  [protected]

Definition at line 500 of file GoBackN.cpp.

void GoBackN::processIncoming ( const CompoundPtr compound  )  [virtual]

Implements wns::ldk::DelayedInterface.

Definition at line 270 of file GoBackN.cpp.

void GoBackN::processOutgoing ( const CompoundPtr sdu  )  [virtual]

Implements wns::ldk::DelayedInterface.

Definition at line 109 of file GoBackN.cpp.

void GoBackN::removeACKed ( const ARQCommand::SequenceNumber  ackedNS,
CompoundContainer container 
) [protected]

Definition at line 525 of file GoBackN.cpp.

bool GoBackN::retransmissionState (  )  const [protected]

Definition at line 555 of file GoBackN.cpp.

void GoBackN::show_seqnr_list ( const char *  name,
CompoundContainer compoundList 
) const [protected]

Definition at line 561 of file GoBackN.cpp.


Friends And Related Function Documentation

friend class ::wns::ldk::arq::tests::GoBackNTest [friend]

Definition at line 128 of file GoBackN.hpp.


Member Data Documentation

Definition at line 288 of file GoBackN.hpp.

Definition at line 273 of file GoBackN.hpp.

Definition at line 253 of file GoBackN.hpp.

Definition at line 248 of file GoBackN.hpp.

Definition at line 314 of file GoBackN.hpp.

Definition at line 312 of file GoBackN.hpp.

Definition at line 268 of file GoBackN.hpp.

Definition at line 316 of file GoBackN.hpp.

Definition at line 263 of file GoBackN.hpp.

Definition at line 258 of file GoBackN.hpp.

Definition at line 293 of file GoBackN.hpp.

Definition at line 303 of file GoBackN.hpp.

Definition at line 298 of file GoBackN.hpp.

Definition at line 278 of file GoBackN.hpp.

Definition at line 243 of file GoBackN.hpp.

Definition at line 283 of file GoBackN.hpp.

Todo:
unknownPerson: this should go into the base class when the probe configuration works better.

Definition at line 310 of file GoBackN.hpp.

Definition at line 238 of file GoBackN.hpp.


The documentation for this class was generated from the following files:

Generated on Sat May 26 03:32:55 2012 for openWNS by  doxygen 1.5.5