This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
KillaMaaki's profile picture

RDNP: Long Range Wireless Networking

Started by KillaMaaki, 15 July 2014 - 02:20 PM
KillaMaaki #1
Posted 15 July 2014 - 04:20 PM
Hello, everyone!
Here's a little project I did yesterday. It's called RDNP - which stands for ReDNet Protocol.

It's a framework for long-distance communication over wireless RedNet.

RDNP organizes the network into a tree structure. At the heart of the tree is the MRC, the Master Routing Controller.
Extending outwards from the MRC are the Routing Nodes. Each of these nodes is connected to one other node in the network - either another Routing Node, or directly to the MRC.
Finally, connected to these nodes are your actual computers.

So, when a message is sent, it travels up the chain of routing nodes to the MRC, and then back down the chain of routing nodes to the target recipient.

Included in the world save are a number of installation disks for each MRC, Routing Node, and Client, to make creating new nodes easy (just pop in the disk, and run disk/install, reboot), and additionally a full manual describing how the system works in detail and how to configure your network (plus, documentation on the included RDNP API for use in your own programs)

Here's a link to the world save which contains this system: https://dl.dropboxusercontent.com/u/99106620/ComputerCraft%20RDNP.zip

Note: That save relies on the ChickenChunks mod. Indeed you should have the mod installed to use this system, as otherwise you would get "gaps" in the network when chunks containing important routing nodes are unloaded.
I advise you place one Spot Loader directly next to each important computer (within the same chunk, of course), as is done in the linked world save.

There's some things which could be done to improve this. One way, for more usability, is to have a "ping" function where a computer can ping for nearby routers and display their labels and computer IDs in a list. So you might use:

>> rdnp/ping
Router 1, 33
Router 2, 12
Router 3, 56

>> rdnp/connect
Please enter the ID of a parent node
>> 33
Connecting to the network…
Connection successful!

Or something like that. As it stands, you have to make note of the router's ID manually, and you could put that on a signpost somewhere (for instance, you might have a town with a single dedicated router - after setting up the router you would make note of it's CID and put that on a signpost, so that people in the town can refer to the signpost when hooking up their computers for the first time)

Thoughts? Comments? Suggestions? Hate mail?
Cranium #2
Posted 15 July 2014 - 04:33 PM
I see you posted the world save, but could you also include the code separately?
KillaMaaki #3
Posted 15 July 2014 - 06:33 PM
Ok…. let me see.


There's a lot of files involved, perhaps too much for something like Pastebin, so instead here's a ZIP file containing the floppy disk contents: https://dl.dropboxusercontent.com/u/99106620/RDNP%20Floppy%20Disks.zip
There's ClientInstaller, RoutingNodeInstaller, and MRCInstaller.

You could create three floppy disks in your world (add some empty file to each one to create the physical file directories), locate the world's save files, and then copy the contents of these folders to the new disks.
KillaMaaki #4
Posted 15 July 2014 - 06:57 PM
Aight, screw it. Here's the pastebins and instructions on where the files go.

CLIENT INSTALLER DISK
http://pastebin.com/9DncGc5z –> disk/rdnp/connect
http://pastebin.com/56ZDU7Rr –> disk/rdnp/rdnp-api
http://pastebin.com/eMG2bjD2 –> disk/install

ROUTING NODE INSTALLER DISK
http://pastebin.com/Sm1QE3WR –> disk/rdnp/routingNode
http://pastebin.com/xvSfnseK –> disk/rdnp/startup
http://pastebin.com/YZzU2xjF –> disk/install

MASTER ROUTING CONTROLLER INSTALLATION DISK
http://pastebin.com/97EzNBC7 –> disk/rdnp/masterRoutingController
http://pastebin.com/AzRQvphp –> disk/rdnp/startup
http://pastebin.com/12sTNeQF –> disk/install
KillaMaaki #5
Posted 15 July 2014 - 07:57 PM
Another pastebin.
This one is a new update utility for the Client RDNP installation.

http://pastebin.com/TnLuEpMi

Save this to rdnp/update. Whenever you want to update, do this:

>>rdnp/update

And it will automatically re-download the RDNP installation from Pastebin.

EDIT
A new version is now available on Pastebin. You'll need to update the Client installation, and re-download the Master Routing Controller Program.
This new version adds Ports to messages. You can now send messages on a particular port, and listen for messages on a specific port as well. By default messages are sent on Port 1 (keep in mind Port 1 contains built-in traffic, so you may want to avoid using it in your own programs)
Edited on 15 July 2014 - 09:39 PM