pktgen / Pktgen-DPDK

DPDK based packet generator
Other
377 stars 117 forks source link

Unable to set TCP flags #284

Open pchaseh opened 12 hours ago

pchaseh commented 12 hours ago

Hi,

I'm using this project with packets generated from an Lua script which appears as follows:

package.path = package.path ..";?.lua;test/?.lua;app/?.lua;"

require "Pktgen"

local seq_table = {
     ["eth_dst_addr"] = "xx:xx:xx:xx:xx:xx",
     ["eth_src_addr"] = "yy:yy:yy:yy:yy:yy",
     ["ip_dst_addr"] = "1.2.3.4",
     ["ip_src_addr"] = "4.3.2.1",
     ["sport"] = 9,
     ["dport"] = 10,
     ["ethType"] = "ipv4",
     ["ipProto"] = "tcp",
     ["vlanid"] = 11,
     ["pktSize"] = 128,
     ["tcp_flags"] = 2
 };
 pktgen.seqTable(0, "all", seq_table);
 pktgen.vlan("all", "enable");
 pktgen.set("all", "seqCnt", 1);

When I launch pktgen and run it (via script myscript.lua then start all) I'm seeing the generated TCP traffic still use DEFAULT_TCP_FLAGS (ACK) instead of the tcp_flags value. I'm not sure what representation it expects, but I've tried both the numerical value for the SYN flag (2) as well as "S" to no avail. Additionally, running set all tcp flag set syn yields no difference. When I recompile pktgen with DEFAULT_TCP_FLAGS set to SYN_FLAG it works, so it appears as if never overwrites the default value.

pktgen version: 24.07.0

KeithWiles commented 11 hours ago

It looks like a bug, I see why it is not working and I will look at it this weekend.