dswp.de
http://www.dswp.de/old/

friday lag screens
http://www.dswp.de/old/forum-gameserver-support/friday-lag-screens-t5025-10.html
Page 2 of 2

Author:  BEH [ 03.12.12 ]
Post subject:  Re: friday lag screens

Interesting. but still. there's only 1 shortest route ye? I figure it uses that route all the time. and it seems there is now either a shorter route found, or some engineer on the railroads forced a detour of some sorts. it works nice anyhow. =)

Author:  natirips [ 03.12.12 ]
Post subject:  Re: friday lag screens

A better analogy would be traveling in a big city from point A to point B. Normally you take the shortest route, but during the rush hour an alternate path may be faster.

So when the network is clogged, packets go through different routes.

Now, TCP is like a convoy (all packets take the same route), while UDP is like sending each packet independently.

TCP is more linear in behavior because packets come in the same order at they are sent. This is good as long as the path doesn't get clogged up in the middle of transmission.

UDP, however, uses a different route for each packet, so when one route is clogged other packets may still get to the destination. The problem is that sometimes a packet is not lost, but just delayed so they reach destination in a somewhat random order.

So TCP is good for WWW/file transfers/e-mails/etc., while UDP is better for gaming/real-time monitoring/etc..

Author:  wurst [ 03.13.12 ]
Post subject:  Re: friday lag screens

no, today @ 19h his happened:
now the servers are not only fixed, the firewall react within 1-2 seconds on UDP getstatus spam.
im not finished yet, i need a clearance system and better perormance in ripping down existing fw states.

Code:
<?php
/*
wursti 3-2012 wegen getstatus flood
wird betrieben per "tcpdump -n -X 'udp and len <= 60' | php getstatusflood.php"

die kiste snifft q3 getstatuspakete und speichert/reagiert 1x pro sekunde.
Kontrolle MySQL auf mileva über "tcpdump "host 192.168.9.5 and tcp port 3306" -n -X"


error_reporting(E_ERROR | E_WARNING | E_PARSE);
*/


$dbhost='***.***.***.***';
$dbusername='********';
$dbuserpass='********';;
$dbname='mydb';




// $now = time();



$in = fopen("php://stdin", "r");

  while (!feof($in)) {
 
    $textline = fgets($in);
   
       if (preg_match("/ IP /", $textline)) {  //IP Line, 4rd from here must contain getstatus string
          $line = 1;
       $packetinfo = str_word_count($textline, 1, '1234567890.');
        $src = $packetinfo['4'];
        // (thats btw lan IP :P) $dst = $packetinfo['5'];
                                            }

       if ($line == 4) {
             if (preg_match("/getstatus/i", $textline)) {  //we found a getstatus packet, lets go cummulate...
                                                         
                                                         $now = time();
                                                         
                                                         $src = explode('.',$src);
                                                         $src = $src['0'].".".$src['1'].".".$src['2'].".".$src['3'];
                                                         $array[$src]++ ;
                                                         
                                                         if ($last != $now) { //we have a new second!
                                                         
                                                         //echo time()."\n";
                                                         echo ".";
                                                         
                                                         //add new IPs to MySQL DB and update existing records
                                                         
                                                         foreach ($array as $src => $count) {
                                                                                             if ($count > 50 &amp;&amp; $src != ''){
                                                                                             
                                                                                             mysql_connect($dbhost, $dbusername, $dbuserpass) or die(mysql_error());
                                                                                             mysql_select_db($dbname) or die('Cannot select database');
                                                                                             
                                                                                             unset ($sql_upsert);
                                                                                             $sql_upsert ="INSERT INTO nat1_flooding_hosts2 (ip,pps_avg,active_sec,last_seen)\n";
                                                                                             $sql_upsert .="VALUES ('$src', '$count', '1', '')\n";
                                                                                             $sql_upsert .="ON DUPLICATE KEY UPDATE active_sec=active_sec+1, pps_avg=((pps_avg * active_sec) + $count)/(active_sec + 1),last_seen=now();\n";
                                                                                             
                                                                                             //echo $sql_upsert;
                                                                                             
                                                                                             mysql_query($sql_upsert);
                                                                                             
                                                                                             
                                                                                             //find out wether we have a new record in DB (without SQLing again)
                                                                                             if (mysql_affected_rows()){
                                                                                             if (mysql_affected_rows() == '1'){//on update we have *2* affected rows lol
                                                                                                                             
                                                                                                                             
                                                                                                                             
                                                                                                                              system("easyrule block wan $src", $return);
                                                                                                                             
                                                                                                                              echo "$return\n";
                                                                                                                             
                                                                                                                              }
                                                                                             else                             { //ausmerzen bei update verdammt :P
                                                                                                                               
                                                                                                                              system("pfctl -k $src", $states);
                                                                                                                              system("pfctl -K $src", $srcnodes);
                                                                                                                               
                                                                                                                              echo "$states\n$srcnodes\n";
                                                                                                                              }
                                                                                                                        }
                                                                                               mysql_close();
                                                                                               


//                                                                                             $fw_check ="SELECT ip FROM nat1_flooding_hosts2";
//                                                                                             $fw_check .="WHERE active_sec = 1 AND ip = $src";
//                                                                                             $fw_check .=";";

//                                                                                             $result = mysql_query($fw_check, $db);
//                                                                                             echo mysql_result($result, 0);





                                                                                             echo "$src - $count\n";
                                                                                                              }
                                                                                             }
                                                                                             //echo ".\n\n";
                                                                             //unset($src); unset($count); unset($return); unset($states); unset($srcnodes);
                                                                             unset($array);
                                                         
                                                                             }
                                                         
                                                            //     echo $src."\n";
                                                         $last = $now;
                                                        }
                      }
          $line++;
                   }

?>


 

Author:  natirips [ 03.13.12 ]
Post subject:  Re: friday lag screens

Attachment:
screenshot3.png
screenshot3.png [ 53.31 KiB | Viewed 5976 times ]

Quote:
Wusrti sows fear.
:)

Author:  wurst [ 03.13.12 ]
Post subject:  Re: friday lag screens

wursti knows gnawing creatures that come @ night!

btw it died tonight @ 2am cause mysql connection, when i re-use the connection in script it *forgets* on a specified point.
however, its up and running again:
Attachment:
gnawing_animals_at_night.png
gnawing_animals_at_night.png [ 33.39 KiB | Viewed 5979 times ]

Author:  natirips [ 03.13.12 ]
Post subject:  Re: friday lag screens

That is hell of a lot of blocked traffic.

Author:  wurst [ 03.15.12 ]
Post subject:  Re: friday lag screens

no its 1-2-3Mbit, its what 1-2-3 dsl kids would typically be able to do.

Author:  natirips [ 03.15.12 ]
Post subject:  Re: friday lag screens

But it looks like there's more blocked traffic than passed traffic.

Author:  wurst [ 03.16.12 ]
Post subject:  Re: friday lag screens

Sure, the gaming dont need much.
its like 10Kbit per user up/down, the more full the server is, the more data will be sent to the client.
Typical would be ~20Kbits up and 10 down (server pov) when Server is full.

Its more about Latency, we have 3X Gigabit Linkup.
In Fact we use around 1% of the capacity.
Anyways, it lags the Gameservers handling 4K getstatus Requests per Second.
Even that fixed ones (which dont reply when a specified source IP is busting the programmed frequency for this request)

BTW.
Not responding at all to getstatus request means:

1.) Not beeing listed in the Masterlist
2.) If beeing listet, not being displayed in Clients lists (they getstatus the whole list when u *refresh* there)
--> We could simply switch it off.

Page 2 of 2 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/