|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpeersim.transport.E2ETransport
public class E2ETransport
This transport protocol is based on the E2ENetwork
class.
Each instance
of this transport class is assigned to one of the routers contained in
the (fully static singleton) E2ENetwork
,
and subsequently the E2ENetwork
class is used to obtain the
latency for messages sending based on the router assignment.
Parameter Summary | |
---|---|
local
The delay that corresponds to the time spent on the source (and destination) nodes. |
Constructor Summary | |
---|---|
E2ETransport(java.lang.String prefix)
Reads configuration parameters. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Clones the object. |
long |
getLatency(Node src,
Node dest)
Calculates latency using the static singleton E2ENetwork . |
int |
getRouter()
|
void |
send(Node src,
Node dest,
java.lang.Object msg,
int pid)
Delivers the message reliably, with the latency calculated by getLatency(peersim.core.Node, peersim.core.Node) . |
void |
setRouter(int router)
Associates the node hosting this transport protocol instance with a router in the router network. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Parameter Detail |
---|
local
Constructor Detail |
---|
public E2ETransport(java.lang.String prefix)
Method Detail |
---|
public java.lang.Object clone()
clone
in interface Protocol
clone
in class java.lang.Object
public void send(Node src, Node dest, java.lang.Object msg, int pid)
getLatency(peersim.core.Node, peersim.core.Node)
.
send
in interface Transport
src
- sender nodedest
- destination nodemsg
- message to be sentpid
- protocol identifierpublic long getLatency(Node src, Node dest)
E2ENetwork
.
It looks up which routers the given nodes are assigned to, then
looks up the corresponding latency. Finally it increments this value
by adding twice the local delay configured by "local".
getLatency
in interface Transport
src
- sender nodedest
- destination nodepublic void setRouter(int router)
setRouter
in interface RouterInfo
router
- the numeric index of the routerpublic int getRouter()
getRouter
in interface RouterInfo
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |