org.jgroups.protocols

Class FLOW_CONTROL

public class FLOW_CONTROL extends MessageProtocol implements Runnable

FLOW_CONTROL provides end-end congestion control and flow control. Attempts to maximize through put, by minimizing the possible block times(Forward flow control). Initially, sender starts with a smaller window size W and large expected RTT grpRTT. Sender also keeps a margin in the window size. When the margin is hit, insted of waiting for the window size to be exhausted, sender multicasts a FLOW_CONTROL info request message. If the window size is exhausted before the responses are received, send will be blocked. FCInfo(flow control info) from all the receivers is gathered at the sender, and current RTT is computed. If the current RTT is greater than estimated RTT window size and margin are reduced, otherwise they are increased.

Horizontal interaction is initiated by the sender with the other group members.

Note: A reliable transport layer is required for this protocol to function properly. With little effort this can be made completely independent.

Author: Ananda Bollu

UNKNOWN: Handle view changes (e.g., members {A,B,C}, blocked on C, and C crashes --> unblock).
Also block on down() instead of sending BLOCK_SEND.

Constructor Summary
FLOW_CONTROL()
Method Summary
StringgetName()
Objecthandle(Message req)
Called when a request for this protocol layer is received.
booleanhandleDownEvent(Event evt)
If Event.MSG type is received count is incremented by one, and message is passed to the down_prot.
booleanhandleUpEvent(Event evt)
If Event.MSG type is received message, number of received messages from the sender is incremented.
voidrun()
FCInfo request must be submitted in a different thread. handleDownEvent() can still be called to send messages while waiting for FCInfo from receivers. usually takes RTT.
booleansetProperties(Properties props)
Following parameters can be optionally supplied:
  • window size cap - int Limits the window size to a reasonable value.

Constructor Detail

FLOW_CONTROL

public FLOW_CONTROL()

Method Detail

getName

public String getName()

handle

public Object handle(Message req)
Called when a request for this protocol layer is received. Processes and return value is sent back in the reply. FLOW_CONTROL protocol of all members gets this message(including sender?)

Returns: Object containing FC information for sender with senderID. Callback. Called when a request for this protocol layer is received.

handleDownEvent

public boolean handleDownEvent(Event evt)
If Event.MSG type is received count is incremented by one, and message is passed to the down_prot. At some point, based on the algorithm(FLOW_CONTROL protocol definition) data collection sequence is started. This is done by each member in SENDER role when _numMSGsSentThisPeriod hits the margin. Before rsp arrives only _fwdMarginSize number of messages can be sent, and then sender will be blocked.

handleUpEvent

public boolean handleUpEvent(Event evt)
If Event.MSG type is received message, number of received messages from the sender is incremented. And the message is passed up the stack.

run

public void run()
FCInfo request must be submitted in a different thread. handleDownEvent() can still be called to send messages while waiting for FCInfo from receivers. usually takes RTT.

setProperties

public boolean setProperties(Properties props)
Following parameters can be optionally supplied:

See Also: setProperties

Copyright ? 1998-2005 Bela Ban. All Rights Reserved.