Reputation: 2263
I know it is possible to add or modify single flows of OpenFlow switches to decrement the TTL(IPv4) or the hop limit (IPv6).
I tested it with the floodlight controller and the following flow entry
ovs-ofctl -O OpenFlow13 add-flow s1 "priority=1,ip,in_port=2,dl_src=<src_mac>,dl_dst=<dst-mac>,nw_src=10.0.0.1,nw_dst=10.0.0.2 actions=dec_ttl,output:1"
But how can I do this for all UDP IPv6 packets passing a switch? I can not update all flows all the time.
I want to simulate the decrementing of the ttl/hoplimit like it is done in IP routers with SDN switches. The testbed I am using is build with Mininet and Open vSwitch switches running in kernel mode.
I don't want to write a whole SDN Controller and I also don't want to implement all flows by myself. I just want the switches to decrement the ttl/hop limit of every UDP IPv6 packet passing.
Upvotes: 2
Views: 1293
Reputation: 261
You can use a flow to match only on UDP packets as follows:
$ sudo ovs-ofctl -O OpenFlow13 add-flow s1 "priority=1,dl_type=0x86DD,nw_proto=17 actions=dec_ttl"
You can see in the output of dump-flow that it will match udp on ipv6 packets:
$ sudo ovs-ofctl dump-flows s1 -O OpenFlow13
cookie=0x0, duration=4.103s, table=0, n_packets=0, n_bytes=0, priority=1,udp6 actions=dec_ttl
Upvotes: 3