faucet.valve_pipeline module

Manages movement of packets through the faucet pipeline.

class faucet.valve_pipeline.ValvePipeline(dp)[source]

Bases: faucet.valve_manager_base.ValveManagerBase

Responsible for maintaing the integrity of the Faucet pipeline for a single valve.

Controls what packets a module sees in its tables and how it can pass packets through the pipeline.

Responsible for installing flows in the vlan, egress and classification tables

accept_to_classification(actions=None)[source]

Get instructions to forward packet through the pipeline to classification table. :param actions: (optional) list of actions to apply to packet.

Returns

list of instructions

accept_to_egress(actions=None)[source]

Get instructions to forward packet through the pipeline to egress table

Raises an assertion error if egress pipeline is not configured

Parameters

actions – (optional) list of actions to apply to the packet

Returns

Return type

list of instructions

accept_to_l2_forwarding(actions=None)[source]

Get instructions to forward packet through the pipeline to l2 forwarding. :param actions: (optional) list of actions to apply to packet.

Returns

list of instructions

accept_to_vlan(actions=None)[source]

Get instructions to forward packet through the pipeline to vlan table. :param actions: (optional) list of actions to apply to packet.

Returns

list of instructions

add_port(port)[source]

install flows in response to a new port

del_port(port)[source]

delete flows in response to a port removal

filter_packets(match_dict, priority_offset=0)[source]

get a list of flow modification messages to filter packets from the pipeline. :param match_dict: a dictionary specifying the match fields :param priority_offset: used to prevent overlapping entries

initialise_tables()[source]

Install rules to initialise the classification_table

output(port, vlan, hairpin=False, external_forwarding_requested=None)[source]

Get instructions list to output a packet through the regular pipeline.

Parameters
  • port – Port object of port to output packet to

  • vlan – Vlan object of vlan to output packet on

  • hairpin – if True, hairpinning is required

  • apply_egress_acl – if True the packet will be sent to the egress acl table before being output

Returns

list of Instructions

remove_filter(match_dict, strict=True, priority_offset=0)[source]

retrieve flow mods to remove a filter from the classification table

select_packets(target_table, match_dict, actions=None, priority_offset=0)[source]

retrieve rules to redirect packets matching match_dict to table