[WIP] Implement basic managed ethernet switch with mac learning and vlan support#62
[WIP] Implement basic managed ethernet switch with mac learning and vlan support#62Kilobyte22 wants to merge 6 commits into
Conversation
|
Very cool, thanks! Will have a closer look as soon as possible. And I'll see about making a custom model. |
|
|
||
| // Keep Mac Address entries for 2 Real Life Minutes | ||
| private final long HOST_TTL = 20 * 60 * 2; | ||
| private final Map<Long, HostEntry> hostTable = new HashMap<>(); |
There was a problem hiding this comment.
I'd probably make this a Long2ObjectMap to avoid the boxing of the key; I can do that after the merge though. Long2ObjectArrayMap would probably be sufficient with the number of devices I'd expect on such a network?
There was a problem hiding this comment.
I am not quite sure on the performance characteristics, but i think a realistic number would be < 50. Fairly sure thats good enough.
|
I do probably want to add some improvements going forward, but since it should be working right now, I can just add them at a later stage. After all the entire Mod is currently mostly a prototype. |
184f4e6 to
449021e
Compare
|
I believe i ruined things with git magic during a rebase. I'll see about sorting that out at some point |
449021e to
27c1861
Compare
|
This PR should now be at the same state as when it was originally created. I still want to make a few modifications before this gets merged. In particular i want to change the management channel to in-band, which would in theory make it possible to write a linux kernel driver with DSA support. |
dd4bd23 to
c0a3fcc
Compare
|
I'm having issues with the switch not showing up as a hardware component. It seems it didn't work since i rebased it to 1.18. Other blocks (redstone, projector etc) are detected just fine. Do you have any idea what i'm doing wrong? |
|
Thanks for the reminder in Discord; will try to have a look soon! |
|
Think I found it, the switch block currently returns a network hub tile-entity, and that one doesn't have callbacks. |
|
@Kilobyte22 I would like to use this switch, but I cant seem to configure it to forward packets. I enabled trunking on all ports, but that does nothing. The ping is not getting through. |
|
do you mind posting a screenshot of your config and your host table? |
|
Can you tell me where to find them? |
|
https://github.com/Paranoidlabs/oc2/blob/d38e683abbc6815715cc67398a05d9a2e9ca4b3c/src/main/scripts/bin/swconfig.lua you can this script (it should be available on your computer somewhere in /mnt i believe) to dump both of them. |
|
I did use that script to enable trunking on all ports |
This implements an Ethernet Switch. It has been laying around for weeks without any work done, but is mostly working. I've just now rebased it ontop the current 1.16.5. It does compile, but i have not tested it since.
Features:
Missing: