Introduction to Computer Networking

G. Leduc - INFO0010-4 and INFO0010-2 (ULg)

Last update : July 4th 2019

07/04/2019 : Added guidelines for second session.

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-X 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 INFO0010-2 will only develop the first part of the assignment and can work in groups of two students.

Second session

The schedule for the oral exam is not available yet but should be after July 16th.

Students can resubmit their projects. If they don't, the grade they obtained in the first session is used for the second session. The new submission will erase the old one (I don't consider the best of both submissions). The deadline is August 15th via the submission platform. Guidelines of the first session still apply. You may keep the same groups or create new ones.

It is not possible to redo the Netkit labs, but grades obtained in the first session are only kept in the second session if they are in your favor.



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.
Feedback Feedback for the first part of the assignment.
Guidelines #2 Slides with guidelines for the second part of the assignment.



Assignment #1 Statement for the first part of the assignment.
Hard deadline is March, 27th 2019

Frequently asked questions
May I create more classes and files than the mandatory BattleshipClient and BattleshipServer ?
Yes, of course. All I ask for is that all your files are put in the same directory.
I have issues when transforming the array of bytes into String. Could you help me ?
There's no real good reason in this assignment to use String (characters) instead of bytes. Remember that the protocol is binary-oriented, not text-oriented, meaning that "1" is not the same thing as 1.
Is it OK if the client asks for X,Y coordinates starting at (1,1) ?
Yes, but since I didn't specify how the coordinates should be input, and that there are other ways (e.g. coordinates start at (0,0) or using a letter and a number (e.g. D3)), I would greatly appreciate if the client displayed the type of representation that it uses.
I don't understand what byte msg[ ] = new byte[64]; stands for. Could you explain?
This is the byte buffer that's been used for receiving. After executing int len =;, it contains what has been sent from the other side (maximum 64 bytes). The variable len tells me how many bytes were effectively received.
How do we have to implement a game over?
This is not explicitly stated in the brief, so anything goes. Acceptable solutions include : (i) The client is aware of the game over and does not let the user continue, or (ii) The server is aware of the game over and responds with 1 4 for each guess untill it receives 1 0 again.
What if the user picks twice the same location and the client sends two identical messages?
In that case, the server will respond with the same value for both messages. Now, the brief doesn't specify if the second time counts as a try (on the allowed 70) or not, so do whatever you want. And maybe it would be a good idea to implement something client-side so that the client doesn't even have to ask the server in that case.
If the client keeps track of previous tries, should we still implement the list in the protocol?
Yes, because the protocol is imposed, meaning that I should be able to use a different client using the same protocol and it would still work. Obviously, if the client keeps track of previous messages, it doesn't have to specifically ask for the list to the server.
Assignment #2 Statement for the second part of the assignment.
Hard deadline is May, 12th 2019

Frequently asked questions
May I use java.text.* ?
Yes, you may.
May my Java program manipulate files ?
Your program may not write anything on the file system. However, you may store some files that your Java program will read.