Jump to content

The "Getting Bolo to work over the internet" challenge


Recommended Posts

  • 68kMLA Supporter

The problem with doing "search and replace" on the UDP packets is that the 4 bytes that represent a player's IP address can also completely legitimately be game data. Blindly replacing that data will cause infrequent but infuriating bugs.

 

The simplest thing to deal with would have been packet types that contain data in a fixed-position format. Unfortunately it's rather more annoying than that, but we're making good progress on it. Aside from bus order negotiation and exchanging game map and status data upon joining, all the events in the game are transmitted using Bolo packet id 2. That packet is a sequence of "opcodes" and associated data for that opcode: opcode, data, opcode, data, opcode, data, [...]. For any number or combination of opcodes. Each opcode's data has a different structure. One of those opcodes is the list of player IP addresses. So in order to correctly replace the IP addresses, the proxy has to know, at minimum, the length of the data for each opcode in the game. For example, if the address list is the 4th opcode in the packet, we have to at least know the length of the data associated with the first 3 opcodes, otherwise we can't even distinguish the "player IP address list" opcode from data.

Link to post
Share on other sites
  • Replies 170
  • Created
  • Last Reply

Top Posters In This Topic

  • 68kMLA Supporter
4 hours ago, LaPorta said:

Correct me if I am wrong (I am not a programmer of any sort), but it seems like from what you are saying is that there isn't really a reliable way to centrally do this. Each and every machine has to send out modified packets?

 

Well, you can centrally proxy it.  In that case, the proxy stands in for every player, and replaces addresses in the packets as they come in and passes them back out again; so essentially each player sees itself in a ring with the proxy on both sides of it, and the central proxy relays and rewrites as necessary.  It's a bit of a mindbender, but you can kind of think of it as turning the topology where every player has a proxy 'inside-out', so that the ring exists largely within the proxy.  I think this is what @anthon is up to, roughly

Link to post
Share on other sites
  • 68kMLA Supporter

Right. The proxy essentially converts the protocol into a client-server model. Every Bolo instance sends and receives its packets to/from the proxy. This will have repercussions in the form of increased latency. But it has a side-benefit of possibly not requiring port forwarding.

 

Here's a diagram comparing normal Bolo networking and Bolo with a proxy:

BoloNetwork.png.fc1b343c8ee36f399e439fbcc8d4a89b.pngBoloNetworkProxy.png.45fbbc7da9dc634c687098a265176243.png

Link to post
Share on other sites
  • 68kMLA Supporter

We can add tracker functionality to the proxy. Right now I'm just focused on getting the proxy to work for a single game. Then we can make it support multiple games. For tracking, maybe just start with a web page. The utility:effort ratio decreases significantly at this point, because I don't expect a lot of active games at once.

Link to post
Share on other sites

Absolutely, just to get it working first is the key. I suppose I was eventually hoping for something that can interface with Internet Bolo Buddy for a seamless experience.

 

But you are right, just the game functioning!

Link to post
Share on other sites
On 2/11/2021 at 8:58 AM, superjer2000 said:

What kills me is that if the source code for bolo was public it would likely be pretty trivial to add a text box to enter your external IP address and embed that into the packets being sent rather than your macs internal IP address.  The code would then also look for that external IP address rather than the internal one on received packets. 

 

This is actually a really good idea. If I am understanding the discussion in this thread correctly, it should be possible to patch the app to do exactly this, and have things work 'natively' - as long as everyone is using the patched version. It might be worth doing this as a low-cost proof of concept, or short-term way to scratch people's networked Bolo 'itch'.

Link to post
Share on other sites
  • 68kMLA Supporter

No code is available, nor has any at least recent reverse-engineering of the codebase taken place.

 

Writing an offboard proxy will be a lot easier than trying to patch the code in the game itself, at a guess.

Link to post
Share on other sites
  • 68kMLA Supporter
6 hours ago, cheesestraws said:

 

Writing an offboard proxy will be a lot easier than trying to patch the code in the game itself, at a guess.

I’m not convinced of this. I think that trying to reverse engineer the protocol and ensuring that all possible permutations of Bolo packets are addressed, and then developing and making a proxy available is a pretty big undertaking.  Inserting the correct address right at the source would be pretty straightforward as I’m guessing the IP just gets embedded in one or two places in each packet and being able to see how the packets are built in the C or Pascal code would make it pretty clear.
 

That being said I have looked and don’t see that the source was ever posted or leaked so it’s probably moot. 
 

I am not sure what Stuart Cheshire’s motivation would be to keep the source code private, unless he’s either lost it or just doesn’t care period. 

Edited by superjer2000
Link to post
Share on other sites
4 hours ago, superjer2000 said:

Inserting the correct address right at the source would be pretty straightforward as I’m guessing the IP just gets embedded in one or two places in each packet and being able to see how the packets are built in the C or Pascal code would make it pretty clear.

 

Right - that is my thinking as well. Either finding the code that constructs the packets, and overwriting the bytes there, or perhaps even simpler, finding the code that determines the local IP in the first place, and overwriting there, should result in a seamless solution.

 

4 hours ago, superjer2000 said:

That being said I have looked and don’t see that the source was ever posted or leaked so it’s probably moot. 

 

Not necessarily - plenty of modifications to programs have been made without source code access :) This problem can be thought of as analogous to removing copy protection, for example.

Link to post
Share on other sites
  • 68kMLA Supporter
4 hours ago, gcp said:

Not necessarily - plenty of modifications to programs have been made without source code access :) This problem can be thought of as analogous to removing copy protection, for example.

 

While I don't dispute that it can be done - it is well past my own capabilities.  You'd need somebody who's pretty familiar with 68k ASM and is pretty motivated to spend the time required to understand exactly how to modify the program.

Link to post
Share on other sites
  • 68kMLA Supporter
4 hours ago, superjer2000 said:

Inserting the correct address right at the source would be pretty straightforward as I’m guessing the IP just gets embedded in one or two places in each packet and being able to see how the packets are built in the C or Pascal code would make it pretty clear.

 

The code is not available, as I said upthread, and the author does not answer email about Bolo, as has also been said upthread.

 

4 hours ago, gcp said:

Right - that is my thinking as well. Either finding the code that constructs the packets, and overwriting the bytes there, or perhaps even simpler, finding the code that determines the local IP in the first place, and overwriting there, should result in a seamless solution.

 

Please by all means feel free to do this modification, should you wish to.

Link to post
Share on other sites
  • 68kMLA Supporter
12 hours ago, cheesestraws said:

 

13 hours ago, gcp said:

Right - that is my thinking as well. Either finding the code that constructs the packets, and overwriting the bytes there, or perhaps even simpler, finding the code that determines the local IP in the first place, and overwriting there, should result in a seamless solution.

 

Please by all means feel free to do this modification, should you wish to.

 

I agree, it would be awesome if gcp would implement this.

Link to post
Share on other sites
  • 68kMLA Supporter

Status update. I have written the network proxy code that can rewrite packets as they pass between players. At first I just implemented the packets that have a fixed position format. This worked surprisingly well. There are at least two issues. One is when players leave, one of the opcode-based packets tells the ring how to adjust itself to remove the player. In that situation, the ring sometimes gets messed up depending on who leaves. The other issue I'm not sure exactly how it arises, but sometimes the Network Info dialog (for a player other than the one to start the game) will show the first player's IP address as upstream or downstream. There is only one other opcode I have observed that contains that IP address, but I thought it was purely informational because it doesn't include a port number. Working on re-writing these opcodes to see if the problems go away. One snag is that they both appear to contain checksums and the game is not happy at all if the checksum fails!

 

I'll reach out to people for testing once I have something that seems to be stable. Speaking of stability -- does anyone recall if the aIndy brain had a tendency to crash a lot?

Link to post
Share on other sites
  • 68kMLA Supporter
On 2/13/2021 at 2:23 PM, anthon said:

945415603_BoloWiresharkScreenshot.thumb.PNG.515b4cadbcc0d64a439b17132fbd1b42.PNG

This is super cool!!!!!  For wire shark do you just define how various packets look based on the Includes bytes and then it parses out the packets like this?  I had no idea Wireshark could do this. 

Link to post
Share on other sites
  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...