DESERT 3.5.1
|
#include <sun-ipr-sink.h>
Classes | |
class | SendTimer |
Public Member Functions | |
SunIPRoutingSink () | |
virtual | ~SunIPRoutingSink () |
Protected Member Functions | |
virtual int | command (int, const char *const *) |
virtual void | recv (Packet *) |
virtual int | recvSyncClMsg (ClMessage *) |
virtual int | recvAsyncClMsg (ClMessage *) |
virtual void | initialize () |
virtual void | sendProbe () |
const double | getDelay (const double &period_) const |
virtual void | start () |
virtual void | stop () |
virtual void | transmit () |
virtual void | setProbeTimer (const double &) |
virtual const double & | getProbeTimer () const |
virtual void | sendBackAck (const Packet *) |
virtual void | initPktAck (Packet *) |
const long & | getProbeCount () const |
const long & | getAckCount () const |
virtual void | tracePacket (const Packet *const, const string &position="UNDEF___") |
virtual string | createTraceString (const string &, const double &, const int &, const int &, const int &, const int &, const int &, const int &, const int &, const double &, const int &, const int &) |
virtual void | writeInTrace (const string &) |
virtual void | writePathInTrace (const Packet *) |
Static Protected Member Functions | |
static string | printIP (const nsaddr_t &) |
static string | printIP (const ns_addr_t &) |
static nsaddr_t | str2addr (const char *) |
static const int | getProbePktHeaderSize () |
static const int | getAckHeaderSize () |
Protected Attributes | |
nsaddr_t | ipAddr_ |
double | t_probe |
int | PoissonTraffic_ |
double | periodPoissonTraffic_ |
int | printDebug_ |
int | numberofnodes_ |
unsigned int ** | arrayofstats_ |
SendTimer | sendTmr_ |
bool | trace_ |
bool | trace_path_ |
char * | trace_file_name_ |
char * | trace_file_path_name_ |
ostringstream | osstream_ |
ofstream | trace_file_ |
ofstream | trace_file_path_ |
char | trace_separator_ |
Static Protected Attributes | |
static long | probe_count_ = 0 |
static long | number_of_ackpkt_ = 0 |
Private Member Functions | |
SunIPRoutingSink (const SunIPRoutingSink &) | |
Friends | |
class | SendTimer |
SunIPRoutingSink class is used to represent the routing layer of a sink.
Definition at line 72 of file sun-ipr-sink.h.
SunIPRoutingSink::SunIPRoutingSink | ( | ) |
Constructor of SunIPRoutingNode class.
Definition at line 76 of file sun-ipr-sink.cpp.
|
virtual |
Constructor of SunIPRoutingNode class.
Definition at line 93 of file sun-ipr-sink.cpp.
|
private |
Copy constructor declared as private.
It is not possible to create a new SunIPRoutingSink object passing to its constructor another SunIPRoutingSink object.
SunIPRoutingSink& | SunIPRoutingSink object. |
TCL command interpreter.
It implements the following OTcl methods:
argc | Number of arguments in argv. |
argv | Array of strings which are the command parameters (Note that argv[0] is the name of the object). |
Definition at line 122 of file sun-ipr-sink.cpp.
|
protectedvirtual |
Function that accept a list of string and create an entry for the trace file.
Definition at line 540 of file sun-ipr-sink.cpp.
Returns the number of Ack packets processed by the entire network.
Definition at line 308 of file sun-ipr-sink.h.
Returns the size in byte of a hdr_sun_ack packet header.
Definition at line 286 of file sun-ipr-sink.h.
Returns a delay value to use in transmission.
The delay can be 0 or poissonian accordingly with the flag PoissonTraffic_.
Definition at line 204 of file sun-ipr-sink.h.
Returns the number of Probe packets processed by the entire network.
Definition at line 297 of file sun-ipr-sink.h.
Returns the size in byte of a hdr_sun_probe packet header.
Definition at line 275 of file sun-ipr-sink.h.
Returns the current time interval between two consecutive probes.
Definition at line 427 of file sun-ipr-sink.cpp.
|
protectedvirtual |
Initializes a SunIPRoutingNode node.
It sends to the lower layers a Sync message asking for the IP of the node.
Definition at line 292 of file sun-ipr-sink.cpp.
Initializes an ack packet passed as argument with the default values.
Packet* | Pointer to a packet already allocated to fill with the right values. |
Definition at line 468 of file sun-ipr-sink.cpp.
Return a string with an IP in the classic form "x.x.x.x" converting an ns2 ns_addr_t address.
ns_addr_t& | ns2 address |
Definition at line 362 of file sun-ipr-sink.cpp.
Return a string with an IP in the classic form "x.x.x.x" converting an ns2 nsaddr_t address.
nsaddr_t& | ns2 address |
Definition at line 343 of file sun-ipr-sink.cpp.
Performs the reception of packets from upper and lower layers.
Packet* | Pointer to the packet will be received. |
Definition at line 223 of file sun-ipr-sink.cpp.
|
protectedvirtual |
Cross-Layer messages asynchronous interpreter.
Used to retrive the IP od the current node from the IP module.
ClMessage* | an instance of ClMessage that represent the message received and used for the answer. |
Definition at line 110 of file sun-ipr-sink.cpp.
|
protectedvirtual |
Cross-Layer messages synchronous interpreter.
ClMessage* | an instance of ClMessage that represent the message received |
Definition at line 102 of file sun-ipr-sink.cpp.
Creates an ack packet and sends it to the previous hop using the information contained in the header of the data packet passed as input parameter.
It is an ack to the previous hop, and not to the source of the packet.
Packet* | Pointer to a Data packet to acknowledge. |
Definition at line 435 of file sun-ipr-sink.cpp.
|
protectedvirtual |
Creates and sends in broadcast a probe message to notify the presence of the sink.
Definition at line 305 of file sun-ipr-sink.cpp.
Sets the probe interval timer.
double& | Time t in seconds between two consecutive probes. |
Definition at line 417 of file sun-ipr-sink.cpp.
|
protectedvirtual |
Starts to send Probe packets.
Definition at line 392 of file sun-ipr-sink.cpp.
|
protectedvirtual |
Stops to send Probe packets.
Definition at line 400 of file sun-ipr-sink.cpp.
Returns a nsaddr_t address from an IP written as a string in the form "x.x.x.x".
char* | IP in string form |
Definition at line 368 of file sun-ipr-sink.cpp.
|
protectedvirtual |
Traces a packet.
Packet | to be traced. |
String | optional for the packet. |
Definition at line 493 of file sun-ipr-sink.cpp.
|
protectedvirtual |
Sends a single Probe packet.
Definition at line 408 of file sun-ipr-sink.cpp.
Opens the trace file, writes the string passed as input and closes the file.
String | to write in the trace file. |
Definition at line 564 of file sun-ipr-sink.cpp.
Writes in the Path Trace file the path contained in the Packet.
Packet | to analyze. |
Definition at line 575 of file sun-ipr-sink.cpp.
Definition at line 75 of file sun-ipr-sink.h.
Structure that contains the number of data packets received by the the sink, for different nodes and for different values of hop count.
It is used for statistics purposes.
Definition at line 365 of file sun-ipr-sink.h.
|
protected |
IP of the current node.
Definition at line 349 of file sun-ipr-sink.h.
|
staticprotected |
Comulative number of Ack packets processed by SunIPRoutingNode objects.
Definition at line 360 of file sun-ipr-sink.h.
|
protected |
Number of nodes in the network, used for statistic purposes.
Definition at line 363 of file sun-ipr-sink.h.
|
protected |
Used to convert to string.
Definition at line 387 of file sun-ipr-sink.h.
|
protected |
Period of the Poisson traffic.
Definition at line 353 of file sun-ipr-sink.h.
|
protected |
Enable (1) or disable (0) the Poisson traffic for SUN packets.
Definition at line 351 of file sun-ipr-sink.h.
|
protected |
Flag to enable or disable dirrefent levels of debug.
Definition at line 354 of file sun-ipr-sink.h.
|
staticprotected |
Comulative number of probes sent by SunIPRoutingSink objects.
Definition at line 358 of file sun-ipr-sink.h.
|
protected |
SendTimer object.
Definition at line 373 of file sun-ipr-sink.h.
|
protected |
Period of the probing.
Definition at line 350 of file sun-ipr-sink.h.
|
protected |
Flag used to enable or disable the trace file for nodes,.
Definition at line 376 of file sun-ipr-sink.h.
|
protected |
Ofstream used to write the trace file in the disk.
Definition at line 388 of file sun-ipr-sink.h.
|
protected |
Name of the trace file writter for the current node.
Definition at line 381 of file sun-ipr-sink.h.
|
protected |
Ofstream used to write the path trace file in the disk.
Definition at line 390 of file sun-ipr-sink.h.
|
protected |
Name of the trace file that contains the list of paths of the data packets received.
Definition at line 384 of file sun-ipr-sink.h.
|
protected |
Flag used to enable or disable the path trace file for nodes,.
Definition at line 378 of file sun-ipr-sink.h.
|
protected |
Used as separator among elements in an entr of the tracefile.
Definition at line 392 of file sun-ipr-sink.h.