{
    "mode": "man",
    "parameter": "tc-simple",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/tc-simple/8/json",
    "generated": "2026-06-13T22:10:10Z",
    "synopsis": "tc ... action simple [ sdata STRING ] [ index INDEX ] [ CONTROL ]\nCONTROL := { reclassify | pipe | drop | continue | ok }",
    "sections": {
        "NAME": {
            "content": "simple - basic example action\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "tc ... action simple [ sdata STRING ] [ index INDEX ] [ CONTROL ]\n\nCONTROL := { reclassify | pipe | drop | continue | ok }\n\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This  is  a  pedagogical example rather than an actually useful action. Upon every access, it\nprints the given STRING which may be of arbitrary length.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "sdata STRING\nThe actual string to print.\n\nindex INDEX\nOptional action index value.\n\nCONTROL\nIndicate how tc should proceed after executing the action. For a  description  of  the\npossible CONTROL values, see tc-actions(8).\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "The  following  example makes the kernel yell \"Incoming ICMP!\" every time it sees an incoming\nICMP on eth0. Steps are:\n\n1)  Add an ingress qdisc point to eth0\n\n2)  Start a chain on ingress of eth0 that first matches ICMP then invokes the  simple  action\nto shout.\n\n3)  display stats and show that no packet has been seen by the action\n\n4)  Send one ping packet to google (expect to receive a response back)\n\n5)  grep the logs to see the logged message\n\n6)  display stats again and observe increment by 1\n\nhadi@noma1:$ tc qdisc add dev eth0 ingress\nhadi@noma1:$tc filter add dev eth0 parent ffff: protocol ip prio 5 \\\nu32 match ip protocol 1 0xff flowid 1:1 action simple sdata \"Incoming ICMP\"\n\nhadi@noma1:$ sudo tc -s filter ls  dev eth0 parent ffff:\nfilter protocol ip pref 5 u32\nfilter protocol ip pref 5 u32 fh 800: ht divisor 1\nfilter protocol ip pref 5 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:1\nmatch 00010000/00ff0000 at 8\naction order 1: Simple <Incoming ICMP>\nindex 4 ref 1 bind 1 installed 29 sec used 29 sec\nAction statistics:\nSent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)\nbacklog 0b 0p requeues 0\n\n\nhadi@noma1$ ping -c 1 www.google.ca\nPING www.google.ca (74.125.225.120) 56(84) bytes of data.\n64 bytes from ord08s08-in-f24.1e100.net (74.125.225.120): icmpreq=1 ttl=53 time=31.3 ms\n\n--- www.google.ca ping statistics ---\n1 packets transmitted, 1 received, 0% packet loss, time 0ms\nrtt min/avg/max/mdev = 31.316/31.316/31.316/0.000 ms\n\nhadi@noma1$ dmesg | grep simple\n[135354.473951] simple: Incoming ICMP1\n\nhadi@noma1$ sudo tc/tc -s filter ls  dev eth0 parent ffff:\nfilter protocol ip pref 5 u32\nfilter protocol ip pref 5 u32 fh 800: ht divisor 1\nfilter protocol ip pref 5 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:1\nmatch 00010000/00ff0000 at 8\naction order 1: Simple <Incoming ICMP>\nindex 4 ref 1 bind 1 installed 206 sec used 67 sec\nAction statistics:\nSent 84 bytes 1 pkt (dropped 0, overlimits 0 requeues 0)\nbacklog 0b 0p requeues 0\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "tc(8) tc-actions(8)\n\n\n\niproute2                                     12 Jan 2015                      Simple action in tc(8)",
            "subsections": []
        }
    },
    "summary": "simple - basic example action",
    "flags": [],
    "examples": [
        "The  following  example makes the kernel yell \"Incoming ICMP!\" every time it sees an incoming",
        "ICMP on eth0. Steps are:",
        "1)  Add an ingress qdisc point to eth0",
        "2)  Start a chain on ingress of eth0 that first matches ICMP then invokes the  simple  action",
        "to shout.",
        "3)  display stats and show that no packet has been seen by the action",
        "4)  Send one ping packet to google (expect to receive a response back)",
        "5)  grep the logs to see the logged message",
        "6)  display stats again and observe increment by 1",
        "hadi@noma1:$ tc qdisc add dev eth0 ingress",
        "hadi@noma1:$tc filter add dev eth0 parent ffff: protocol ip prio 5 \\",
        "u32 match ip protocol 1 0xff flowid 1:1 action simple sdata \"Incoming ICMP\"",
        "hadi@noma1:$ sudo tc -s filter ls  dev eth0 parent ffff:",
        "filter protocol ip pref 5 u32",
        "filter protocol ip pref 5 u32 fh 800: ht divisor 1",
        "filter protocol ip pref 5 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:1",
        "match 00010000/00ff0000 at 8",
        "action order 1: Simple <Incoming ICMP>",
        "index 4 ref 1 bind 1 installed 29 sec used 29 sec",
        "Action statistics:",
        "Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)",
        "backlog 0b 0p requeues 0",
        "hadi@noma1$ ping -c 1 www.google.ca",
        "PING www.google.ca (74.125.225.120) 56(84) bytes of data.",
        "64 bytes from ord08s08-in-f24.1e100.net (74.125.225.120): icmpreq=1 ttl=53 time=31.3 ms",
        "--- www.google.ca ping statistics ---",
        "1 packets transmitted, 1 received, 0% packet loss, time 0ms",
        "rtt min/avg/max/mdev = 31.316/31.316/31.316/0.000 ms",
        "hadi@noma1$ dmesg | grep simple",
        "[135354.473951] simple: Incoming ICMP1",
        "hadi@noma1$ sudo tc/tc -s filter ls  dev eth0 parent ffff:",
        "filter protocol ip pref 5 u32",
        "filter protocol ip pref 5 u32 fh 800: ht divisor 1",
        "filter protocol ip pref 5 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:1",
        "match 00010000/00ff0000 at 8",
        "action order 1: Simple <Incoming ICMP>",
        "index 4 ref 1 bind 1 installed 206 sec used 67 sec",
        "Action statistics:",
        "Sent 84 bytes 1 pkt (dropped 0, overlimits 0 requeues 0)",
        "backlog 0b 0p requeues 0"
    ],
    "see_also": [
        {
            "name": "tc",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/tc/8/json"
        },
        {
            "name": "tc-actions",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/tc-actions/8/json"
        },
        {
            "name": "tc",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/tc/8/json"
        }
    ]
}