It's a continually occurring question here on HN, is there a particular programming language you want to learn, or are you just looking to understand the whole stack from ethernet interfaces / arp / ip4 / tcp, udp, dns, dhcp, etc?
For me, it's been decades since I first grokked what a subnet mask is.