public class FLOW_CONTROL extends MessageProtocol implements java.lang.Runnable
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.
todo 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. // done, bela April 28 2006
_corr, members
down_handler, down_prot, down_queue, down_thread, down_thread_prio, log, observer, props, stack, stats, up_handler, up_prot, up_queue, up_thread, up_thread_prio
Constructor and Description |
---|
FLOW_CONTROL() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getName() |
java.lang.Object |
handle(Message req)
Called when a request for this protocol layer is received.
|
boolean |
handleDownEvent(Event evt)
If Event.MSG type is received count is incremented by one,
and message is passed to the down_prot.
|
boolean |
handleUpEvent(Event evt)
If Event.MSG type is received message, number of received
messages from the sender is incremented.
|
void |
run()
FCInfo request must be submitted in a different thread.
|
boolean |
setProperties(java.util.Properties props)
Following parameters can be optionally supplied:
window size cap -
int Limits the window size to a reasonable value. |
castMessage, down, sendMessage, start, stop, up, updateView
destroy, downThreadEnabled, dumpStats, enableStats, getDownProtocol, getDownQueue, getProperties, getUpProtocol, getUpQueue, handleSpecialDownEvent, init, passDown, passUp, printStats, providedDownServices, providedUpServices, receiveDownEvent, receiveUpEvent, requiredDownServices, requiredUpServices, resetStats, setDownProtocol, setObserver, setPropertiesInternal, setProtocolStack, setUpProtocol, startDownHandler, startUpHandler, statsEnabled, stopInternal, upThreadEnabled
public boolean handleDownEvent(Event evt)
handleDownEvent
in class MessageProtocol
public boolean handleUpEvent(Event evt)
handleUpEvent
in class MessageProtocol
public java.lang.Object handle(Message req)
handle
in interface RequestHandler
handle
in class MessageProtocol
public void run()
run
in interface java.lang.Runnable
public boolean setProperties(java.util.Properties props)
int
Limits the window size to a reasonable value.
int
these many number of messages are sent before a block could happen
int
a request for flow control information is sent when remaining window size hits this margin
double
Max RTT in the group is calculated during each Flow control request. lower number assigns
higher weight to current RTT in estimating RTT.
double
When current RTT is greater than estimated RTT current window size
is reduced by this multiple.
double
When current RTT is less than estimated RTT window is incremented
by this multiple.
setProperties
in class Protocol
Protocol.setProperties(Properties)
Copyright ? 1998-2006 Bela Ban. All Rights Reserved.