Forum

> > CS2D > General > cs2d packet
Forums overviewCS2D overviewGeneral overviewLog in to reply

English cs2d packet

13 replies
To the start Previous 1 Next To the start

old cs2d packet

RoDioN1322
BANNED Off Offline

Quote
What is the largest packet size can send cs2d
EDIT: In length me need
edited 1×, last 26.11.13 07:39:42 pm

old Re: cs2d packet

TimeQuesT
User Off Offline

Quote
65.527(bytes)[content: excluding header], but it is for sure that it's reaching its target damaged and uncomplete.

old Re: cs2d packet

RoDioN1322
BANNED Off Offline

Quote
user TimeQuesT has written
65.527(bytes)[content: excluding header], but it is for sure that it's reaching its target damaged and uncomplete.

length will be?

old Re: cs2d packet

ohaz
User Off Offline

Quote
@user RoDioN1322: If you don't know that "byte" can describe a length, then you probably shouldn't work on the topic you're working on.

old Re: cs2d packet

RoDioN1322
BANNED Off Offline

Quote
@TimeQuesT
I realized

i have problem in this code
1
iptables -A INPUT -p udp -m length --length 278:428 -j DROP
he block udp packet who dos my server
problem: i see Players join and dont leave in spec and him ping = 0

old Re: cs2d packet

RoDioN1322
BANNED Off Offline

Quote
user TimeQuesT has written
Here take this link as gift!

Click meh!

this i knowe
and code normal work problem because this code create lag (ping = 0 ,not for all)
and i dont know why

old Re: cs2d packet

fragezeichen
User Off Offline

Quote
1
iptables -A INPUT -p udp -m length --length 278:428 -j DROP

This blocks all incoming udp packets with a size between 278 bytes and 428 bytes. size here means the size of the ip packet including the ip and udp header. (ip header size = 20 bytes, udp header size = 8 bytes, so you have to substract 28 from the interval to get the actual size of the payload that udp packets get blocked for).

This will block all udp packets, so if you have other stuff running on your server that have udp packets with that size, they'll get blocked too.

old Re: cs2d packet

DC
Admin Off Offline

Quote
"length" is commonly equal to "bytes" (or: the length is specified in bytes) when talking about network packets.

CS2D tries to keep UDP packet sizes below the MTU Ethernet v2 size (http://en.wikipedia.org/wiki/Maximum_transmission_unit) which is 1500 bytes.
Actually in most cases it will even try to keep the packet payload size under 1000 bytes (plain payload size, excluding headers).

So discarding packets with a size > 1500 (raw size, including headers) should be safe.
CS2D itself automatically ignores all packets with a payload size (headers excluded) of >= 5000 bytes.
Take care of other stuff running on your server though! It might be a good idea to limit the rule to the port(s) you are using for CS2D servers.

Also CS2D never sends completely empty UDP packets. So it's recommended to block these with
1
iptables -A INPUT -p udp -m length --length 0:28 -j DROP

This blocks all UDP packets with a size <= 28 bytes. Those are packets consisting just of an ip/udp header without any actual payload or simply strange bogus packets. Before using this rule make sure that you are not running any services on your system which have to be able to receive empty UDP packets (quite unlikely but not impossible) or limit the rule to port(s) you are using for CS2D servers.

old Re: cs2d packet

RoDioN1322
BANNED Off Offline

Quote
@user DC:
servers are very fragile and I'm trying to make a simple protect.
http://unrealsoftware.de/forum_posts.php?post=364740&l#jl here me dos and i check he send me 2 packet 300 bytes in sec, server crashed :c

and i create test in tcpdump when i download files on server i too send big packet (by cs2d) and server not lagged/crash

where logic?

EDIT: and how can I filter?

old Re: cs2d packet

DC
Admin Off Offline

Quote
It's not just the size that makes the server crash.
It depends on the content as well. You can't filter them easily.
I don't know which content leads to a crash, otherwise I would fix it.
To the start Previous 1 Next To the start
Log in to replyGeneral overviewCS2D overviewForums overview