A super secret network - Python Tun + Arduino IP Link Project

Опубликовано: 12 Июнь 2026
на канале: InvalidEntry
173
13

Are you worried about Lancastrian Spies listening to your private network messages? I am! And that's why I built my own network card that allows my two computers to talk to each other without anything listening in. Finally, we will keep those Lancastrians at bay!

A virtual network card (a TUN) written in python, linked up to an arduino, that are linked together, to allow super-secret network connection between two Pi's? A stupid idea - sure, but if it enables people to understand more about the intricacies of how networking works inside a computer and lets us develop as human beings, then there's no bounds to the madness.

Source code: https://github.com/Invalid-Entry/Ardu...

Also, Remote packet capture:    • Remote Packet Capture with Wireshark (Mac ...  

Chapters
00:00 Intro and setup
01:43 Architecture Intro
04:36 Deeper Dive Arch
08:10 Arduino Serial Link
10:35 First Malformed Packets
13:32 Where do the bytes go?
15:05 They disappear in both directions
19:22 More malformed data
22:54 Success! Pings galore

In this video, I use python-taptun to create a virtual network card, and then a simple Arduino script using software serial to allow me to network multiple cards together. This is part one in the setup, because the following ones will be to improve or change the transmission methods.

A TUN device allows us to send and receive individual IP packets (unlike a TAP device which is about Eithernet Frames). This means we can do our own networking protocol. As this is a link-link device, we don't need to worry too much about things like ARP and Mac address resolution.

This project took a lot of twists and turns in its progression. Malformed Packets, dropping bytes on the serial connection before finally, we have working code that allows a secret communication between the two Pis*.

The code in python isn't the most efficient - if you look at the first main commit to the github above - partially because of the extra sleep functions that I've added, and also because of the way that pythons interpreter* works, means that I should really rewrite this to use file descriptors better.

The end of this is that I have a much better appreciation of the tap/tun system, I've learnt to remote packet capture, and I think I've grown as a human being.

Plural of Pi looks wrong. Pis.
** By Python interpreter I do of course mean the bytecode interpreter vm thing.