Arbitrary internet communication

Discussion in 'Mac Programming' started by Sydde, Jan 18, 2010.

  1. Sydde macrumors 68020


    Aug 17, 2009
    Is there a way to locate a specific computer over the internet that may have a dynamic IP address at some arbitrary time? What I am thinking of is a sort of server-less SVN-like protocol that would allow for collaboration on shared files that may be on two or fifty computers - like the old real-time white-boards, but with change updates happening whenever the collaborating computers are available (e.g., the owner of the notebook is on an airplane while a file on the ground is being changed and the update is received when the notebook comes back onto the 'net).

    How does one determine whether a connection has a dynamic IP and what subnet range should be scanned (for instance, to find one that has open the port that the sync would use)?
  2. larkost macrumors 6502a

    Oct 13, 2007
    Scanning ranges is not a good way as it will quickly get you marked as a possible threat, and that idea is going to miss so many circumstances as to be worthless: computers that change subnets, computers behind NAT routers. And it will require that you constantly be scanning.

    The way that everyone does this is to reverse the connection. Make the client check in with a server. That is going to solve so many of the problems with the connection aspect.

    However, you are then setting yourself up for another nasty issue: synchronization. There is no simple way of doing this, especially if you are going to allow for a lot of people and figure in off-line operations. The only way of handling it really is to make your operations log-based, and then have some killer method of resolving conflicts (and that is going to get nasty fast). That you didn't see the obvious problems with the network connection bit leads me to believe that this is not the sort of problem you should be trying to solve at this point. Get some more experience before you try and take this one on.
  3. Sydde thread starter macrumors 68020


    Aug 17, 2009
    I realize that the issues are more or less beyond my current abilities. Mostly I was just musing on how a particular computer could be located. The only practical method for doing this might be some extension of Finger, except for the fact that it is mostly obsolete AFAICT.

    Synchronization could be accomplished rather simply by the content being time-locked by a particular file so that other copies could not submit changes if the lock showed updates since the last check-in.
  4. Krevnik macrumors 68040


    Sep 8, 2003
    It is an interesting mental puzzle, for sure, but it doesn't have a good answer. You'd almost be better off with a P2P-style network that is constantly active, and cache all the members under the assumption that at least one will be online and reachable at all times. The trick is that you need a critical mass for this to work reliably.

    Gnutella, Kazaa and others have shown it is really hard to build a P2P network with no true 'central' region or server. Even BitTorrent abandoned the concept to an extent.

    GIT and similar have trackers as far as I know that help coordinate the nodes and discover each other.
  5. Sydde thread starter macrumors 68020


    Aug 17, 2009
    On the other hand, there is IRC, but it does rely pretty heavily on its servers.

Share This Page