switch_abstraction module¶
This module is part of the nmeta suite running on top of Ryu SDN controller.
It provides functions that abstract the details of OpenFlow switches
-
class
switch_abstraction.
FlowTables
(_nmeta, logger, _config, datapath)¶ Bases:
object
This class provides an abstraction for the flow tables on an OpenFlow Switch
-
add_fe_amf_macport_dst
(dpae_port, eth_dst)¶ Add Flow Entry (FE) to the Active Mode Filter flow table to send packets destined for learned destination MACs out the port to the DPAE
-
add_fe_amf_miss
()¶ Add Active Mode Filter flow table miss Flow Entry to send packets to next flow table
-
add_fe_fwd_macport_dst
(out_port, eth_dst)¶ Add Flow Entry (FE) to the Forwarding flow table to match learned destination MAC and output learned port to avoid flooding
-
add_fe_fwd_miss
()¶ Add Forwarding flow table miss Flow Entry to flood packets out ports as we haven’t learnt the MAC address
-
add_fe_iig_broadcast
()¶ Add Flow Entry (FE) to the Identity Indicators (General) flow table to flood Ethernet broadcast packets to lower the load on the rest of the pipeline
-
add_fe_iig_dhcp
(dpae_port)¶ Add Flow Entry (FE) to the Identity Indicators (General) flow table to clone DHCP packets to a DPAE
-
add_fe_iig_dns
(dpae_port)¶ Add Flow Entry (FE) to the Identity Indicators (General) flow table to clone DNS packets to a DPAE
-
add_fe_iig_lldp
(dpae_port)¶ Add Flow Entry (FE) to the Identity Indicators (General) flow table to clone LLDP packets to a DPAE
-
add_fe_iig_miss
()¶ Add Identity Indicator (General) flow table miss Flow Entry to continue pipeline processing
-
add_fe_iim_dpae_active_bypass
(dpae_port)¶ Add Identity Indicator (MAC) Flow Entry to bypass intermediate tables for traffic from DPAE (return packets from active mode TC) and goto treatment table direct
-
add_fe_iim_dpae_join
()¶ Add Identity Indicator (MAC) Flow Entry to send DPAE Join packets to the controller as packet-in messages
-
add_fe_iim_macport_src
(in_port, eth_src)¶ Add Flow Entry (FE) to the Identity Indicator (MAC) flow table to match combo of in port and source MAC and goto next table. This is used filter punts to the controller for learning MAC to port mappings so that only new port/MAC mappings that aren’t matched by a rule are punted by the Identity Indicator (MAC) flow table miss rule
-
add_fe_iim_miss
()¶ Add Identity Indicator (MAC) flow table miss Flow Entry to clone a table-miss packet to the controller as a packet-in message
-
add_fe_tc_dpae
(tc_flows, dpae_port, mode)¶ Install DPAE Traffic Classification (TC) flows from optimised TC policy to switch (i.e. Flow Entries that invoke actions that need for DPAE to classify). Mode is either active or passive. Passive Mode: Output to DPAE and Goto-Table Traffic Treatment (ft_tt) Active Mode: Goto-Table Active Mode Filter (ft_amf)
-
add_fe_tc_id
(id_type, id_detail, id_mac, tc_flows)¶ Add Flow Entri(es) to the switch if required for identity match and action. Check to see if we have any to install, and if so use a separate function to install to switch
-
add_fe_tc_id_install
(id_mac, action)¶ Add Flow Entry to the switch for identity match and action
-
add_fe_tc_miss
()¶ Add Traffic Classification flow table miss Flow Entry to send packets to Traffic Treatment Flow Table
-
add_fe_tc_static
(tc_flows)¶ Install non-DPAE static Traffic Classification (TC) flows from optimised TC policy to switch (i.e. Flow Entries that invoke actions without need for DPAE to classify)
-
add_fe_tcf_accepts
()¶ Add Traffic Classification Filter flow table accept Flow Entries to send packets to TC flow table)
-
add_fe_tcf_miss
()¶ Add Traffic Classification Filter flow table miss Flow Entry to send packets to Traffic Treatment (ft_tt) table
-
add_fe_tcf_suppress
(suppress_dict)¶ Process a Traffic Classification flow suppression request from a DPAE, where it has requested that we don’t send any more packets to it for a specific flow. Install an FE to switch for each direction of the flow to bypass sending to DPAE. . Only supports IPv4 and TCP at this stage. .
-
add_fe_tt_advised
(flow_dict)¶ Process a Traffic Classification flow treatment advice from a DPAE. Install an FE to switch for each direction of the flow applying the appropriate treatment. . Only supports IPv4 and TCP at this stage. .
-
add_fe_tt_miss
()¶ Add Traffic Treatment flow table miss Flow Entry to send packets to next flow table
-
add_group_dpae
(dpae_port)¶ Add Group Table to the switch for forwarding packets to DPAE out a specific port. Note, will generate error if group table already exists.
-
delete_all_flows
()¶ Delete all Flow Entries from all Flow Tables on this switch
-
delete_fe
(match, flow_table_id)¶ Delete a specific FE from a specific Flow Table on this switch
-
matches_add_fe_prereqs
(fe_matches)¶ Passed a dictionary of match_type, value pairs for creating a flow entry on a switch and work out what match types are missing as per requirements of OpenFlow v1.3 standard and add them to the dictionary
-
-
class
switch_abstraction.
MACTable
(_nmeta, logger, _config, datapath)¶ Bases:
object
This class provides an abstraction for the MAC table on an OpenFlow Switch that maps MAC addresses to switch ports
-
add
(mac, in_port, context)¶ Passed a MAC address and the switch port it was learnt via along with a context. Add this to the database and tidy up by removing any other entries for this MAC on this switch in given context.
-
delete
(mac, in_port, context)¶ Passed a MAC address, switch port and context to delete. Delete any entries from DB and from switch
-
dump_macs
(context)¶ Return a list of all known MAC addresses for a given context on this switch
-
mac2port
(mac, context)¶ Passed a dpid and mac address and return the switch port number that this mac has been learned via (or 999999999 if unknown)
-
-
class
switch_abstraction.
Switch
(_nmeta, logger, _config, datapath)¶ Bases:
object
This class provides an abstraction for an OpenFlow Switch
-
get_friendly_of_version
(ofproto)¶ Passed an OF Protocol object and return a human-friendly version of the protocol revision number
-
packet_out
(data, in_port, out_port, out_queue, nq=0)¶ Sends a supplied packet out switch port(s) in specific queue. Set nq=1 if want no queueing specified (i.e. for a flooded packet) Use nq=1 for Zodiac FX compatibility Does not support use of Buffer IDs
-
request_switch_desc
()¶ Send an OpenFlow request to the switch asking it to send us it’s description data
-
set_switch_config
(config_flags, miss_send_len)¶ Set config on a switch including config flags that instruct fragment handling behaviour and miss_send_len which controls the number of bytes sent to the controller when the output port is specified as the controller.
-