DESERT 3.5.1
Loading...
Searching...
No Matches
SunIPRoutingNode Class Reference

#include <sun-ipr-node.h>

Inheritance diagram for SunIPRoutingNode:
Collaboration diagram for SunIPRoutingNode:

Public Member Functions

 SunIPRoutingNode ()
 
virtual ~SunIPRoutingNode ()
 

Static Public Attributes

static const int LISTLENGTH = 30
 
static const int MINUTE
 

Protected Types

enum  { HOPCOUNT = 1 , SNR , LESSCONGESTED }
 

Protected Member Functions

virtual int command (int, const char *const *)
 
virtual void recv (Packet *)
 
virtual int recvSyncClMsg (ClMessage *)
 
virtual int recvAsyncClMsg (ClMessage *)
 
virtual void clearHops ()
 
virtual void initialize ()
 
virtual void printHopTable () const
 
virtual void printSelectedRoutes () const
 
const longgetNPathsEstablished ()
 
const double getDelay (const double &period_) const
 
const bool isZero (const double &value) const
 
virtual const intsetNumberOfHopToSink (const int &)
 
virtual const intgetNumberOfHopToSink () const
 
virtual void receiveProbe (const Packet *)
 
virtual void searchPath ()
 
virtual void initPktPathEstSearch (Packet *) const
 
virtual void replyPathEstSearch (Packet *)
 
virtual const bool addMyIpInList (Packet *)
 
virtual const bool isMyIpInList (const Packet *) const
 
virtual void updateQuality (Packet *)
 
virtual void answerPath (const Packet *)
 
virtual void initPktPathEstAnswer (Packet *, const Packet *)
 
virtual void sendRouteBack (Packet *)
 
virtual const intevaluatePath (const Packet *)
 
virtual void initPktDataPacket (Packet *)
 
virtual void forwardDataPacket (Packet *)
 
virtual void sendBackAck (const Packet *)
 
virtual void initPktAck (Packet *)
 
virtual void createRouteError (const Packet *, Packet *)
 
virtual void sendRouteErrorBack (Packet *)
 
virtual void updatePacketsCount ()
 
virtual void updateAcksCount ()
 
virtual const int getPacketsLastMinute () const
 
virtual const int getAcksLastMinute () const
 
virtual const double getLoad () const
 
virtual void bufferManager ()
 
const longgetAckCount () const
 
const longgetDataCount () const
 
const longgetForwardedCount () const
 
const longgetDataDropsCountBuffer () const
 
const longgetDataDropsCountMaxRetx () const
 
const longgetPathEstablishmentCount () const
 
virtual void expTimerHopTable ()
 
virtual void lostSink ()
 
virtual void searchPathExpire ()
 
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 &)
 

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 getAckHeaderSize ()
 
static const int getDataPktHeaderSize ()
 
static const int getPathEstHeaderSize ()
 

Protected Attributes

nsaddr_t ipAddr_
 
int metrics_
 
int PoissonTraffic_
 
double period_status_
 
double period_data_
 
int num_hop_to_sink
 
double quality_link
 
nsaddr_thop_table
 
int hop_table_length
 
nsaddr_t sink_associated
 
int printDebug_
 
double probe_min_snr_
 
double snr_to_sink_
 
bool search_path_enable_
 
int disable_path_error_
 
int reset_buffer_if_error_
 
double list_packets [LISTLENGTH]
 
double list_acks [LISTLENGTH]
 
int pointer_packets_
 
int pointer_acks_
 
long list_packets_max_time_
 
long list_acks_max_time_
 
bool packets_array_full
 
bool acks_array_full
 
double alpha_
 
int max_ack_error_
 
int ack_warnings_counter_
 
bool ack_error_state
 
vector< buffer_elementbuffer_data
 
uint32_t buffer_max_size_
 
long pkt_stored_
 
long pkt_tx_
 
int safe_timer_buffer_
 
double timer_route_validity_
 
double timer_sink_probe_validity_
 
double timer_buffer_
 
double timer_search_path_
 
RemoveHopTableTimer rmhopTableTmr_
 
SinkProbeTimer sinkProbeTimer_
 
BufferTimer bufferTmr_
 
SearchPathTimer searchPathTmr_
 
bool trace_
 
chartrace_file_name_
 
ostringstream osstream_
 
ofstream trace_file_
 
char trace_separator_
 
int data_and_hops [MAX_HOP_NUMBER]
 
std::map< uint8_t, uintpaths_selected
 
long n_paths_established
 
uint max_retx_
 

Static Protected Attributes

static long number_of_pathestablishment_ = 0
 
static long number_of_datapkt_ = 0
 
static long number_of_ackpkt_ = 0
 
static long number_of_drops_buffer_full_ = 0
 
static long number_of_drops_maxretx_ = 0
 
static long number_of_pkt_forwarded_ = 0
 

Private Member Functions

 SunIPRoutingNode (const SunIPRoutingNode &)
 

Friends

class RemoveHopTableTimer
 
class AckWaiting
 
class SinkProbeTimer
 
class BufferTimer
 
class SearchPathTimer
 

Detailed Description

SunIPRoutingNode class is used to represent the routing layer of a node.

Definition at line 196 of file sun-ipr-node.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
HOPCOUNT 
SNR 
LESSCONGESTED 

Definition at line 828 of file sun-ipr-node.h.

Constructor & Destructor Documentation

◆ SunIPRoutingNode() [1/2]

SunIPRoutingNode::SunIPRoutingNode ( )

Constructor of SunIPRoutingNode class.

Definition at line 91 of file sun-ipr-node.cpp.

◆ ~SunIPRoutingNode()

SunIPRoutingNode::~SunIPRoutingNode ( )
virtual

Destructor of SunIPRoutingNode class.

Definition at line 160 of file sun-ipr-node.cpp.

◆ SunIPRoutingNode() [2/2]

SunIPRoutingNode::SunIPRoutingNode ( const SunIPRoutingNode )
private

Copy constructor declared as private.

It is not possible to create a new SunIPRoutingNode object passing to its constructor another SunIPRoutingNode object.

Parameters
SunIPRoutingNode&SunIPRoutingNode object.

Member Function Documentation

◆ addMyIpInList()

const bool SunIPRoutingNode::addMyIpInList ( Packet p)
protectedvirtual

Adds the IP of the current node in the header of a Path Establishment packet passed as argument.

It can do it if there is at least one free block. The function returns true if it added the IP, false otherwise.

Parameters
Packet*Pointer to a Path Establishment Search packet in which to add an IP.
Returns
true if the IP was added, false otherwise.

Definition at line 205 of file sun-ipr-node-pathest-search.cpp.

◆ answerPath()

void SunIPRoutingNode::answerPath ( const Packet p_old)
protectedvirtual

Creates and sends an Path Establishment Answer packet.

Parameters
Packet*Pointer to a Path Establishment packet with the option field set to Search.
See also
SunIPRoutingNode::getNumberOfHopToSink()
SunIPRoutingNode::initPktPathEstAnswer(Packet*, const Packet*)

Definition at line 54 of file sun-ipr-node-pathest-answer.cpp.

◆ bufferManager()

void SunIPRoutingNode::bufferManager ( )
protectedvirtual

Manage the buffer of the data packets.

Definition at line 58 of file sun-ipr-node-buffermanager.cpp.

◆ clearHops()

void SunIPRoutingNode::clearHops ( )
protectedvirtual

Clears all the route information of the current node.

Definition at line 197 of file sun-ipr-node.cpp.

◆ command()

int SunIPRoutingNode::command ( int  argc,
const char *const argv 
)
protectedvirtual

TCL command interpreter.

It implements the following OTcl methods:

Parameters
argcNumber of arguments in argv.
argvArray 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.

Definition at line 329 of file sun-ipr-node.cpp.

◆ createRouteError()

void SunIPRoutingNode::createRouteError ( const Packet p_data,
Packet p 
)
protectedvirtual

Used to create a route error packet.

This packet will be sent by the current node to the source of the data packet that generated the error.

Parameters
Packet*Pointer to a Data packet that the current node is unable to forward.
Packet*Pointer to a Route error packet already allocated to initialize with proper values.
See also
SunIPRoutingNode::initPktPathEstSearch(Packet*)

Definition at line 111 of file sun-ipr-node-ack.cpp.

◆ createTraceString()

string SunIPRoutingNode::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

Function that accepts a list of string and create an entry for the trace file.

Definition at line 1007 of file sun-ipr-node.cpp.

◆ evaluatePath()

const int & SunIPRoutingNode::evaluatePath ( const Packet p)
protectedvirtual

Evaluates the route information contained in a Path Establishment packet, and according to different metrics it evaluates if the path contained in the packet is the new best route.

Parameters
Packet*Pointer to a Path Establishment packet to evaluate.
Returns
Number of hops that separate the current node to the sink.
See also
SunIPRoutingNode::clearHops()
SunIPRoutingNode::setNumberOfHopToSink(const int&)
SunIPRoutingNode::getNumberOfHopToSink()

Definition at line 306 of file sun-ipr-node-pathest-answer.cpp.

◆ expTimerHopTable()

void SunIPRoutingNode::expTimerHopTable ( )
protectedvirtual

This function is invoked when the timer of the routing table expires.

It removes all the information about routing information and sink association.

See also
SunIPRoutingNode::clearHops()
SunIPRoutingNode::setNumberOfHopToSink(const int&)

Definition at line 945 of file sun-ipr-node.cpp.

◆ forwardDataPacket()

void SunIPRoutingNode::forwardDataPacket ( Packet p)
protectedvirtual

Forwards a data packet to the next hop.

All the information to route the packet are contained in the packet. If the current node is in the coverage are of the sink it will forward the packet directly to the sink, otherwise the packet will be forwarded to the next hop.

Parameters
Packet*Pointer to a Data packet to forward.

Definition at line 88 of file sun-ipr-node-data.cpp.

◆ getAckCount()

const long & SunIPRoutingNode::getAckCount ( ) const
inlineprotected

Returns the number of Ack packets processed by the entire network.

Returns
Number of Ack packets processed by the entire network.

Definition at line 707 of file sun-ipr-node.h.

◆ getAckHeaderSize()

static const int SunIPRoutingNode::getAckHeaderSize ( )
inlinestaticprotected

Returns the size in byte of a hdr_sun_ack packet header.

Returns
The size of a hdr_sun_ack packet header.

Definition at line 674 of file sun-ipr-node.h.

◆ getAcksLastMinute()

const int SunIPRoutingNode::getAcksLastMinute ( ) const
protectedvirtual

Returns the number of acks received by the current node in the last interval of time (MINUTE).

Returns
Number of acks received by the current node in the last interval of time (MINUTE).
See also
MINUTE.

Definition at line 118 of file sun-ipr-node-loadmetric.cpp.

◆ getDataCount()

const long & SunIPRoutingNode::getDataCount ( ) const
inlineprotected

Returns the number of Data packets processed by the entire network.

Returns
Number of Data packets processed by the entire network.

Definition at line 718 of file sun-ipr-node.h.

◆ getDataDropsCountBuffer()

const long & SunIPRoutingNode::getDataDropsCountBuffer ( ) const
inlineprotected

Returns the number of packets dropped by the entire network for the reason: buffer is full.

Returns
Number of packets dropped by the entire network.

Definition at line 741 of file sun-ipr-node.h.

◆ getDataDropsCountMaxRetx()

const long & SunIPRoutingNode::getDataDropsCountMaxRetx ( ) const
inlineprotected

Returns the number of packets dropped by the entire network for the reason: maximum number of retransmission reached.

Returns
Number of packets dropped by the entire network.

Definition at line 753 of file sun-ipr-node.h.

◆ getDataPktHeaderSize()

static const int SunIPRoutingNode::getDataPktHeaderSize ( )
inlinestaticprotected

Returns the size in byte of a hdr_sun_data packet header.

Returns
The size of a hdr_sun_data packet header.

Definition at line 685 of file sun-ipr-node.h.

◆ getDelay()

const double SunIPRoutingNode::getDelay ( const double period_) const
inlineprotected

Returns a delay value to use in transmission.

The delay can be 0 or poissonian accordingly with the flag PoissonTraffic_.

Returns
Transmission delay.
See also
PoissonTraffic_
periodPoissonTraffic_

Definition at line 367 of file sun-ipr-node.h.

◆ getForwardedCount()

const long & SunIPRoutingNode::getForwardedCount ( ) const
inlineprotected

Returns the number of Data packets forwarded by the entire network.

Returns
Number of Data packets forwarded by the entire network.

Definition at line 729 of file sun-ipr-node.h.

◆ getLoad()

const double SunIPRoutingNode::getLoad ( ) const
protectedvirtual

Returns the load index of the current node combining the information from getPacketsLastMinute() and getAcksLastMinute() functions.

Returns
The load index of the current node.
See also
SunIPRoutingNode::getPacketsLastMinute()
SunIPRoutingNode::getAcksLastMinute()

Definition at line 156 of file sun-ipr-node-loadmetric.cpp.

◆ getNPathsEstablished()

const long & SunIPRoutingNode::getNPathsEstablished ( )
inlineprotected

Print how many times the node was established as relay node for other nodes of the netwok.

Returns
number of times the node was established as relay node

Definition at line 326 of file sun-ipr-node.h.

◆ getNumberOfHopToSink()

const int & SunIPRoutingNode::getNumberOfHopToSink ( ) const
protectedvirtual

Returns the number of hops that separate the node to the sink.

  • 0 means no routing information;
  • 1 means directly connected with the sink;
  • a value > 1 correspond to the number of hops;
Returns
The number of hops that separate the node to the sink.
See also
SunIPRoutingNode::getNumberOfHopToSink()

Definition at line 865 of file sun-ipr-node.cpp.

◆ getPacketsLastMinute()

const int SunIPRoutingNode::getPacketsLastMinute ( ) const
protectedvirtual

Returns the number of packets processed by the current node in the last interval of time (MINUTE).

Returns
Number of packets processed by the current node in the last interval of time (MINUTE).
See also
MINUTE.

Definition at line 76 of file sun-ipr-node-loadmetric.cpp.

◆ getPathEstablishmentCount()

const long & SunIPRoutingNode::getPathEstablishmentCount ( ) const
inlineprotected

Returns the number of Path Establishment packets processed by the entire network.

Returns
Number of Path Establishment Packets processed by the entire network.

Definition at line 766 of file sun-ipr-node.h.

◆ getPathEstHeaderSize()

static const int SunIPRoutingNode::getPathEstHeaderSize ( )
inlinestaticprotected

Returns the size in byte of a hdr_sun_path_est packet header.

Returns
The size of a hdr_sun_path_est packet header.

Definition at line 696 of file sun-ipr-node.h.

◆ initialize()

void SunIPRoutingNode::initialize ( )
protectedvirtual

Initializes a SunIPRoutingNode node.

It sends to the lower layers a Sync message asking for the IP of the node.

See also
UWIPClMsgReqAddr(int src)
sendSyncClMsgDown(ClMessage* m)

Definition at line 236 of file sun-ipr-node.cpp.

◆ initPktAck()

void SunIPRoutingNode::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.
See also
SunIPRoutingNode::initPktAck(Packet*)

Definition at line 80 of file sun-ipr-node-ack.cpp.

◆ initPktDataPacket()

void SunIPRoutingNode::initPktDataPacket ( Packet p)
protectedvirtual

Initializes a data packet passed as argument with the default values.

Parameters
Packet*Pointer to a packet already allocated to fill with the right values.

Definition at line 49 of file sun-ipr-node-data.cpp.

◆ initPktPathEstAnswer()

void SunIPRoutingNode::initPktPathEstAnswer ( Packet new_pkt,
const Packet old_pkt 
)
protectedvirtual

Initializes a Path Establishment Answer packet (previously allocated) retrieving the information from a Path Establishment Request packet.

Parameters
Packet*Pointer to a Path Establishment packet with the option field set to Answer to initialize.
Packet*Pointer to a Path Establishment packet with the option field set to Search.

Definition at line 92 of file sun-ipr-node-pathest-answer.cpp.

◆ initPktPathEstSearch()

void SunIPRoutingNode::initPktPathEstSearch ( Packet p) const
protectedvirtual

Initializes a Path Establishment Search packet (previously allocated).

Parameters
Packet*Pointer to a Path Establishment Packet with the option field set to Search to initialize.

Definition at line 95 of file sun-ipr-node-pathest-search.cpp.

◆ isMyIpInList()

const bool SunIPRoutingNode::isMyIpInList ( const Packet p) const
protectedvirtual

Checks if the IP of the current node is in the header of the packet passed as argument.

If yes it returns true, otherwise it return false.

Parameters
Packet*Pointer to a Path Establishment packet to analyze.
Returns
true if the IP of the current node is in the header, otherwise false.

Definition at line 228 of file sun-ipr-node-pathest-search.cpp.

◆ isZero()

const bool SunIPRoutingNode::isZero ( const double value) const
inlineprotected

Evaluates is the number passed as input is equal to zero.

When C++ works with double and float number you can't compare them with 0. If the absolute value of the number is smaller than eplison that means that the number is equal to zero.

Parameters
double&Number to evaluate.
Returns
true if the number passed in input is equal to zero, false otherwise.
See also
std::numeric_limits<double>::epsilon()

Definition at line 389 of file sun-ipr-node.h.

◆ lostSink()

void SunIPRoutingNode::lostSink ( )
protectedvirtual

This function removes all the information about routing information and sink association.

See also
SunIPRoutingNode::clearHops()
SunIPRoutingNode::setNumberOfHopToSink(const int&)

Definition at line 920 of file sun-ipr-node.cpp.

◆ printHopTable()

void SunIPRoutingNode::printHopTable ( ) const
protectedvirtual

Prints in the stdout the routing table of the current node.

Definition at line 250 of file sun-ipr-node.cpp.

◆ printIP() [1/2]

string SunIPRoutingNode::printIP ( const ns_addr_t ipt_)
staticprotected

Returns a string with an IP in the classic form "x.x.x.x" converting an ns2 ns_addr_t address.

Parameters
ns_addr_t&ns2 address
Returns
String that contains a printable IP in the classic form "x.x.x.x"

Definition at line 298 of file sun-ipr-node.cpp.

◆ printIP() [2/2]

string SunIPRoutingNode::printIP ( const nsaddr_t ip_)
staticprotected

Returns a string with an IP in the classic form "x.x.x.x" converting an ns2 nsaddr_t address.

Parameters
nsaddr_t&ns2 address
Returns
String that contains a printable IP in the classic form "x.x.x.x"

Definition at line 279 of file sun-ipr-node.cpp.

◆ printSelectedRoutes()

void SunIPRoutingNode::printSelectedRoutes ( ) const
protectedvirtual

Print the nodes that were chosen as relay nodes to rach the sink and how many times each node was chosen.

Definition at line 263 of file sun-ipr-node.cpp.

◆ receiveProbe()

void SunIPRoutingNode::receiveProbe ( const Packet p)
protectedvirtual

Invoked when the node receives a probe packet from a sink.

It is used to update the information about routes.

Parameters
Packet*Pointer to a Probe packet.
See also
SunIPRoutingNode::clearHops()
SunIPRoutingNode::setNumberOfHopToSink(const int&)

Definition at line 873 of file sun-ipr-node.cpp.

◆ recv()

void SunIPRoutingNode::recv ( Packet p)
protectedvirtual

Performs the reception of packets from upper and lower layers.

Parameters
Packet*Pointer to the packet will be received.

Definition at line 450 of file sun-ipr-node.cpp.

◆ recvAsyncClMsg()

int SunIPRoutingNode::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.

Definition at line 183 of file sun-ipr-node.cpp.

◆ recvSyncClMsg()

int SunIPRoutingNode::recvSyncClMsg ( ClMessage *  m)
protectedvirtual

Cross-Layer messages synchronous interpreter.

Parameters
ClMessage*an instance of ClMessage that represent the message received
Returns
0 if successful.

Definition at line 175 of file sun-ipr-node.cpp.

◆ replyPathEstSearch()

void SunIPRoutingNode::replyPathEstSearch ( Packet p)
protectedvirtual

Replies to Path Establishment Search packets.

It adds in the packet the IP of the current node and forwards or replies to the request.

Parameters
Packet*Pointer to a Path Establishment Search packets to process.
See also
SunIPRoutingNode::isMyIpInList(const Packet*)
SunIPRoutingNode::addMyIpInList(Packet*)
SunIPRoutingNode::updateQuality(Packet*)
SunIPRoutingNode::getNumberOfHopToSink()
SunIPRoutingNode::answerPath(const Packet*)

Definition at line 134 of file sun-ipr-node-pathest-search.cpp.

◆ searchPath()

void SunIPRoutingNode::searchPath ( )
protectedvirtual

Sends a Path Establishment Packet with the option field sets to Search.

It also remove all the information about current routes to the sink.

See also
SunIPRoutingNode::clearHops()
SunIPRoutingNode::setNumberOfHopToSink(const int&)
SunIPRoutingNode::initPktPathEstSearch(Packet*)

Definition at line 54 of file sun-ipr-node-pathest-search.cpp.

◆ searchPathExpire()

void SunIPRoutingNode::searchPathExpire ( )
protectedvirtual

This function enable the possibility to send a new Seath Path packet.

It is used to avoid too many control packets in network in a high load condition.

Definition at line 933 of file sun-ipr-node.cpp.

◆ sendBackAck()

void SunIPRoutingNode::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
SunIPRoutingNode::initPktAck()
SunIPRoutingNode::clearHops()
SunIPRoutingNode::setNumberOfHopToSink(const int&)

Definition at line 47 of file sun-ipr-node-ack.cpp.

◆ sendRouteBack()

void SunIPRoutingNode::sendRouteBack ( Packet p)
protectedvirtual

Forwards a Path Establishment Answer Packet.

Adds the information about the route in the routing table of the current node.

Parameters
Packet*Pointer to a Path Establishment packet with option field set to ANSWER to forward.
See also
SunIPRoutingNode::clearHops()
SunIPRoutingNode::setNumberOfHopToSink(const int&)

Definition at line 162 of file sun-ipr-node-pathest-answer.cpp.

◆ sendRouteErrorBack()

void SunIPRoutingNode::sendRouteErrorBack ( Packet p)
protectedvirtual

Send back an error packet to the previous hop.

It uses the information contained in the header of the packet.

Parameters
Packet*Pointer to a Packet to forward to the next hop.

Definition at line 160 of file sun-ipr-node-ack.cpp.

◆ setNumberOfHopToSink()

const int & SunIPRoutingNode::setNumberOfHopToSink ( const int hop)
protectedvirtual

Sets the number of hops that the current node needs to reach the sink.

Parameters
int&Number of hops to the sink. The value must be greater or equal to 1.
Returns
Number of hops that separate the current node to the sink.

Definition at line 846 of file sun-ipr-node.cpp.

◆ str2addr()

nsaddr_t SunIPRoutingNode::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
char*IP in string form
Returns
nsaddr_t that contains the IP converter from the input string

Definition at line 304 of file sun-ipr-node.cpp.

◆ tracePacket()

void SunIPRoutingNode::tracePacket ( const Packet * const  p,
const string position = "UNDEF___" 
)
protectedvirtual

Traces a packet.

Parameters
Packetto be traced.
Stringoptional for the packet.

Definition at line 960 of file sun-ipr-node.cpp.

◆ updateAcksCount()

void SunIPRoutingNode::updateAcksCount ( )
protectedvirtual

Updates the number of acks received by the current node.

To be used when the node receives an ack.

Definition at line 60 of file sun-ipr-node-loadmetric.cpp.

◆ updatePacketsCount()

void SunIPRoutingNode::updatePacketsCount ( )
protectedvirtual

Updates the number of packets processed by the current node.

To be used when the node receives or generates a packet.

Definition at line 46 of file sun-ipr-node-loadmetric.cpp.

◆ updateQuality()

void SunIPRoutingNode::updateQuality ( Packet p)
protectedvirtual

Updates the field quality in the packet passed as parameter.

The value written in the packet depends on the metric field.

Parameters
Packet*Pointer to a packet in which to update the quality field.

Definition at line 245 of file sun-ipr-node-pathest-search.cpp.

◆ writeInTrace()

void SunIPRoutingNode::writeInTrace ( const string string_to_write_)
protectedvirtual

Opens the trace file, writes the string passed as input and closes the file.

Parameters
Stringto write in the trace file.

Definition at line 1031 of file sun-ipr-node.cpp.

Friends And Related Symbol Documentation

◆ AckWaiting

Friend class used to implement the timer on Acks.

See also
SinkProbeTimer

Definition at line 211 of file sun-ipr-node.h.

◆ BufferTimer

Friend class used to implement the timer on the Buffer.

See also
BufferTimer

Definition at line 225 of file sun-ipr-node.h.

◆ RemoveHopTableTimer

Friend class used to implement the timer on Hop Tables.

See also
SinkProbeTimer

Definition at line 204 of file sun-ipr-node.h.

◆ SearchPathTimer

Friend class used to implement the timer on the Search Path mechanism.

See also
SearchPathTimer

Definition at line 232 of file sun-ipr-node.h.

◆ SinkProbeTimer

Friend class used to implement the timer on Probes.

See also
SinkProbeTimer

Definition at line 218 of file sun-ipr-node.h.

Member Data Documentation

◆ ack_error_state

bool SunIPRoutingNode::ack_error_state
protected

true if the node is not in an error state (that means that it discovered a broken link), false if the link to the next hop is considered valid.

Definition at line 898 of file sun-ipr-node.h.

◆ ack_warnings_counter_

int SunIPRoutingNode::ack_warnings_counter_
protected

Number of acks lost since the last reset.

Definition at line 897 of file sun-ipr-node.h.

◆ acks_array_full

bool SunIPRoutingNode::acks_array_full
protected

true if list of acks is full, false otherwise.

Definition at line 889 of file sun-ipr-node.h.

◆ alpha_

double SunIPRoutingNode::alpha_
protected

Parameters used by Load metric.

It is a correlation factor.

Definition at line 891 of file sun-ipr-node.h.

◆ buffer_data

vector<buffer_element> SunIPRoutingNode::buffer_data
protected

Buffer used to store data packets.

Definition at line 906 of file sun-ipr-node.h.

◆ buffer_max_size_

uint32_t SunIPRoutingNode::buffer_max_size_
protected

Maximum length of the data buffer.

Definition at line 907 of file sun-ipr-node.h.

◆ bufferTmr_

BufferTimer SunIPRoutingNode::bufferTmr_
protected

BufferTimer object.

Definition at line 929 of file sun-ipr-node.h.

◆ data_and_hops

int SunIPRoutingNode::data_and_hops[MAX_HOP_NUMBER]
protected

Structure that contains the number of data packets sent by the current node to the sink, for different values of hop count.

It is used for statistics purposes.

Definition at line 945 of file sun-ipr-node.h.

◆ disable_path_error_

int SunIPRoutingNode::disable_path_error_
protected

Flag to enable or disable the possibility to send Path Error packets.

Definition at line 862 of file sun-ipr-node.h.

◆ hop_table

nsaddr_t* SunIPRoutingNode::hop_table
protected

List of IPs to reach the sink.

Definition at line 852 of file sun-ipr-node.h.

◆ hop_table_length

int SunIPRoutingNode::hop_table_length
protected

Current length of the hop_table.

Definition at line 853 of file sun-ipr-node.h.

◆ ipAddr_

nsaddr_t SunIPRoutingNode::ipAddr_
protected

IP of the current node.

Definition at line 835 of file sun-ipr-node.h.

◆ list_acks

double SunIPRoutingNode::list_acks[LISTLENGTH]
protected

List of the last LISTLENGTH temporal instants in which the node received acks.

Definition at line 875 of file sun-ipr-node.h.

◆ list_acks_max_time_

long SunIPRoutingNode::list_acks_max_time_
protected

Clock of the last ack received by the node.

Definition at line 884 of file sun-ipr-node.h.

◆ list_packets

double SunIPRoutingNode::list_packets[LISTLENGTH]
protected

List of the last LISTLENGTH temporal instants in which the node received data packets.

Definition at line 871 of file sun-ipr-node.h.

◆ list_packets_max_time_

long SunIPRoutingNode::list_packets_max_time_
protected

Clock of the last packet received by the node.

Definition at line 882 of file sun-ipr-node.h.

◆ LISTLENGTH

const int SunIPRoutingNode::LISTLENGTH = 30
static

Used by the load metric to set the number of the acks tracked.

Definition at line 245 of file sun-ipr-node.h.

◆ max_ack_error_

int SunIPRoutingNode::max_ack_error_
protected

Maximum number of Ack errors tollerated by the node.

Definition at line 895 of file sun-ipr-node.h.

◆ max_retx_

uint SunIPRoutingNode::max_retx_
protected

Maximum Number of transmissions performed: real retransmissions counter the counter is increased only when the packet is sent downlayer.

Definition at line 980 of file sun-ipr-node.h.

◆ metrics_

int SunIPRoutingNode::metrics_
protected

Metric used by the current node.

Definition at line 836 of file sun-ipr-node.h.

◆ MINUTE

const int SunIPRoutingNode::MINUTE
static
Initial value:
=
60

Used by the load metric to set the period to consider for the evaluation of the metric.

Definition at line 247 of file sun-ipr-node.h.

◆ n_paths_established

long SunIPRoutingNode::n_paths_established
protected

Number of times the node is established as realy node by the other nodes of the network.

Definition at line 956 of file sun-ipr-node.h.

◆ num_hop_to_sink

int SunIPRoutingNode::num_hop_to_sink
protected

Number of hops needed to reach the sink using tha path saved tn the routing table.

If the node is directly connected this value is equal to 1, is the node doesn't have any valid path to the sink this value is equal to 0

Definition at line 845 of file sun-ipr-node.h.

◆ number_of_ackpkt_

long SunIPRoutingNode::number_of_ackpkt_ = 0
staticprotected

Comulative number of Ack packets processed by SunIPRoutingNode objects.

Definition at line 965 of file sun-ipr-node.h.

◆ number_of_datapkt_

long SunIPRoutingNode::number_of_datapkt_ = 0
staticprotected

Comulative number of Data packets processed by SunIPRoutingNode objects.

Definition at line 963 of file sun-ipr-node.h.

◆ number_of_drops_buffer_full_

long SunIPRoutingNode::number_of_drops_buffer_full_ = 0
staticprotected

Comulative number of packets dropped by SunIPRoutingNode objects, reason: the buffer is full.

Definition at line 968 of file sun-ipr-node.h.

◆ number_of_drops_maxretx_

long SunIPRoutingNode::number_of_drops_maxretx_ = 0
staticprotected

Comulative number of packets dropped by SunIPRoutingNode objects, reason: max number of retransmission reached.

Definition at line 972 of file sun-ipr-node.h.

◆ number_of_pathestablishment_

long SunIPRoutingNode::number_of_pathestablishment_ = 0
staticprotected

Comulative number of Path Establishment packets processed by SunIPRoutingNode objects.

Definition at line 960 of file sun-ipr-node.h.

◆ number_of_pkt_forwarded_

long SunIPRoutingNode::number_of_pkt_forwarded_ = 0
staticprotected

Comulative number of Data packets forwarded by the network.

Definition at line 977 of file sun-ipr-node.h.

◆ osstream_

ostringstream SunIPRoutingNode::osstream_
protected

Used to convert to string.

Definition at line 938 of file sun-ipr-node.h.

◆ packets_array_full

bool SunIPRoutingNode::packets_array_full
protected

true if list of packets is full, false otherwise.

Definition at line 886 of file sun-ipr-node.h.

◆ paths_selected

std::map<uint8_t, uint> SunIPRoutingNode::paths_selected
protected

Map containing the nodes selected as relay to the sink and the number of times each node was selected.

Definition at line 952 of file sun-ipr-node.h.

◆ period_data_

double SunIPRoutingNode::period_data_
protected

Period of the Poisson traffic for data packets in the buffer.

Definition at line 842 of file sun-ipr-node.h.

◆ period_status_

double SunIPRoutingNode::period_status_
protected

Period of the Poisson traffic for status and ack packets.

Definition at line 840 of file sun-ipr-node.h.

◆ pkt_stored_

long SunIPRoutingNode::pkt_stored_
protected

Keep track of the total number of packet transmitted.

Definition at line 909 of file sun-ipr-node.h.

◆ pkt_tx_

long SunIPRoutingNode::pkt_tx_
protected

Keep track of the total number of packet retransmitted.

Definition at line 911 of file sun-ipr-node.h.

◆ pointer_acks_

int SunIPRoutingNode::pointer_acks_
protected

Pointer of the first avaiable space in list_acks list.

Definition at line 880 of file sun-ipr-node.h.

◆ pointer_packets_

int SunIPRoutingNode::pointer_packets_
protected

Pointer of the first avaiable space in list_packets list.

Definition at line 878 of file sun-ipr-node.h.

◆ PoissonTraffic_

int SunIPRoutingNode::PoissonTraffic_
protected

Enable (1) or disable (0) the Poisson traffic for SUN packets.

Definition at line 837 of file sun-ipr-node.h.

◆ printDebug_

int SunIPRoutingNode::printDebug_
protected

Flag to enable or disable dirrefent levels of debug.

Definition at line 855 of file sun-ipr-node.h.

◆ probe_min_snr_

double SunIPRoutingNode::probe_min_snr_
protected

Value below which if a node receives a probe it discards it.

Definition at line 857 of file sun-ipr-node.h.

◆ quality_link

double SunIPRoutingNode::quality_link
protected

Quality of the link from the node to the sink.

Definition at line 851 of file sun-ipr-node.h.

◆ reset_buffer_if_error_

int SunIPRoutingNode::reset_buffer_if_error_
protected

If == 1 when a node identify a broken link it will automatically free its buffer.

Definition at line 865 of file sun-ipr-node.h.

◆ rmhopTableTmr_

RemoveHopTableTimer SunIPRoutingNode::rmhopTableTmr_
protected

RemoveHopTableTimer object.

Definition at line 927 of file sun-ipr-node.h.

◆ safe_timer_buffer_

int SunIPRoutingNode::safe_timer_buffer_
protected

Enables a mechanism used to modify the timer_buffer_ in case of the sending time is shorter than the time needed to receive acks.

Definition at line 914 of file sun-ipr-node.h.

◆ search_path_enable_

bool SunIPRoutingNode::search_path_enable_
protected

Flag to enable or disable the possibility to send search_path packets.

Definition at line 860 of file sun-ipr-node.h.

◆ searchPathTmr_

SearchPathTimer SunIPRoutingNode::searchPathTmr_
protected

SearchPathTimer object.

Definition at line 930 of file sun-ipr-node.h.

◆ sink_associated

nsaddr_t SunIPRoutingNode::sink_associated
protected

IP of the sink associated to the node.

Definition at line 854 of file sun-ipr-node.h.

◆ sinkProbeTimer_

SinkProbeTimer SunIPRoutingNode::sinkProbeTimer_
protected

SinkProbeTimer object.

Definition at line 928 of file sun-ipr-node.h.

◆ snr_to_sink_

double SunIPRoutingNode::snr_to_sink_
protected

SNR between the sink and the current node.

Definition at line 859 of file sun-ipr-node.h.

◆ timer_buffer_

double SunIPRoutingNode::timer_buffer_
protected

Timer for buffer management.

Definition at line 924 of file sun-ipr-node.h.

◆ timer_route_validity_

double SunIPRoutingNode::timer_route_validity_
protected

Maximum validity time for a route entry.

Definition at line 920 of file sun-ipr-node.h.

◆ timer_search_path_

double SunIPRoutingNode::timer_search_path_
protected

Timer for the search path mechanism.

Definition at line 925 of file sun-ipr-node.h.

◆ timer_sink_probe_validity_

double SunIPRoutingNode::timer_sink_probe_validity_
protected

Maximum validity time for a sink probe.

Definition at line 922 of file sun-ipr-node.h.

◆ trace_

bool SunIPRoutingNode::trace_
protected

Flag used to enable or disable the trace file for nodes,.

Definition at line 933 of file sun-ipr-node.h.

◆ trace_file_

ofstream SunIPRoutingNode::trace_file_
protected

Ofstream used to write the trace file in the disk.

Definition at line 939 of file sun-ipr-node.h.

◆ trace_file_name_

char* SunIPRoutingNode::trace_file_name_
protected

Name of the trace file writter for the current node.

Definition at line 936 of file sun-ipr-node.h.

◆ trace_separator_

char SunIPRoutingNode::trace_separator_
protected

Used as separator among elements in an entr of the tracefile.

Definition at line 941 of file sun-ipr-node.h.


The documentation for this class was generated from the following files: