faucet.valve_stack module
Manage higher level stack functions
- class faucet.valve_stack.ValveStackManager(logger, dp, stack, tunnel_acls, acl_manager, output_table, **_kwargs)[source]
Bases:
ValveManagerBase
Implement stack manager, this handles the more higher-order stack functions. This includes port nominations and flood directionality.
- consistent_roots(expected_root_name, valve, other_valves)[source]
Returns true if all the stack nodes have the root configured correctly
- default_port_towards(dp_name)[source]
Default shortest path towards the provided destination, via direct shortest path
- Parameters:
dp_name (str) – Destination DP
- Returns:
port from current node that is shortest directly towards destination
- Return type:
- edge_learn_port_towards(pkt_meta, edge_dp)[source]
Returns the port towards the edge DP
- Parameters:
pkt_meta (PacketMeta) – Packet on the edge DP
edge_dp (DP) – Edge DP that received the packet
- Returns:
Port towards the edge DP via some stack chosen metric
- Return type:
- is_selected_towards_root_port(port)[source]
Return true if the port is the chosen towards root port
- static nominate_stack_root(root_valve, other_valves, now, last_live_times, update_time)[source]
Nominate a new stack root
- Parameters:
root_valve (Valve) – Previous/current root Valve object
other_valves (list) – List of other valves (not including previous root)
now (float) – Current time
last_live_times (dict) – Last live time value for each DP
update_time (int) – Stack root update interval time
- Returns:
Name of the new elected stack root
- Return type:
str
- relative_port_towards(dp_name)[source]
Returns the shortest path towards provided destination, via either the root or away paths
- Parameters:
dp_name (str) – Destination DP
- Returns:
- port from current node that is towards/away the destination DP depending on
relative position of the current node
- Return type:
- tunnel_outport(src_dp, dst_dp, dst_port)[source]
Returns the output port for the current stack node for the tunnel path
- Parameters:
src_dp (str) – Source DP name of the tunnel
dst_dp (str) – Destination DP name of the tunnel
dst_port (int) – Destination port of the tunnel
- Returns:
Output port number for the current node of the tunnel
- Return type:
int
- update_health(now, last_live_times, update_time)[source]
- Returns whether the current stack node is healthy, a healthy stack node
is one that attempted connected recently, or was known to be running recently, has all LAGs UP and any stack port UP
- Parameters:
now (float) – Current time
last_live_times (dict) – Last live time value for each DP
update_time (int) – Stack root update interval time
- Returns:
True if current stack node is healthy
- Return type:
bool