Assignment#2 is marked
Apparently second assignment has been quite challenging as only five submissions were received. It's been marked and all of them have passed the assignment. Source code of any of the submissions can be obtained on the anti-plagiarism system report.
Torrents are good
Downloading large files using P2P technology can be quite convenient. As an example I've uploaded the ISO image of Graduation Ceremony DVD to Mininova. These guys are now prevented by a court order to distribute copyrighted contents. However there is no problem if the contents is public domain or posted by the rights holder. So here you have the torrent file.
If you did not graduate this year and therefore missed the ceremony, now you can have a look at it.
Class source code
Today we talked about Multi-thread servers and how we can create them easily in Java.
There are the three examples I wrote.
And let me correct myself: The first implementation of synchronized methods (using inc and dec methods for the simultaneous client counter) is as good as the last one (using just inc) as it is explained in here.
There are the three examples I wrote.
And let me correct myself: The first implementation of synchronized methods (using inc and dec methods for the simultaneous client counter) is as good as the last one (using just inc) as it is explained in here.

Excellence in Teaching Awards 2009

Now it is time to look around and to thank all the people that made this possible: from my colleagues who share an interest on teaching to my students who keep on asking questions. From all of them I learn a lot every day.
I'm also grateful for my University and government that through various programs have supported different visits and stays at foreign universities.
And last, but not least, to my dear family and friends who have always been there for me.
For all of these I'm grateful.
Assignment#1 report
Not that the results are very bad but I want you to know that measures are taken to keep you all honest.
The following report checks the similarities between all of your submitted assignments.
Class problem
A 4-MByte file is transferred between two computers linked by a router. Each link is 100 Mbps and 100 meters long. Signal propagates at 85% the speed of light. TCP is used for the transfer with MSS=1460 bytes and Receive window is 2048 bytes. How long does it take for the transfer to complete?
Assume only data and TCP headers are transmitted. Assume TCP acknowledgments transmission and queuing delay are negligible. Assume TCP uses delayed acknowledgments. Assume no transmission errors happen and no congestion control is used. Assume TCP connection already established.
For solution OpenOffice's spreadsheet click on this entry title.
Or...
No thanks, I prefer to shot myself on the foot than to use OpenOffice.
Assume only data and TCP headers are transmitted. Assume TCP acknowledgments transmission and queuing delay are negligible. Assume TCP uses delayed acknowledgments. Assume no transmission errors happen and no congestion control is used. Assume TCP connection already established.
For solution OpenOffice's spreadsheet click on this entry title.
Or...
No thanks, I prefer to shot myself on the foot than to use OpenOffice.
Solution to assignment#1
As you have asked me for a solution I'm providing you mine.
You can see that as soon as a client does not provide expected command it is kicked out.
This server won't accept multiple messages sent over the same connection (nor it was required).
An alternative implementation using a finite state machine for the implementation is shown in this other solution.
You can see that as soon as a client does not provide expected command it is kicked out.
This server won't accept multiple messages sent over the same connection (nor it was required).
An alternative implementation using a finite state machine for the implementation is shown in this other solution.
Second assignment is out
Only GET method is permitted, so you can safely reject any other method coming from the browser (to keep things as simple as possible).
You can click on this entry title to get the assignment text. Second assignment due date is December 23rd, 2009.
Haven't read RFC 821 yet?

Click on the image on the left to get a better view of it.
Issues with Assignment#1
Apparently there are some difficult statements on the assignment text (given the submissions I'm getting). Let me repeat some of them here (pasted from original document, boldface added here):
- Please include a MANDATORY comment on the source code with your name.
- Please send me the java source code file by email to the email account shown here with
EXACTLY the subject: Assignment#1 - Each time your server receives a message it will write it down to a text file named "received.txt".
- Main class name MUST BE SmtpServer.
In case you have not noticed it, I was using UPPER CASE to remark that these were IMPORTANT information.
How to write to a text file in Java?
I would suggest you to use PrintWriter class to write to a text file the same way you'll print to a socket. In the below example object out is created so later on out.println("whatever") can be invoked.
PrintWriter out = new PrintWriter(new FileOutputStream("received.txt"));
Office hours change
I've changed office hours due to agenda conflicts. You can see below the new office hours.

Lab#2
This week lab#2 starts. You can get the lab text from this page file repository (or by clicking on this message's title). On the other hand, it has been a subtle change about lab's local storage: Now your home directory is set to your own private network storage. So, contrary to what the lab instructs you to do, you can keep the lab folder if you want.
This lab is about using sockets from the command line interface (CLI). FTP protocol is also presented here.
This lab is about using sockets from the command line interface (CLI). FTP protocol is also presented here.
Java Network Programming
There are many good sources to learn from. But I think the best advice I can give you is that network programming is like riding a bike: you learn by doing it.
While on the campus network you can access a huge collection of Safari Books Online. A relevant one is this one.
But among many online resources, the Java Tutorial is worth trying. They even have a Sockets section you may enjoy reading.
Please remember that Java is free and open. You can easily download JDK to your system, so you can both compile and run any examples. I encourage to do so.
First assignment

I've published the first assignment on our file repository. If lazy, just click on this entry title.
You have till Nov 20th, 2009 to turn it in. Remember that while optional, assignments will count to your final mark.
Those from foreign universities can use a programming language different than Java.
I'm providing you a sample server binary that, hopefully, will work. You can run it by typing
java SmtpServer
Update: There is been already one submission.
Lab Blues
I failed to mention that there is a self-assessment test at the end of each lab session. Unfortunately these exams are only available in Spanish. The good news is that you can safely skip them. It is ok if you do them too. It is ok if you provide random answers too.
The real assessment for the lab exercises will happen in the written exams, where 30% of the mark will come from questions about the labs. Please note other students (not the English one) have a different policy regarding the lab tests (these being mandatory). Please note the teacher in the lab may not know you're from the English group.
I am sorry I did not mention that before but please remember last week we did not have lectures of RED.
Fiber optics Nobel prize
It is said that success has many fathers.
Charles Kao, one of the fathers of fiber optic technology has been awarded this year's Nobel prize in Physics. The prize is shared with two other notable physicists.
This gives you an idea of how important fiber optic technology is.
Odd week
As you know next Friday is a national holiday. Next Thursday, however, it is not a holiday. But, in order to balance the number of weekdays next Thursday will be like a Monday regarding to lectures' schedule.
So to make a long story short: This week we won't have RED lectures.
Subscribe to:
Posts (Atom)