I am creating a simulator for digital radio using Python. Radio relays by radio frequency each with one RS-232 port and Ethernet port, and a couple of radio stations produce seamless pipes. Thus, the simulator will be used in pairs, and channels simulating radio frequency communication between them can be used, allowing users to connect to each end using physical interfaces, virtual interfaces, or tunnels.
For the RF serial port, I use PySerial and virtual serial ports to make the simulator as versatile as possible: I can connect the simulator to a physical serial port, to a network socket, or another local program. Besides the tools used to create virtual serial ports on every other OS, this approach is completely cross-platform.
I would like the simulator to be able to connect to the local program through a virtual interface, with a remote program through a common network interface and with a remote program through a local physical interface that would be dedicated to the simulator, but so far I have not found a direct way to do this. I watched SLIP / PPP, TAP / DUN, pcap / SOCK_RAW and other features, and I do not see an obvious or general solution.
The key difficulty is that it is connected to the entire Ethernet interface below the IP layer at the level of the Ethernet protocol itself. If it were just a few ports, the solution would be relatively simple. Or am I missing something dazzlingly obvious?
How to use Python to create and use the RF Ethernet interface as versatile as the solution for the RF Serial interface?
source
share