RLRP routing
v.0.1.0
|
Route table class. More...
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... | |
Route table class.
Contains a list and methods for manipulating the entries and its values, which correspond to different src-dst pairs (routes).
def RouteTable.Table.__init__ | ( | self, | |
node_mac | |||
) |
Constructor.
self | The object pointer. |
node_mac | MAC address of the node's network interface. |
def RouteTable.Table.get_avg_value | ( | self, | |
dst_ip | |||
) |
Calculate and return the average estimation value of the given entry.
self | The object pointer. |
dst_ip | Destination IP address of the route. |
def RouteTable.Table.get_entry | ( | self, | |
dst_ip | |||
) |
Return current entry assigned for given destination IP.
self | The object pointer. |
dst_ip | Destination IP address of the route. |
def RouteTable.Table.get_neighbors | ( | self | ) |
Return the current list of neighbors.
self | The object pointer. |
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.
self | The object pointer. |
dst_ip | Destination IP address of the route. |
def RouteTable.Table.print_table | ( | self | ) |
Print out the contents of the route table to a specified file.
self | The object pointer. |
def RouteTable.Table.update_entry | ( | self, | |
dst_ip, | |||
mac, | |||
reward | |||
) |
Update the estimation value of the given action_id (mac) by the given reward.
self | The object pointer. |
dst_ip | Destination IP address of the route. |
mac | MAC address of the neighbor (action ID). |
reward | Reward value to be assigned. |
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".