All the networks!

Timeline: Jan - Apr 2021

This page describes various assignments I worked on with one other friend as part of UBC’s CPSC 317 course.

Assignment #1: Application-level Protocol: Dictionary Server Client

We implemented a command-line client program at the Application level of the networking stack. This client program communicates with a dictionary server, for example this one, based on a communication protocol. Our program works similar to communicating with a dictionary server with a command such as nc test.dict.org 2628 to query the dictionary server.

We decided to encapsulate this functionality into two main entities. One entity represents a dictionary client, with an underlying socket connection, and related components such as socket reader, writer, and timeout. We used Java sockets to communicate with the server. Each command that our program supports is implemented based on the requirements (such as, status codes) of the communication protocol linked above.

The other entity deals with the command-line parsing and processing of commands. Given a set of valid commands that the user can input, we implemented a simple state machine to validate the “state” of the program, as not every command is valid at all times, for example trying to retrieve definitions before opening a connection. This entity is responsible for fetching and displaying information from the dictionary server using the methods defined in the first entity, as well as keeping track of various error cases that might happen in the program (ex: “Supplied command not expected at this time” / “Invalid argument” / “Connection I/O error”), and displaying the appropriate errors.

Code to our project is here.

Assignment #2: Domain Name Resolver / DNS Client

We implemented a command-line DNS client that resolves domain names (ex: www.cs.ubc.ca) into IP addresses (ex: 142.103.6.5) by iteratively querying different nameservers.

Our project and instructions to run it are here.

Gökçe Dilek
Gökçe Dilek
Software Engineer & Open Source Contributor

Related