|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectdesmoj.core.simulator.NamedObject
desmoj.core.simulator.ModelComponent
verinec.netsim.components.layers.abstractNetworkLayer
verinec.netsim.components.layers.TransportLayer
public class TransportLayer
Transport Layer (Layer 4 in the OSI Model)
| Field Summary | |
|---|---|
private Vector |
datagramSockets
|
int |
maxTCPSegmentSize
the size of a tcp Segment |
private RoutingTable |
routingtable
|
private Vector |
Sockets
|
| Constructor Summary | |
|---|---|
TransportLayer(Model owner,
EventProcessor processor,
RoutingTable routingtable)
Constructs a new TransportLayer |
|
| Method Summary | |
|---|---|
void |
bind(SocketImpl impl)
Binds a SocketImplementation with a localaddress on this host |
void |
bindUDP(DatagramSocketImpl impl)
Binds a DatagramSocketImplementation on this host |
IAddress |
getInterface(IAddress dst)
gets the address used as localhost when sending data to dst |
IAddress |
getLocalAddress()
gets the local IPAddress of this Layer, which is the first Address associated to this Layer |
SocketImpl |
getSocketImpl(int port)
Gets a SocketImpl associated to a given port |
SocketImpl |
getSocketImpl(int localport,
IAddress remoteaddress,
int remoteport)
gets a bound socket from this host, null if there isn't a bound socket with specified parameters |
DatagramSocketImpl |
getUDPSocketImpl(int port)
Gets a Datagram SocketImpl associated to a given port |
boolean |
isPortFree(int port)
checks if a a socket is port to a given portnumber |
boolean |
isUDPPortFree(int port)
checks if a a datagram socket is port to a given portnumber |
void |
sendDown(Packet packet,
double timeoffset,
ILogger logger)
Sends a Packet to the lower Layers(Observers). |
void |
unbind(SocketImpl impl)
removes a Socket from the bound Sockets list |
void |
unbindUDP(DatagramSocketImpl impl)
removes a datagram Socket from the bound Sockets list |
| Methods inherited from class verinec.netsim.components.layers.abstractNetworkLayer |
|---|
addAddress, addProcessor, addresses, attachLower, attachUpper, compareAddress, detachLower, detachUpper, getDownEvent, getFirstAddress, getLayerName, getLowerobserver, getNode, getProcessor, getUpEvent, processorelements, sendUp, setNode |
| Methods inherited from class desmoj.core.simulator.ModelComponent |
|---|
current, currentEntity, currentEvent, currentModel, currentSimProcess, currentTime, debugIsOn, debugOff, debugOn, epsilon, getModel, isExperimentCompatible, isModelCompatible, sendDebugNote, sendMessage, sendTraceNote, sendWarning, skipTraceNote, skipTraceNote, traceIsOn, traceOff, traceOn |
| Methods inherited from class desmoj.core.simulator.NamedObject |
|---|
getName, getQuotedName, rename, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private RoutingTable routingtable
private Vector Sockets
private Vector datagramSockets
public int maxTCPSegmentSize
| Constructor Detail |
|---|
public TransportLayer(Model owner,
EventProcessor processor,
RoutingTable routingtable)
owner - a modelprocessor - a processorroutingtable - a routing table| Method Detail |
|---|
public void sendDown(Packet packet,
double timeoffset,
ILogger logger)
Subject
sendDown in interface SubjectsendDown in class abstractNetworkLayerpacket - The Packet to be sent downtimeoffset - timeoffset added to now, when tje packet should arrivelogger - logger used to log all events caused by this eventabstractNetworkLayer.sendDown(verinec.netsim.entities.packets.Packet,
double, verinec.netsim.loggers.ILogger)public IAddress getLocalAddress()
public IAddress getInterface(IAddress dst)
dst - an address
public void bind(SocketImpl impl)
impl - a Socket Implementationpublic boolean isPortFree(int port)
port - a portnumber to check
public SocketImpl getSocketImpl(int localport,
IAddress remoteaddress,
int remoteport)
localport - localport of the bound socketremoteaddress - remote adddress of the bound socketremoteport - remote port of the bound socket
public SocketImpl getSocketImpl(int port)
port - a port
public DatagramSocketImpl getUDPSocketImpl(int port)
port - a port
public void unbind(SocketImpl impl)
impl - a Socket the should be removed from the bound listpublic boolean isUDPPortFree(int port)
port - a portnumber to check
public void bindUDP(DatagramSocketImpl impl)
impl - a Socket Implementationpublic void unbindUDP(DatagramSocketImpl impl)
impl - a datagram Socket the should be removed from the bound list
|
Copyright © 2005 Verinec, DIUF | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||