Sunday, November 24, 2013

Homework about TCP Congestion Control

A new TCP connection is made and assuming receiver's window value is always 64 MSS:

  1. What is the Congestion Window value after sending 27 full-size (1 MSS) TCP segments? (Unless otherwise noted, all ACKs arrive on time within the same RTT).
  2. A new segment is transmitted but a timeout event happens next, what will be the new Congestion Window after sending yet another 15 TCP segments?
  3. At that point, what is the Threshold value?
  4. Draw the the evolution of the congestion window over time using round-trip time as the time unit of the graph. Use MSS as the unit for the window size.

Tuesday, November 12, 2013

Marked test and next class

Next class will introduce TCP protocol. Additional reading are sections 3.5.1 & 3.5.2.

Chapter 2 test has already been marked.

Programming project

Some of you have asked me about the way the labs are going to be assessed. Though I will pr
esent it in the next class, here is the deal: The work you do in the lab is mostly about learning how to use the sockets interface during the first term. So that learning outcome will be shown by you creating a distributed application of your choice (ie. a two or more players game, a P2P filesharing app, a simple FTP|HTTP|SMTP server, a chat server, etc). There is not a closed list and whenever possible I want you to chose the project.

This is a team work where up to three students can work together in a common project. It is still possible to do it alone, though. Projects will be publicly presented in the lab and marked by your peers.

Those of you that could not think of a possible project can come to my office for getting a project proposed by me too.

Whatever project you chose you need to check with me that is ok (projects that do not involve network programming will be rejected, that is almost the only requirement).

It is ok if you just invent a new type of application or protocol, as far as you are capable of convince your classmates of its usefulness and/or coolness.

All work is due to the lab session December 17th. Those that can make it to the previous week can have a bit more time to explain and show their projects.

It is suggested that projects are based PC platform and Java language, for that I can provide support, but it is ok if you rather use another language or develop for Android/IOS or any gaming platform, as far as you can produce the source code and show us a working demo.

Monday, November 11, 2013

Lab#5: Multithreading in Java

This lab is not really about sockets but about how you can build a server that can handle several clients
at once.

Servers can be classified attending on how they handle simultaneous clients. The first type is called iterative server. This is when a server can only handle one client at a time. If there are more than one client, they will be served on a first-come first-served basis. Every call to the accept() method will give the server a Socket object to talk to the next client. Once a client has been served, the server goes on to serve the next client that is waiting (if there is any). When multiple clients arrive at the same time, all but the lucky one will have to wait.

The second type of servers, called concurrent servers, can handle several clients at the same time. Clients do not have to wait to be served, and average response time is usually much lower, which is a good thing for interactive services (as humans tend to become anxious if they have to wait without nothing apparently happening).

The way we can program a concurrent server is by using techniques for concurrent programming. Two basic mechanisms for doing that: multiple process and multiple execution threads. We can use threads easily in Java by extending Thread class and re-writing its run() method with the code we want our thread to run.

Here you have a simple example of it. The main program will start a thread that after some time will print a message. Main program itself does not much more than printing another message, but it could be doing any other more fancy task meanwhile.

Sunday, November 3, 2013

Lab#4: Iterative TCP servers

These are servers that can handle one client at a time. If a second client arrives in the server, it will have to wait till the first client is served. Iterative servers are easy to implement and good enough for these uses where the client serving time is small and/or where response time is not important.

Lab is here.

Please read section 3.4 from the book before next lecture.

A quick test about Chapter 2 will be performed after the break.