public interface NetworkLayer
A network layer must implement this interface, which derives from
StackLayer.
StackLayer| Method Summary | |
|---|---|
void |
init(int nodeNum,
TransportLayer transportLayer,
DatalinkLayer datalinkLayer,
java.util.ArrayList<java.lang.Integer> neighbors)
The simulator calls this method at time=0 to initialize. |
void |
receivePacket(NetworkPacket packet)
This is called by the layer below. |
void |
sendPacket(NetworkPacket packet)
This is called by the layer above to send a packet. |
void |
updateLinkStatus(int neighbor,
LinkStatus status)
This is called by the simulator at regular intervals to indicate the status of a link. |
| Methods inherited from interface edu.gwu.simplenetsim.StackLayer |
|---|
timerBeep |
| Method Detail |
|---|
void init(int nodeNum,
TransportLayer transportLayer,
DatalinkLayer datalinkLayer,
java.util.ArrayList<java.lang.Integer> neighbors)
nodeNum - an int value, the node ID.transportLayer - a TransportLayer value, a ref to the layer above.datalinkLayer - a DatalinkLayer value, the layer below.neighbors - an ArrayList value, the list of nodeIDs of neighboring nodes. Note that two-way links are assumed.void sendPacket(NetworkPacket packet)
packet - a NetworkPacket valuevoid receivePacket(NetworkPacket packet)
packet - a NetworkPacket value
void updateLinkStatus(int neighbor,
LinkStatus status)
neighbor - an int valuestatus - a LinkStatus value