glob2-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[glob2-devel] P2P Architecture


From: Bradley Arsenault
Subject: [glob2-devel] P2P Architecture
Date: Fri, 4 May 2007 17:13:12 -0400

I've seen the need for a P2P architecture for Glob2. For voice
transmission, a single host (YOG) clearly is not a good system. So, I
intent to make a P2P architecture for this purpose, and rather than
having the notion of a host, there will be routes.

It operates like this:

1) Every game has an assocciatted "p2p" group that is managed by the server.
2) The P2P group is linked with every person in that game
3) When the P2P group does a "connection", each person attempts a
connection with every other person. It works like so: A attempts to
connect to B, and if that fails, B attempts to connect to A. This is
because an incoming connection may work for one person and not the
other.
4) Some of the connections will obvioussly fail due to NAT and/or
firewall issues. When this happens, the P2P manager (which is YOG)
will direct some of the players with successfull connections to route
for the ones without successful connections.
5) If *none* of the connections are successfull, the server will
volunteer to join the P2P group, and will be the route. (features like
voice can be disabled in this event).

This system, while simple in idea, has some interesting results. Lets
say there are two blocked users and 4 normal users in a game. (blocked
means that they have NAT or firewall issues). The only failed
connection is between 2 blocked users. So the P2P manager will direct
one of the users (picked arbitrarily, could be picked intelligently at
some time in the future based on latency or something along those
lines) and direct them to route the information from the 1'st blocked
user to the 2'nd. A different user would be directed to route from the
2'nd to the 1'st.

It could also occur that there is only one normal user and 4 blocked
users. In this case, the blocked users will fail many connection
attempts with eachother, but succeed to connect to the normal user.
The server would direct the normal user to route for everyone.

I've seen this system used in games like Star Wars: Empire At War.
Now, to be fair. Empire at war has a fairly unreliable networking
system, and many believed it was due to a P2P system like this (Yet it
could be caused for any number of reasons), so we should probably
examine it in practice.

The P2P system will be built on top of the Net classes, as its own,
self contained system. Each player will have a P2P connection class.
This class needs to have a connection to the P2P manager (which would
be YOG in our case), and manager would send information about various
people in the P2P group, and the would allocate certain people to
route for other people. The P2P manager will also offer itself as the
route if none of the users can establish connections with eachother.

--
Really. I'm not lieing. Bradley Arsenault.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]