User Manual, Developers Guide and API Documentation

wns::ldk::arq::SelectiveRepeat Class Reference

SelectiveRepeat implementation of the ARQ interface. More...

#include <ldk/arq/SelectiveRepeat.hpp>

Inheritance diagram for wns::ldk::arq::SelectiveRepeat:

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

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 ()
 Return a user data Compound for transmission.
virtual const wns::ldk::CompoundPtr hasACK () const
 Return an acknowledgement Compound that should be considered for transmission.
virtual bool hasCapacity () const
 Return true, if the FunctionalUnit is still accepting compounds.
virtual const wns::ldk::CompoundPtr hasData () const
 Return a user data Compound that should be considered for transmission.
virtual void onTimeout ()
 Your callback. Implement this.
virtual void processIncoming (const CompoundPtr &compound)
 Process compounds on uplink.
virtual void processOutgoing (const CompoundPtr &sdu)
 Process compounds on downlink.
 SelectiveRepeat (fun::FUN *fuNet, const wns::pyconfig::View &config)
 ~SelectiveRepeat ()

Protected Member Functions

virtual void doDelayDelivery ()
virtual void doDeliver ()
void keepSorted (const CompoundPtr &compound, CompoundContainer &conatiner)
void onACKFrame (const CompoundPtr &compound)
void onIFrame (const CompoundPtr &compound)
virtual bool onSuspend () const
void prepareRetransmission ()
void removeACKed (const CompoundPtr &ackCompound, CompoundContainer &container)
bool retransmissionState () const

Protected Attributes

wns::probe::bus::ContextCollectorPtr ackDelayProbeBus
CompoundContainer ackPDUs
 list of ACK PDU to be sent.
CompoundPtr activeCompound
 PDU to be sent.
int commandSize
 Number of Bits the command occupies in the Commandpool.
bool delayingDelivery
ARQCommand::SequenceNumber LA
 Sequence number of the last ACK received in order.
logger::Logger logger
ARQCommand::SequenceNumber NR
 Sequence number of the last packet received in order.
ARQCommand::SequenceNumber NS
 Sequence number of the last packet sent.
CompoundContainer receivedACKs
 received out-of-sequence ACKs.
CompoundContainer receivedPDUs
 received compounds.
double resendTimeout
 Idle (no ACK) time after which sender enters retransmission state.
double retransmissionInterval
 min time to be waiting between two retransmissions of the same packet.
wns::probe::bus::ContextCollectorPtr roundTripTimeProbeBus
bool sendNow
 Remember to send the activeCompound.
CompoundContainer sentPDUs
 The packets sent but not acknowledged yet.
int sequenceNumberSize
 Divisor for Sequence Numbers.
CompoundContainer toRetransmit
 List of packets to be retransmit.
wns::probe::bus::ContextCollectorPtr transmissionAttemptsProbeBus
 probe to count the number of retransmissions needed. :TODO: this should go into the base class when the probe configuration works better.
int windowSize
 Window size.

Private Types

typedef std::list< CompoundPtrCompoundContainer

Friends

class tests::SelectiveRepeatTest


Detailed Description

This implementation was made according to the implementation of the SelectiveRepeat ARQ algorithm as described by Fred Halsall in "Data Communications, Computer Networks and open systems".

Note:
The mentioned implementation relies on the in-order delivery of ACKnowledgements. i.e. if an ACKnowledgement other than the next one expected is received by the Sender, a packet loss is considered to be the reason and the sender enters retransmission state. This makes this ARQ scheme unusable in applications where the in-order-delivery can not be guaranteed (e.g. in a TCP implementation). Consider using N-channel Stop and Wait in that case.

: the following modification has been made to make this implementation work in an environment where the Sender can receive the ACKs for multiple packets at the same point in time: If an out-of-sequence ACK arrives, previous (unacked) packets are only retransmitted if (a) they have not been retransmitted before or (b) the previous retransmission took place more than 2*minRTT ago. The minRTT is measured by the protocol itself.

Definition at line 129 of file SelectiveRepeat.hpp.


Member Typedef Documentation

Definition at line 139 of file SelectiveRepeat.hpp.


Constructor & Destructor Documentation

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

Definition at line 50 of file SelectiveRepeat.cpp.

SelectiveRepeat::~SelectiveRepeat (  ) 

Definition at line 90 of file SelectiveRepeat.cpp.


Member Function Documentation

void SelectiveRepeat::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 446 of file SelectiveRepeat.cpp.

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

Implements wns::ldk::DelayedDeliveryInterface.

Definition at line 579 of file SelectiveRepeat.cpp.

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

Implements wns::ldk::DelayedDeliveryInterface.

Definition at line 585 of file SelectiveRepeat.cpp.

wns::ldk::CompoundPtr SelectiveRepeat::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 167 of file SelectiveRepeat.cpp.

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

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

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

Definition at line 183 of file SelectiveRepeat.cpp.

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

Every implementation should return CompoundPtr() in case there is no user data Compound scheduled for transmission.

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

Definition at line 138 of file SelectiveRepeat.cpp.

bool SelectiveRepeat::hasCapacity (  )  const [virtual]

While hasCapacity returns false, processIncoming will never be called.

Implements wns::ldk::DelayedInterface.

Definition at line 102 of file SelectiveRepeat.cpp.

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

Every implementation should return CompoundPtr() in case there is no user data Compound scheduled for transmission.

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

Definition at line 150 of file SelectiveRepeat.cpp.

void SelectiveRepeat::keepSorted ( const CompoundPtr compound,
CompoundContainer conatiner 
) [protected]

Definition at line 508 of file SelectiveRepeat.cpp.

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

Definition at line 367 of file SelectiveRepeat.cpp.

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

Definition at line 284 of file SelectiveRepeat.cpp.

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

Implements wns::ldk::SuspendSupport.

Definition at line 573 of file SelectiveRepeat.cpp.

void SelectiveRepeat::onTimeout (  )  [virtual]

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

Implements wns::events::CanTimeout.

Definition at line 249 of file SelectiveRepeat.cpp.

void SelectiveRepeat::prepareRetransmission (  )  [protected]

Definition at line 463 of file SelectiveRepeat.cpp.

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

Override this method to handle incoming compounds.

Implements wns::ldk::DelayedInterface.

Definition at line 263 of file SelectiveRepeat.cpp.

void SelectiveRepeat::processOutgoing ( const CompoundPtr  )  [virtual]

Override this method to handle outgoing compounds.

Implements wns::ldk::DelayedInterface.

Definition at line 116 of file SelectiveRepeat.cpp.

void SelectiveRepeat::removeACKed ( const CompoundPtr ackCompound,
CompoundContainer container 
) [protected]

Definition at line 537 of file SelectiveRepeat.cpp.

bool SelectiveRepeat::retransmissionState (  )  const [protected]

Definition at line 567 of file SelectiveRepeat.cpp.


Friends And Related Function Documentation

friend class tests::SelectiveRepeatTest [friend]

Definition at line 138 of file SelectiveRepeat.hpp.


Member Data Documentation

Definition at line 270 of file SelectiveRepeat.hpp.

Definition at line 235 of file SelectiveRepeat.hpp.

Definition at line 220 of file SelectiveRepeat.hpp.

Definition at line 200 of file SelectiveRepeat.hpp.

Definition at line 273 of file SelectiveRepeat.hpp.

Definition at line 215 of file SelectiveRepeat.hpp.

Definition at line 275 of file SelectiveRepeat.hpp.

Definition at line 210 of file SelectiveRepeat.hpp.

Definition at line 205 of file SelectiveRepeat.hpp.

Definition at line 245 of file SelectiveRepeat.hpp.

Definition at line 240 of file SelectiveRepeat.hpp.

Definition at line 256 of file SelectiveRepeat.hpp.

Definition at line 262 of file SelectiveRepeat.hpp.

Definition at line 271 of file SelectiveRepeat.hpp.

Definition at line 250 of file SelectiveRepeat.hpp.

Definition at line 225 of file SelectiveRepeat.hpp.

Definition at line 195 of file SelectiveRepeat.hpp.

Definition at line 230 of file SelectiveRepeat.hpp.

Definition at line 269 of file SelectiveRepeat.hpp.

Definition at line 190 of file SelectiveRepeat.hpp.


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

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