Discusion: Network Protocol (masterserver)

Discuss the future of Warzone 2100 with us.
User avatar
kage
Regular
Regular
Posts: 751
Joined: 05 Dec 2006, 21:45

Re: Discusion: Network Protocol (masterserver)

Post by kage » 22 Dec 2006, 10:22

Kamaze wrote: I'd stripped the whitespaces andnew-lines in the reference XML files ;) (not the indent tab)

Sure i forgot that.

@Chojun, this is just a suggestion for the master server. Not the general net-code.
And after the test with the compression, i think only the gamelist will be compressed. (there it makes sense)
well, we can only hope that warzone gets so many players that xml would become overly burdening for master-server use

karmazilla
Trained
Trained
Posts: 84
Joined: 26 Aug 2006, 21:05

Re: Discusion: Network Protocol (masterserver)

Post by karmazilla » 24 Dec 2006, 00:56

On FIPA:
I think we can save some overhead by making our own specialized XML message format.
Besides, on the server side, I think I would use a SAX parser to turn the entier XML message into an object - saving me the overhead of a full DOM.
Plus, the wrapping protocol described in the Wiki really can't get any simpler.
additionally, a map "hash" might be useful in addition to the map name, so that it'd allow the client to determine if they have the right version of a map -- would be wise to accompany this with client-side map hashing so that multiple versions of a map may be stored and used.
I think this is a good idea.
it might be worth allowing for an optional ip attribute -- there might be reasons that a user would want to use an intermediate "master" server, or other instances where the ip address of the actual game would be different than the ip address of that the "OpenGame" message came from
Ah, so we could create a tree of master servers - just like how the DNS system works. This could be useful, but I wonder how we can prevent this from being exploited. I mean, it would be possible to convince a masterserver that an arbitry host has opened a game, without this host knowing about it. Sure, this really isn't such a terrible situation so I guess we could just ignore this.

User avatar
kage
Regular
Regular
Posts: 751
Joined: 05 Dec 2006, 21:45

Re: Discusion: Network Protocol (masterserver)

Post by kage » 24 Dec 2006, 02:33

karmazilla wrote: Ah, so we could create a tree of master servers - just like how the DNS system works. This could be useful, but I wonder how we can prevent this from being exploited. I mean, it would be possible to convince a masterserver that an arbitry host has opened a game, without this host knowing about it. Sure, this really isn't such a terrible situation so I guess we could just ignore this.
actually, my thoughts were that this would mostly be used for private master servers that could be configured to allow some games to be accessible to higher-tier master servers. but officially, we might just have a set of authoritative master servers managed by the community -- by default, users would connect directly to the root master servers, and would use specialized ones only if they wanted to. however, i hadn't really thought about it in a full-tree type system, which does have benefits, but, as you said, could be exploited.

physaro
New user
Posts: 2
Joined: 26 Dec 2006, 13:39

Re: Discusion: Network Protocol (masterserver)

Post by physaro » 26 Dec 2006, 14:24

Sorry that I enter the discussion this late, but I just found Warzone2100 yesterday. I think this is a very cool project.

Now about the Network Protocol, I would personally prefer a binary protocol. Simply because its most efficient and its easy to parse and its small. One example for a good binary protocol is the Battle.net protocol (which is uses by WCIII/TFT, Diablo, etc). One could adopt many things from that protocol because for the master servers the requirements are similar (game list, maybe chat, etc). You can find some documentation about it here: http://bnetdocs.valhallalegends.com/. The most important pages are: In the wiki DevUrandom explains that it is rather difficult to filter a whole line (unknown size) and then parse
it. With this protocol one would just have to read the first four bytes and then extract the packet length and read until one has enough data.
Last edited by DevUrandom on 26 Dec 2006, 21:25, edited 1 time in total.

User avatar
kage
Regular
Regular
Posts: 751
Joined: 05 Dec 2006, 21:45

Re: Discusion: Network Protocol (masterserver)

Post by kage » 27 Dec 2006, 00:33

bnet itself is a proprietary protocol -- if we use too much of that for our own project, we will get sued, as blizzard has been known to do that.

in either case, if we were going to implement a ready-made master-server/lobby protocol, there are plenty of foss ones that beat bnet in stability and features.

btw, joining in a discussion late is generally never a bad thing: what most forum communities don't like is "resurrecting" a very old thread, which is certainly not the case here.

Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3775
Joined: 03 Aug 2006, 19:39

Re: Discusion: Network Protocol (masterserver)

Post by Per » 12 Jan 2007, 19:51

My current thought is that using JSON-RPC (http://json-rpc.org/) over HTTP is the best choice. It is very light-weight, human readable, and goes straight through almost any firewall. It is also well supported by many implementations (C, Python, Google Web Toolkit, etc.).
"Make a man a fire, you keep him warm for a day. Set a man on fire, you keep him warm for the rest of his life."

karmazilla
Trained
Trained
Posts: 84
Joined: 26 Aug 2006, 21:05

Re: Discusion: Network Protocol (masterserver)

Post by karmazilla » 14 Jan 2007, 20:09

Per wrote: My current thought is that using JSON-RPC (http://json-rpc.org/) over HTTP is the best choice. It is very light-weight, human readable, and goes straight through almost any firewall. It is also well supported by many implementations (C, Python, Google Web Toolkit, etc.).
I like this idea; simplicity, readability and existing APIs available. But why not just straight through TCP? HTTP adds very little value IMHO - not even testability, just overhead.
But are you looking into this, Per? If the C API is judt as easy to pick up as the Python one, then this method is certainly feasible.

... And speaking of feasability, check out attached file  ::)
Attachments

[The extension has been deactivated and can no longer be displayed.]


Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3775
Joined: 03 Aug 2006, 19:39

Re: Discusion: Network Protocol (masterserver)

Post by Per » 14 Jan 2007, 22:00

I am not done with my thesis work yet, so no, I'm not working on anything yet. Soon, though. I am sure we can discuss whether HTTP is a good idea. Not entirely sure if I can explain right now why I thought it was a good idea when I first thought about it.
"Make a man a fire, you keep him warm for a day. Set a man on fire, you keep him warm for the rest of his life."

User avatar
kage
Regular
Regular
Posts: 751
Joined: 05 Dec 2006, 21:45

Re: Discusion: Network Protocol (masterserver)

Post by kage » 17 Jan 2007, 14:56

Per wrote: I am not done with my thesis work yet, so no, I'm not working on anything yet. Soon, though. I am sure we can discuss whether HTTP is a good idea. Not entirely sure if I can explain right now why I thought it was a good idea when I first thought about it.
i agree with karma on this point to great extent. the only thing i can possibly forsee as direct usefulness with http (though i wouldn't be surprised if you come up with a very excellent reason for http) is if there were something like a client side xslt document that would convert the json into xhtml tables and lists for www browser viewing, with links to servers specified with something like the "wz2100://" or "wzr://" protocol, which, if configured correctly in the browser or host operating system, could launch wz with the appropriate options needed to connect to that server. however, this is entirely dependent on the master server accepting a (for simplicity i'll express it in sql) "SELECT * FROM game_servers WHERE map_name='Sk_Rush' AND starting_tech_lvl < 3 LIMIT 30" request -- if information about each server had to be requested individually, this simply would not work. in either case, and in all honesty, we're better off spending our time making the in-game server browser good enough that players shouldn't feel the need for anything else.

Post Reply