This article is more than 1 year old

Router admin? Bored? Let's play Battleships using BGP!

Protocol how-to turns into

Playing Battleships over the Border Gateway Protocol probably wasn't a scenario considered by the standard's authors, but UK blogger Ben "Jojo" Cox has explained how to do it.

Cox's tutorial is part amusement, part warning, because while explaining the protocol (and why it's hard to fix), he pointed out that in the 32 bits used to signal route announcements, 16 bits can carry arbitrary data – that is, anything you like.

“This is useful in terms of filtering. For example if you have many providers and you want to try and ensure traffic stays local to your country, you can use these communities to give a better preference to those routes. This had me thinking though. What else could we signal? And how far do communities go?”

Cox chose Battleships to demonstrate “non-conventional communication” in BGP because it needs so little space to communicate: the X coordinate, the Y coordinate, and whether or not your opponent's last move was a hit or a miss.

Cox concocted the hand-drawn communication schema below:

Ben Jojo's BGP Battleships format

Ben Jojo's BGP Battleships comms schema

Once he'd worked that out, it was trivial to code up the game, and join with another router admin – so it was Ben playing from AS206924 (his own) and AS203729 (Igloo), with a timeout imposed so as not to trigger blocks from machines configured with RFC2439, “BGP Route Flap Damping”, resulting in “what is likely the first board game ever conducted purely over BGP”.

Ben Jojo's BGP Battleships

Ben Cox's router Battleship game in progress

Don't try this at home! ®

Similar topics


Send us news

Other stories you might like