title: Running Pktgen with Lua scripts
body: <p>I am currently working with pktgen in order to achieve high-rate packet generation for a project. I am using version 2.9.5 of pktgen, along with DPDK version 2.1.0. It does work perfectly fine ( I am able to generate and send packet at 10 Gb/s rate ) until I try to use lua scripts for formatting packets.</p>
  
  <p>As a matter of fact, scripts examples that you can find with the sources seem to not always have the expected behaviour. Simplest scripts work perfectly fine ( HelloWorld.lua for example, I am also able to set packet size, rate or burst with script commands )</p>
  
  <pre><code>   package.path = package.path ..";?.lua;test/?.lua;app/?.lua;"
    2 
    3 pktgen.set("all", "count", 0);
    4 pktgen.set("all", "rate", 50);
    5 pktgen.set("all", "size", 256);
    6 pktgen.set("all", "burst", 128);
    7 pktgen.start(0)
  </code></pre>
  
  <p>( the code above does work )</p>
  
  <p>However, I have encountered issues as I tried to define directly a packet format with a table, like in this example :</p>
  
  <pre><code>-- Lua uses '--' as comment to end of line read the
    2 -- manual for more comment options.
    3 local seq_table = {                     -- entries can be in any order
    4     ["eth_dst_addr"] = "0011:4455:6677",
    5     ["eth_src_addr"] = "0011:1234:5678",
    6     ["ip_dst_addr"] = "10.12.0.1",
    7     ["ip_src_addr"] = "10.12.0.1/16",   -- the 16 is the size of the mask va    lue
    8     ["sport"] = 9,                      -- Standard port numbers
    9     ["dport"] = 10,                     -- Standard port numbers
   10     ["ethType"] = "ipv4",       -- ipv4|ipv6|vlan
   11     ["ipProto"] = "udp",        -- udp|tcp|icmp
   12     ["vlanid"] = 1,                     -- 1 - 4095
   13     ["pktSize"] = 128           -- 64 - 1518
   14   };
   15 -- seqTable( seq#, portlist, table );
   16 pktgen.seqTable(0, "all", seq_table );
   17 pktgen.set("all", "seqCnt", 1);
  </code></pre>
  
  <p>When I try this script, Pktgen will usually give me a
      Unknown Ethertype 0x0000
  Error as soon as I try start 0 in commandline ( 0 is the port I use to transmit packet ). 
   Same problem occurs when I try the main.lua script.</p>
  
  <p>Long story short, I have troubles understanding how the pktgen.seqtable function works, and why it does not work properly in my case. I did not find any really helpful documentation on the net on this subject.</p>
  
  <p>the command I use to launch scripts is :</p>
  
  <pre><code>sudo -E $PKTGEN_CMD/pktgen -c 0x7 -n 4 -- -m "1.0,2.1" -f test/set_seq.lua
  </code></pre>
  
  <p>( test/set_seq.lua being a script example ).</p>