Information résau

From Resonite Wiki
Revision as of 23:40, 23 February 2024 by J4 (talk | contribs) (Created page with "Perforation UDP (NAT Punchthrough LNL)")

Resonite est un moteur de jeu puissant connecté a ses utilisateurs directement et aux services Cloud Resonite. Si vous êtes curieux ou avez un pare-feu que vous voulez configurer, les informations suivantes peuvent aider.

Traffic HTTP et WebSocket

Les informations comme le profil et objets dans votre inventaire sont stockés dans le Cloud de Resonite. Votre client va utiliser HTTPS ou WebSocket pour obtenir ces informations.

Voici une liste de domaines sur lesquels vous verrez probablement des connexions:

  • La plupart du traffic HTTPS est vers api.resonite.com
  • SignalR (mises à jour en temps réel) créé une connexion WebSocket vers un service sur api.resonite.com
  • Les Assets (avatars, modèles, textures, etc) et autres binaires sont stockés sur une variétés d'hôtes:
    • Les variant d'assets sont stockés sur variants.resonite.com et skyfrost-archive.resonite.com/variants
    • Les assets sont stockés sur assets.resonite.com et skyfrost-archive.resonite.com/assets
    • Les vignettes sont stockées sur thumbnails.resonite.com et skyfrost-archive.resonite.com/thumbnails

Traffic de sessions

Quand vous vous connectez a une session Resonite, vous établissez une connexion vers l'hôte de la session. Généralement, cela est l'ordinateur de l'utilisateur mais dans certains cas, cela peut être un serveur qui pourrait être hébergé n'importe ou; les cas les plus communs étant un ordinateur additional ou un serveur loué en centre de données.

Dépendant de vos options et les options de l'hôte, vous vous connecterez avec l'un des protocoles suivants:

LNL

  • LNL utilise UDP
  • Les ports utilisés varient et peuvent être n'importe quel port sur l'hôte tant que celui-ci est libre.
  • Dans d'autres cas, un relais sera utilisé.
  • Après un punch-through ou relais, la connexion s'établira.

Steam Sockets

Steam Sockets est un protocole réseau créé par Valve. Vous pouvez trouver des informations sur celui-ci sur leur site officiel.

Établir des connections

Resonite utilise plusieurs méthodes pour tenter de se connecter a une session. Cela peut être illustré dans le graphique suivant.


Resonite va tenter de se connecter directement quand il peut, par exemple sur un réseau local. Cela n'est cependant pas toujours possible dépendant sur le réseau et sa sécurité.

Connexion directe

En général, une connexion directe est le meilleur cas. Vous vous connectez directement quand Resonite sait exactement ou aller et comment y aller (généralement directement avec une adresse IP, nom de domaine et port ouvert).

Pour utiliser une connexion directe

  • Utilisez une node ProtoFlux OpenWorld et ajoutez une URI avec l'adresse IP et port comme cela: lnl://<adresse IP>:<Port>/
    • Pour IPv6, mettez l'adresse entre crochets: lnl://[<adresse IPv6>]:<port>/
    • Vous pouvez aussi utiliser un domaine pour cela: lnl://<domaine>:<port>/
  • Un port est demandé et fait partie de l'URI.
  • Dans la plupart des cas, cela est utile pour se connecter a un serveur ayant une adresse IP statique et le port ouvert.

Comme exemple, une session hébergée avec l'adresse IPv4 203.0.113.7, l'adresse IPv6 2001:db8::7 et le domaine seven.example.com sur le port 12100:

lnl:///203.0.113.7:12100/: Connexion IPv4 directe

lnl://[2001:db8::7]:12100/: Connexion IPv6 directe

lnl://seven.example.com:12100/: Connexion directe via un domaine

Perforation UDP (NAT Punchthrough LNL)

La perforation UDP est utilisée par LNL dans Resonite pour établir une connexion bidirectionnelle entre l'utilisateur et l'hôte de session, quand l'un d'entre eux est derrière NAT.

This is facilitated by one of Resonite's LNL punchthrough servers (the same hosts that can be seen in #LNL Relay), where both you and the host establish a connection in order to establish a peer to peer connection between you and the host that should be indistinguishable from directly connecting.

If you encounter issues with NAT punchthrough, you may be behind a Strict (also known as Type 3) NAT, where the conditions of the NAT make it so hole punching doesn't work.

You can check your NAT type by going to https://networktest.razortune.com/ in a web browser - this is a tool hosted by community member Rucio and is specific towards Resonite networking.

If your NAT type is Strict, there are two common causes for this:

  • Your router could have settings in place for its NAT causing this to happen - what you want is a 1:1 NAT or a static NAT (terminology may differ depending on router)
  • Your ISP could be doing CGNAT in a way that causes this - you can see if you're behind CGNAT by checking what your router reports your WAN address as being and what a site like https://ipinfo.io says; if these two addresses differ, you're likely behind CGNAT.

If it's your router:

Check your router settings - a good way to start is by searching "<router> Open NAT" and seeing what comes up setting wise.

If it's your ISP:

You may be able to contact your ISP to get them to either take you out from behind CGNAT or give you a static, public IPv4 address. This may come at a cost for something like a static IP.


If you're unable to resolve being in a strict NAT situation, it is recommended to use #Direct IP connections followed by using the #LNL Relay to connect to sessions.


Possible Bugs

  • One current issue seems to be that the NAT punchthrough server occasionally does not respond very quickly, and the client does not always wait for a response and tries the next protocol on it’s internal list to attempt.
  • The punchthrough server does not support IPv6, instead only supporting IPv4. Some ISPs in some parts of the world, such as Japan, use exclusively IPv6. Users in these networks may not be able to use NAT punchthrough (this gets very complicated very quickly, results will vary). (Github Issue #143)

LNL Relay

This can come with performance implications. The relay acts as a third point between both clients, and all traffic is routed through it. Ping will likely be worse here (but not always). If the relay has issues or is overloaded, you may also get service issues.

  • We have the following LNL Relays
    • uswest1.resonite.com - US West (Hillsboro, OR)
    • au1.resonite.com - Oceania (Sydney, Australia)
    • japan1.resonite.com - Asia Pacific (Tokyo, Japan)
    • europe.resonite.com - Europe (Helsinki, Finland)

You can see the status of these relays at https://status.yellowdogman.com or in a raw format at https://api.resonite.com/networknodes

How LNL Relays Work

When a relay is required, the client sends a request to https://api.resonite.com/networknodes to retrieve the currently available relays. From there, the client makes a determination based upon multiple factors which relay is the best one for it to utilize. For example, the relay's currently available capacity, and its ping. The ports for the relay are determined by the relay server's operating system and port availability. Do not assume any consistency for the relays.

Here's a diagram illustrating the relay connection flow:




At this time, we do not support the ability to pick a specific relay.

Recommendations for Headless Servers

To better support direct connection conditions it is suggested server hosts try to promote direct IP connections and IPv6 support.

If you have a public IPv4 address that you can use, you can port forward the session's port. To do this, set the forcePort option for the world in your headless config file & forward the port through your router. You can find out how to do this by searching "<Router Model> port forward" - for most routers, you'll be able to find an example somewhere on the internet.

If you have IPv6 support, use it when possible by setting forcePort as in the IPv4 example, allowing the session's port through your firewall & direct connecting (See #Direct IP for how to directly connect to a session)

You may not be to port forward in all situations, such as if you're using a router that doesn't let you port forward or if you're behind CGNAT.

If you are behind CGNAT (Carrier Grade NAT), see if you can get off it - depending on your ISP and the type of your internet connection, you may get varying results. Some will take you off CGNAT if you ask, some will get you to pay for a static IP address and some may not allow you to get off CGNAT at all.

If you're having users with issues connecting via LNL punchthrough, direct them to directly connecting to your session. Making an object that connects them - such as a button that they can press and just connect makes doing this quite easy.

Recommended Router Configuration

Many consumer routers are configured by default to provide optimal connectivity for Resonite by routing traffic in such a way which permits the ability for users to directly establish a connection to other users on the Internet. However, some advanced routers employ a type of NAT (Network Address Translation) where port numbers are not preserved when communicating with other hosts on the internet. This type of NAT is often referred to as strict, or “Type-3”. As the name implies, the strict nature of this type of NAT does not permit the ability to establish connections with other users.

For the best Resonite experience, it is recommended to configure your router in such a way to permit a moderate or Type-2 NAT from the computer running Resonite. Each manufacturer implements this configuration differently and the terminology is not often the same between brands. Please refer to the documentation for your particular router or ask for assistance in the #questions-help forum in the Resonite Discord server.

LNL Relay Support for Strict NAT

Resonite provides a method for users who are using a router with strict NAT to connect to other users by using an intermediary server known as the Resonite LNL Relay. Although this solution will work for occasional use, it may not provide the best performance depending on geographic location and network load/congestion.

You can determine if you are connecting through an LNL Relay by the presence of the “LNL Relay” text appearing under the “Loading…” message while joining a world. The presence of the “LNL Relay” text when joining a world means that Resonite was unable to connect to the host user directly and the Resonite LNL Relay server was used.

The presence of the “LNL Relay” text typically indicates that either you, the host user, or both users may be behind a strict / Type-3 NAT. If you see this message each time you connect to a world, there is a good chance that you are behind a router that is configured for strict / Type-3 NAT.

It is recommended to use a moderate or Type-2 NAT to avoid the dependency on using the LNL Relay. See the Router Configuration section above for more information.

uPNP/NAT-PMP and Port Forwarding

Resonite does not currently offer support for port forwarding or uPNP/NAT-PMP.