Jump to content

  • Log In with Google      Sign In   
  • Create Account


Any idea on an expected Nat punchthrough failure rate?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 The ZMan   Members   -  Reputation: 702

Like
0Likes
Like

Posted 11 October 2012 - 11:11 AM

Hello again..

We're seeing higher-than-we-would-like number of people who simply cannot host or connect to games. We're using lidgren which supports some form of NAT punchthrough and all of our user hosted servers are likely behind NAT. For most cases it appears to be client specific i.e. they cannot connect to any games anywhere.

We added some tracking and out of about 40k connection attempts we fail NAT punchthrough about 15% of the time. If we then attempt to connect anyway we get though in an additional 6% of the time giving us an overall failure rate of 9% of our user attempts. Not good enough to stop complaints :-) We've checked out code many times (and found/fixed a few bugs) and also wiresharked to show that the packets simply do not make it through the routers.

So before we spend even more time digging deep I thought I would ask if 15% seems reasonable or if something is wrong?

Many of our users declare they can play other games without problems - we suspect they are playing on servers hosted on machines with no NAT (or very very permissive ones). We tried hosting on AWS and Azure VMs and are seeing about the same 15% - the cloud services are all behind NATs too. Our next step here is to try a server with a static IP/No NAT to see if everyone can connect even if they have a 'bad' router at their end.

And finally any other ideas? We don't have the resources to invest in advanced NAT techniques that we've been reading about http://xboxforums.cr...7670.aspx#37670 - we've heard that the gamespy library may be better http://docs.poweredbygamespy.com but theres no docs on its Nat traversal abilities.

Thanks

Edited by thezbuffer, 11 October 2012 - 11:16 AM.

ZMan

Sponsor:

#2 hplus0603   Moderators   -  Reputation: 4907

Like
0Likes
Like

Posted 11 October 2012 - 06:12 PM

You could tell users that if it fails hosting, they need to configure port forwarding if they are hosting. Users generally understand that port forwarding might be necessary for hosting, so at least they'll complain less (plus it will probably up the % of users that "it works" for.)

I don't understand what you mean when you say "NAT fails, but we go ahead and connect anyway, and that gets us another 6%."
How can "NAT fail" if you can connect?

enum Bool { True, False, FileNotFound };

#3 The ZMan   Members   -  Reputation: 702

Like
0Likes
Like

Posted 12 October 2012 - 03:24 PM

We already have instructions for people hosting. So either they are not doing that, or their router is open enough to let some people through so they don't feel they have to change. We actually have a tooltop that appears if they host for more than 2 minutes without anyone joining...

I'm not sure I can explain exactly but we have a matching server that sends the nat introduction to both sides (server and client) and then both server and client sent out a NAT punch through to each other. Sometimes the client -> server fails from the client point of view but the server -> client punch through has worked so if we follow up the failure with a connection (as if it worked) then we actually make a connection. We did find some vague explanation of why this might work - and it does.

I may be using the wrong terms here so hopefully you can work it all out.
ZMan

#4 hplus0603   Moderators   -  Reputation: 4907

Like
0Likes
Like

Posted 12 October 2012 - 03:48 PM

It sounds like you're not being through enough in the punch-through set-up, then.
A proper punch-through procedure means that each side starts sending out a packet with a TTL of 2.
Then, each side sends out a packet with a TTL of 3.
... repeat, until both sides see each other, or you reach some high number of TTL, like 100.
In the best of worlds, you include the matchmaker as a coordinator for each of these steps, and the coordination is done using "reliable" messaging on top of the same UDP port as you're using for the punch-through.

enum Bool { True, False, FileNotFound };

#5 The ZMan   Members   -  Reputation: 702

Like
0Likes
Like

Posted 15 October 2012 - 10:04 AM

Thanks for that hint. I'll look into lidgren and see what it does and if we can make it do that.
ZMan

#6 0BZEN   Crossbones+   -  Reputation: 2002

Like
0Likes
Like

Posted 16 October 2012 - 11:38 AM

Thanks for that hint. I'll look into lidgren and see what it does and if we can make it do that.


You can look into RakNet as well, it's got some info on punch through and various generic types. But in general, both sides have to initiate a connection attempt, to allow the other side to punch through the firewall.

Everything is better with Metal.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS