RLRP routing  v.0.1.0
RewardHandler.RewardSendHandler Class Reference

A class which handles a reward generation and sending back to the sender node. More...

Collaboration diagram for RewardHandler.RewardSendHandler:
Collaboration graph

Public Member Functions

def __init__ (self, table, raw_transport)
 Constructor. More...
 
def send_reward (self, dst_ip, mac)
 Send the reward back to the sender node after some "hold on" time interval. More...
 
def send_back (self, dst_ip, mac)
 Generate and send the reward message back to the originating node. More...
 

Public Attributes

 table
 Reference to RouteTable.Table object. More...
 
 raw_transport
 Reference to Transport.RawTransport object. More...
 
 node_mac
 Reference to the node's own MAC address, stored in Transport.RawTransport.node_mac. More...
 
 reward_send_list
 Define a structure for handling reward sends for given dst_ips. More...
 
 hold_on_timeout
 A timeout after which the reward value is sent back to the sender. More...
 

Detailed Description

A class which handles a reward generation and sending back to the sender node.

Constructor & Destructor Documentation

def RewardHandler.RewardSendHandler.__init__ (   self,
  table,
  raw_transport 
)

Constructor.

Parameters
selfThe object pointer.
tableReference to RouteTable.Table object.
raw_transportReference to Transport.RawTransport object.
Returns
None

Member Function Documentation

def RewardHandler.RewardSendHandler.send_back (   self,
  dst_ip,
  mac 
)

Generate and send the reward message back to the originating node.

Parameters
selfThe object pointer.
dst_ipDestination IP of the route for this packet.
macMAC address of the node where the packet had been sent for getting the reward.
Returns
None

Here is the caller graph for this function:

def RewardHandler.RewardSendHandler.send_reward (   self,
  dst_ip,
  mac 
)

Send the reward back to the sender node after some "hold on" time interval.

This timeout is needed to control a number of generated reward messages for some number of the received packets with the same dst_ip.

Parameters
selfThe object pointer.
dst_ipDestination IP of the route for this packet.
macMAC address of the node where the packet had been sent for getting the reward.
Returns
None

Here is the call graph for this function:

Member Data Documentation

RewardHandler.RewardSendHandler.hold_on_timeout

A timeout after which the reward value is sent back to the sender.

This is done in order to decrease a number of reward messages being sent back in a case when the incoming packet stream is too intensive.

RewardHandler.RewardSendHandler.node_mac

Reference to the node's own MAC address, stored in Transport.RawTransport.node_mac.

RewardHandler.RewardSendHandler.raw_transport

Reference to Transport.RawTransport object.

RewardHandler.RewardSendHandler.reward_send_list

Define a structure for handling reward sends for given dst_ips.

Format: {hash(dst_ip + mac): last_sent_ts}. Hash is 32-bit integer, generated from md5 hash.

RewardHandler.RewardSendHandler.table

Reference to RouteTable.Table object.


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