faucet.valve_host module

Manage host learning on VLANs.

class faucet.valve_host.ValveHostFlowRemovedManager(logger, ports, vlans, eth_src_table, eth_dst_table, eth_dst_hairpin_table, pipeline, learn_timeout, learn_jitter, learn_ban_timeout, cache_update_guard_time, idle_dst, stack, has_externals, stack_root_flood_reflection)[source]

Bases: faucet.valve_host.ValveHostManager

Trigger relearning on flow removed notifications.

Note

not currently reliable.

expire_hosts_from_vlan(_vlan, _now)[source]

Expire hosts from VLAN cache.

flow_timeout(now, table_id, match)[source]

Handle a flow timed out message from dataplane.

learn_host_timeouts(port, eth_src)[source]

Calculate flow timeouts for learning on a port.

class faucet.valve_host.ValveHostManager(logger, ports, vlans, eth_src_table, eth_dst_table, eth_dst_hairpin_table, pipeline, learn_timeout, learn_jitter, learn_ban_timeout, cache_update_guard_time, idle_dst, stack, has_externals, stack_root_flood_reflection)[source]

Bases: faucet.valve_manager_base.ValveManagerBase

Manage host learning on VLANs.

add_port(port)[source]

install flows in response to a new port

ban_rules(pkt_meta)[source]

Limit learning to a maximum configured on this port/VLAN.

Parameters

pkt_meta – PacketMeta instance.

Returns

OpenFlow messages, if any.

Return type

list

del_port(port)[source]

delete flows in response to a port removal

delete_host_from_vlan(eth_src, vlan)[source]

Delete a host from a VLAN.

expire_hosts_from_vlan(vlan, now)[source]

Expire hosts from VLAN cache.

flow_timeout(_now, _table_id, _match)[source]

Handle a flow timed out message from dataplane.

initialise_tables()[source]

initialise tables controlled by this manager.

learn_host_intervlan_routing_flows(port, vlan, eth_src, eth_dst)[source]
Returns flows for the eth_src_table that enable packets that have been

routed to be accepted from an adjacent DP and then switched to the destination. Eth_src_table flow rule to match on port, eth_src, eth_dst and vlan

Parameters
  • port (Port) – Port to match on.

  • vlan (VLAN) – VLAN to match on

  • eth_src – source MAC address (should be the router MAC)

  • eth_dst – destination MAC address

learn_host_on_vlan_port_flows(port, vlan, eth_src, delete_existing, refresh_rules, src_rule_idle_timeout, src_rule_hard_timeout, dst_rule_idle_timeout)[source]

Return flows that implement learning a host on a port.

learn_host_on_vlan_ports(now, port, vlan, eth_src, delete_existing=True, last_dp_coldstart_time=None)[source]

Learn a host on a port.

learn_host_timeouts(port, eth_src)[source]

Calculate flow timeouts for learning on a port.