mgen icon indicating copy to clipboard operation
mgen copied to clipboard

Same DSCP/TOS marking for different events

Open fenwick0neil opened this issue 1 year ago • 2 comments

Was working with DSCP / TOS marking found that both MGEN events are marked with the same TOS value.

MGEN COMMAND: mgen event "0.0 ON 1 UDP DST 127.0.0.1/5111 PERIODIC [ 1 128 ] TOS 16" event "0.0 ON 2 UDP DST 127.0.0.1/5222 PERIODIC [ 1 128 ] TOS 8"

TCPDUMP on lo: sudo tcpdump -lnnei lo -v port 5111 or port 5222

13:38:56.527050 00:00:00:00:00:00 > 00:00:00:00:00:00, ethertype IPv4 (0x0800), length 170: (tos 0x8, ttl 255, id 63041, offset 0, flags [DF], proto UDP (17), length 156) 127.0.0.1.43691 > 127.0.0.1.5111: UDP, length 128 13:38:56.527101 00:00:00:00:00:00 > 00:00:00:00:00:00, ethertype IPv4 (0x0800), length 170: (tos 0x8, ttl 255, id 63042, offset 0, flags [DF], proto UDP (17), length 156) 127.0.0.1.43691 > 127.0.0.1.5222: UDP, length 128

fenwick0neil avatar May 10 '23 13:05 fenwick0neil

I can verify that this is a problem, as I just ran into it the other day. I believe this is due to the code reusing an existing socket and not detecting that it needs to create a separate one. There should be a way to fix that properly, but I'm not sure offhand how complicated that may be. If you need a workaround in the meantime, specify different source ports on the different TOS flows.

weston-nrl avatar May 10 '23 13:05 weston-nrl

Workaround works, thanks.

fenwick0neil avatar May 11 '23 13:05 fenwick0neil