57 std::cout <<
"> searchPath()" << std::endl;
63 <<
"]::PATH_SEARCH::END_NODE"
71 Packet *p = Packet::alloc();
78 <<
"]::SENDING_SEARCH_PATH"
79 <<
"::UID:" << ch->uid()
98 std::cout <<
"> initPktPathEstSearch()" << std::endl;
105 ch->direction() = hdr_cmn::DOWN;
120 hpest->list_of_hops_length() = 0;
122 hpest->list_of_hops()[
i] = 0;
124 hpest->quality() = 0;
127 ch->timestamp() = Scheduler::instance().clock();
137 std::cout <<
"> replyPathEstSearch()" << std::endl;
150 <<
"]::PATH_SEARCH::DROP_ALREADY_PROCESSED_FROM:" <<
printIP(iph->
saddr())
151 <<
"::UID:" <<
ch->uid()
174 <<
"]::PATH_SEARCH::FORWARD"
175 <<
"::PREV_HOP:" <<
printIP(ch->prev_hop_)
177 <<
"::UID:" <<
ch->uid()
208 std::cout <<
"> addMyIpInList()" << std::endl;
216 hpest->list_of_hops_length()++;
231 std::cout <<
"> isMyIpInList()" << std::endl;
234 for (
int i = 0;
i <=
hpest->list_of_hops_length();
i++) {
248 std::cout <<
"> updateQuality()" << std::endl;
252 hpest->quality() += 1;
274 std::cerr <<
"The metric_ field of SUN was not set up." << std::endl;
virtual void replyPathEstSearch(Packet *)
Replies to Path Establishment Search packets.
static string printIP(const nsaddr_t &)
Returns a string with an IP in the classic form "x.x.x.x" converting an ns2 nsaddr_t address.
ostringstream osstream_
Used to convert to string.
virtual void clearHops()
Clears all the route information of the current node.
virtual const int getPacketsLastMinute() const
Returns the number of packets processed by the current node in the last interval of time (MINUTE).
bool trace_
Flag used to enable or disable the trace file for nodes,.
virtual const int & getNumberOfHopToSink() const
Returns the number of hops that separate the node to the sink.
virtual const bool isMyIpInList(const Packet *) const
Checks if the IP of the current node is in the header of the packet passed as argument.
virtual void initPktPathEstSearch(Packet *) const
Initializes a Path Establishment Search packet (previously allocated).
static long number_of_pathestablishment_
Comulative number of Path Establishment packets processed by SunIPRoutingNode objects.
double snr_to_sink_
SNR between the sink and the current node.
virtual void updateQuality(Packet *)
Updates the field quality in the packet passed as parameter.
double period_status_
Period of the Poisson traffic for status and ack packets.
virtual const int & setNumberOfHopToSink(const int &)
Sets the number of hops that the current node needs to reach the sink.
const double getDelay(const double &period_) const
Returns a delay value to use in transmission.
virtual void searchPath()
Sends a Path Establishment Packet with the option field sets to Search.
int printDebug_
Flag to enable or disable dirrefent levels of debug.
virtual void tracePacket(const Packet *const, const string &position="UNDEF___")
Traces a packet.
virtual const double getLoad() const
Returns the load index of the current node combining the information from getPacketsLastMinute() and ...
nsaddr_t ipAddr_
IP of the current node.
virtual const bool addMyIpInList(Packet *)
Adds the IP of the current node in the header of a Path Establishment packet passed as argument.
int metrics_
Metric used by the current node.
virtual void answerPath(const Packet *)
Creates and sends an Path Establishment Answer packet.
const bool isZero(const double &value) const
Evaluates is the number passed as input is equal to zero.
hdr_sun_path_est describes path establishment packets used by UWSUN
float & quality()
Reference to the quality_ variable.
hdr_uwip describes UWIP packets.
uint8_t & saddr()
Reference to the saddr_ variable.
#define HDR_SUN_PATH_EST(p)
Common structures and definition used by SUN.
#define MIN_SNR
Reference variable for min values for the SNR.
#define DROP_PATH_ESTABLISHMENT_SEARCH_PACKET_ALREADY_PROCESSED
Reason for a drop in a UWSUN module.
#define STACK_TRACE
Used to keep track of methods call.
#define DROP_PATH_ESTABLISHMENT_SEARCH_PACKET_HOP_LIST_FULL
Reason for a drop in a UWSUN module.
static int sunuid_
Unique identifier for UWSUN packets.
Dinamic source routing protocol, this file contains Nodes specifications.
static const int MAX_HOP_NUMBER
Maximum number of hops contained in a SUN Path Establishment packet.
static const uint8_t UWIP_BROADCAST
Variable used to represent a broadcast UWIP.