A collection of small exercises on computer networks, written in C.
Developed together with @RKade2811 and @bert-brause.
The exercises build on top of each other. Issues or bugs in earlier tasks might have been fixed at a later stage.
Basic exercises on UDP and TCP communication using the Berkeley Socket API.
The two QOTD examples also measure the time it takes for requests to finish in order to show the difference between UDP and TCP with regards to speed.
Arguments: hostname port
Connects to a Quote-Of-The-Day (RFC 865) Server using UDP and receives a random quote.
Example servers are:
- alpha.mike-r.com Port 17
- djxmmx.net Port 17
- ziaspace.com Port 17
Arguments Server: port filename
Arguments Client: hostname port
Server implements the Quote-Of-The-Day Protocol (RFC 865) over TCP. Loads the Quotes from a porovided file. Client is basically a port of udp_qotd to TCP.
Arguments: hostname
Downloads a file (an image) using HTTP over TCP.
Shows how to load data of size greater than the MTU of TCP packets.
This example consists of a Client and Server implementing a small movie database using RPC.
It also contains the implemtation of a hashtable that is used to store data.
The RPC communication protocol is a custom one:
Arguments: port
Arguments: hostname port filename
Takes a CSV file as input and sends all entries to the RPC server to store them. Afterwards it retrieves and deletes the values.
An implementation of a distributed hashtable using a simplified version of the Chord P2P protocol (for example, we do not use fingertables). run_dht.sh
launches a ring of 4 nodes that coordinate themselves. The client from 2_rpc can be used to communicate to with any of the nodes. Internally, the RPC protocol from the previous exercise was also extended to allow for internal communiction of the ring:
Implemetation of a small HTTP-Webserver using libonion. Any message sent is saved in the hashtable from previous exercises and assigned an ID under which it can be retrieved. HTTP Commands GET
, POST
and DELETE
are supported.
Info: The makefile assumes a precompiled static library saved at
lib/64/libonion_static.a
orlib/32/libonion_static.a
. Those are not included in this repository.
Arguments: hostname [hostname...]
A basic implementation of NTP. It takes a list of NTP server adresses and queries the current time from each of them. Afterwards it selects the best of them based on their delay.