RLRP routing  v.0.1.0
DataHandler.IncomingTrafficHandler Class Reference

A thread class for receiving incoming data from the real physical network interface. More...

Inheritance diagram for DataHandler.IncomingTrafficHandler:
Inheritance graph
Collaboration diagram for DataHandler.IncomingTrafficHandler:
Collaboration graph

Public Member Functions

def __init__ (self, app_handler_thread, neighbor_routine)
 Constructor. More...
 
def run (self)
 Main thread routine. More...
 
def handle_data_packet (self, src_mac, dsr_message, packet)
 Default method for handling incoming unicast data packets from the network side. More...
 
def handle_data_packet_monitoring_mode (self, src_mac, dsr_message, packet)
 Method for handling incoming unicast data packets from the network if the application is running in the monitoring mode (conf.MONITORING_MODE_FLAG is set to True). More...
 
def handle_reliable_data_packet (self, src_mac, dsr_message, packet)
 Handle data packet, sent via ARQ. More...
 
def handle_reliable_data_packet_monitoring_mode (self, src_mac, dsr_message, packet)
 Handle data packet, sent via ARQ, if the monitoring mode is ON. More...
 
def handle_broadcast_packet (self, dsr_message, packet)
 Handle the broadcast data packets, generated from the network application. More...
 
def handle_rreq (self, src_mac, rreq)
 Handle incoming RREQ messages. More...
 
def handle_rreq_monitoring_mode (self, src_mac, rreq)
 Handle incoming RREQs if the Monitoring Mode is ON. More...
 
def handle_rrep (self, src_mac, rrep)
 Handle incoming RREP messages. More...
 
def handle_rrep_monitoring_mode (self, src_mac, rrep)
 Handle incoming RREPs if the Monitoring Mode is ON. More...
 
def handle_ack (self, ack_message)
 Handle incoming ACK messages. More...
 
def handle_reward (self, reward_message)
 Handle incoming reward messages. More...
 
def quit (self)
 Stop and quit the thread operation. More...
 

Public Attributes

 handle_data_packet
 Create a reference to default self.handle_data_packet method. More...
 
 handle_reliable_data_packet
 Create a reference to default self.handle_reliable_data_packet method. More...
 
 handle_rreq
 Create a reference to default self.handle_rreq method. More...
 
 handle_rrep
 Create a reference to default self.handle_rrep method. More...
 
 running
 Thread running state bool() flag. More...
 
 app_handler_thread
 Reference to DataHandler.AppHandler object. More...
 
 raw_transport
 Reference to Transport.RawTransport object. More...
 
 arq_handler
 Reference to DataHandler.AppHandler.arq_handler object. More...
 
 path_discovery_handler
 Reference to DataHandler.AppHandler.path_discovery_handler object. More...
 
 listen_neighbors_handler
 Reference to NeighborDiscovery.NeighborDiscovery.listen_neighbors_handler object. More...
 
 table
 Reference to RouteTable.Table object. More...
 
 broadcast_list
 Reference to DataHandler.AppHandler.broadcast_list attribute. More...
 
 broadcast_mac
 Store the default MAC broadcast value, referenced from Transport.RawTransport.broadcast_mac. More...
 
 max_broadcast_ttl
 Set a maximum number of hops a broadcast frame can be forwarded over. More...
 
 reward_send_handler
 Create a handler for generating and sending back a reward to the sender node. More...
 
 reward_wait_handler
 Create a reference to RewardHandler.RewardWaitHandler object thread. More...
 
 rreq_ids
 List of all previously processed RREQ IDs. More...
 
 rrep_ids
 List of all previously processed RREP IDs. More...
 
 reliable_packet_ids
 List of all previously processed IDs of data packets have been sent reliably using ARQ. More...
 

Detailed Description

A thread class for receiving incoming data from the real physical network interface.

Constructor & Destructor Documentation

def DataHandler.IncomingTrafficHandler.__init__ (   self,
  app_handler_thread,
  neighbor_routine 
)

Constructor.

Parameters
selfThe object pointer.
app_handler_threadReference to DataHandler.AppHandler object.
neighbor_routineReference to NeighborDiscovery.NeighborDiscovery object.
Returns
None

Member Function Documentation

def DataHandler.IncomingTrafficHandler.handle_ack (   self,
  ack_message 
)

Handle incoming ACK messages.

Parameters
selfThe object pointer.
ack_messageRLRP ACK service message header object from Messages module.
Returns
None

Here is the caller graph for this function:

def DataHandler.IncomingTrafficHandler.handle_broadcast_packet (   self,
  dsr_message,
  packet 
)

Handle the broadcast data packets, generated from the network application.

Check the broadcast_ttl with the defined max value, and either drop or forward it, accordingly.

Parameters
selfThe object pointer.
dsr_messageRLRP broadcast data packet header object from Messages module.
packetRaw data packet.
Returns
None

Here is the caller graph for this function:

def DataHandler.IncomingTrafficHandler.handle_data_packet (   self,
  src_mac,
  dsr_message,
  packet 
)

Default method for handling incoming unicast data packets from the network side.

Check the dst_mac from dsr_header. If it matches the node's own mac -> send it up to the virtual interface If the packet carries the data, either send it to the next hop, or, if there is no such one, put it to the AppQueue, or, if the dst_mac equals to the node's mac, send the packet up to the application.

Parameters
selfThe object pointer.
src_macSource MAC address of the received packet.
dsr_messageRLRP unicast data packet header object from Messages module.
packetRaw data packet.
Returns
None

Here is the call graph for this function:

def DataHandler.IncomingTrafficHandler.handle_data_packet_monitoring_mode (   self,
  src_mac,
  dsr_message,
  packet 
)

Method for handling incoming unicast data packets from the network if the application is running in the monitoring mode (conf.MONITORING_MODE_FLAG is set to True).

Handle data packet, if in monitoring mode. If the dst_mac is the mac of the receiving node, send the packet up to the application, otherwise, discard the packet.

Parameters
selfThe object pointer.
src_macSource MAC address of the received packet.
dsr_messageRLRP unicast data packet header object from Messages module.
packetRaw data packet.
Returns
None

Here is the call graph for this function:

def DataHandler.IncomingTrafficHandler.handle_reliable_data_packet (   self,
  src_mac,
  dsr_message,
  packet 
)

Handle data packet, sent via ARQ.

Parameters
selfThe object pointer.
src_macSource MAC address of the received packet.
dsr_messageRLRP unicast data packet header object from Messages module.
packetRaw data packet.
Returns
None

Here is the call graph for this function:

def DataHandler.IncomingTrafficHandler.handle_reliable_data_packet_monitoring_mode (   self,
  src_mac,
  dsr_message,
  packet 
)

Handle data packet, sent via ARQ, if the monitoring mode is ON.

Parameters
selfThe object pointer.
src_macSource MAC address of the received packet.
dsr_messageRLRP unicast data packet header object from Messages module.
packetRaw data packet.
Returns
None

Here is the call graph for this function:

def DataHandler.IncomingTrafficHandler.handle_reward (   self,
  reward_message 
)

Handle incoming reward messages.

Parameters
selfThe object pointer.
reward_messageRLRP reward service message header object from Messages module.
Returns
None

Here is the caller graph for this function:

def DataHandler.IncomingTrafficHandler.handle_rrep (   self,
  src_mac,
  rrep 
)

Handle incoming RREP messages.

Parameters
selfThe object pointer.
src_macSource MAC address of the received RREQ.
rrepRLRP RREP service message header object from Messages module.
Returns
None
def DataHandler.IncomingTrafficHandler.handle_rrep_monitoring_mode (   self,
  src_mac,
  rrep 
)

Handle incoming RREPs if the Monitoring Mode is ON.

Receive the RREPs, which have been sent to this node, discard all other RREPs.

Parameters
selfThe object pointer.
src_macSource MAC address of the received RREQ.
rrepRLRP RREP service message header object from Messages module.
Returns
None
def DataHandler.IncomingTrafficHandler.handle_rreq (   self,
  src_mac,
  rreq 
)

Handle incoming RREQ messages.

Parameters
selfThe object pointer.
src_macSource MAC address of the received RREQ.
rreqRLRP RREQ service message header object from Messages module.
Returns
None
def DataHandler.IncomingTrafficHandler.handle_rreq_monitoring_mode (   self,
  src_mac,
  rreq 
)

Handle incoming RREQs if the Monitoring Mode is ON.

Process only the RREQs, which have been sent for this node (dst_ip in node_ips). Do not forward any other RREQs further.

Parameters
selfThe object pointer.
src_macSource MAC address of the received RREQ.
rreqRLRP RREQ service message header object from Messages module.
Returns
None
def DataHandler.IncomingTrafficHandler.quit (   self)

Stop and quit the thread operation.

Parameters
selfThe object pointer.
Returns
None
def DataHandler.IncomingTrafficHandler.run (   self)

Main thread routine.

Parameters
selfThe object pointer.
Returns
None

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

DataHandler.IncomingTrafficHandler.app_handler_thread

Reference to DataHandler.AppHandler object.

DataHandler.IncomingTrafficHandler.arq_handler

Reference to DataHandler.AppHandler.arq_handler object.

DataHandler.IncomingTrafficHandler.broadcast_list

Reference to DataHandler.AppHandler.broadcast_list attribute.

DataHandler.IncomingTrafficHandler.broadcast_mac

Store the default MAC broadcast value, referenced from Transport.RawTransport.broadcast_mac.

DataHandler.IncomingTrafficHandler.handle_data_packet

Create a reference to default self.handle_data_packet method.

Check the MONITORING_MODE_FLAG. If True - override the self.handle_data_packet variable for working in the monitoring mode.

DataHandler.IncomingTrafficHandler.handle_reliable_data_packet

Create a reference to default self.handle_reliable_data_packet method.

Check the MONITORING_MODE_FLAG. If True - override the self.handle_reliable_data_packet method for working in the monitoring mode.

DataHandler.IncomingTrafficHandler.handle_rrep

Create a reference to default self.handle_rrep method.

Check the MONITORING_MODE_FLAG. If True - override the self.rrep_handler method for working in the monitoring mode.

DataHandler.IncomingTrafficHandler.handle_rreq

Create a reference to default self.handle_rreq method.

Check the MONITORING_MODE_FLAG. If True - override the self.rreq_handler method for working in the monitoring mode.

DataHandler.IncomingTrafficHandler.listen_neighbors_handler
DataHandler.IncomingTrafficHandler.max_broadcast_ttl

Set a maximum number of hops a broadcast frame can be forwarded over.

Default value is 1.

DataHandler.IncomingTrafficHandler.path_discovery_handler
DataHandler.IncomingTrafficHandler.raw_transport

Reference to Transport.RawTransport object.

DataHandler.IncomingTrafficHandler.reliable_packet_ids

List of all previously processed IDs of data packets have been sent reliably using ARQ.

Limit the max length of the list to 100.

DataHandler.IncomingTrafficHandler.reward_send_handler

Create a handler for generating and sending back a reward to the sender node.

DataHandler.IncomingTrafficHandler.reward_wait_handler

Create a reference to RewardHandler.RewardWaitHandler object thread.

DataHandler.IncomingTrafficHandler.rrep_ids

List of all previously processed RREP IDs.

Limit the max length of the list to 100.

DataHandler.IncomingTrafficHandler.rreq_ids

List of all previously processed RREQ IDs.

Limit the max length of the list to 100.

DataHandler.IncomingTrafficHandler.running

Thread running state bool() flag.

DataHandler.IncomingTrafficHandler.table

Reference to RouteTable.Table object.


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