I'm having a slightly difficult time learning strictly the datalink layer programming. Every time I search for "network programming" it's 99% of the time TCP/IP and mostly HTTP.
However, I want to do something which requires knowledge of Data Link Layer programming - need to write a custom program which uses the NIC to do some wi-fi stuff at the MAC address level.
Do you know of any good resources, books, tutorials, etc in which a program is implemented in layer 2 of the OSI model entirely? If not, can you suggest a simple program I could try writing to get a basic knowledge of this layer?
I assume I'm still going to be using the socket() API but just with raw sockets like this: socket(AF_PACKET,RAW_SOCKET) etc... but since I've never worked at this layer or know anyone who does, I don't even understand what a "connection" would look like at level if that makes sense.
In any event, I looked at the ToC for Unix Network Programming book and it does seem to be mostly focused on TCP/IP and also my The Linux Programming Interface book is the same way, which makes sense because most apps do work at those layers... But someone must have had to code up the lower-level stuff and I'm rather surprised there isn't a title focusing on layer 2. I did take a look at the tun code in the Linux kernel but that's also like trying to build a house by diving straight into a jungle.