Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I learn _really_ low-level network programming?

So I want to learn all about networks. Well below the socket, down to raw sockets and stuff. And I want to understand hubs, routers, access points, etc. For example, I'd like to be able to write my own software to do this kind of stuff.* Is there a great source for this kind of information?

I know that I'm asking a LOT here, and that to fully explain it all requires from high level down to low level. I guess I'm looking for a source similar in scope and depth to Applied Cryptography, but about networks.

Thanks to anyone who can help to point me (and others like me?) in the right direction.

* Yes, I realize using any of my hand-crafted network stack code would be a huge security issue, and am only looking to do it to learn :)

Similar Question: here. However I'm looking for more than just 'what's below TCP/UDP sockets?'.

Edited for Clarification: The depth I'm talking about is above the driver level. So assuming that the bits can make it to and from the other end of the wire, what next?

like image 302
Alex Gartrell Avatar asked Jun 05 '09 07:06

Alex Gartrell


People also ask

How long does it take to learn socket programming?

For basic knowledge, around 4-5 days is enough.

What is low level networking?

At the lowest level, the network protocol is handled by BSOCK packets which contain a lot of information about the status of the network connection: who is at the other end, etc. Each basic Bacula network read or write actually consists of two low level network read/writes.

Is socket programming low level?

The 'socket' module in Python's standard library defines how server and client machines can communicate using socket endpoints on top of the operating system. The 'socket' API contains functions for both connection-oriented and connectionless network protocols.


10 Answers

I learned IP networking from TCP/IP Illustrated. Highly recommended.

like image 140
Greg Hewgill Avatar answered Oct 04 '22 00:10

Greg Hewgill


This may not help you learn it, but a packet sniffer like Wireshark will give you some insight into what the data looks like at a pretty low-level protocol (TCP/IP).

like image 34
Andy White Avatar answered Oct 03 '22 22:10

Andy White


As you have obviously recognised, the universe does not start and end with the IP Protocol. Take a look at the OSI 7 Layer Model where IP is a Layer 3 (Network) protocol. Common IP Routers will operate at this level, but there is more complexity you probably should understand in the Data Link and Physical layers before you start coding your own network stacks.

Start with the fundamentals of data communications in all its myriad forms and work your way up the stack until you get to where you need to stop. Data Communications, Computer Networking and Open Systems is a good foundation text, and then look for more detail on each area you need to focus on. Previous answers include good links for IP and TCP/IP, and as mentioned Wireshark will let you look down through some of the layers

like image 25
Kevin Avatar answered Oct 04 '22 00:10

Kevin


CISCO CCNA materials contain a great network fundamentals, but does not affect programming aspect. I'm not sure that there is an official free link, but you can try to find them.

like image 38
Eugene Avatar answered Oct 03 '22 23:10

Eugene


You should equip yourself with a c compiler and the necessary libs and headers for your OS and play around. You may want to read for example:

http://snap.nlc.dcccd.edu/learn/fuller3/chap13/chap13.html

I had some more links in my delicious account, but they all went down the digital drain ;-)

like image 41
Patrick Cornelissen Avatar answered Oct 03 '22 22:10

Patrick Cornelissen


Have you any embedded programming experience ? If so I recommend you buy one of these development boards. They are cheap and allow you work on every part of the networking stack plus all the software tools required are free.

Note that getting going on it isn't easy and I ended up reading the CS8900 IC datasheet to learn how to make it communicate with the ARM7 based processor. But if you enjoy that sort of thing (as I do) then they are great fun.

like image 32
IanW Avatar answered Oct 04 '22 00:10

IanW


Hmmm ... have you looked into Computer Networks by Tanenbaum ?

like image 32
Billy Avatar answered Oct 03 '22 23:10

Billy


The TCP/IP Guide

like image 39
raspi Avatar answered Oct 03 '22 22:10

raspi


I have found the networking chapter in "understanding the linux kernel" and "understanding linux network internals" from oreilly to be very helpful.

The TCP/IP stack is a very good start but there is a lot more and a good understanding of how ethernet works and how ethernet != IP != the-interweb will go a long way.

books on network security often do a decent if not goos job explaining how networks work in a concise context.

what really did the trick for me was taking a job implementing NAT :)

like image 20
Arthur Ulfeldt Avatar answered Oct 03 '22 22:10

Arthur Ulfeldt


This course worked for me: COS 461 at Princeton. Note that it assumes system-level programming experience with C.

Pretty much all the readings and lectures are available online under "Syllabus". And you can try the assignments too (unfortunately, you won't have access to the Virtual Network System).

like image 1
weiyin Avatar answered Oct 03 '22 22:10

weiyin