Beginning with X-IvAp, IVAO software developments begins to introduce direct peer2peer technology in the client software. This document briefly describes what peer2peer is and what it does, its benefits, drawbacks and technical implications.
In common network infrastructures (which is also being used by IVAO), clients like IvAc and IvAp establish one network connection to one server. This network connection is being used to transport data like pilot positions, ATIS, chat messages and other information from the client to the server and back. IVAO adds a bit of complication to that, because the network servers talk to each others so that a client which is connected to one server can still see clients on different servers.
Lets take a fictional example: Pilot Joe in Atlanta is connected to IVANUS and sends a chat message to pilot Kevin in Munich, who is connected to IVANDE. Lets look at the path the chat message travels until it arrives on Kevins screen:
Joes computer -> IVANUS -> IVANDE -> Kevins computer.
You see, it has a long way to go. Each piece of information coming from Joe goes through (at least) two network servers until it arrives at Kevins place. Quite a detour - but it is very reliable and works.
A peer2peer ("peer to peer") connection is different: instead of sending the message via the servers, it is sent directly from Joes to Kevins place. This has a few advantages: the message arrives a lot faster because it does not go through the servers, and the servers network traffic is reduced, saving some of the server owners money.
Unfortunately, peer2peer connections do have some disadvantages too. First of all, establishing a direct connection from one client to another one is not always possible - it depends on the router and firewall configurations being in use (more on that later).
Also, due to the way the internet works, we are forced to use UDP packets to send peer2peer messages, while we can use TCP for client-server connections. Using TCP, the internet guarantees that everything the client sends to the server will be received by the server. It cannot guarantee the same for UDP messages, which is why UDP is sometimes expanded to "Unreliable Data Protocol".
In other words: peer2peer connections are unreliable. if Joe sends a chat message to Kevin using a UDP message, there is no way to tell if the message ever arrived at Kevins computer - it might be lost on the way, vanished somewhere in the internet. This is very bad for some types of messages (like chats), but not so important for other types of information - like pilot position information, because that is being sent all the time, and it doesnt matter if one of 10 packets is lost.
Another disadvantage is the bandwith being used. Lets say you are near to 4 pilots who send peer2peer position updates to you and each others. Whenever you send a position packet to the others, your client has to send the same information 4 times, once for each pilot (with the client-server connection, that was done for you by the server - using the servers bandwith, not yours).
The availability of peer2peer (p2p) connectivity depends on your type of internet connection. First of all, the clients determine your type of connection using the STUN protocol The possible types are:
If your type is active p2p, you will always be able to establish peer2peer connections to other clients, as long as they are not firewalled (blocked). If your type is passive p2p, you will be able to establish peer2peer connections to other clients, as long as they are active. If your and your peers type is passive, it is impossible to establish a peer2peer connection.
|your type||peer's type||works?|
Our peer2peer works in active mode with most modems and routers, especially the cheap ones (because they usually are quite stupid - no kidding), also if they perform NAT (Network Address Translation).
Please note, and this is important:
I really want to stress this point: do not use UPnP, and do not change your router configuration for IVAO clients. They are supposed to - and usually - work without port forwarding. Configuring port forwarding would be pointless anyway, because peer2peer uses a random port; it is impossible to predict which port you should be forwarding. However, there is an exception which does only apply if your connection type is not active p2p, and you really know what you are doing: it is possible to define the peer2peer port to use in the clients configuration.
That said, there are some situations when you might want (or have to)
configure port forwarding on your NAT device to make p2p work
for you (or to get you from "passive" or "blocked" into the "active" p2p mode).
I do, however, demand that:
At the time of this writing, the only p2p client on IVAO is X-IvAp. It supports peer2peer position updates since version 0.1.6, and comes with a default configuration that enables peer2peer for most setups without additional configuration. X-IvAp will display your NAT type in the debug console (and in the logfile) right after you connect to IVAO, please make sure to check your NAT type there before you start to fiddle around with portforwarding.
First, pick any port number of your choice, let's take 4711 for this example.
You need to configure your NAT device in such a way that it forwards all UDP packets going to your external (public) IP and your chosen port (4711) to the internal IP address of the computer on which you are running the client. How to do that depends on your local network setup and your NAT device, please consult the appropriate manuals - I can't give you any support there. You need to know what you're doing. Really, I'm not kidding.
Next, you have to tell X-IvAp to use the same port number for peer2peer. There is no way to do that via the user interface, you have to edit your X-IvAp.conf file (you'll find it in your "X-Plane/Resources/plugins/X-IvAp Resources" directory). Add the following to the [P2P] section of the configuration file (if that section doesn't exist yet, add it):
Restart X-Plane, and try it out. Your NAT type will now display as "active p2p", but that is no guarantee that everything works correctly. Let me know if it works for you. If it does not, let me know too - but include some technical background information please). And by the way, there are some other P2P related settings in the configuration file, documented in a readme file you got with the X-IvAp distribution.
Enjoy, and let us know if it works, and what you think about it!
� 1998-2014 - IVAO - All Rights Reserved