Third assignment: Wake on LAN server

The third assignment is a server to wake up computers through the network. The server allows clients to schedule a wake-up operation into the future. This third assignment only uses UDP protocol.

For managing the list of pending wake-up requests a hash table (or similar) can make your job easier.

Update: I have added a sample server on the campus network. You can reach it with command nc -u msanchez.upv.es 2323 and it works as the exercise requests. Please note you can only interact with it from inside the campus network, otherwise you'll be blocked by the campus firewall. If you want to use it from your home, please create a VPN connection to the campus network.

You can receive the response by specifying your own IP address and running this other command: nc -ulp 7 on your computer (for this command you'll need administrative rights). Please remember the message is scheduled to be transmitted once the time has passed. If this command is not running before datagram is transmitted then datagram will be lost (it is not queued anywhere).

Update: One small detail is that nc command will add an end-of-line marker (char 0x0a in OSX and Linux) to the text you just typed at the terminal when you press enter key.

Update II (March 9th): An unscheduled power outage left the sample server out of service for a few days. Now it is back online.

World IPv6 Day Test


Next June 8th, several companies have decided to have their websites available for IPv6 traffic too. Click on this entry title to get more information.

Redes rules

For those of you joining us lately, here you have the course syllabus-
Re Des 2010

1st term marks

All your exams have been marked and you can see the results on the "Exams" tab of the attendance worksheet.



For a limited time, your written exam is available for you to double-check the grading process. If you detect any error, please let me know. If you have any question about marking process or the answers of the solved exam feel free to contact me. Please note that the document below contains all the exams in no specific order, so you may need to scroll down a bit if yours is the last one.




For your own protection, saving or printing this document is not permitted. Nor this document is available to a regular visitor on the hosting service.

Solved 1st term exam

You will find below the solved exam. Please have a careful look at the answered provided there and considering your own answers to the written exam, mark your own answers and email me the mark you think you have obtained. Consider only good or bad answers (that will be worth 2% or 0%). Do this as soon as possible (as your memory about your own answers will fade away).

You can get a full-page document view by clicking on this entry title. Do not hesitate contacting me if you find an error on any of the provided answers.
Solved 1st Term2011

Solution to 2nd assignment

Time is out. Here you have one solution to the second assignment. Whether you failed it or you are interested on learning how to do it, you can used this code as a reference implementation.

All submissions have been marked. You can see your mark on the attendance page, assignments tab. If you submit your assignment and the mark is missing, please send me an email.

Solution to 1st assignment

A sample solution.

Important reminder

Next Thursday, December 9th, there is a change in the regular class schedule and classes will proceed as if it were a Monday at ETSINF (please note this does not apply to other schools or studies).

We do not have lectures on Mondays but we do have lab sessions. Remember this not to miss anything.

Attendance rate is declining fast

If you look at the attendance record you'll see that I've added two rows in the bottom showing the total number of attendees on each session and a moving average too.

I can see there is a steep decline in the attendance to the class. Whether this is due to a problem that can be fixed or not I do not know. I just hope you're not given up the subject as still there is one month left. If there is something that needs to be changed in the classroom just talk to me.

Attendance to my office hours is very low too. I just want to remind you that I am here to help and that office hours are part of the instruction.


Sample micro web server

The sample code shows a very basic web server that handles requests one at a time. A text line is printed showing the file requests. Please note the contents to be served has to be in the same folder of the server binary.

BTW, web server listens on port 7777, but you may change that if you wish.

Click on this entry's title to see the code on pastie's page. Please note there is a download link on the upper right corner there.

Second assignment


Though you still have two weeks to turn in your first assignment, the second one is published too.
Do not worry because you have till December 20th, 2010.

This time it is a server what you have to do (a multi-threaded server). The good news is that the application protocol is very simple. After connecting to the server, the client may send one line of text containing an arithmetic expression (i.e. 1+2*3/4) and the server will respond with another text line containing the result of evaluating this expression (i.e. 2.5) or an error message if there is something wrong with the client expression.

Client will signal the server its willingness to quit by sending an empty line. Server will provide no other answer to the empty line but closing the connection.

Several clients can be using the server at the same time and all of them need to be served right away.

You can find here the Eval.java mentioned on the assignment text.

Another useful tool


Though we have mentioned traceroute command in the class. I want to bring your attention to a better alternative: mtr program and its windows version WinMTR.

What it does is a more in depth statistical analysis of the path from your computer to a certain destination. Contrary to traceroute, mtr command is kept running till you press "q" or Ctrl+C as it is constantly updating its measurements.

HTTP and your bike


While you may think HTTP is just a protocol for downloading HTML files, this idea is wrong. HTTP is used daily for transferring many different types of files, from HTML to several graphic formats (JPEG, PNG, GIF, etc) to Cascade Style Sheets (CSS) to JavaScript files and many others.

In this post you can study the way the city bicycle service (Valenbisi) works in order to provide an application the location of the different bike stations and the current state of each one. Here the body of each HTTP response is an XML file.

Armed with this knowledge, this site was created and, believe it or not, it turns out to be much more useful than the "official" one.


The software you don't want your friends to have

Not sure how long this trick will work, but it is a wake up call about Facebook security when it comes to users accessing over wifi networks. We'll be explaining HTTP protocol soon in the classroom, but for Wifi technology you'll have to wait till next term.

I reckon this tool will only work on WEP-protected wifi networks, but I'll be interested on your feedback if you get it working.

Now that "The social network" is on theaters it seems a good moment for this type of information :-)

Short Tutorial on Java Network Programming

I'll be using this material in the classroom to present the basics about Java Network Programming. You can download the PDF file by clicking on this entry title too.
Java Network Programming

It seems the guys at Scribd have some trouble with this document. If you see empty yellow boxes, please download PDF or watch the file on Scribd site (by clicking on Scribd logo) to be able to see the missing code.

Source code is available too.

First assignment is out


This is our first assignment. It is about writing as small web server in Java language. Those of you not familiar with Java might use a different language upon request.

We will present the basic ideas of how to create networking programs in Java in a few days. Please note a sample server is also provided so you can now see exactly what is required.

For running the sample code you need to have a Java Virtual Machine installed on your system. Then at a terminal type: java EchoWebServer
And next type in your browser address bar: http://localhost:8080/anything

Every now and then ...


... we are told the transition to the new version of IP protocol is about to happen. This article says, once more, that old motto (it's been a decade of listening to the same message in slightly different ways).

We will be covering Internet Protocol in Chapter 3. But unless something earthbreaking happens next month, we will still be covering IP version 4 instead of the new version 6 (which is now twelve years old). Whatever it happens, please remember your computer (no matter what OS you use as far as it is recent) already supports both versions.

Labs schedule

You can get a copy of the laboratory sessions' schedule by clicking on this entry tittle.

Course presentation, 2010-2011


Click on this entry title to get the PDF file of subject's presentation slides.

September 2010 marks

Click on the title to go the mark's sheet.

Congratulations to Fernando and Isma that passed the subject.

Your exam is available for you to check it out.