Hello everyone! In this topic, I present you my own development - set of network protocols called OpenComputers Network Stack.
This version - OCNSv1 is still considered Alpha, so don't pay attention to details.
OpenComputers Network Stack (OCNS in a short way) is the TCP/IP-like network protocols stack aimed to standardize network interconnections between OpenComputers machines. The first version of the stack, to which this note is attached, is Alpha-version - there are plenty of imperfections, some protocols are not what they are intended to be, however, I've decided to share this stack with community, and I hope you will help me in any way - feel free to suggest anything or criticize my decisions
OCNS architecture was developed to support these characteristics:
To provide easy extensibility and complementarity, a protocol should support defining its components as separate elements.
Every protocol in the stack is represented as a single file, following defined for its layer protocols API.
Users of higher-layer protocols should not care about routing, channelling, packets forming and other low-layer stuff, and clear separation of protocols over OSI model helps users to only pay attention to higher layers and programmers to develop their own protocols with only taking care of lower one
Instead of imitating of real-life protocols, OCNS create its own, OpenComputers-oriented system and have the author, that write features of his stack out of his own head
OCNS have got protocols, distributed over OSI models like shown below:
Let's analyze all the points from down to up:
OpenComputers provides plenty of different medias - tunnel cards, wire modems, wireless ones and so on. To unificate their interfaces, we should develop single API and implement medias' interfaces over it. This approach lets us to make crazy things - transmitting network packages over redstone, floppies carried by drones and just anything you can imagine - and any of these will be easily controlled via few methods
However, now all the protocols depend on a primary modem in OS, so this is the planned feature
Routing protocol. Uses cool 3-octet address
In version 1 only supports routing in one Ethernet
Protocol intended to seek not cool physical addresses by cool mIP ones
Works nominal in version 1 and not planned to be changed
Allows to use mUDP sockets
Is planned to obtain extended API in version 2
Old debug protocol, marked for deletion
The protocol that encapsulates a mUDP sockets in very convenient streams
There is an example program echo in the archive that demonstrates the power of the protocol
Is going to be reworked in version 2
1) Download - **Removed by staff** (was too lazy to make it over Pastebin or Git)
2) Extract all the folders (except 'echo') to the root of your OpenOS drive
4) Assign an unique mIP address to the computer by typing 'change_mIP x.x.x'
5) Repeat these steps at another PC connected with the first one and test connection between them using ping
6) Done! Every API method is documented, so it will be easy for you to learn the code Готово! Каждый метод API задокументирован в коде, так что разобраться в нем не должно составить труда
Don't forget about the echo test program