New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove ping_tun_tap example and documentation? #2232
Comments
All good reasons, but it's still sad to see it go because it is/was an example showing what is easy in Python compared to other verification methods. |
A similar example that doesn't require sudo permission would be nice. Either of the examples you mentioned would work. Matt's code is up to date, the JPEG encoder example is not. |
Matt's example has the disadvantage that it's not so ... graphic. :) |
I am also a big fan of this example, as I learned from that how to intercept packets and I used something similar in my designs. Agree with @cmarqu this shows how powerful cocotb is to leverage the external environment and use cocotb more as a "glue" rather than a test generator. |
@marcinwoj Does that mean it works for you? I would be happy if it worked, even if it did require sudo (though Windows users are hung out to dry). Could you update the test and get it back into a working state? I updated it to run under Python 3, but it didn't detect any of the incoming packets (from the |
@ktbarrett yes, it worked. However, it could have been still Python 2 (not sure that now) and also I might have changed it more, but for sure I was able to pick up/send pkts from/to tun_tap devices. Vaguely remember that I used python's select.select() method somewhere there. I will dig up for the code and will try to update the example. It can take a few/several days though. |
Maybe we need a cocotb examples repo for stuff like this. Instead of outright removing it, move it over there where it can be worked on independent of the core cocotb codebase. |
Actually, crazy idea: maybe clean this up and roll it in to https://github.com/alexforencich/cocotbext-eth. Connecting a TAP to an AXI stream, GMII, XGMII, etc. interface could be a rather useful feature. Edit: and maybe instead of doing some of the TUN/TAP stuff manually, maybe it would make sense to utilize something like scapy. |
I have been thinking about such an example for a very long time ;-) |
I'm currently evaluating dpkt and scapy for use in testbenches for verilog-ethernet and corundum, but if we could also use scapy to connect to the outside world, that could certainly be an interesting capability. |
There are already references to scapy elsewhere in cocotb, FWIW. |
Let's remove this example from the cocotb repositoy. From an in-tree example, I'd expect it showing a "best practice", be well described and maintained. None of that is the case for this example at the moment. Since we don't have a volunteer or other bandwidth to improve the current example, let's just remove it. We live in a world of git and eternal archives, so it's easy to resurrect it if/when the need arises. |
And yes, scapy and cocotb are a good combination. A former colleague did use it e.g. here: https://github.com/aoeldemann/fluent10g |
A few reasons:
ifconfig
toolThe text was updated successfully, but these errors were encountered: