[ovs-git] [openvswitch/ovs] f69f71: ipfix: Support tunnel information for Flow IPFIX.

GitHub noreply at github.com
Fri Jun 17 17:21:44 UTC 2016


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: f69f713bb032e8c31c05477f32e92f0f235a30e2
      https://github.com/openvswitch/ovs/commit/f69f713bb032e8c31c05477f32e92f0f235a30e2
  Author: Benli Ye <daniely at vmware.com>
  Date:   2016-06-17 (Fri, 17 Jun 2016)

  Changed paths:
    M NEWS
    M include/openvswitch/ofp-actions.h
    M lib/odp-util.c
    M lib/odp-util.h
    M lib/ofp-actions.c
    M ofproto/ofproto-dpif-ipfix.c
    M ofproto/ofproto-dpif-ipfix.h
    M ofproto/ofproto-dpif-upcall.c
    M ofproto/ofproto-dpif-xlate.c
    M ofproto/ofproto.h
    M tests/odp.at
    M tests/ofp-actions.at
    M tests/ofproto-dpif.at
    M tests/ovs-ofctl.at
    M utilities/ovs-ofctl.8.in
    M vswitchd/bridge.c
    M vswitchd/vswitch.xml

  Log Message:
  -----------
  ipfix: Support tunnel information for Flow IPFIX.

Add support to export tunnel information for flow-based IPFIX.
The original steps to configure flow level IPFIX:
    1) Create a new record in Flow_Sample_Collector_Set table:
       'ovs-vsctl -- create Flow_Sample_Collector_Set id=1 bridge="Bridge UUID"'
    2) Add IPFIX configuration which is referred by corresponding
       row in Flow_Sample_Collector_Set table:
       'ovs-vsctl -- set Flow_Sample_Collector_Set
       "Flow_Sample_Collector_Set UUID" ipfix=@i -- --id=@i create IPFIX
       targets=\"IP:4739\" obs_domain_id=123 obs_point_id=456
       cache_active_timeout=60 cache_max_flows=13'
    3) Add sample action to the flows:
       'ovs-ofctl add-flow mybridge in_port=1,
       actions=sample'('probability=65535,collector_set_id=1,
       obs_domain_id=123,obs_point_id=456')',output:3'
NXAST_SAMPLE action was used in step 3. In order to support exporting tunnel
information, the NXAST_SAMPLE2 action was added and with NXAST_SAMPLE2 action
in this patch, the step 3 should be configured like below:
       'ovs-ofctl add-flow mybridge in_port=1,
       actions=sample'('probability=65535,collector_set_id=1,obs_domain_id=123,
       obs_point_id=456,sampling_port=3')',output:3'
'sampling_port' can be equal to ingress port or one of egress ports. If sampling
port is equal to output port and the output port is a tunnel port,
OVS_USERSPACE_ATTR_EGRESS_TUN_PORT will be set in the datapath flow sample action.
When flow sample action upcall happens, tunnel information will be retrieved from
the datapath and then IPFIX can export egress tunnel port information. If
samping_port=65535 (OFPP_NONE), flow-based IPFIX will keep the same behavior
as before.

This patch mainly do three tasks:
    1) Add a new flow sample action NXAST_SAMPLE2 to support exporting
       tunnel information. NXAST_SAMPLE2 action has a new added field
       'sampling_port'.
    2) Use 'other_configure: enable-tunnel-sampling' to enable or disable
       exporting tunnel information.
    3) If 'sampling_port' is equal to output port and output port is a tunnel
       port, the translation of OpenFlow "sample" action should first emit
       set(tunnel(...)), then the sample action itself. It makes sure the
       egress tunnel information can be sampled.
    4) Add a test of flow-based IPFIX for tunnel set.

How to test flow-based IPFIX:
    1) Setup a test environment with two Linux host with Docker supported
    2) Create a Docker container and a GRE tunnel port on each host
    3) Use ovs-docker to add the container on the bridge
    4) Listen on port 4739 on the collector machine and use wireshark to filter
       'cflow' packets.
    5) Configure flow-based IPFIX:
       - 'ovs-vsctl -- create Flow_Sample_Collector_Set id=1 bridge="Bridge UUID"'
       - 'ovs-vsctl -- set Flow_Sample_Collector_Set
    "Flow_Sample_Collector_Set UUID" ipfix=@i -- --id=@i create IPFIX \
    targets=\"IP:4739\" cache_active_timeout=60 cache_max_flows=13 \
    other_config:enable-tunnel-sampling=true'
       - 'ovs-ofctl add-flow mybridge in_port=1,
    actions=sample'('probability=65535,collector_set_id=1,obs_domain_id=123,
    obs_point_id=456,sampling_port=3')',output:3'
       Note: The in-port is container port. The output port and sampling_port
       are both open flow port and the output port is a GRE tunnel port.
    6) Ping from the container whose host enabled flow-based IPFIX.
    7) Get the IPFIX template pakcets and IPFIX information packets.

Signed-off-by: Benli Ye <daniely at vmware.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>




More information about the git mailing list