Ideas for network programming practice projects (C/C++)
I'm looking ideas for network programming projects. My languages are C or C++ (possibly also Rust and ARM/x86-Assembly).
By "networks" I primarily mean the functioning of Internet's infrastructure (in contrast to the WWW) which can include protocols such as BGP, OSPF, IMCP, ARP, TCP, IP, MPLS, IS-IS, OPF... but I'm also eager to learn about LANs and ethernet and related protocols such as ARP. Projects could be smaller or bigger, I'm not very experienced yet but I like challenges. |
Obtain the IETF specifications for the various internet protocols and write your own implementations of them.
Start with writing your own network sniffer/decoder software. (Note about promiscuous mode for adapters, learn about it) |
I suggest a different approach than rtmistler. You will learn about how the Internet works “in real” by following his advice, which can be exactly what is needed to program cool software.
However, the moment that you seek to program stuff, as your OP insinuates, you probably wish to see your stuff at work; and maybe to see your stuff at work, at last. So either before you commence the network sniffer, or after you accomplished that task.., or while you are at it, for a while, maybe do the usual “Hello world” by programming a simple chat-application. Do it right from the start and mark the frontier between the server-side- and the client-side routines, which remain part of the same program, in this case.., in whichever way suites you. I remember that it gave me a lot of “energy”, seeing my own messages displayed on a second machine, while Sean Walten was laying beside my keyboard. And P.S.: Not knowing where you are in your studies of network protocols, it may or may not be necessary to follow rtmistler's advice anyway. |
Thanks so far...
Do you have any suggestions how those different protocols given in the first post (is something essential missing from there?) might compare in their importance? ...when the goal is to get hold of network essentials (especially the low level Internet, also some Ethernet). Intuitively, it might be the case that TCP/IP implementation would be the first thing to achieve (after that sniffer). Not totally sure what kind of software does it mean in practice but maybe I'll get an idea when I start working on it. |
Quote:
|
Quote:
|
Quote:
(still looking for answers to my previous post) |
Quote:
If you are serious when you say "Intuitively, it might be the case that TCP/IP implementation would be the first thing to achieve (after that sniffer)." You will need to start with some old documents. https://tools.ietf.org/html/rfc791 https://tools.ietf.org/html/rfc793 https://tools.ietf.org/html/rfc768 Here's some information on how linux interfaces with the network and programming apis interface with linux https://www.kernel.org/doc/html/late...ing/index.html It doesn't hurt to know this stuff but it isn't necessary to now all the details to write network programs. Understanding what IP, TCP and UDP are is essential. In modern networks the protocols that make our applications work are written on top of these protocols. Even "writing a sniffer" is a meaningless phrase. Sniffers either implement a kernel driver or use a library that does. One is a very advanced application, the other requires understanding of network packets but is fairly trivial to get started at. Sniffing packets won't help you much unless you understand what it is you see in the output. https://www.tcpdump.org/ |
Quote:
Or do you think I have got it wrong what implementation means? So, what kind of practice projects you think a person should take in order to learn network programming? |
I don't think it really should be a concern if different people have different suggestions, that's normal.
Instead you can look for a wide variety of source examples on the web and start with those, no matter which particular type of network programming interests you. All those protocols you listed are already written, you can search for source of many of these along with their specs and learn as you review, modify, compile, and etc. The key would be to start exploring. |
Quote:
Start with the basics - write a simple client/server - perhaps an echo server - and try to understand how and why it works. Add threading or process forking so the server can handle more then one connection. Create a communication protocol so the client/server can perform a useful function. If your goal is to dive into the underlying protocols then read about them first because there is a lot to understand to make any sense of it. |
Quote:
Learning the protocols at the most detailed level is not the goal itself for me but I assumed the good knowledge on these protocols is essential here. And the approach doesn't even need to focus strongly on protocols, I've just assumed they're pivotal. So far I've been suggested to write implementations of essential network protocols. That's what I've been considering but other ideas are welcome as well. |
Quote:
The lowest level you can go in linux user space is to use raw sockets. To go lower means diving into the kernel. This is perfectly valid but not the best way to learn about the protocols since it is pretty easy to get lost in the weeds. Your post says you are not very experienced. Implementing a user space protocol, if you haven't already, might be a better way to get experience then implementing a routing protocol. Just my 2c. |
Quote:
|
Quote:
https://en.wikipedia.org/wiki/List_o...ols_(OSI_model) In a previous job I spent a lot of time on SIP, SDP, RTSP, RTP, etc. Lots of challenges there (internet telephony). If reading a protocol doesn't seem interesting then think of things you might want to reasonably communicate between computers and devise a means of your own to do it. i.e. write your own protocol. |
All times are GMT -5. The time now is 07:11 PM. |