Class AlternatingBitProtocol

java.lang.Object
  extended by RDTProtocol
      extended by AlternatingBitProtocol

public class AlternatingBitProtocol
extends RDTProtocol

An AlternatingBitProtocol implements the RDTProtocol interface using an alternating bit algorithm.


Constructor Summary
AlternatingBitProtocol()
           
 
Method Summary
protected  void doInit()
          rdtp.doInit() is invoked to perform protocol-dependent initialization for this AlternatingBitProtocol.
 void handleNewSegment(int id)
          handleNewSegment(id) is invoked to handle a new segment with identification number id.
 void handleReceivedAck(Packet pkt)
          rdtp.handleReceivedAck(pkt) is invoked to handle a ACK_TYPE packet received from its TCPEntity's connection partner.
 void handleReceivedData(Packet pkt)
          handleReceivedData(pkt) is invoked to handle a DATA_TYPE packet received from its TCPEntity's connection partner.
 void handleTimedOutPacket(Packet pkt)
          rdtp.handleTimedOutPacket(pkt) is invoked to handle a packet acknowledgement timeout for pkt.
 
Methods inherited from class RDTProtocol
createPacket, createTimer, handleReceivedClose, handleReceivedNack, initialize, initiateDisconnect, reassemble, send, setAcceptingNewSegments, setPendingAcknowledgements, terminate, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AlternatingBitProtocol

public AlternatingBitProtocol()
Method Detail

doInit

protected void doInit()
rdtp.doInit() is invoked to perform protocol-dependent initialization for this AlternatingBitProtocol.

Specified by:
doInit in class RDTProtocol

handleNewSegment

public void handleNewSegment(int id)
handleNewSegment(id) is invoked to handle a new segment with identification number id. The identification number is just a stand-in for the real data in a segment. It is used by the Logger for recording purposes.

Specified by:
handleNewSegment in class RDTProtocol

handleReceivedData

public void handleReceivedData(Packet pkt)
handleReceivedData(pkt) is invoked to handle a DATA_TYPE packet received from its TCPEntity's connection partner.

Specified by:
handleReceivedData in class RDTProtocol

handleReceivedAck

public void handleReceivedAck(Packet pkt)
rdtp.handleReceivedAck(pkt) is invoked to handle a ACK_TYPE packet received from its TCPEntity's connection partner.

Specified by:
handleReceivedAck in class RDTProtocol

handleTimedOutPacket

public void handleTimedOutPacket(Packet pkt)
rdtp.handleTimedOutPacket(pkt) is invoked to handle a packet acknowledgement timeout for pkt. pkt may be null for protocols that use a single timer.

Specified by:
handleTimedOutPacket in class RDTProtocol