r/AskComputerScience • u/AddemF • May 26 '19
Can you recommend a simple network exercise?
I am a volunteer teacher at a prison where inmates can earn a degree and move to the job market after release. I teach Math, but I have an advanced student who is interested in learning CompSci. Since I'm about the only person in the facility who can teach him anything about CompSci, I've been doing my best to guide him through CLRS. Although I am a CompSci novice, by my estimate he's doing well. We've covered list and graph algorithms, he's implemented them in Java, we're now doing hash functions, FFT, and we'll probably cap it off with NP-Completeness.
He's now getting interested in moving on to studying networks, and here I am just way out of my depth. I'll research, recommend, and order him some books. In the mean time I was wondering if there were some very introductory exercise that he and I could work on. Say for instance, to build a very simple simulation of a network in Java or JavaScript on a very old computer with no internet. If such a thing makes sense, does anyone know where I could get some guidance, like a website or book that describes how to do this? The goal would just be to get a basic, hands-on idea of what a network is and what simple things you can do to it and with it. It could smooth things over when we get around to a book.
Thanks.
2
u/Terny May 27 '19
I would recommend teaching subnetting. I'm assuming you already covered binary and octect, if not, go over these. Most of the exercises can be done pen and paper.
1
u/AddemF May 27 '19
By binary, do you mean binary numbers, like base-2? If so, yeah, we're fine with anything that intersects math and CS like that. (In fact, the notes I made for him had the section numbering zero-indexed and in base-2. :) )
→ More replies (1)
1
u/obiwanks May 27 '19
What you want is a network simulation software like Packet Tracer. You can simulate physical networks in the Packet Tracer environment by dragging, dropping and connecting network equipments (or you can use commands like in linux terminal). Google Packet Tracer Labs and go with the one that starts from scratch.
1
u/AddemF May 27 '19
Can't download anything, no internet connection.
What I had in mind was sort of like what we did for graphs. We made an interface giving high-level descriptions of how the object should behave and then implemented the details in some very crude way. Here, I'd think along the lines "Ok, a network, what is that? I guess it's nodes. Maybe the nodes can get distinguished between clients and servers? Or is there really a deep difference from a network perspective? Are there other kinds of nodes I would need to plan for? I dunno, would need a reference for this. Anyway, the nodes can connect to each other, and when they connect there is some kind of protocol. I've heard the phrase "handshake", I'm not sure what that is. Anyway, they connect and now they can start "talking". ..." And so write an interface with methods for connecting and talking and so on.
Nothing fancy, nothing extremely optimized and as complex as the real thing. Just the rough sketch of what a network is, as a Java class.
3
u/[deleted] May 26 '19
What kind of network? It sounds like he's interested in graphs (networks that are interesting because they simulate structure), but it could also mean he's interested in networking (getting two computers to talk to each other). If it's the graphs, there's a lot he could do. For starters there are libraries to represent graphs in many languages. A graph is just a list of associations, so a list of objects with "source" and "target" properties should suffice. There's also a matrix representation as well. If I'm not mistaken CLRS covers this pretty well and obviously has some graph algorithms, but this is merely a problem about encoding the network.
If you're actually interested in applications, I would check out Barabasi's Network Science book. It does a good job of going through the history and applications of networks. http://networksciencebook.com/. Also, get him a copy of SICP https://mitpress.mit.edu/sites/default/files/sicp/index.html. These sort of data structures problems are the meat of SICP and could be good to just work through if he's interested in CompSci.