OSI Layer 2 Network Programming

I recently took a few classes on the net (CCNA 1 through 4), so I understand most of the theory behind all this. Now I would like to take this knowledge and implement it in the form of small applications.

I read some articles on MSDN on how to do this, but they seem to cover only network programming at level 3 or 4 and above, IIRC. I am looking for some simple examples of how to handle second-level communications (i.e., framing) between hosts, or even just something like transferring via Ethernet.

I have little experience with C # and C ++, so the examples that use any of these languages โ€‹โ€‹will be great.

Thanks.

+4
source share
3 answers

For Windows, check out WinPcap , which provides low-level network access. The developer package already has some simple examples to get you started.

By the way, Linux has socket packages .

+4
source

You can use the eEx Network Library to write small applications (I did the same during my CCNA).

This is an easy-to-use and object-oriented .Net programming library that allows you to go to layer 2 and send custom frames through WinPcap.

Frame types such as Ethernet, ARP, IP, UDP, TCP and RIP are implemented, and as far as I know, these are the protocols that occur during CCNA.

C # tutorials are available here , and if you want to look at something in depth, such as address resolution, you can always look at the source code, since the library is open source.

+4
source

Most likely, you could study the low-level network utilities on GNU / Linux systems, as well as examine the kernel levels of TCP or UDP or IP. But, for example, Ethernet broadcast transmission is something very low, and not very useful. And real-world examples (usually encoded in C rather than C ++) probably cannot be simple because they have to deal with error handling.

+1
source

All Articles