Introduction to Computer Networking

G. Leduc - INFO0010-4 (ULg)

Last update : December 13th 2019

Update notes
09/14/2019 : Reset the page for 2019-2020 academic year.
10/09/2019 : Added material for project 1
11/13/2019 : Added feedback for project 1 and material for project 2
12/02/2019 : Added FAQ section for project 2
12/09/2019 : Added a frequently added question
12/12/2019 : !! Extended deadline : December 20th !!
12/13/2019 : Added three frequently added questions


Information page for the programming assignment

This page is dedicated to materials and information about the programming assignment, split into two parts, to be realized in the context of the INFO0010-4 course.

Students attending INFO0010-4 will have to develop the two parts of the assignment. They will work alone for the first part and in groups of two students for the second part.

Students attending only Partim A will only develop the first part of the assignment and can work in groups of two students.


 

Resource

Java Sockets Slides about Socket programming in Java, including guidelines for the first part of the assignment.
Assignment #1 guidelines Guidelines for the first part of the assignment.
GuessTester.jar A jar file containing the tester program
Feedback Feedback for the first part of the assignment.
Assignment #2 guidelines Guidelines for the second part of the assignment.
myImage Image for the FTP server.


 

Assignments

Assignment #1 Statement for the first part of the assignment.
Hard deadline is November, 3rd 2019
Assignment #2 Statement for the second part of the assignment.
Hard deadline is December, 20th 2019

Frequently asked questions
May I use java.text.* ?
Yes, you may.
May I use org.apache.ftpserver.* ?
No, you may not.
How am I supposed to transfer files while I cannot manipulate files?
Your files will be virtual in the sense that you will only store them in memory. In this regards, using a class such as "File" is useless. Of course, FileZilla will view this representation as actual files.
I don't understand how the files are supposed to be refreshed at each server reboot, could you explain ?
Since the files are only virtual, it's very easy to recreate the structure from scratch. You only add them at server startup. Even if some "files" were added/deleted, no actual file was impacted on disk.
In the protocol, should I send this after that? How does it work?
I'm sorry, but you have to understand the FTP protocol by yourself, that's one of the objectives for the assignment.
How am I supposed to virtually represent files?
You will create a class that contains meta-data (file name, size, last modified date, ...) and content for each file (possibly folder). So each file/folder will be represented by an object of this class. You can then use a structure (e.g. a tree structure) to hold the structure of the virtual files. Adding/deleting a file will thus lead to the addition/deletion of an object in your structure.
I don't understand what you mean by port 20xx and when it should be used. I though the client sent the port number in active mode?
Port 20xx is the local port. The client will send its own port (distant). You should thus use the Socket constructor with 4 arguments (and use InetAddress.getLocalHost to get your IP address)
Sometimes, if two transfers are too close, I get an "address already in use" exception. But if I wait several minutes, it works fine. What's going on?
When you close a socket, you don't really free the resource right away. TCP has a timer during which the IP/port is still in use to ensure packet delivery, and resending the packet if necessary. So, sometimes for a few minutes, the address is already in use, and if you try to use the same address/port, you will get an exception. The solution is to use setReuseAddress(true) on the Socket, and the problem will disappear.