ostore.network.patchwork
Class LossPatch

java.lang.Object
  |
  +--ostore.network.patchwork.Patch
        |
        +--ostore.network.patchwork.LossPatch

public class LossPatch
extends Patch

A Patch that measures loss rate in percent, from 0 to 100, where 100 percent means all packets are lost.

Version:
$Id: LossPatch.java,v 1.5 2003/04/29 21:10:16 strib Exp $
Author:
Jeremy Stribling

Inner classes inherited from class ostore.network.patchwork.Patch
Patch.SeqNo
 
Field Summary
static long VALUE_LOSS
           
static long VALUE_NON_LOSS
           
 
Fields inherited from class ostore.network.patchwork.Patch
_classifier, _fault_admin, _period, _probe_times, _queue, _quick_stats, _self_node_id, _seq_nos, _table, _type, _udp_lock, _udp_socket, _userdata_sinks, _write_selitem, _write_selset, class_tag, DEBUG, NUM_TYPES, sim_running, TYPE_BANDWIDTH, TYPE_LATENCY, TYPE_LOSS, TYPE_RECALC, use_tcp
 
Constructor Summary
LossPatch(NodeId self_node_id, Classifier classifier, PatchworkTable table, FaultAdmin fault_admin, Period period, int lossRespondEvery)
           
 
Method Summary
protected  int getAndUpdateSeqNo(NodeId node)
          Get the next sequence number for this node, and update it for next time.
protected  void handleAlarm(AlarmMsg alarm)
           
protected  void handleProbe(ProbeMsg inProbe)
           
protected  void handleProbeResponse(ProbeMsg response, long timeRecvd)
          Handle the response to a probe.
protected  void handleTimeout(ProbeTimeout timeout)
           
protected  void sendQuickStatProbe(NodeId peer)
          Send a standard quick probe to the given node.
 
Methods inherited from class ostore.network.patchwork.Patch
addMonitorAll, addNode, addToQueue, dispatch, dispatch, enqueue, handleEvent, handleQuickStatProbeResp, handleQuickStatReq, handleQuickStatTimeout, handleUnknown, makeObservation, makeObservation, registerResponse, registerTimeout, removeNode, sendProbe, setNextAlarm
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VALUE_NON_LOSS

public static final long VALUE_NON_LOSS

VALUE_LOSS

public static final long VALUE_LOSS
Constructor Detail

LossPatch

public LossPatch(NodeId self_node_id,
                 Classifier classifier,
                 PatchworkTable table,
                 FaultAdmin fault_admin,
                 Period period,
                 int lossRespondEvery)
Method Detail

handleProbeResponse

protected void handleProbeResponse(ProbeMsg response,
                                   long timeRecvd)
Description copied from class: Patch
Handle the response to a probe.
Overrides:
handleProbeResponse in class Patch
Following copied from class: ostore.network.patchwork.Patch
Parameters:
response - the response
timeRecvd - the absolute time the repsonse was received (in microseconds)

handleProbe

protected void handleProbe(ProbeMsg inProbe)
Overrides:
handleProbe in class Patch

handleAlarm

protected void handleAlarm(AlarmMsg alarm)
Overrides:
handleAlarm in class Patch

sendQuickStatProbe

protected void sendQuickStatProbe(NodeId peer)
Description copied from class: Patch
Send a standard quick probe to the given node.
Overrides:
sendQuickStatProbe in class Patch

handleTimeout

protected void handleTimeout(ProbeTimeout timeout)
Overrides:
handleTimeout in class Patch

getAndUpdateSeqNo

protected int getAndUpdateSeqNo(NodeId node)
Description copied from class: Patch
Get the next sequence number for this node, and update it for next time.
Overrides:
getAndUpdateSeqNo in class Patch
Following copied from class: ostore.network.patchwork.Patch
Returns:
the sequence number to use for the next probe.