/mylittlenet

Userspace network stack implemented in Python

Primary LanguagePythonThe UnlicenseUnlicense

Archived

Project is being succeeded by PetiteNet

mylittlenet

User-space networking stack implemented in Python for fun and giggles.

Why?

I've been working as a system administrator/network engineer for a while now, but I've never really understood how the whole stack works in detail.

I have educated guesses from reading RFCs and experiences at work, but I've never really implemented anything from the ground up.

Besides, the best way to learn how anything works is to implement it yourself, right?

Why Python?

While professionally I have frustrations with Python (especially in production or at scale), it is still a comfortable language for prototyping and getting something up and running quickly.

Originally, I tried to implement this in Zig, but I found myself spending more time fighting the language than actually implementing the networking stack.

So, Python it is.

Goals

Not in any particular order

  • Ethernet
  • ARP
  • IPv4 (w/o fragmentation)
  • ICMPv4 Echo Request/Reply
  • IPv4 fragmentation/reassembly
  • ICMPv4 Unreachable
  • UDP
    • UDP echo server
  • TCP
    • TCP echo server
  • Static routing
  • Running applications on top of the stack / Shell
  • Ping

Stretch goals

Are these ambitious? Yes.

Do I know what I'm doing? No.

Will I get to them? Lets be honest, probably not.

  • DNS client
  • DNS server
  • HTTP client

I really doubt I'll get to these...

  • HTTP server
  • DHCP client
  • DHCP server
  • Dynamic routing: RIP
  • Dynamic routing: OSPF
  • Dynamic routing: BGP

Non-goals

  • IPv6
  • Anything "modern"
    • Let's keep it simple and old-school

References used