[ovs-dev] Is there any way to simulate the tunnel traffic in test cases to test IPFIX feature?

Wenyu Zhang wenyuz at vmware.com
Tue Jun 3 09:51:06 UTC 2014


I am trying to simulate traffic in test cases to test IPFIX feature. 
  
For normal traffic, I can use "ovs-appctl netdev-dummy/receive " to simulate it, just refer to the netflow and sflow cases in tests/ofproto-dpif.at 
And I can capture the IPFIX packets on lo interface as expected. 
  
But for tunnel traffic, I haven't find a workable way to generate this kind of traffic.  
For example,  I try to use "ovs-appctl ofproto/trace ovs-dummy" command with "-generate" option.  
And we can see that the "sample" actions has been inserted as expected, but these actions are not executed, and no IPFIX packets can be captured on lo interface. 
  
Anyone knows about the usage of this command? Or other way to generate the tunnel traffic to trigger IPFIX sample action? Thanks a lot. 
  
Following is the script to simulate tunnel traffic, but it doesn't work for IPFIX. 


AT_SETUP([ofproto-dpif - IPFIX tunnel packet sampling]) 
   OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=gre \ 
                       options:remote_ip=1.1.1.1 ofport_request=1\ 
                       -- add-port br0 p2 -- set Interface p2 type=gre \ 
                       options:local_ip=2.2.2.2 options:remote_ip=1.1.1.1 \ 
                       ofport_request=2 \ 
                       -- add-port br0 p3 -- set Interface p3 type=gre \ 
                      options:remote_ip=2.2.2.2 ofport_request=3]) 
   AT_DATA([flows.txt], [dnl 
actions=IN_PORT 
]) 

  ovs-appctl time/stop 
  ON_EXIT([kill `cat test-ipfix.pid`]) 
  AT_CHECK([ovstest test-ipfix --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > ipfix.log], [0], [], [ignore]) 
  AT_CAPTURE_FILE([ipfix.log]) 
  IPFIX_PORT=`parse_listening_port < test-ipfix.log` 

  ovs-vsctl \ 
     set Bridge br0 ipfix=@i -- \ 
     --id=@i create IPFIX targets=\"127.0.0.1:$IPFIX_PORT\" \ 
       sampling=1 obs_domain_id=123 obs_point_id=456 cache_active_timeout=1 cache_max_flows=0 other_config:enable-tunnel-sampling=true 

   AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) 
   AT_CHECK([ovs-appctl dpif/show | tail -n +3], [0], [dnl 
                br0 65534/100: (dummy) 
                p1 1/1: (gre: remote_ip=1.1.1.1) 
                p2 2/1: (gre: local_ip=2.2.2.2, remote_ip=1.1.1.1) 
                p3 3/1: (gre: remote_ip=2.2.2.2) 
]) 


 dnl remote_ip 
   AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=1.2.3.4,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)' -generate], [0], [stdout]) 
   AT_CHECK([tail -1 stdout], [0], 
    [Datapath actions: sample(sample=100.0%,actions(userspace(pid=0,ipfix(output_port=4294967295)))),set(tunnel(tun_id=0x0,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df))),sample(sample=100.0%,actions(userspace(pid=0,ipfix(output_port=1),tunnel_out_port=1))),1   
 Bests, 
Wenyu 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20140603/effc1654/attachment-0005.html>


More information about the dev mailing list