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.
Congratulations to Fernando and Isma that passed the subject.
Your exam is available for you to check it out.
September 2010 exam
A few details about the September 13th, 2010 exam:
- At 15:30 the 2nd term exam will be held.
- At 18:00 the 1st term exam will be held.
- Each part will last two hours.
June 2010 Final Marks
While still you can review your exam and ask for any correction that might be needed, current final marks have been published. Hopefully this will remove the anxiety of some of you about the final marks.
Please note that those with incomplete assessment (i.e. one term exam missing) will get no number in their mark. Instead it will be stated that not enough information is available so as to give any grade.
Those of you that have failed the subject, please remember there will be a new opportunity on September for both, first and second term exams. Also remember the only requirement is that the average mark of both terms has to be equal or greater than 50% to pass the subject. Whether you want to take one or two exams in September is your choice.
Please note that those with incomplete assessment (i.e. one term exam missing) will get no number in their mark. Instead it will be stated that not enough information is available so as to give any grade.
Those of you that have failed the subject, please remember there will be a new opportunity on September for both, first and second term exams. Also remember the only requirement is that the average mark of both terms has to be equal or greater than 50% to pass the subject. Whether you want to take one or two exams in September is your choice.
Marks are available
Both 1st and 2nd term exams have been marked. For many of you there is a small difference between your assessment and mine. There are a couple of cases where difference has been significant.
2nd Term June2010
I've made every effort to provide an accurate and correct marking, but errors may happen. Should you have any concern about your mark, please let me know.
Please note that the view of marked exams is available only for a limited time and that document download is disabled.
2nd Term June2010
I've made every effort to provide an accurate and correct marking, but errors may happen. Should you have any concern about your mark, please let me know.
Solved 2nd term June 2010 exam
You can download the solved exam and mark yourself. Please email me your mark. Click this entry title to get the file.
First term exam has already been marked. Results are in the usual place.
First term exam has already been marked. Results are in the usual place.
Interesting IT security event in Valencia
Asegúr@IT 8 is a one-morning event to be held in Valencia. Speakers are knowledgeable people on the security field. Attendance to the event is free but the seats are limited.
BTW, this event is sponsored by Microsoft and a Passport/LiveID account is needed to register.
BTW, this event is sponsored by Microsoft and a Passport/LiveID account is needed to register.
CodeJam2010
I usually join the contest and I am kick out very soon. Java is among the programming languages accepted. There are many sample problems you can attempt to test your skills before the contest begins. Those of you making it to Round 2 can claim an extra 10% mark.
4th and last assignment is out
This time you have to write a simple "wrapper" code to allow the use of an interactive command-line program through a socket connection. While this can be achieved by piping your command to nc or sock commands, you are required to do this by yourself in Java language.
A brief explanation on how you can launch an external program and access its input and output is provided. You have till May 26th, 2010.
A sample implementation is provided too, but please note it won't work in a Windows computer (unless /usr/bin/bc command is found on your system).
A brief explanation on how you can launch an external program and access its input and output is provided. You have till May 26th, 2010.
A sample implementation is provided too, but please note it won't work in a Windows computer (unless /usr/bin/bc command is found on your system).
New assignment is out

One of the problems we face when our computer is behind a NAT (or a firewall) is that incoming connections cannot reach our computer. While it is possible to fix this with some additional configuration, this assignment is about creating a piece of software that will help two users to be connected even when they are behind a NAT.
For testing purposes let's assume both users will use telnet application to have an interactive chat session (only two users per chat). Your meeting server will enable conversations between pairs of clients, but at any given moment several independent chat sessions may take place.
You can click on the title to get a copy of the assignment document.Update: Please feel free to ask any question you might have about the assignment as a comment to this entry. This way other students may benefit from it being answered here to.
Update2: As with other assignments, I'm providing you a sample binary for MServer for you to test.
1st term marks
Exams have been marked. Most of you will find your estimate was pretty accurate, but a few cases differ more than 10%, some underestimated and others overestimated their mark. It is ok. Those having no mark is because they did not show up for the exam.
We've won three new students that just showed up for the exam (so they have 0% attendance), for these people, welcome to the class, I hope to see you more often. It is likely some new Erasmus students will join us for the 2nd term too.
Exam average mark is 45% and term average mask is 50%. Both Juan and Anush are our top scorers this term, congratulations!
However, our top scorer in the exam was not any of them but Michał, who scored 80%, congratulations too!
The most difficult question seemed to be (17) how to print the IP address of a received datagram packet. Nobody realized getAddress method returns a InetAddress object and not an IP address dotted decimal string. For that, getHostAddress method was needed.
Those of you below of 40% this term really need to get up to speed to pass this subject. Whether you plan on just focus on the second term or repeat the first term exam too is up to you. But I strongly recommend you to work quite a bit harder not to fail the subject.
To see the list you can click this entry title or just go to the attendance record link where all the details are found.
Update: You can now check marked exams. Please email me if you find any marking error you want me to have a look at.
Solved exam
Click on the title to have access to the solved exam.
I sent it to all of you by email too.
Please have a look at it and mark your own answers (I guess you remember what you answered this morning) using a digital logic: answers are either right or wrong.
Please note each right answer scores 2%.
Once you have marked your exam I want you to send me an email with your name and mark.
Please do so as fast as possible (as your memory about what you answered today will fade away).
I sent it to all of you by email too.
Please have a look at it and mark your own answers (I guess you remember what you answered this morning) using a digital logic: answers are either right or wrong.
Please note each right answer scores 2%.
Once you have marked your exam I want you to send me an email with your name and mark.
Please do so as fast as possible (as your memory about what you answered today will fade away).
Exam Remainder
Please remember REDES' exam will be held in building 1G next Monday, January 25th, at 9:00. Max exam duration is two hours.
X-ray your network communication
While we've presented netstat as a tool to help you watch your connections, if you're running Windows you may want to hear about TCPview. From their website:
TCPView is a Windows program that will show you detailed listings of all TCP and UDP endpoints on your system, including the local and remote addresses and state of TCP connections. On Windows Server 2008, Vista, and XP, TCPView also reports the name of the process that owns the endpoint. TCPView provides a more informative and conveniently presented subset of the Netstat program that ships with Windows. The TCPView download includes Tcpvcon, a command-line version with the same functionality.
Please note that the tool can also be useful to track down suspicious communications happening on your computer. You can easily know where your computer is connecting to and which process is doing it.
TCPView is a Windows program that will show you detailed listings of all TCP and UDP endpoints on your system, including the local and remote addresses and state of TCP connections. On Windows Server 2008, Vista, and XP, TCPView also reports the name of the process that owns the endpoint. TCPView provides a more informative and conveniently presented subset of the Netstat program that ships with Windows. The TCPView download includes Tcpvcon, a command-line version with the same functionality.
Please note that the tool can also be useful to track down suspicious communications happening on your computer. You can easily know where your computer is connecting to and which process is doing it.
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.
September marks
Just in case you've not searched for them on the usual place, here you have September marks. They will become official by the end of this week.
Sorry, former link was not public, it should be fixed by now.
Sorry, former link was not public, it should be fixed by now.
Some ideas if you bring your laptop to the lectures
A former student, Ismael, mentioned that some students found interesting to use software for adding comments on PDF slide files. Apparently PDF-Xchange Viewer (for Windows) and Skim (for OS X) can do the job (for free).
Of course this may only be interesting for those of you that are bringing a laptop to the class. But, time-proven technology, like paper and pen, can be very useful tool too.
Of course this may only be interesting for those of you that are bringing a laptop to the class. But, time-proven technology, like paper and pen, can be very useful tool too.
Welcome to the 2010 class of RED
We'll use this blog for posting interesting data about the subject, slides, laboratory exercises, solved exams, assignments and marks.
Contrary to PoliformaT this blog is open to anyone, whether you are enrolled in the subject or not (or not yet).
Feel free to use the comments on any topic to ask questions or to make any comment you think it is appropriated.
Please note the "File Repository" link on the top right side will lead you to a Google site with (hopefully) all the required files related to the course.
Let's keep in touch
While I do know some of you are going to stay around for a while, others are already back to your home country. Because many of you are using the university provided email, contact will be lost as soon as your account has expired.
You still can reach me on Facebook or Linkedin networks, and I think it is a good idea to keep the link on. Sometimes you may need a recommendation letter or discuss any technical issue. Other times I may ask for some traveling advice. Who knows.
So farewell and see you online.
You still can reach me on Facebook or Linkedin networks, and I think it is a good idea to keep the link on. Sometimes you may need a recommendation letter or discuss any technical issue. Other times I may ask for some traveling advice. Who knows.
So farewell and see you online.
Challenge your programming skills
The new edition of Google's CodeJam contest is about to start. While you won't get any points on this subject, it can be fun and you can also get some cash!
Spicing up your marks
After some changes on the marking due to your requests, marks have been adjusted so all the available range of the pass mark is covered. As a result some of the marks actually crossed the fail/pass border and those of you affected will be pleasantly surprised. Still some of you did not make it and you will have to come back in September for another exam. Please note the exam "algorithm" will be the same as in June: You can take 1st term, 2nd term or both exams.
REDES-2008_09
REDES-2008_09
Publish at Scribd or explore others:
Do you want to check your exam?
Please note you'll need to scroll down to find your exam. They are not stored in any special order, so be patient.
1st term exam
and
2nd term exam
are available for you to see them on-line (no download is allowed).
Exams will only be available for a limited time.
Update: Question 21 of 2nd term exam has been re-examined and now Dijkstra is also considered a valid answer. Marks have been modified accordingly for all of you.
1st term exam
and
2nd term exam
are available for you to see them on-line (no download is allowed).
Exams will only be available for a limited time.
Update: Question 21 of 2nd term exam has been re-examined and now Dijkstra is also considered a valid answer. Marks have been modified accordingly for all of you.
June 2009 2nd and 1st term solved exams
As we did before, please double check the solved exam and with the answers you remember you provided and then, mark your own exam and email the mark to me.
Thanks.
Jun2009A Solved
The 1st term exam solution is below. As with the other exam, please mark yours and email it.
Jun2009B Solved
Thanks.
Jun2009A Solved
The 1st term exam solution is below. As with the other exam, please mark yours and email it.
Jun2009B Solved
A few more solved exams
If you took the time to explore this blog's content backwards you've realized some of the older links are dead. But fear not, some of that content is brought back to life here. These are a few solved exams more for you to look at.
Don't forget next Monday we'll have the exam.
Either you are attending to one term exam or two, see you there.
Don't forget next Monday we'll have the exam.
Either you are attending to one term exam or two, see you there.
Breaking bad
Some years ago we've got a situation at UPV. This paper details some of the events that happened. I reckon both students involved are still at UPV.
Paper
Paper
Exam details
Next June 2009 exam will consist of two parts. Those of you only interested on the second term part have to come at 10:00. 2nd term exam will last two hours.
After the 2nd term exam a 1st term exam will be held (same place but fewer rooms).
Please note that it is mandatory you take now the 2nd term exam but the 1st term one is optional. If you are happy with the mark you already have got in the 1st term then you do not need to repeat that. Your final mark will average the mark of both semesters "no strings attached".
Both exams will follow a similar format than the ones on the blog (sorry but old links may not work).
After the 2nd term exam a 1st term exam will be held (same place but fewer rooms).
Please note that it is mandatory you take now the 2nd term exam but the 1st term one is optional. If you are happy with the mark you already have got in the 1st term then you do not need to repeat that. Your final mark will average the mark of both semesters "no strings attached".
Both exams will follow a similar format than the ones on the blog (sorry but old links may not work).
Improve your Spanish while learning cryptography

Manuel Lucena is a professor from Jaen University who has a great book on cryptographic algorithms and who is kind enough to provide us a free PDF version.
There is only a catch on this offer: it's only available in Spanish. What a good opportunity for practicing your newly acquired skills!!
Contrary to what happened in the classroom, the book provides a detailed view of many cryptographic algorithms, including DES, IDEA, AES, RSA, ElGamal, DSA, ... etc
Update: For those of you that still prefer a book written in English you can download this one. Though a bit aged it is still a very solid book.
Put your crypto skills to work
For many of you [non-Spaniards] this might be a more difficult challenge as Spanish knowledge can help. Can you discover what is the hidden part of this message?
You are welcome to bring the solution to the class and I'll pay you a coffee.
For more challenging proposals you can go to this contest.
Last two chapters

Chapter 6 and Chapter 8 are the last chapters of our course. There is not much time left and we will skip some of the sections, please stay tuned to get the details about what is left out.
Easter Fun
Now that we're approaching the end of the course you might be eager to see the whole thing in action. There is no better way to learn anything that when you're facing the task of building a working system. And I mean to build all of it!
Most of the time you work on a personal computer. Not the hardware or the operating system are part of what you have to build. In an extreme case you might be rebuilding the kernel of the operating system you're running.
If you like hardware and to experiment I propose you to get one Arduino board and a LAN adapter for it. I've used in the past the ones I'm referencing and I've found that seller the cheapest option at the time.
To get things running you'll need to download the software library for the LAN card plus the Arduino IDE appropriated for your computer (OS X, Linux or Windows).
Arduino is an easy-to-use low-cost "open hardware" microcontroller board around ATmega168 chip. USB bus server to both power the board and download developed code to it. Many extensions are possible and the LAN card adds a simple Microchip LAN controller to Arduino. All the source code you see is all what's available: no operating system below, no hidden strings, just the bare source of the library.
Error checking (kind of)
If you want to know the character (for error control purposes) of a Spanish identification document, just perform the modulo 23 operation over the DNI number. Then use the next table. That's it.
And if you want to get a better idea about how CRC works you can visit this old post. There is a detailed Wikipedia article too.
0 | T | 12 | N |
1 | R | 13 | J |
2 | W | 14 | Z |
3 | A | 15 | S |
4 | G | 16 | Q |
5 | M | 17 | V |
6 | Y | 18 | H |
7 | F | 19 | L |
8 | P | 20 | C |
9 | D | 21 | K |
10 | X | 22 | E |
11 | B |
And if you want to get a better idea about how CRC works you can visit this old post. There is a detailed Wikipedia article too.
Chapter #5 slides
Oops, I've almost forgot to post it here. You can click on the title to get the file.
IPv6 survey result
It was published recently on NetworkWorld site. ISP's are not seeing a big business drive for IPv6.
Sample implementation of assignment#3
You'll need it if you're planning to do assignment#4 but you did not do #3. Source code is available here. It consists of a main class and three additional classes one for each server (peer, query and file server).
Better late than never
After some questions I've learned that I mention nowhere what the expected command-line parameters order for #3 and #4 is. Three are the parameters you need: port number, shared folder and initial peer, like this:
I just thought this afternoon that a test tool might come in handy for you to test your assignment #3 servers. So here you have such a tool. Please remember a full implementation of a peer was also available (as another way to test that your server works nicely).
The test program is intended to be run in the same computer as #3, so you only need to provide the port information.
Please note the file is not read from the filesystem but sending a file download request to your server listening on port P+2.
Also note that peer 1.1.1.1:1234 might not appear on the peer list till you run test program twice.
Do not use an empty folder for your P2P server: share some files!!
$ java P2P 7123 ./ 158.42.53.17:7777
| | |
port | |
folder |
initial peer
I just thought this afternoon that a test tool might come in handy for you to test your assignment #3 servers. So here you have such a tool. Please remember a full implementation of a peer was also available (as another way to test that your server works nicely).
The test program is intended to be run in the same computer as #3, so you only need to provide the port information.
Please note the output above shows the expected behaviour where you have three sections. On the top it is the peer list, after connect ok message that tells you the three server ports are open (p, p+1 and p+2). Next you have the list of filenames (only if your code reacts this way to an empty line query, something mine does) and in the third place you have the first 10 data bytes of the filename that appears last on your file list (FileServer.class).
$ java P2Tester 7777
>>> CONNECT OK
158.42.53.17:7777
158.42.53.17:8899
1.1.1.1:1234
P2P.class
QueryServer.class
ListManagement.class
Peers.class
FileServer.class
>>> READ FROM FILE (first ten bytes): FileServer.class
ca fe ba be 00 00 00 32 00 72
Please note the file is not read from the filesystem but sending a file download request to your server listening on port P+2.
Also note that peer 1.1.1.1:1234 might not appear on the peer list till you run test program twice.
Do not use an empty folder for your P2P server: share some files!!
Last assignment is out

Fourth and last assignment completes the P2P software you started building on #3. Therefore you'll need to add the #4 code to the one you wrote for #3. If you did not do third assignment but you'd like to attempt the fourth, please contact me for a reference implementation for third assignment (once #3 due time has expired).
This last assignment takes care of the user interface of the peer to peer program, that allows the user to search for files on the network of peers and to download a file from a peer. It also takes care of maintaining a "live" list of active peers (pruning it when a peer is found not responsive).
Due date is April 30th, 2009.
Assume command line information is correct.
IPv6 addresses problem
IPv6 is proposed as an almost unlimited source of addresses to overcome the IPv4 address shortage some people have suggested. As IPv6 addresses are 128-bit long, 2^128 (aprox 3.4 x 10^38 ) addresses are possible. This should be large enough.
To put things into perspective consider the following problem: How many IPv6 addresses could you put into each squared centimeter of the planet? (Assume the Earth is a regular sphere of 40.000 Km of perimeter).
And a second part ... compare the above number of IPv6 addresses per square centimeter to the total address space of IPv4.
To put things into perspective consider the following problem: How many IPv6 addresses could you put into each squared centimeter of the planet? (Assume the Earth is a regular sphere of 40.000 Km of perimeter).
And a second part ... compare the above number of IPv6 addresses per square centimeter to the total address space of IPv4.
Fragmentation exercise
A 4000 byte-long datagram has to be transmitted over a network whose MTU is 512 bytes. Determine the number of fragments and, for each one of them, write down the fragment offset field contents and the number of data bytes of each fragment.
Solution was presented as a spreadsheet in the class. Here you have a copy. You can export it to your favorite spreadsheet software too (to see the formulas).
Third assignment announcement

Third and forth assignments will be based on a peer-to-peer protocol invented for the occasion. The so-called "P+2" protocol has been created to be one of the simplest P2P protocols (but not any simpler). You need to read and to understand the protocol specification. Protocol was already presented in the class but if there is general call I will repeat the explanation.
This assignment covers three different servers needed to create a full implementation. Assignment's servers can be tested to work using either telnet, netcat (nc) or sock commands. Java language is mandatory for Spanish students but the rest may use the language of your choice. A working implementation of a peer is available too (just a binary version).
You can download assignment text from here. Or you can just go to the file repository (linked on the top right corner, under the new stuff title).
There is a sample peer running too. You may not need it yet for this assignment. Anyway, it is available at 158.42.53.17:7777
You are welcome to ask me for help. Please remember you have to write code by yourself. As assignments are marked individually, it is not something you can develop jointly with a classmate. If two or more assignments are copied from each other all the involved parties will fail the assignment. Due date is March 13th.
p_2
Second term starts
Chapter 4 slides are already available. For those of you joining us for the second term please note you should read the syllabus that contains important details about how the subject works.
Next week we'll start with the lab again. Lab#6 is out too.
Next week we'll start with the lab again. Lab#6 is out too.
Marks are out
You can check your mark on-line. There a few more students who have never attended lectures that will appear at the end of the list of names. This marks are not final as you still have a choice to check your exam. If you want to do that, please tell me so next week in the classroom (or send me an e-mail).
You can see we have a tie on the top performers. I want to congratulate both: Rasmus and Juliusz. Keep up the good work!
Solved 1st term exam Feb 2009
Feb2009 Solved
You know what you have answered. Now you know the right answers. So please check them out, use a binary logic (an answer is either right or wrong, and it scores or not) and calculate your mark and email it to me.
Publish at Scribd or explore others:
You know what you have answered. Now you know the right answers. So please check them out, use a binary logic (an answer is either right or wrong, and it scores or not) and calculate your mark and email it to me.
My mark after the exam ...
- Exam will be marked from 0 to 10 (being 10 the best mark possible).
- Attendance is already marked as a value from 0 to 1 (expressed as a %).
- Assignments have been marked too (0 to 2).
1st-term = attendance + (9-assignments)*exam/10 + assignments
Same process will hold for the second term. Course mark will be obtained by averaging both terms. There is not a minimum average you need to obtain on each term, but course average needs to be equal or higher than 5 points to pass the course.
To know more about threads synchronization
Assignment#2 presented you an scenario where multiple threads handle one client each. However, given that each thread has to send a text line to each any other thread's client, a synchronization problem may happen.
If all you use to test server's code is a few telnet clients running on your computer, it is difficult you see any problem (as only one client is typing at a time). If you're interested on researching this topic further, you may use IMTester.java code. This program will throw one hundred simultaneous clients to your server, each one sending on hundred text lines and then the mandatory quit command.
You may well see errors like this "Exception in thread "Thread-85" java.util.ConcurrentModificationException" on the server program. It basically means that an object was modified while others were reading from it (not a good thing). While I was not interested on raising this topic of synchronization, some of you pointed it out, so I cannot avoid explaining a bit more.
The main problem happens because the list of clients may change while one (or more) thread is iterating through it. If the client list changes while messages are being sent to other clients it is possible that either a client is missing the message or that a message is attempted to be delivered to client who is gone.
The solution is pretty simple but not obvious, and most of you failed to provide a proper one (not that it was a requirement though). I'm including an slightly modified version of my sample implementation for you that addresses the synchronization problem. The basic idea is that looping through client list and removing a client from the list are performed exclusively.
Update: A Vector object should have been used instead of ArrayList (as Vector is Thread safe and ArrayList is not).
Assignment #2 is marked
You should have got an email answer about your work. At any rate, marks are on the usual place (assignments tab). Those with a 0 mark still can try to fix it by Thursday 15th.
If any of you is missing a mark, please let me know.

You can have a look at my implementation.
December 18th
Today's class was used to explain the basics of a P2P protocol that will be used for assignments #3 and #4. Same explanation is here.
Please note the text of the assignments will not be provided until the beginning of the second term lectures after the exams break.
Not sure how useful it will be ...

It's been suggested that having all the information in one place might be interesting. So I am putting everything together on a Google site (as an excuse to learn a bit about that feature).
First term last lab

You're required to write a concurrent web server. Here you have the source code of the lab (which appears written on the lab document). You're not supposed to waste your time re-typing it.
Second assignment is out
Now that assignment#1 is due I'm publishing assignment#2 text.
This second assignment is about writing a multithreaded server application for an instant messaging server. Not that you're going to program the next Messenger server (at least not yet) but I hope it'll be fun.
Please remember this assignment is due on January 12th, 2009.
TCP sockets programming
Here you can find a copy of the source code java files I wrote during last class.
This is the client.
And this is the server code:
Please note that I detailed during the class some DOs and DON'Ts that not necessarily show in my (quick and dirty) code.
This is the client.
import java.net.Socket;
import java.io.*;
import java.util.Scanner;
class TestTCP {
public static void main(String args[]) throws java.net.UnknownHostException, java.io.IOException , java.lang.InterruptedException{
Socket s = new Socket ( "www.upv.es", 80 );
// Thread.sleep(100000);
PrintWriter output = new PrintWriter( s.getOutputStream(), true);
output.println("GET / HTTP/1.0");
output.println("");
Scanner input = new Scanner( s.getInputStream());
while(true) System.out.println(input.nextLine());
}
}
And this is the server code:
import java.net.*;
import java.io.*;
import java.util.Scanner;
class Server {
public static void main(String args[]) throws IOException, InterruptedException{
ServerSocket ss = new ServerSocket(8080);
while(true) {
Socket s = ss.accept();
Scanner input = new Scanner( s.getInputStream());
PrintWriter output = new PrintWriter( s.getOutputStream(), true);
System.out.println(input.nextLine()); // reads a line from the socket (client)
output.println("Hello client!");
s.close();
}
}
}
Please note that I detailed during the class some DOs and DON'Ts that not necessarily show in my (quick and dirty) code.
First assignment is out
You have till December 1st to turn in this first assignment. You may need to have a look to SMTP protocol specification (RFC 821). Please note that this RFC has been obsoleted by newer versions. However, for the purpose of this assignment, the original version of SMTP specs are ok.
Second chapter
Here you have second chapter slides and second lab too.
I know some of you still need to get a valid user account and I'm sorry. While this is not fixed, please ask the lab teacher to pair you with another student with a valid user account so you can do the lab.
I know some of you still need to get a valid user account and I'm sorry. While this is not fixed, please ask the lab teacher to pair you with another student with a valid user account so you can do the lab.
Laboratory starts this week
Just in case you haven't noticed, lab sessions started October 13th. I'm afraid you may be looking for the English version of the lab I forgot to post :-(
1st chapter slides
As I mentioned today in the lecture, here you have the slides from Chapter 1. I have created a Google Docs spreadsheet that will contain all the relevant information about your performance (i.e. class attendance, assignments, etc).
Unfortunately today the service is not working nicely and at the moment I cannot even access that page. As soon as they are back on-line I'll post here the URL for that page.
It is advisable that you check your attendance record from time to time. Please report any error you may find as soon as possible.
Update: Attendance spreadsheet is back on-line.
Update2: Lab calendar is here.
Here we go again
A new course starts on Monday. Amazingly over 25 students are already enrolled on the group, this has to be an all times record for our subject. I want to welcome you all and I hope you'll enjoy the subject.
For the moment I'm only making the course syllabus available. All the slides and interesting materials will be added to this blog little by little. Feel free to go back in time too, but please be warned that links from years ago may no longer be working.
Applied knowledge to physical layer

Most of you are young enough not to have ever used a cassette tape as a digital storage system. But still you may feel curious about how it sounded and, even more important how it worked. This entry links to an article about using software to decode an old BASIC interpreter for Apple I computer.
Different techniques were used long time ago to create audio signals representing digital files that could be stored and recovered from a cassette using an inexpensive cassette player.
And we are back online!!
After one year of using the PoliformaT platform I've got enough. It might well be ok for some people but I'm not among them. I refuse to be a good well-trained monkey.
In what I think is the best interest of my students (and my own sanity) I'm recovering this blog as the vehicle to distribute the class material.
There are a number of reasons for this move:
As an starter I'm posting here the solved exams of last June 9th, 2008.
And the second semester's ...
Please note that older material that is linked from previous entries may not work as it was lost after a hard disk crash. If you absolutely need to get any of them send me an email and I'll recover it for you.
In what I think is the best interest of my students (and my own sanity) I'm recovering this blog as the vehicle to distribute the class material.
There are a number of reasons for this move:
- Students will no longer need to log-in to read any class related news.
- Visitors will now be able to see what's going on in the subject.
- Prospective students will learn what the subject is all about.
- I will be able to avoid to do a dance to upload a single comment or document. However I will have to add a comment with any document I add, which I find appropriated.
- Anyone could comment on the topics of the blog, whether they are enrolled in the subject or not.
- Availability will improve upon university's.
- I will be able to keep the English group of the subject apart from the noise of other languages' groups.
- Blogger's usability is miles away from the ugly and clunky interface of PoliformaT.
- We will be free to enjoy videos of any size (PoliformaT limits to 20 MB max which is a joke).
- Maybe the site will open up collaboration links with other universities.
- Site appearance could easily be changed (if I were not so lazy).
As an starter I'm posting here the solved exams of last June 9th, 2008.
Read this document on Scribd: solved exam 1st term
And the second semester's ...
Read this document on Scribd: Solved exam 2nd term
Please note that older material that is linked from previous entries may not work as it was lost after a hard disk crash. If you absolutely need to get any of them send me an email and I'll recover it for you.
Local storage is gone!
After the last storm the computer that used to act as this blog storage server gave up the ghost.
That means that the copies of laboratory exercises and course slides are gone too. Together with many of the documents referenced in this blog. I am not planning on restoring either the contents or the server anytime soon.
However, I will be posting each new document on the "private" PoliformaT site.
That means that the copies of laboratory exercises and course slides are gone too. Together with many of the documents referenced in this blog. I am not planning on restoring either the contents or the server anytime soon.
However, I will be posting each new document on the "private" PoliformaT site.
I have to let this blog go
I want to welcome all the new students. This blog has been the home for the English language class of the subject RED (code 5662). The format was simple (and sometimes even Internet Explorer rendered it properly) and you needed no silly authorization to download anything. However, the UPV in its infinite wisdom has decided to curtail the use of external tools, like this blog, in favor of their locally cooked version of Sakai they have named PoliformaT.
It seems that faculty not using this tool will be considered as doing no work on cyberspace. There is some money involved, don't get me wrong, we have a job to do and some money to make. By putting the carrot on the use of PoliformaT they are insuring all of us will end up using that platform whether it fits our (or your) needs or not.
For our English group it has been a constant cause of trouble the fact that students join us a bit later than the beginning of the term. Because of the involved paperwork, they use to come to the class sooner than they have got a username and password. Under the university instituted systems (so called microwebs and now PoliformaT) they have no access to course syllabus or slides. To address this problem I have been using for two years this blog (the fact blogger interface was cooler and simpler than the local alternatives did help too).
So from here I want to apology in advance for the possible trouble you are facing with this new move at the UPV. While technically I cannot claim this is censorship I would say they are giving as the same choice that Ford Motor Company gave to T-model customers: "You can choose any color you like as long as it is black".
It seems that faculty not using this tool will be considered as doing no work on cyberspace. There is some money involved, don't get me wrong, we have a job to do and some money to make. By putting the carrot on the use of PoliformaT they are insuring all of us will end up using that platform whether it fits our (or your) needs or not.
For our English group it has been a constant cause of trouble the fact that students join us a bit later than the beginning of the term. Because of the involved paperwork, they use to come to the class sooner than they have got a username and password. Under the university instituted systems (so called microwebs and now PoliformaT) they have no access to course syllabus or slides. To address this problem I have been using for two years this blog (the fact blogger interface was cooler and simpler than the local alternatives did help too).
So from here I want to apology in advance for the possible trouble you are facing with this new move at the UPV. While technically I cannot claim this is censorship I would say they are giving as the same choice that Ford Motor Company gave to T-model customers: "You can choose any color you like as long as it is black".
September marks
!!! I am glad to inform you that after marking the exams all of you have passed the subject. Details can be found on the usual place.
Next September 11th
Those of you who haven't pass the subject yet do not forget exam will be held September 11th, at 4:00pm.
Subscribe to:
Posts (Atom)