RLRP routing  v.0.1.0
RouteTable.Table Class Reference

Route table class. More...

Collaboration diagram for RouteTable.Table:
Collaboration graph

Public Member Functions

def __init__ (self, node_mac)
 Constructor. More...
 
def get_next_hop_mac (self, dst_ip)
 This method selects a next hop for the packet with the given dst_ip. More...
 
def update_entry (self, dst_ip, mac, reward)
 Update the estimation value of the given action_id (mac) by the given reward. More...
 
def get_avg_value (self, dst_ip)
 Calculate and return the average estimation value of the given entry. More...
 
def get_neighbors (self)
 Return the current list of neighbors. More...
 
def get_entry (self, dst_ip)
 Return current entry assigned for given destination IP. More...
 
def print_table (self)
 Print out the contents of the route table to a specified file. More...
 

Public Attributes

 table_filename
 Define a filename to write the table entries to. More...
 
 node_mac
 MAC address of the node's network interface. More...
 
 neighbors_list
 Define a shared dictionary of current active neighbors. More...
 
 entries_list
 Define list of current route entries. More...
 
 current_node_ips
 Store current ip addresses assigned to this node. More...
 
 action_selector
 Create RL-helper rl_logic.ActionSelector object, to handle the process of action selection. More...
 

Detailed Description

Route table class.

Contains a list and methods for manipulating the entries and its values, which correspond to different src-dst pairs (routes).

Constructor & Destructor Documentation

def RouteTable.Table.__init__ (   self,
  node_mac 
)

Constructor.

Parameters
selfThe object pointer.
node_macMAC address of the node's network interface.
Returns
None

Member Function Documentation

def RouteTable.Table.get_avg_value (   self,
  dst_ip 
)

Calculate and return the average estimation value of the given entry.

Parameters
selfThe object pointer.
dst_ipDestination IP address of the route.
Returns
Average estimation value. float().
def RouteTable.Table.get_entry (   self,
  dst_ip 
)

Return current entry assigned for given destination IP.

Parameters
selfThe object pointer.
dst_ipDestination IP address of the route.
Returns
(Entry object) or None.
def RouteTable.Table.get_neighbors (   self)

Return the current list of neighbors.

Parameters
selfThe object pointer.
Returns
List of current neighbors. list().
def RouteTable.Table.get_next_hop_mac (   self,
  dst_ip 
)

This method selects a next hop for the packet with the given dst_ip.

The selection is being made from the current estimated values of the neighbors mac addresses, using some of the available action selection algorithms - such as greedy, e-greedy, soft-max and so on.

Parameters
selfThe object pointer.
dst_ipDestination IP address of the route.
Returns
(MAC address of the next hop) or None.
def RouteTable.Table.print_table (   self)

Print out the contents of the route table to a specified file.

Parameters
selfThe object pointer.
Returns
None
def RouteTable.Table.update_entry (   self,
  dst_ip,
  mac,
  reward 
)

Update the estimation value of the given action_id (mac) by the given reward.

Parameters
selfThe object pointer.
dst_ipDestination IP address of the route.
macMAC address of the neighbor (action ID).
rewardReward value to be assigned.
Returns
None

Member Data Documentation

RouteTable.Table.action_selector

Create RL-helper rl_logic.ActionSelector object, to handle the process of action selection.

RouteTable.Table.current_node_ips

Store current ip addresses assigned to this node.

list().

RouteTable.Table.entries_list

Define list of current route entries.

Format: {dst_ip: Entry}.

RouteTable.Table.neighbors_list

Define a shared dictionary of current active neighbors.

This dictionary is also used by the ListenNeighbors class from the NeighborDiscovery module. Format: {mac: NeighborDiscovery.Neighbor object}.

RouteTable.Table.node_mac

MAC address of the node's network interface.

RouteTable.Table.table_filename

Define a filename to write the table entries to.

Default filename is "table.txt".


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