Monday, March 25, 2013

How to reduce or even remove packet loss in games

,
Back after a good day here in my soho, today i feel like posting a networking thread. So i`m gaming - anyone is gaming somehow - during a high packet loss there comes great ping - unable to play - rage!


How to minimise or remove packet loss completely?


There's a thing called MTU Limit which by default is set to 1500 in any system (unless jumbo frames) which is used to transfer packets across networks, actually it carries 1500 bytes of data in a single packet.
 - With jumbo frames that can go up to 9000 but that's another story. So why don't we go to check our current packet loss?


I`ll pick google.com for now, you can pick your gaming-server or anything that you connect to and needs some tweaking.

Run as Administrator command prompt & type:
netsh interface ipv4 show subinterfaces
after the execution you will notice a table where you can check your current MTU size, which by default should be 1500. -be sure to check your current established connection.

As you noticed it's 1500, so let's test now if it's actually that amount or a bit lower....
ping google.com -f -l 1472
-why i use a 1472 value? It's because 28 bytes are the ip/icmp overhead of the packet.

example of fragmented packets

Now, if your ping was successful - that means you saw a reply - then you're good to go!

But what if you notice the Packet needs to be fragmented but DF set ?
Your packets are getting fragmented - you have to reduce the MTU till you reach a successful ping.

I am getting replies with a lower MTU, now what?
Let's say i get replies when my MTU is down to 1423..., memorize this number & add 28.
Then:
netsh interface ipv4 set subinterface "Your connection name here" mtu=1451 store=persistent
 Your connection name here should be Local Area Connection

That was it , now you are set to go with 0% packet loss after restarting your computer.

23 people replied:

  1. Nice post Admin and thank u for this becoz when i play game ,my lot of data is going waste

    ReplyDelete
  2. What should I type insead of "Your connection name here"

    ReplyDelete
    Replies
    1. I typed "Local Area Connection" and got the same result as Anonymous. I'm on windows 8.1.

      Delete
    2. In 8.1 'Local Area Connection' is renamed to 'Ethernet'

      Delete
    3. Thank you so much for this post! The packets lost have decreased significantly but the problem is still present. Again I thank you and I will link my friends to this post. It helped a lot! :)

      Delete
    4. What is the problem which still occurs?
      Maybe i can help a bit further...

      Delete
    5. For example when I am playing Battlefield 4, every few seconds I start running in my place and when I test the system performance in game, a comment says that I am having severe packet loss issues. Also in League of Legends, my ping is unstable and keeps fluctuating and every few seconds I skip a few frames.

      Delete
  3. ey,
    if i do the things you say,
    ,y computer replies that it is invalid.
    i have tried 100 to 1451 but every time it says :
    the syntaxis that you use for this command are invalid look at the helpdesk for the right syntaxis ( it was in dutch )

    what do i need to do then ?

    ReplyDelete
    Replies
    1. I think that you should retry the commands.
      What version of Windows are you using?

      Delete
  4. if your getting packet loss for battlefield 4 not to worry its not you setup its not your pc its not you internet their junk game! i have been looking into this for days tested all my shit zero packet loss on my end or my isp's end. witch leaves only one place all the packets are going.. right in the pisss slit of the dip shit that thought battlefield 4 was reals for launch!! it would not be ready for the holiday season of 2014... the game is a joke do not buy it!!!!

    ReplyDelete
  5. I ve checked with pingtest.net and the packet loss remains the same as before i change the mtu.
    Btw it was a strange coincidence that i had the same results like the example... the mtu start working at the same numbers (1423) The problem is that i didnt quite understand why should i add the 28?

    ReplyDelete
    Replies
    1. 28 bytes is the header of the packet, it should be included always after the mtu
      20 bytes for the IP header and the 8 rest are for the ICMP.

      You can read more about IP here:
      http://en.wikipedia.org/wiki/IPv4

      ICMP here:
      http://en.wikipedia.org/wiki/Internet_Control_Message_Protocol

      Delete
  6. After i did what u mention above when i try to see if i get a packet loss i get the "request timed out"....
    Also when i measure the packet loss with the pingtest.net i get the same amount of packet loss (88%) though i doubt this is accurate cuz i think if i had that much i couldnt even connect to internet.

    ReplyDelete
  7. I've done all you said,but then my download speed dropped from 10mbs to 200kbs, how to restore prevous settings...?

    ReplyDelete
    Replies
    1. Then you obviously did something wrong, maybe set the MTU too low? Change your mtu to the default level. Simple as that.

      Delete
  8. Hello I have a PPoE connection. Should I change the MTU value of the PPoE connection or the Ethernet ?

    ReplyDelete
    Replies
    1. PPPoE stands for Point-to-Point Protocol over Ethernet, which basically is the same as Ethernet.
      Which one do you use to connect to your modem/router?

      This solution will work for you if you're having packet loss inside the subnet your ISP is letting you use. If this really isn`t bothering you should re-consider changing your MTU values. If you're playing an online game and get packet loss, this will remove packet loss from your computer to your ISP, not from the server to your client. I`ve answered many comments about the battlefield problems you're facing, it's not you guys, it's their server experiencing connectivity problems or unable to handle users... have fun.

      Delete
    2. When I run the command "netsh interface ipv4 show subinterfaces" I see two interfaces being shown. One called "Dot Internet" with a MTU default value of 1480 and another one called "Ethernet 3" with a MTU default value of 1500. Dot Internet is the WAN Miniport (PPPOE) while the other one being the NIC, I'm confused as to which interface's MTU value I need to change, the Dot Internet MTU value or the Ethernet 3 MTU value?

      Delete