faucet.dp module

Configuration for a datapath.

class faucet.dp.DP(_id, dp_id, conf)[source]

Bases: faucet.conf.Conf

Stores state related to a datapath controlled by Faucet, including configuration.

acls = None
add_acl(acl_ident, acl)[source]

Add an ACL to this DP.

add_port(port)[source]

Add a port to this DP.

add_router(router_ident, router)[source]

Add a router to this DP.

advertise_interval = None
all_valve_tables()[source]

Return list of all Valve tables.

arp_neighbor_timeout = None
bgp_vlans()[source]

Return list of VLANs with BGP enabled.

check_config()[source]

Check config at instantiation time for errors, typically via assert.

combinatorial_port_flood = None
configured = False
cookie = None
defaults = {'advertise_interval': 30, 'arp_neighbor_timeout': 250, 'combinatorial_port_flood': False, 'cookie': 1524372928, 'description': None, 'dot1x': None, 'dp_acls': None, 'dp_id': None, 'drop_broadcast_source_address': True, 'drop_spoofed_faucet_mac': True, 'faucet_dp_mac': '0e:00:00:00:00:01', 'group_table': False, 'group_table_routing': False, 'hardware': 'Open vSwitch', 'high_priority': None, 'highest_priority': None, 'ignore_learn_ins': 10, 'interface_ranges': {}, 'interfaces': {}, 'lacp_timeout': 30, 'learn_ban_timeout': 10, 'learn_jitter': 10, 'lldp_beacon': {}, 'low_priority': None, 'lowest_priority': None, 'max_host_fib_retry_count': 10, 'max_hosts_per_resolve_cycle': 5, 'max_resolve_backoff_time': 32, 'metrics_rate_limit_sec': 0, 'name': None, 'ofchannel_log': None, 'packetin_pps': None, 'pipeline_config_dir': '/home/docs/checkouts/readthedocs.org/user_builds/faucet/envs/1.8.10/etc/faucet', 'priority_offset': 0, 'proactive_learn': True, 'stack': None, 'timeout': 300, 'use_idle_timeout': False}
defaults_types = {'advertise_interval': <class 'int'>, 'arp_neighbor_timeout': <class 'int'>, 'combinatorial_port_flood': <class 'bool'>, 'cookie': <class 'int'>, 'description': <class 'str'>, 'dot1x': <class 'dict'>, 'dp_acls': <class 'list'>, 'dp_id': <class 'int'>, 'drop_bpdu': <class 'bool'>, 'drop_broadcast_source_address': <class 'bool'>, 'drop_lldp': <class 'bool'>, 'drop_spoofed_faucet_mac': <class 'bool'>, 'faucet_dp_mac': <class 'str'>, 'group_table': <class 'bool'>, 'group_table_routing': <class 'bool'>, 'hardware': <class 'str'>, 'high_priority': <class 'int'>, 'highest_priority': <class 'int'>, 'ignore_learn_ins': <class 'int'>, 'interface_ranges': <class 'dict'>, 'interfaces': <class 'dict'>, 'learn_ban_timeout': <class 'int'>, 'learn_jitter': <class 'int'>, 'lldp_beacon': <class 'dict'>, 'low_priority': <class 'int'>, 'lowest_priority': <class 'int'>, 'max_host_fib_retry_count': <class 'int'>, 'max_hosts_per_resolve_cycle': <class 'int'>, 'max_resolve_backoff_time': <class 'int'>, 'metrics_rate_limit_sec': <class 'int'>, 'name': <class 'str'>, 'ofchannel_log': <class 'str'>, 'packetin_pps': <class 'int'>, 'pipeline_config_dir': <class 'str'>, 'priority_offset': <class 'int'>, 'proactive_learn': <class 'bool'>, 'stack': <class 'dict'>, 'timeout': <class 'int'>, 'use_idle_timeout': <class 'bool'>}
dot1x = None
dot1x_defaults_types = {'nfv_intf': <class 'str'>}
dot1x_ports()[source]

Return list of ports with 802.1x enabled.

dp_acls = None
dp_id = None
drop_broadcast_source_address = None
drop_spoofed_faucet_mac = None
dyn_last_coldstart_time = None
dyn_up_ports = set()
faucet_dp_mac = None
finalize_config(dps)[source]

Perform consistency checks after initial config parsing.

get_config_changes(logger, new_dp)[source]

Detect any config changes.

Parameters:
  • logger (ValveLogger) – logger instance
  • new_dp (DP) – new dataplane configuration.
Returns:

changes tuple containing:

deleted_ports (set): deleted port numbers. changed_ports (set): changed/added port numbers. changed_acl_ports (set): changed ACL only port numbers. deleted_vlans (set): deleted VLAN IDs. changed_vlans (set): changed/added VLAN IDs. all_ports_changed (bool): True if all ports changed.

Return type:

(tuple)

get_config_dict()[source]

Return DP config as a dict for API call.

get_native_vlan(port_num)[source]

Return native VLAN for a port by number, or None.

get_tables()[source]

Return tables as dict for API call.

group_table = False
group_table_routing = False
groups = None
high_priority = None
ignore_learn_ins = None
in_port_tables()[source]

Return list of tables that specify in_port as a match.

interface_ranges = None
interfaces = None
is_stack_edge()[source]

Return True if this DP is a stack edge.

lacp_timeout = None
learn_ban_timeout = None
learn_jitter = None
lldp_beacon = {}
lldp_beacon_defaults_types = {'max_per_interval': <class 'int'>, 'send_interval': <class 'int'>, 'system_name': <class 'str'>}
low_priority = None
match_tables(match_type)[source]

Return list of tables with matches of a specific match type.

max_host_fib_retry_count = None
max_hosts_per_resolve_cycle = None
max_resolve_backoff_time = None
meters = {}
metrics_rate_limit_sec = None
name = None
output_only_ports = None
packetin_pps = None
peer_stack_up_ports(peer_dp)[source]

Return list of stack ports that are up towards a peer.

pipeline_config_dir = None
ports = None
priority_offset = None
proactive_learn = None
reset_refs(vlans=None)[source]
resolve_port(port_name)[source]

Resolve a port by number or name.

resolve_stack_topology(dps)[source]

Resolve inter-DP config for stacking.

routers = None
running = False
set_defaults()[source]

Set default values and run any basic sanity checks.

shortest_path(dest_dp, src_dp=None)[source]

Return shortest path to a DP, as a list of DPs.

shortest_path_port(dest_dp)[source]

Return first port on our DP, that is the shortest path towards dest DP.

shortest_path_to_root()[source]

Return shortest path to root DP, as list of DPs.

stack = None
stack_defaults_types = {'priority': <class 'int'>}
stack_ports = None
tables = {}
tables_by_id = {}
timeout = None
to_conf()[source]

Return DP config as dict.

use_idle_timeout = None
vlan_match_tables()[source]

Return list of tables that specify vlan_vid as a match.

vlans = None
wildcard_table = <faucet.valve_table.ValveTable object>
class faucet.dp.NullRyuDatapath[source]

Bases: object

Placeholder Ryu Datapath.

ofproto = <module 'ryu.ofproto.ofproto_v1_3' from '/home/docs/checkouts/readthedocs.org/user_builds/faucet/envs/1.8.10/lib/python3.5/site-packages/ryu/ofproto/ofproto_v1_3.py'>