nmeta module¶
This is the main module of the nmeta suite running on top of Ryu SDN controller to provide network identity and flow (traffic classification) metadata . Do not use this code for production deployments - it is proof of concept code and carries no warrantee whatsoever. You have been warned.
-
class
nmeta.
NMeta
(*args, **kwargs)¶ Bases:
ryu.base.app_manager.RyuApp
,baseclass.BaseClass
This is the main class used to run nmeta
-
OFP_VERSIONS
= [4]¶
-
switch_connection_handler
(event)¶ A switch has connected to the SDN controller. We need to do some tasks to set the switch up properly such as setting it’s config for fragment handling and table miss packet length and requesting the switch description
-
desc_stats_reply_handler
(event)¶ Receive a reply from a switch to a description statistics request
-
switch_down_handler
(event)¶ OpenFlow state has gone down for a given DPID
-
packet_in
(event)¶ This method is called for every Packet-In event from a Switch. We receive a copy of the Packet-In event, pass it to the traffic classification area for analysis, work out the forwarding, update flow metadata, then add a flow entry to the switch (when appropriate) to suppress receiving further packets on this flow. Finally, we send the packet out the switch port(s) via a Packet-Out message, with appropriate QoS queue set.
-
flow_removed_handler
(event)¶ A switch has sent an event to us because it has removed a flow from a flow table
-
error_msg_handler
(event)¶ A switch has sent us an error event
-
_port_status_handler
(event)¶ Switch Port Status event
-
-
class
nmeta.
PITelemetry
(pi_start_time, event, logger, pi_time_col)¶ Bases:
object
Telemetry data for a single Packet-In (PI) event
-
record_outcome
(outcome)¶ Calculate the elapsed time for processing this packet-in event and record to the pi_time database collection. Also record the outcome for the packet, one of: - drop_same_port - drop_reserved_mac - drop_action - packet_out_flooded - packet_out Additionally, record time taken queueing event in Ryu (if available).
-
-
nmeta.
ipv4_text_to_int
(ip_text)¶ Takes an IP address string and translates it to an unsigned integer