54 module->bufferManager();
94 if (iph->
daddr() == 0) {
97 _tmp.t_last_tx_ = Scheduler::instance().clock();
118 _tmp.t_last_tx_ = Scheduler::instance().clock();
136 std::cout <<
"[" <<
NOW
139 <<
"]::PACKET_SENT::RETX:" << _tmp.
retx_
140 <<
"::UID:" <<
ch->uid()
141 <<
"::SN:" <<
uwcbrh->sn()
144 for (
int i = 0;
i <
hdata->list_of_hops_length();
i++) {
147 std::cout << std::endl;
157 if (iph->
daddr() == 0) {
161 _tmp.num_attempts_++;
162 _tmp.t_last_tx_ = Scheduler::instance().clock();
173 _tmp.num_attempts_++;
174 _tmp.t_last_tx_ = Scheduler::instance().clock();
181 _tmp.num_attempts_++;
182 _tmp.t_last_tx_ = Scheduler::instance().clock();
191 std::cout <<
"[" <<
NOW
194 <<
"]::PACKET_WAITING::NO_ROUTE::RETX:" << _tmp.
retx_
195 <<
"::UID:" <<
ch->uid()
196 <<
"::SN:" <<
uwcbrh->sn()
202 if (iph->
daddr() == 0) {
214 _tmp.t_last_tx_ = Scheduler::instance().clock();
232 _tmp.t_last_tx_ = Scheduler::instance().clock();
248 std::cout <<
"[" <<
NOW
251 <<
"]::PACKET_SENT::RETX:" << _tmp.
retx_
252 <<
"::UID:" <<
ch->uid()
253 <<
"::SN:" <<
uwcbrh->sn()
256 for (
int i = 0;
i <
hdata->list_of_hops_length();
i++) {
259 std::cout << std::endl;
280 if (
ch->next_hop() ==
this->sink_associated) {
283 }
else if (ch->next_hop() != 0 &&
311 std::cout <<
"[" <<
NOW
314 <<
"]::INVALID_PACKET::UID:" << ch->uid()
315 <<
"::SN:" <<
uwcbrh->sn()
SunIPRoutingNode *virtual void expire(Event *e)
< Pointer to an objet of type SunIPRoutingNode.
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.
uint max_retx_
Maximum Number of transmissions performed: real retransmissions counter the counter is increased only...
vector< buffer_element > buffer_data
Buffer used to store data packets.
ostringstream osstream_
Used to convert to string.
bool search_path_enable_
Flag to enable or disable the possibility to send search_path packets.
static long number_of_datapkt_
Comulative number of Data packets processed by SunIPRoutingNode objects.
virtual void initPktDataPacket(Packet *)
Initializes a data packet passed as argument with the default values.
virtual void createRouteError(const Packet *, Packet *)
Used to create a route error packet.
virtual void clearHops()
Clears all the route information of the current node.
nsaddr_t * hop_table
List of IPs to reach the sink.
virtual void forwardDataPacket(Packet *)
Forwards a data packet to the next hop.
int disable_path_error_
Flag to enable or disable the possibility to send Path Error packets.
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 void bufferManager()
Manage the buffer of the data packets.
int data_and_hops[MAX_HOP_NUMBER]
Structure that contains the number of data packets sent by the current node to the sink,...
int reset_buffer_if_error_
If == 1 when a node identify a broken link it will automatically free its buffer.
static long number_of_pkt_forwarded_
Comulative number of Data packets forwarded by the network.
BufferTimer bufferTmr_
BufferTimer object.
nsaddr_t sink_associated
IP of the sink associated to the node.
double timer_buffer_
Timer for buffer management.
virtual const int & setNumberOfHopToSink(const int &)
Sets the number of hops that the current node needs to reach the sink.
double period_data_
Period of the Poisson traffic for data packets in the buffer.
SearchPathTimer searchPathTmr_
SearchPathTimer object.
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 max_ack_error_
Maximum number of Ack errors tollerated by the node.
int printDebug_
Flag to enable or disable dirrefent levels of debug.
virtual void tracePacket(const Packet *const, const string &position="UNDEF___")
Traces a packet.
nsaddr_t ipAddr_
IP of the current node.
long pkt_tx_
Keep track of the total number of packet retransmitted.
double timer_search_path_
Timer for the search path mechanism.
static long number_of_drops_maxretx_
Comulative number of packets dropped by SunIPRoutingNode objects, reason: max number of retransmissio...
buffer_element describes an entry in the buffer used by SUN.
unsigned int retx_
Real retransmission counter: incremented only if packet is sent donwlayer.
Packet * p_
Pointer to the packet buffered.
hdr_sun_data describes data packets used by UWSUN
hdr_uwcbr describes UWCBR packets.
hdr_uwip describes UWIP packets.
uint8_t & daddr()
Reference to the daddr_ variable.
#define STACK_TRACE
Used to keep track of methods call.
Dinamic source routing protocol, this file contains Nodes specifications.
Provides the UWCBR packets header description and the definition of the class UWCBR.