1

I use Mininet with a custom topology and the RYU-REST controller "ofctl-rest.py". After installing some flowentries in the switches, sending some packets over the network and capturing traffic I recognize that the switches do not decrease the ttl - field in the ip - layer. I figure out that i have to tell the switches to decrease the ttl field (this is possible since OpenFlow - version 1.1). To do so I try the line "type": "DEC_NW_TTL", but it does not work. My compleate command look like this:

curl -X POST -d '{
    "dpid": 1,
    "cookie": 1,
    "cookie_mask": 1,
    "table_id": 0,
    "idle_timeout": 3600,
    "hard_timeout": 3600,
    "priority": 0,
    "flags": 1,
    "match":{
        "in_port": 1
    },
    "actions":[
        {
            "type":"OUTPUT",
            "port": 4,
            "type":"DEC_NW_TTL"
        }
    ]
 }' http://localhost:8080/stats/flowentry/add

What do I wrong? How do I have to modify the comand to let the switch reduce ttl? Please help me. Thank you in advance.

André
  • 53
  • 2
  • 6

2 Answers2

0

I think you have to specify more than one action. Also you should change the actions' order. First, you need to decrement the TTL and afterwards send it the packet out. Sending the packet first and decrementing afterwards doesn't work.

I would try it this way:

curl -X POST -d '{
    "dpid": 1,
    "cookie": 1,
    "cookie_mask": 1,
    "table_id": 0,
    "idle_timeout": 3600,
    "hard_timeout": 3600,
    "priority": 0,
    "flags": 1,
    "match":{
        "in_port": 1
    },
    "actions":[
        {
            "type":"DEC_NW_TTL"
        },
        {
            "type":"OUTPUT",
            "port": 4
        }
    ]
 }' http://localhost:8080/stats/flowentry/add
Abbadon
  • 1
  • 1
0

The answer by Abbadon should work. You should put each action within a pair of brackets. However, the order of different actions in the post request doesn't matter. OpenFlow has its default order for different types of actions.

  1. copy TTL inwards: apply copy TTL inward actions to the packet
  2. pop: apply all tag pop actions to the packet
  3. push-MPLS: apply MPLS tag push action to the packet
  4. push-PBB: apply PBB tag push action to the packet
  5. push-VLAN: apply VLAN tag push action to the packet
  6. copy TTL outwards: apply copy TTL outwards action to the packet
  7. decrement TTL: apply decrement TTL action to the packet
  8. set: apply all set-field actions to the packet
  9. qos: apply all QoS actions, such as set queue to the packet
  10. group: if a group action is specified, apply the actions of the relevant group bucket(s) in the order specified by this list
  11. output: if no group action is specified, forward the packet on the port specified by the output action