#include <sun-ipr-sink.h>
|
| 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 *) |
| |
SunIPRoutingSink class is used to represent the routing layer of a sink.
◆ SunIPRoutingSink() [1/2]
| SunIPRoutingSink::SunIPRoutingSink |
( |
| ) |
|
◆ ~SunIPRoutingSink()
| SunIPRoutingSink::~SunIPRoutingSink |
( |
| ) |
|
|
virtual |
◆ SunIPRoutingSink() [2/2]
Copy constructor declared as private. It is not possible to create a new SunIPRoutingSink object passing to its constructor another SunIPRoutingSink object.
- Parameters
-
◆ command()
| int SunIPRoutingSink::command |
( |
int |
argc, |
|
|
const char *const * |
argv |
|
) |
| |
|
protectedvirtual |
TCL command interpreter. It implements the following OTcl methods:
- Parameters
-
| 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). |
- Returns
- TCL_OK or TCL_ERROR whether the command has been dispatched successfully or not.
References arrayofstats_, getAckCount(), getAckHeaderSize(), getProbeCount(), getProbePktHeaderSize(), getProbeTimer(), initialize(), ipAddr_, numberofnodes_, sendProbe(), start(), stop(), str2addr(), trace_, trace_file_, trace_file_name_, trace_file_path_, trace_file_path_name_, and trace_path_.
◆ createTraceString()
| string SunIPRoutingSink::createTraceString |
( |
const string & |
info_string, |
|
|
const double & |
simulation_time_, |
|
|
const int & |
node_id_, |
|
|
const int & |
pkt_id_, |
|
|
const int & |
pkt_sn_, |
|
|
const int & |
pkt_from_, |
|
|
const int & |
pkt_next_hop, |
|
|
const int & |
pkt_source_, |
|
|
const int & |
pkt_destination_, |
|
|
const double & |
snr_, |
|
|
const int & |
direction_, |
|
|
const int & |
pkt_type |
|
) |
| |
|
protectedvirtual |
◆ getAckCount()
| const long & SunIPRoutingSink::getAckCount |
( |
| ) |
const |
|
inlineprotected |
Returns the number of Ack packets processed by the entire network.
- Returns
- Number of Ack packets processed by the entire network.
References number_of_ackpkt_.
Referenced by command().
◆ getAckHeaderSize()
| static const int SunIPRoutingSink::getAckHeaderSize |
( |
| ) |
|
|
inlinestaticprotected |
◆ getDelay()
| const double SunIPRoutingSink::getDelay |
( |
const double & |
period_ | ) |
const |
|
inlineprotected |
◆ getProbeCount()
| const long & SunIPRoutingSink::getProbeCount |
( |
| ) |
const |
|
inlineprotected |
Returns the number of Probe packets processed by the entire network.
- Returns
- Number of Probe packets processed by the entire network.
References probe_count_.
Referenced by command().
◆ getProbePktHeaderSize()
| static const int SunIPRoutingSink::getProbePktHeaderSize |
( |
| ) |
|
|
inlinestaticprotected |
◆ getProbeTimer()
| const double & SunIPRoutingSink::getProbeTimer |
( |
| ) |
const |
|
protectedvirtual |
Returns the current time interval between two consecutive probes.
- Returns
- The time interval between two consecutive probes.
References t_probe.
Referenced by command(), start(), and transmit().
◆ initialize()
| void SunIPRoutingSink::initialize |
( |
| ) |
|
|
protectedvirtual |
◆ initPktAck()
| void SunIPRoutingSink::initPktAck |
( |
Packet * |
p | ) |
|
|
protectedvirtual |
Initializes an ack packet passed as argument with the default values.
- Parameters
-
| Packet* | Pointer to a packet already allocated to fill with the right values. |
References ipAddr_, and PT_SUN_ACK.
Referenced by sendBackAck().
◆ printIP() [1/2]
| string SunIPRoutingSink::printIP |
( |
const ns_addr_t & |
ipt_ | ) |
|
|
staticprotected |
Return a string with an IP in the classic form "x.x.x.x" converting an ns2 ns_addr_t address.
- Parameters
-
- Returns
- String that contains a printable IP in the classic form "x.x.x.x"
References printIP().
◆ printIP() [2/2]
| string SunIPRoutingSink::printIP |
( |
const nsaddr_t & |
ip_ | ) |
|
|
staticprotected |
◆ recv()
| void SunIPRoutingSink::recv |
( |
Packet * |
p | ) |
|
|
protectedvirtual |
Performs the reception of packets from upper and lower layers.
- Parameters
-
| Packet* | Pointer to the packet will be received. |
References arrayofstats_, hdr_uwip::daddr(), ipAddr_, hdr_sun_data::list_of_hops_length(), numberofnodes_, printDebug_, printIP(), PT_SUN_ACK, PT_SUN_PATH_EST, PT_SUN_PROBE, hdr_uwip::saddr(), sendBackAck(), trace_, trace_path_, tracePacket(), and writePathInTrace().
◆ recvAsyncClMsg()
| int SunIPRoutingSink::recvAsyncClMsg |
( |
ClMessage * |
m | ) |
|
|
protectedvirtual |
Cross-Layer messages asynchronous interpreter. Used to retrive the IP od the current node from the IP module.
- Parameters
-
| ClMessage* | an instance of ClMessage that represent the message received and used for the answer. |
- Returns
- 0 if successful.
References UWIPClMsgSendAddr::getAddr(), ipAddr_, and UWIP_CLMSG_SEND_ADDR.
◆ recvSyncClMsg()
| int SunIPRoutingSink::recvSyncClMsg |
( |
ClMessage * |
m | ) |
|
|
protectedvirtual |
Cross-Layer messages synchronous interpreter.
- Parameters
-
| ClMessage* | an instance of ClMessage that represent the message received |
- Returns
- 0 if successful.
◆ sendBackAck()
| void SunIPRoutingSink::sendBackAck |
( |
const Packet * |
p | ) |
|
|
protectedvirtual |
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.
- Parameters
-
| Packet* | Pointer to a Data packet to acknowledge. |
- See also
- SunIPRoutingSink::initPktAck()
References hdr_uwip::daddr(), getDelay(), initPktAck(), ipAddr_, number_of_ackpkt_, periodPoissonTraffic_, printDebug_, printIP(), hdr_uwcbr::sn(), trace_, tracePacket(), and hdr_sun_ack::uid().
Referenced by recv().
◆ sendProbe()
| void SunIPRoutingSink::sendProbe |
( |
| ) |
|
|
protectedvirtual |
Creates and sends in broadcast a probe message to notify the presence of the sink.
References hdr_uwip::daddr(), getDelay(), ipAddr_, periodPoissonTraffic_, printDebug_, printIP(), probe_count_, PT_SUN_PROBE, hdr_uwip::saddr(), trace_, and tracePacket().
Referenced by command(), and transmit().
◆ setProbeTimer()
| void SunIPRoutingSink::setProbeTimer |
( |
const double & |
t_ | ) |
|
|
protectedvirtual |
Sets the probe interval timer.
- Parameters
-
| double& | Time t in seconds between two consecutive probes. |
References t_probe.
◆ start()
| void SunIPRoutingSink::start |
( |
| ) |
|
|
protectedvirtual |
◆ stop()
| void SunIPRoutingSink::stop |
( |
| ) |
|
|
protectedvirtual |
◆ str2addr()
| nsaddr_t SunIPRoutingSink::str2addr |
( |
const char * |
str | ) |
|
|
staticprotected |
Returns a nsaddr_t address from an IP written as a string in the form "x.x.x.x".
- Parameters
-
- Returns
- nsaddr_t that contains the IP converter from the input string
Referenced by command().
◆ tracePacket()
| void SunIPRoutingSink::tracePacket |
( |
const Packet * const |
p, |
|
|
const string & |
position = "UNDEF___" |
|
) |
| |
|
protectedvirtual |
Traces a packet.
- Parameters
-
| Packet | to be traced. |
| String | optional for the packet. |
References createTraceString(), hdr_uwip::daddr(), ipAddr_, PT_SUN_ACK, hdr_uwip::saddr(), hdr_uwcbr::sn(), trace_, hdr_sun_ack::uid(), and writeInTrace().
Referenced by recv(), sendBackAck(), and sendProbe().
◆ transmit()
| void SunIPRoutingSink::transmit |
( |
| ) |
|
|
protectedvirtual |
◆ writeInTrace()
| void SunIPRoutingSink::writeInTrace |
( |
const string & |
string_to_write_ | ) |
|
|
protectedvirtual |
◆ writePathInTrace()
| void SunIPRoutingSink::writePathInTrace |
( |
const Packet * |
p | ) |
|
|
protectedvirtual |
◆ SendTimer
◆ arrayofstats_
| unsigned int** SunIPRoutingSink::arrayofstats_ |
|
protected |
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.
Referenced by command(), and recv().
◆ ipAddr_
| nsaddr_t SunIPRoutingSink::ipAddr_ |
|
protected |
◆ number_of_ackpkt_
| long SunIPRoutingSink::number_of_ackpkt_ = 0 |
|
staticprotected |
◆ numberofnodes_
| int SunIPRoutingSink::numberofnodes_ |
|
protected |
Number of nodes in the network, used for statistic purposes.
Referenced by command(), and recv().
◆ osstream_
| ostringstream SunIPRoutingSink::osstream_ |
|
protected |
◆ periodPoissonTraffic_
| double SunIPRoutingSink::periodPoissonTraffic_ |
|
protected |
◆ PoissonTraffic_
| int SunIPRoutingSink::PoissonTraffic_ |
|
protected |
◆ printDebug_
| int SunIPRoutingSink::printDebug_ |
|
protected |
◆ probe_count_
| long SunIPRoutingSink::probe_count_ = 0 |
|
staticprotected |
◆ sendTmr_
◆ t_probe
| double SunIPRoutingSink::t_probe |
|
protected |
◆ trace_
| bool SunIPRoutingSink::trace_ |
|
protected |
◆ trace_file_
| ofstream SunIPRoutingSink::trace_file_ |
|
protected |
◆ trace_file_name_
| char* SunIPRoutingSink::trace_file_name_ |
|
protected |
◆ trace_file_path_
| ofstream SunIPRoutingSink::trace_file_path_ |
|
protected |
◆ trace_file_path_name_
| char* SunIPRoutingSink::trace_file_path_name_ |
|
protected |
◆ trace_path_
| bool SunIPRoutingSink::trace_path_ |
|
protected |
Flag used to enable or disable the path trace file for nodes,
Referenced by command(), and recv().
◆ trace_separator_
| char SunIPRoutingSink::trace_separator_ |
|
protected |
The documentation for this class was generated from the following files: