UDP socket programming
The second assignment is dedicated to UDP socket programming with Java and testing your programs in a virtual networking environment. You will use provided starter code for UDP echo server and client, improve it and test your implementation in a setting where server and client programs are executed on different machines connected in a network.
Reference material
- Starter code for UDP echo server / client
- Java networking tutorial
- Official Java documentation
- Putty terminal (for Windows users)
- Oracle VirtualBox documentation
- Virtual machine image
- Ubuntu terminal usage documentation
- Additional notes on VM usage
Problem 1
You will start with setting up virtual networking environment. Install VirtualBox (extensions pack must also be installed!), download provided Ubuntu virtual machine image and import it to VirtualBox.
You can read about VM configuration and usage on this page.
To check networking, use “ping -c 5” program from one machine with IP address of the other machine. Include screenshot (or paste the terminal session as text) in your report!
Problem 2
This part of assignment involves programming. Start with downloading provided UDP server and client programs, compiling and running them on your computer.
Improve programs by adding exception handling and error messages output. The next feature to implement is configuration of message size (in bytes) and messages transfer rate (in messages per second). It must be possible to specify these values as client command-line parameters. Rate value 0 must result in client sending message only once.
Test your programs with different parameter values and input strings! Try to set buffer size to some small value (e.g., 64) and run programs with input string of bigger size (e.g., 80-100). What happens in this case? Include screenshot (or paste the terminal session as text) and explain this situation in your report!
Problem 3
Finally, copy Java classes / JAR files of server program to the virtual machine and launch it there. Launch client on your host system, repeat testing from previous step and ensure that programs work as expected. Include screenshots in your report!
Submission
The deadline for submitting your assignment is February 28, 2013, 23:59.
This assignment may be done individually or in a group of two students (in this case, only one submission should be made and names / IDs of both partners must be included in submission letter).
Submission must be packed in a single ZIP archive and it must include:
- all of your source code files in non-default Java packages (e.g., your classes should belong to package “1dv201.my_package_name”); your source code files are expected to have sufficient amount of comments
- report with answers for problems, specified example outputs / screenshots, short comments on implementation, etc. as a PDF or HTML file
Submission archive must be sent to Kostiantyn ( kk222bt@student.lnu.se ); please include “1DV201 Assignment 2” in your email topic and include your name and student ID (e.g., “kk222bt”) in your email body.