DESERT 3.5.1
|
#include <sun-ipr-node.h>
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 } |
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 () |
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 |
SunIPRoutingNode class is used to represent the routing layer of a node.
Definition at line 196 of file sun-ipr-node.h.
Enumerator | |
---|---|
HOPCOUNT | |
SNR | |
LESSCONGESTED |
Definition at line 828 of file sun-ipr-node.h.
SunIPRoutingNode::SunIPRoutingNode | ( | ) |
Constructor of SunIPRoutingNode class.
Definition at line 91 of file sun-ipr-node.cpp.
|
virtual |
Destructor of SunIPRoutingNode class.
Definition at line 160 of file sun-ipr-node.cpp.
|
private |
Copy constructor declared as private.
It is not possible to create a new SunIPRoutingNode object passing to its constructor another SunIPRoutingNode object.
SunIPRoutingNode& | SunIPRoutingNode object. |
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.
Packet* | Pointer to a Path Establishment Search packet in which to add an IP. |
Definition at line 205 of file sun-ipr-node-pathest-search.cpp.
Creates and sends an Path Establishment Answer packet.
Packet* | Pointer to a Path Establishment packet with the option field set to Search. |
Definition at line 54 of file sun-ipr-node-pathest-answer.cpp.
|
protectedvirtual |
Manage the buffer of the data packets.
Definition at line 58 of file sun-ipr-node-buffermanager.cpp.
|
protectedvirtual |
Clears all the route information of the current node.
Definition at line 197 of file sun-ipr-node.cpp.
TCL command interpreter.
It implements the following OTcl methods:
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). |
Definition at line 329 of file sun-ipr-node.cpp.
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.
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. |
Definition at line 111 of file sun-ipr-node-ack.cpp.
|
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.
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.
Packet* | Pointer to a Path Establishment packet to evaluate. |
Definition at line 306 of file sun-ipr-node-pathest-answer.cpp.
|
protectedvirtual |
This function is invoked when the timer of the routing table expires.
It removes all the information about routing information and sink association.
Definition at line 945 of file sun-ipr-node.cpp.
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.
Packet* | Pointer to a Data packet to forward. |
Definition at line 88 of file sun-ipr-node-data.cpp.
Returns the number of Ack packets processed by the entire network.
Definition at line 707 of file sun-ipr-node.h.
Returns the size in byte of a hdr_sun_ack packet header.
Definition at line 674 of file sun-ipr-node.h.
Returns the number of acks received by the current node in the last interval of time (MINUTE).
Definition at line 118 of file sun-ipr-node-loadmetric.cpp.
Returns the number of Data packets processed by the entire network.
Definition at line 718 of file sun-ipr-node.h.
Returns the number of packets dropped by the entire network for the reason: buffer is full.
Definition at line 741 of file sun-ipr-node.h.
Returns the number of packets dropped by the entire network for the reason: maximum number of retransmission reached.
Definition at line 753 of file sun-ipr-node.h.
Returns the size in byte of a hdr_sun_data packet header.
Definition at line 685 of file sun-ipr-node.h.
Returns a delay value to use in transmission.
The delay can be 0 or poissonian accordingly with the flag PoissonTraffic_.
Definition at line 367 of file sun-ipr-node.h.
Returns the number of Data packets forwarded by the entire network.
Definition at line 729 of file sun-ipr-node.h.
Returns the load index of the current node combining the information from getPacketsLastMinute() and getAcksLastMinute() functions.
Definition at line 156 of file sun-ipr-node-loadmetric.cpp.
Print how many times the node was established as relay node for other nodes of the netwok.
Definition at line 326 of file sun-ipr-node.h.
Returns the number of hops that separate the node to the sink.
Definition at line 865 of file sun-ipr-node.cpp.
Returns the number of packets processed by the current node in the last interval of time (MINUTE).
Definition at line 76 of file sun-ipr-node-loadmetric.cpp.
Returns the number of Path Establishment packets processed by the entire network.
Definition at line 766 of file sun-ipr-node.h.
Returns the size in byte of a hdr_sun_path_est packet header.
Definition at line 696 of file sun-ipr-node.h.
|
protectedvirtual |
Initializes a SunIPRoutingNode node.
It sends to the lower layers a Sync message asking for the IP of the node.
Definition at line 236 of file sun-ipr-node.cpp.
Initializes an ack packet passed as argument with the default values.
Packet* | Pointer to a packet already allocated to fill with the right values. |
Definition at line 80 of file sun-ipr-node-ack.cpp.
Initializes a data packet passed as argument with the default values.
Packet* | Pointer to a packet already allocated to fill with the right values. |
Definition at line 49 of file sun-ipr-node-data.cpp.
|
protectedvirtual |
Initializes a Path Establishment Answer packet (previously allocated) retrieving the information from a Path Establishment Request packet.
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.
Initializes a Path Establishment Search packet (previously allocated).
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.
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.
Packet* | Pointer to a Path Establishment packet to analyze. |
Definition at line 228 of file sun-ipr-node-pathest-search.cpp.
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.
double& | Number to evaluate. |
Definition at line 389 of file sun-ipr-node.h.
|
protectedvirtual |
This function removes all the information about routing information and sink association.
Definition at line 920 of file sun-ipr-node.cpp.
|
protectedvirtual |
Prints in the stdout the routing table of the current node.
Definition at line 250 of file sun-ipr-node.cpp.
Returns a string with an IP in the classic form "x.x.x.x" converting an ns2 ns_addr_t address.
ns_addr_t& | ns2 address |
Definition at line 298 of file sun-ipr-node.cpp.
Returns a string with an IP in the classic form "x.x.x.x" converting an ns2 nsaddr_t address.
nsaddr_t& | ns2 address |
Definition at line 279 of file sun-ipr-node.cpp.
|
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.
Invoked when the node receives a probe packet from a sink.
It is used to update the information about routes.
Packet* | Pointer to a Probe packet. |
Definition at line 873 of file sun-ipr-node.cpp.
Performs the reception of packets from upper and lower layers.
Packet* | Pointer to the packet will be received. |
Definition at line 450 of file sun-ipr-node.cpp.
|
protectedvirtual |
Cross-Layer messages asynchronous interpreter.
Used to retrive the IP od the current node from the IP module.
ClMessage* | an instance of ClMessage that represent the message received and used for the answer. |
Definition at line 183 of file sun-ipr-node.cpp.
|
protectedvirtual |
Cross-Layer messages synchronous interpreter.
ClMessage* | an instance of ClMessage that represent the message received |
Definition at line 175 of file sun-ipr-node.cpp.
Replies to Path Establishment Search packets.
It adds in the packet the IP of the current node and forwards or replies to the request.
Packet* | Pointer to a Path Establishment Search packets to process. |
Definition at line 134 of file sun-ipr-node-pathest-search.cpp.
|
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.
Definition at line 54 of file sun-ipr-node-pathest-search.cpp.
|
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.
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.
Packet* | Pointer to a Data packet to acknowledge. |
Definition at line 47 of file sun-ipr-node-ack.cpp.
Forwards a Path Establishment Answer Packet.
Adds the information about the route in the routing table of the current node.
Packet* | Pointer to a Path Establishment packet with option field set to ANSWER to forward. |
Definition at line 162 of file sun-ipr-node-pathest-answer.cpp.
Send back an error packet to the previous hop.
It uses the information contained in the header of the packet.
Packet* | Pointer to a Packet to forward to the next hop. |
Definition at line 160 of file sun-ipr-node-ack.cpp.
Sets the number of hops that the current node needs to reach the sink.
int& | Number of hops to the sink. The value must be greater or equal to 1. |
Definition at line 846 of file sun-ipr-node.cpp.
Returns a nsaddr_t address from an IP written as a string in the form "x.x.x.x".
char* | IP in string form |
Definition at line 304 of file sun-ipr-node.cpp.
|
protectedvirtual |
Traces a packet.
Packet | to be traced. |
String | optional for the packet. |
Definition at line 960 of file sun-ipr-node.cpp.
|
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.
|
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.
Updates the field quality in the packet passed as parameter.
The value written in the packet depends on the metric field.
Packet* | Pointer to a packet in which to update the quality field. |
Definition at line 245 of file sun-ipr-node-pathest-search.cpp.
Opens the trace file, writes the string passed as input and closes the file.
String | to write in the trace file. |
Definition at line 1031 of file sun-ipr-node.cpp.
|
friend |
Friend class used to implement the timer on Acks.
Definition at line 211 of file sun-ipr-node.h.
|
friend |
Friend class used to implement the timer on the Buffer.
Definition at line 225 of file sun-ipr-node.h.
|
friend |
Friend class used to implement the timer on Hop Tables.
Definition at line 204 of file sun-ipr-node.h.
|
friend |
Friend class used to implement the timer on the Search Path mechanism.
Definition at line 232 of file sun-ipr-node.h.
|
friend |
Friend class used to implement the timer on Probes.
Definition at line 218 of file sun-ipr-node.h.
|
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.
|
protected |
Number of acks lost since the last reset.
Definition at line 897 of file sun-ipr-node.h.
|
protected |
true if list of acks is full, false otherwise.
Definition at line 889 of file sun-ipr-node.h.
|
protected |
Parameters used by Load metric.
It is a correlation factor.
Definition at line 891 of file sun-ipr-node.h.
|
protected |
Buffer used to store data packets.
Definition at line 906 of file sun-ipr-node.h.
|
protected |
Maximum length of the data buffer.
Definition at line 907 of file sun-ipr-node.h.
|
protected |
BufferTimer object.
Definition at line 929 of file sun-ipr-node.h.
|
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.
|
protected |
Flag to enable or disable the possibility to send Path Error packets.
Definition at line 862 of file sun-ipr-node.h.
|
protected |
List of IPs to reach the sink.
Definition at line 852 of file sun-ipr-node.h.
|
protected |
Current length of the hop_table.
Definition at line 853 of file sun-ipr-node.h.
|
protected |
IP of the current node.
Definition at line 835 of file sun-ipr-node.h.
|
protected |
List of the last LISTLENGTH temporal instants in which the node received acks.
Definition at line 875 of file sun-ipr-node.h.
|
protected |
Clock of the last ack received by the node.
Definition at line 884 of file sun-ipr-node.h.
|
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.
|
protected |
Clock of the last packet received by the node.
Definition at line 882 of file sun-ipr-node.h.
Used by the load metric to set the number of the acks tracked.
Definition at line 245 of file sun-ipr-node.h.
|
protected |
Maximum number of Ack errors tollerated by the node.
Definition at line 895 of file sun-ipr-node.h.
|
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.
|
protected |
Metric used by the current node.
Definition at line 836 of file sun-ipr-node.h.
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.
|
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.
|
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.
|
staticprotected |
Comulative number of Ack packets processed by SunIPRoutingNode objects.
Definition at line 965 of file sun-ipr-node.h.
|
staticprotected |
Comulative number of Data packets processed by SunIPRoutingNode objects.
Definition at line 963 of file sun-ipr-node.h.
|
staticprotected |
Comulative number of packets dropped by SunIPRoutingNode objects, reason: the buffer is full.
Definition at line 968 of file sun-ipr-node.h.
|
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.
|
staticprotected |
Comulative number of Path Establishment packets processed by SunIPRoutingNode objects.
Definition at line 960 of file sun-ipr-node.h.
|
staticprotected |
Comulative number of Data packets forwarded by the network.
Definition at line 977 of file sun-ipr-node.h.
|
protected |
Used to convert to string.
Definition at line 938 of file sun-ipr-node.h.
|
protected |
true if list of packets is full, false otherwise.
Definition at line 886 of file sun-ipr-node.h.
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.
|
protected |
Period of the Poisson traffic for data packets in the buffer.
Definition at line 842 of file sun-ipr-node.h.
|
protected |
Period of the Poisson traffic for status and ack packets.
Definition at line 840 of file sun-ipr-node.h.
|
protected |
Keep track of the total number of packet transmitted.
Definition at line 909 of file sun-ipr-node.h.
|
protected |
Keep track of the total number of packet retransmitted.
Definition at line 911 of file sun-ipr-node.h.
|
protected |
Pointer of the first avaiable space in list_acks list.
Definition at line 880 of file sun-ipr-node.h.
|
protected |
Pointer of the first avaiable space in list_packets list.
Definition at line 878 of file sun-ipr-node.h.
|
protected |
Enable (1) or disable (0) the Poisson traffic for SUN packets.
Definition at line 837 of file sun-ipr-node.h.
|
protected |
Flag to enable or disable dirrefent levels of debug.
Definition at line 855 of file sun-ipr-node.h.
|
protected |
Value below which if a node receives a probe it discards it.
Definition at line 857 of file sun-ipr-node.h.
|
protected |
Quality of the link from the node to the sink.
Definition at line 851 of file sun-ipr-node.h.
|
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.
|
protected |
RemoveHopTableTimer object.
Definition at line 927 of file sun-ipr-node.h.
|
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.
|
protected |
Flag to enable or disable the possibility to send search_path packets.
Definition at line 860 of file sun-ipr-node.h.
|
protected |
SearchPathTimer object.
Definition at line 930 of file sun-ipr-node.h.
|
protected |
IP of the sink associated to the node.
Definition at line 854 of file sun-ipr-node.h.
|
protected |
SinkProbeTimer object.
Definition at line 928 of file sun-ipr-node.h.
|
protected |
SNR between the sink and the current node.
Definition at line 859 of file sun-ipr-node.h.
|
protected |
Timer for buffer management.
Definition at line 924 of file sun-ipr-node.h.
|
protected |
Maximum validity time for a route entry.
Definition at line 920 of file sun-ipr-node.h.
|
protected |
Timer for the search path mechanism.
Definition at line 925 of file sun-ipr-node.h.
|
protected |
Maximum validity time for a sink probe.
Definition at line 922 of file sun-ipr-node.h.
|
protected |
Flag used to enable or disable the trace file for nodes,.
Definition at line 933 of file sun-ipr-node.h.
|
protected |
Ofstream used to write the trace file in the disk.
Definition at line 939 of file sun-ipr-node.h.
|
protected |
Name of the trace file writter for the current node.
Definition at line 936 of file sun-ipr-node.h.
|
protected |
Used as separator among elements in an entr of the tracefile.
Definition at line 941 of file sun-ipr-node.h.