Isn't that what sapphire does
So I've been toying around with WSR and built my own version of it which allows multiple WSRs to be hooked up to a server (router/internet) and addresses individually using DHCP-style addresses.
Basically, one device could send data to another device by specifying it's ID.
However, I'm not very good with lua, but I'd like to see the same implementation for a hi-speed network so it can be used with the CPU.
It would basically be a network card.
I know there has been talk about networking devices before for the hi-speed network, but nothing has been released as far as I know.
Correct me, close this thread and smack me in the face with a shovel if I'm mistaken.
This idea is inspired by the Sapphire project here on the forums.
But instead of storing values at a central server, this allows for actually transmitting data between CPUs on other servers.
I had two implementations in mind:
1. The network card can be hooked up to a local network, just like in reality.
And then a router/modem to get access to the "internet".
This would offload the uplink when working only with local devices.
Should be possible by implementing the hi-speed network between network devices.
Or by implementing a new link which allows for duplex wires (connect A to B and B can transfer to A too).
2. The network card would communicate directly with the "internet", no LAN implementation.
This would probably be a lot easier to implement.
The internet would work like this, just as I did when rewriting the WSR:
A server app will process incoming connections and connect them to the "internet".
It also serves as a router to send packets to other servers (routers) or modems/network cards.
I'm pretty open to how the network card should function on the hi-speed network.
Partially because I'm unsure about how the hi-speed network actually operates.
But basically it would require buffering of a full packet and then setting some address to 1 to actually send it (or 2 to flush the packet or something).
To function in the "internet", the packet must contain the target IP/ID and the actual data.
For simplification we could go by IPv4, so one address would be 4 bytes.
Received packets would look basically the same, except the address would be the sender's address.
The network card should also provide an address space to allow the CPU to get it's IP.
And possibly some addresses for reading the amount of buffered packets/bytes (to prevent overflow) and maybe some general statistics (sent/received packets/bytes, current tx/rs speed, server latency, ...).
I can write (and host) the server app if someone can write the lua code.
To make it more stable, an external DLL should probably be implemented to handle packet buffering and the actual protocol.
Well, that's pretty much it.
Feel free to contribute with comments or ideas.
Isn't that what sapphire does
From what I understood, Sapphire allows you to store/retrieve values to/from a central server.
Like a globally accessible version of the flash drive.
This doesn't store anything, it immediately transfer data between two (or more) devices.
Between devices on different GMod servers.
So simply put, I have a network card hooked up to the CPU on my gmod server and you have a network card hooked up to the CPU on your gmod server.
I send some data to the network card over the address bus, it picks it up and sends a packet to a router server which takes a look at the packet and sends it to the network card on your server which will buffer it and your CPU can take that data and process it.
So, what you want is basicly my WSR, but able to handle CPU Memory-Cells?
I got this in mind a bit longer, but I never got myself to actually do it.
Question now would be: You want it as some kind of shared RAM, or two sided memories?
With second one, i mean basicly this:
-Both devices have a bit of memory.
-If the CPU performs a "WriteCell" command, the change will be send to the other user, but will NOT done to local memory.
-If the CPU perfomd a "ReadCell" command, it will get the data from local memory.
Or even just a write-Bridge? This would send all "WriteCell" commands to the other side, where they are going further. so it would be
CPU->WSR->INet->WSR->Other Device
disadvantage of this one would be, that the "ReadCell" command could not be done.
Needz moar Lua
I'm not sure about how the hi-speed network works on Lua level, another reason why i need help with it.
The best solution I can think of at this point is that you edit some cells, for example 0-63, and when you send 1 to 64 it sends the contents of 0-63 (where for example 0-3 is the address of the target device).
When the target device gets the packet it adds it to a buffer, like an array.
Either one with dynamic length to save memory or one with static length, for example 64 bytes so you can just multiply with 64 to get another packet in the buffer.
And when you update a value in the buffer it removes the first packet and pushes up the other packets (i think the wire keyboard does something like this).
If I understood you correctly, two-sided memories would lock two devices together (like the WSR or the paired wire radios)?
While this solution can send/recieve to/from multiple devices using a single device.
Or maybe even send broadcast packets![]()
Ouh, that is pretty simple. Each Hi-Speed able device has a "ENT:ReadCell" function, which takes an "Address" parameter, and a "ENT:WriteCell" function, which takes an "Address" and a "Value" Parameter. How the device saves the data is your thing.
Those functions will be called if you do a memory operation in CPU.
Not that complex, isn't it?
I thought about something with dynamic length. It looks for all changes done after last packet, and tries sort them. So you wont need something like "CellNum-CellValue" for example: "0:1,1:2,2:40,3:40". The result would then be "StartingCell,CellAmount,Value,Value,..." for example: "0:5:1:2:40:40:30"
But first i have to start with it >.>
Two sided memory would be like the paired wire radios.
What solution do you mean? shared ram or paired WSR's? I could do a modification for it, but first i need this working as a base.
Needz moar Lua
The broadcast would be possible with the first solution, not with the two-sided memories one.
Edited my last post
And yes, dynamic length packets shouldn't be too hard to implement.
Either by reading them as a stream:
<lenth>[data]<length>[data]<length>[data]
Or by using an index:
<offset><length><offset><length><offset><length> ... <data><data><data>
And I guess the hi-speed system is pretty easy then
Too bad I still suck at Lua. I should use it more often.
Bookmarks