52 std::cout <<
"> initPktDataPacket()" << std::endl;
59 ch->direction() = hdr_cmn::DOWN;
79 ch->timestamp() = Scheduler::instance().clock();
91 std::cout <<
"> forwardDataPacket()" << std::endl;
96 if (
hdata->list_of_hops_length() <= 0) {
98 }
else if (
hdata->list_of_hops_length() > 0) {
105 ch->next_hop() =
hdata->list_of_hops()[
i_ + 1];
111 std::cout <<
"[" <<
NOW
114 <<
"]::PACKET::UID:" << ch->uid()
117 <<
"::FORWARDED_TO:" <<
printIP(
ch->next_hop())
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.
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.
nsaddr_t * hop_table
List of IPs to reach the sink.
virtual void forwardDataPacket(Packet *)
Forwards a data packet to the next hop.
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.
int hop_table_length
Current length of the hop_table.
static long number_of_pkt_forwarded_
Comulative number of Data packets forwarded by the network.
nsaddr_t sink_associated
IP of the sink associated to the node.
double period_data_
Period of the Poisson traffic for data packets in the buffer.
const double getDelay(const double &period_) const
Returns a delay value to use in transmission.
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.
hdr_sun_data describes data packets used by UWSUN
uint8_t * list_of_hops()
Pointer to the list_of_hops_ variable.
hdr_uwip describes UWIP packets.
#define DROP_DATA_HOPS_LENGTH_EQUALS_ZERO
Reason for a drop in a UWSUN module.
#define STACK_TRACE
Used to keep track of methods call.
Dinamic source routing protocol, this file contains Nodes specifications.