How can i change outgoing packets flags from none to df?

I want the outgoing packets to not be fragment like incoming packets

And what is the best TOS for gaming traffic?
My problem is i am getting low outgoing packets length compared to incoming, i gets for outoing around 11-45 length and incoming 76-200 as shown in tcpdump.

So i think the soluation to this is to make outgoing packets identical to incoming i was able to make ttl identical for both by this command:
Iptables -A PREROUTING - t mangle - j TTL - - ttl-set 45 - p 17

And TOS by this command:
Iptables -A PREOUTING - p 17 - t mangle - j TOS - - set-tos 0x10

And same rules for postrouting

Your packets that are well under your MTU (usually in the 1400-1500 range) are likely being generated by your game intentionally to speed responsiveness. It is unlikely that your router is creating unnecessary fragments.

1 Like

But the game doesn't fragment the incoming packets which is between 75-200 lengths

Could you please compare this to the packet size used by other applications, especially bulk downloads and uploads (download a file, send an email with an attachment)?

Which user-visible improvement are you hoping to get from changing the packet size, TTL or TOS?

I doubt there are any TCP/IP fragments involved. I almost guarantee that. Check to packets with tcpdump. I would be surprised if any are fragmented.

Low-latency applications often use small packets.

Changing TTL or DF flags on in-flight packets almost certainly won’t change the behavior you’re seeing.

i am just trying to make outgoing packets to behave as incoming

these are packets for upload and download by email:

upload file by email:

13:41:34.551045 IP (tos 0x0, ttl 128, id 13403, offset 0, flags [DF], proto TCP (6), length 2800)
    192.168.1.101.12586 > 172.217.18.229.443: Flags [.], cksum 0x8cae (incorrect -> 0x6265), seq 4854839:4857599, ack 3958, win 512, length 2760
13:41:34.560722 IP (tos 0x0, ttl 128, id 13405, offset 0, flags [DF], proto TCP (6), length 2800)
    192.168.1.101.12586 > 172.217.18.229.443: Flags [.], cksum 0x8cae (incorrect -> 0xdb8d), seq 4857599:4860359, ack 3958, win 512, length 2760
13:41:34.566729 IP (tos 0x0, ttl 128, id 13407, offset 0, flags [DF], proto TCP (6), length 3766)
    192.168.1.101.12586 > 172.217.18.229.443: Flags [P.], cksum 0x9074 (incorrect -> 0x81cd), seq 4860359:4864085, ack 3958, win 512, length 3726
13:41:34.573777 IP (tos 0x0, ttl 128, id 13410, offset 0, flags [DF], proto TCP (6), length 2800)
    192.168.1.101.12586 > 172.217.18.229.443: Flags [P.], cksum 0x8cae (incorrect -> 0x0cf3), seq 4864085:4866845, ack 3958, win 512, length 2760
13:41:34.581833 IP (tos 0x0, ttl 128, id 13412, offset 0, flags [DF], proto TCP (6), length 2800)
    192.168.1.101.12586 > 172.217.18.229.443: Flags [.], cksum 0x8cae (incorrect -> 0xc4d0), seq 4866845:4869605, ack 3958, win 512, length 2760
13:41:34.589111 IP (tos 0x0, ttl 128, id 13414, offset 0, flags [DF], proto TCP (6), length 1420)
    192.168.1.101.12586 > 172.217.18.229.443: Flags [.], cksum 0xdd26 (correct), seq 4869605:4870985, ack 3958, win 512, length 1380

download file by email:

13:44:08.101622 IP (tos 0x0, ttl 122, id 25381, offset 0, flags [none], proto TCP (6), length 1470)
    172.217.171.225.443 > 192.168.1.101.12637: Flags [.], cksum 0x11b6 (correct), seq 335370:336800, ack 1693, win 253, length 1430
13:44:08.101776 IP (tos 0x0, ttl 122, id 25352, offset 0, flags [none], proto TCP (6), length 1470)
    172.217.171.225.443 > 192.168.1.101.12633: Flags [.], cksum 0x08ef (correct), seq 1028920:1030350, ack 1693, win 253, length 1430
13:44:08.102052 IP (tos 0x0, ttl 122, id 25382, offset 0, flags [none], proto TCP (6), length 1470)
    172.217.171.225.443 > 192.168.1.101.12637: Flags [.], cksum 0xeb52 (correct), seq 336800:338230, ack 1693, win 253, length 1430
13:44:08.102336 IP (tos 0x0, ttl 122, id 25383, offset 0, flags [none], proto TCP (6), length 1470)
    172.217.171.225.443 > 192.168.1.101.12637: Flags [.], cksum 0x4a5e (correct), seq 338230:339660, ack 1693, win 253, length 1430
13:44:08.102668 IP (tos 0x0, ttl 122, id 25384, offset 0, flags [none], proto TCP (6), length 1256)
    172.217.171.225.443 > 192.168.1.101.12637: Flags [P.], cksum 0x7c98 (correct), seq 339660:340876, ack 1693, win 253, length 1216
13:44:08.103077 IP (tos 0x0, ttl 122, id 25385, offset 0, flags [none], proto TCP (6), length 1470)
    172.217.171.225.443 > 192.168.1.101.12637: Flags [P.], cksum 0xe2a4 (correct), seq 340876:342306, ack 1693, win 253, length 1430

i gets outgoing packets from 39 to 75 lengths it doesn't increase above 75 and incoming packets from 80 to 400 is there way to increase lengths limit for outgoing traffic ??

why incoming traffic for game has DF flag and outgoing not ?

Again, the generation of the packets is almost certainly how the game works and, as such, is out of your control.

One generally wants the smallest possible packets to minimize latency when designing a time-critical application.

You are "jousting with windmills" -- there is not a problem that you have demonstrated.

As to why incoming traffic has the DF flag set, it is because that is how the game's server works.

Edit: Any IPv6-capable network will have an MTU of 1280 bytes. Ancient IPv4 specs (RFC 791, 1981) were a minimum MTU of 68 bytes, however there are few, if any public links with an MTU anywhere near that small.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.