networking - How to increase ping time/network connection latency on Windows?

07
2014-04
  • RZB

    I need to permanently increase network latency in approximately 100ms, without losing packets.

    Reason: On a certain server and internet game my ping is too much lower than the other people playing it. I have 15ms, when average is 150ms which gives me cheater-like advantages.

    So also out of curiosity I'm looking for ways to increase my ping while keeping connection stable. What are my options if any?

    I thought about VPN services, but it seems like a bad option since games use UDP?

    Is there any router/software that would assist me on this?

    I'm on windows.

  • Answers
  • Bob

    You could give dummynet a shot:

    Adding Latency

    We can con­trol traf­fic by adding rules that match spe­cific packet data, and then send the pack­ets through a Dum­mynet pipe with added delay or packet loss. For exam­ple, we could add a 100 ms delay to all traf­fic head­ing to xkcd.com like so:

    $ sudo ipfw pipe 1 config delay 100ms
    $ sudo ipfw add 100 pipe 1 ip from any to xkcd.com
    00100 pipe 1 ip from any to any dst-ip 107.6.106.82
    

    The first com­mand here con­fig­ures a Dum­mynet pipe with id 1, cre­at­ing the pipe if it did not already exist. The sec­ond com­mand cre­ates a rule num­bered 100, which matches pack­ets with the desired des­ti­na­tion address and routes them through the pipe. Note that any rule that attempts to pass pack­ets through a non-existant pipe will block traf­fic and throw an error, so do not for­get to con­fig­ure pipes before using them. Using list again allows us to view the updated ruleset.

    $ sudo ipfw list
    00100 pipe 1 ip from any to 107.6.106.82
    65535 allow ip from any to any
    

    Ping­ing xkcd.com should show a round-trip time of 100 ms plus what­ever the actual cur­rent latency is across the connection.

    $ ping xkcd.com
    PING xkcd.com (107.6.106.82): 56 data bytes
    64 bytes from 107.6.106.82: icmp_seq=0 ttl=55 time=117.092 ms
    64 bytes from 107.6.106.82: icmp_seq=1 ttl=55 time=124.583 ms
    64 bytes from 107.6.106.82: icmp_seq=2 ttl=55 time=117.916 ms
    64 bytes from 107.6.106.82: icmp_seq=3 ttl=55 time=121.067 ms
    

    In most cases, we would want to sim­u­late a full duplex con­nec­tion by adding a cor­re­spond­ing rule for pack­ets com­ing from the remote host, so that the delay is applied in both direc­tions. When we are done play­ing with our new rule, we can delete it and the pipe as follows.

    $ sudo ipfw delete 100
    $ sudo ipfw pipe 1 delete
    

    source


    It looks like the dummynet project includes binaries for Windows. To adapt the commands, it should be enough to simply run the ipfw commands from an elevated command prompt. For example:

    ipfw pipe 1 config delay 100ms
    ipfw add 100 pipe 1 ip from any to server-ip
    ipfw add 101 pipe 1 ip from server-ip to any
    
  • RZB

    I ended up using openvpn. It's a breeze to use and works pretty good. Pings is stable, no packet loss. The only future problem is the 100mb of traffic limit. I'm not sure how fast I'll get to that just by playing games.


  • Related Question

    Linux-Windows 7 Network: Can't ping Linux Box using hostname?
  • DaveJohnston

    First off I should say that I am a total Linux and Networking Noob. I have used Windows all my life, but I am now trying to get into linux so I have set up an old PC with Fedora.

    Currently I only have the Linux Box and a Windows 7 Box and they are both connected to my broadband router. I have set them up with static IP addresses in the router and they can both ping each other by IP address but not hostname. I would like to be able to use hostnames to access each box (e.g. for SSH access and File Sharing). My question is basically how can I do this, what are the options and which is recommended for a small home network?

    So far I have been able to set up the linux box to be able to ping the Windows box by hostname by editing the hosts file. Is this the right thing to do? Should I just do this on the Windows box too?


  • Related Answers
  • Xenoactive

    With only two systems on your network, editing the hosts files is probably the easiest thing to do. You could also run your own DNS service on one of the two systems or you could find a free DNS service and setup entries with your internal IP addresses. Setting up the named.conf and a few basic zone files on a Linux system is relatively easy to do.

  • chuck

    Does your router allow you to setup hostnames and a domain for the NATed machines? If it doesn't you will probably be stuck with editing host files since setting up a dns server probably isn't worth it for two machines. You will also have problems using the Internet if your internal DNS server goes down. You might be able to configure your computers to fail over to your router for DNS but from my experience it slows things down quite a bit.

    For the brave, those willing to risk bricking their router, you might be able to try one of the open source firmwares like DD-wrt, OpenWRT, Tomato, etc. if your model is supported. They include many additional feature that you generally don't get with the stock firmwares on consumer grade access points/routers. You also get a command line interface to tinker with.