USNavalResearchLaboratory / mgen

Multi-Generator (MGEN) traffic generation tool
https://www.nrl.navy.mil/itd/ncs/products/mgen
Other
83 stars 26 forks source link

TCP retry handles flow ID incorrectly #56

Closed aamcintosh closed 1 month ago

aamcintosh commented 1 month ago

In TCP retry mode, the following

0.0 ON 10 TCP DST 172.16.1.12/6767 PERIODIC [2 1400] COUNT 1498

results in the error message

Mgen::ParseEvent() Error: invalid <flowId> at line: 0

This appears to be due to the following code at line 1142 of common/mgenTransport.cpp:

sprintf(cmd, "%x MOD %x RECONNECT", (unsigned int) GetRetryDelay(), next->GetFlowId());

The second %x should be a %d just as it is on line 1138:

sprintf(cmd, "MOD %d PAUSE", next->GetFlowId());

Strange behavior also ensues if the flow ID expressed as a hexadecimal number containing no letters.

weston-nrl commented 1 month ago

Should be fixed, please let me know if it works for you. I updated both of those lines as flow IDs should be unsigned ints.

aamcintosh commented 1 month ago

Yes, that seems to have fixed the problem. Thank you.