Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set TCP flags #284

Open
pchaseh opened this issue Sep 19, 2024 · 4 comments
Open

Unable to set TCP flags #284

pchaseh opened this issue Sep 19, 2024 · 4 comments

Comments

@pchaseh
Copy link

pchaseh commented Sep 19, 2024

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
Copy link
Collaborator

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

@KeithWiles
Copy link
Collaborator

I think I have the TCP flags working, please give the fix-tcp-flags branch a try and let me know.

@pchaseh
Copy link
Author

pchaseh commented Oct 9, 2024

Thanks Keith, seems to be working a first glance, however I'm getting this crash when loading Lua scripts on the fix-tcp-flags branch when the tcp_flags field isn't specified. Likewise, if I change the IP protocol to UDP, it still occurs. I've verified that in switching over to main, recompiling, and relaunching pktgen, I don't see this problem

Screenshot_5263

Note that my script doesn't start sending packets (that's left to the user), so appears to be an issue during packet initialization

@KeithWiles
Copy link
Collaborator

KeithWiles commented Oct 9, 2024

OK thanks, please try the fixes-for-release branch if you have time. It most likely will not fix this problem and it will take me a few days to be able to look into the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants