Sunday, December 22, 2013

Four secret messages for the holidays

Besides wishing you happy holidays, I want to give you some examples of encrypted messages.
Each decrypted message is a homework well done. So feel free to submit your responses to get extra credit.









1) SSB3aXNoIHlvdSBoYXBweSBob2xpZGF5cyBmb3IgeW91IGFuZCB5b3VyIGxvdmVk
IG9uZXMuCg==
2) Zkij te dej unfusj jee cksx veh renydw tqo. (spaces and symbols are preserved, substitution was used here).
3) Dye edaoiteeduexttsin u?  rperpt bs iovec nsoo d (transposition was used here).
Please note there may be two blank spaces, so let's print it again using monospaced charset:
Dye edaoiteeduexttsin u?  rperpt bs iovec nsoo d
................................................ 
4) psdo do qcvpsti tlqxbzt vy xvcvqzbsqwtpde ohwopdphpdvc whp psdo pdxt dp do cvp q eqtoqi edbsti (again this is just monoalphabetic substitution)

Please note this homework is no longer offered nor it will be marked any more.

Friday, December 20, 2013

Just two days before we explained RSA ...

It has been described a new type of attack to RSA that might recover private key when it is being used for decrypting a message based on the noises (sound) the computer does. Not pulling your leg, really.

Tuesday, December 17, 2013

Subject's projects

Today some more projects were presented but some more are pending.

Next Friday we will finish those that are still pending will be presented in the classroom.

I could see excellent work in the lab and it will be a pity that your effort were to be wasted, so I will setup a site that will host all your projects. For that I will need you to send me an email containing the full source code of the project as source.zip, the names of the students involved in the project, a short explanation of your project (max 6 lines) and a title.

Please note that your classroom mates' work is an invaluable learning tool if you liked what you saw in anybody else  project.


Thursday, December 12, 2013

Last chapter of 1st term

Our Chapter 5 is about Network Security. You can read sections 1.6, 8.1 and 8.2.1 of the textbook. Please remember our course chapters not necessarily match the book's numbering scheme.

Some basic concepts about security like privacy, authentication and message integrity will be laid out and some concepts about secret key ciphers will be presented too.

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.

Friday, October 25, 2013

Lab#3 and other stuff

Reading from the book sections 3.1, 3.2 & 3.3 is recommended for next lecture.

Third lab sketch is available for download.

From now on, we have a series of labs that will require you to create small programs in Java. You may use your favorite editor (if installed) and command line or you can use BlueJ if you prefer.

Friday, October 18, 2013

Thursday, October 17, 2013

Reminder

Next Friday Oct 18th a short test of Chapter 1 questions will be held in the classroom. Those arriving late will have no extra time, so be on time or be quick.

Next lecture reading is section 2.4 about electronic mail.

Tuesday, October 15, 2013

What should I have learned from Lab#1?

I am not sure all of you got it it right, but the expected outcomes for this lab were:

  1. To understand the usage of netcat command for creating TCP connections both as a client or as a server (-l) and how it can be used for accesing a certain server from the command line.
  2. To capture network traffic using Wireshark and how to interpret HTTP traffic.
  3. To understand the function of "conditional GET" in HTTP.
  4. To see the traffic caused by HTTP persistent connections.
Please remember that labs are just 90 minutes long and that requires you to have read the lab exercises in advance.

I realized that some of you had not much familiarity with Wireshark program, though you were asked to do a lab#0 just about that. Try to review what capture filters are, what visualization filters are and what Follow TCP stream is for. These are basic concepts that will make your life easier when working with Wireshark software.

Monday, October 7, 2013

Moved class and test

I am scheduling both activities for next Monday morning, October 14th, from 10:00 to 12:00. Besides the lecture, a short written test about Chapter 1 will take place too.

We will have written tests of all chapters during the course. Not to be confused with the written exams that we will have at the end of each term. These classroom tests are mostly for you to know your level of understanding of chapter's contents. A small fraction of them will contribute to the 20% of your mark that measures your classroom performance.

Please note this same week signals the beginning of Lab sessions. There is an exercise for you to do at home to get familiar with some of the tools we will later use in the lab. The main purpose is for you to learn how to use Wireshark software, for which you have plenty of information here. And you may want to start by watching this video.

Lab#1 is already available here.

I wanted to remind you that we use a blog format so you can be a part of it too. That is why anyone can post a comment to any entry. Of course I receive an email every time a comment is made so I have a chance to provide an answer right away, or make note so I can address that in the next lecture. Sending me an email works too, but it deprives others of your comment or question and that may not be as efficient (i.e. repeated question) as a shared question posted as a comment.

Notice A change of hour has been requested by some students. Class will then be held same Monday 14th from 17-19h. In order to make it possible for you all not to miss the test, test has been rescheduled to the next class on Friday, October 18th.

Friday, October 4, 2013

File Transfer Protocol

It is an old protocol designed to provide a way for sending a file from a client to a server and backwards. It allows clients to download files without proper authentication, but it is not a very secure protocol (to say the least).  You can read about it in Section 2.3 and it will be covered in one Lab too.

You can have a look to RFC1945 and RFC2616 though I do not expect you to actually read it. A quick look may be not so hard for you to get familiar with how protocols are detailed.

October 11th class is moved to a yet to be defined date as I will be out of town. Please let me know what date may suit you better to recover that class as soon as possible.

Remember you can check on-line both attendance and marks. Let me know any mistake that could have been made.

Homework

  1. Please research by yourself what persistent connections are (in the context of HTTP protocol)? 
  2. What are persistent connections for?
  3. Show with an example how persistent connections may improve HTTP client-server interaction.

Saturday, September 28, 2013

HTTP and the web

Next class reading is section 2.2 of the book.

The inner workings of the World Wide Web service will be presented.


Homework

Two end-systems (A& B) communicate through a packet switching network. There are two routers (R1 & R2) between the two end-systems. All links are 1Mbps. Host A sends 1 MByte of data to B using 520 bits packets. Each packet has a header of 20 bits.
  1. How long does it take since transmission starts in Host A till the last bit has been received by Host B? (Consider propagation delay, processing and queueing delays negligible).
  2. What is the end-to-end throughput?
  3. Repeat questions 1&2 if propagation delay is 1 millisecond on each link.

Thursday, September 26, 2013

Sample use of traceroute -T

With the required privileges, the traceroute command may give us some of the information that was missing before: http://pastebin.com/hU2siqwZ

You can find this tool useful too.

Friday, September 20, 2013

More work to do

Next week lecture will be based on Section 2.1 of the textbook. Let me know if I should focus on a particular concept you've found difficult to understand.

Please bring the following problems solved for the next class in written form:

1)Suppose users share a 2 Mbps link. Also suppose each user transmits continuosly at 1 Mbps when transmitting, but each user transmits only 20 percent of the time. (See the discussion of statistical multiplexing in Section 1.3.)
a. When circuit switching is used, how many users can be supported?
b. For the remainder of this problem, suppose packet switching is used. Why will there be essentially no queuing delay before the link if two or fewer users transmit at the same time? Why will there be a queuing delay if three users transmit at the same time?
c. Find the probability that a given user is transmitting.
d. Suppose now there are three users. Find the probability that at any given time, all three users are transmitting simultaneously. Find the fraction of time during which the queue grows.

2)Suppose Host A wants to send a large file to Host B. The path from Host A to
Host B has three links, of rates R1 = 500 kbps, R2 = 2 Mbps, and R3 = 1 Mbps.
a. Assuming no other traffic in the network, what is the throughput for the file transfer.
b. Suppose the file is 4 million bytes. Dividing the file size by the throughput, roughly how long will it take to transfer the file to Host B?
c. Repeat (a) and (b), but now with R2 reduced to 100 kbps.

Friday, September 13, 2013

Reading and homework

For the next class please read sections 1.3, 1.4 & 1.5. You may also enjoy reading 1.6 & 1.7 but these won't be covered in the subject.

As I mentioned in the classroom, please let me know those topics we want me to elaborate a bit futher in next Friday's lecture, where we will focus on the core network: what's inside the "cloud" of my drawing and how it works.

I failed to mention in the classroom, but I would like you to respond to the following questions in written form. Please hand it over tom me in the next class:
  1. What is the difference between a host and an end system? List the types of end systems. Is a Web server an end system?
  2. What is a client program? What is a server program? Does a server program request and receive services from a client program?
  3. Dial-up modems, HFC, DSL and FTTH are all used for residential access. For each of these access technologies, provide a range of transmission rates and comment on whether the transmission rate is shared or dedicated.
Don't forget to write down your name too. Feel free to use the Internet to answer any of these questions but try to provide your own answer instead of just pasting someone else's. 

Friday, September 6, 2013

Welcome to Computer Networks 101 (2013-14)

One more year I welcome new students (and maybe some not so new ones) to this subject that as you know will be entirely taught in English. Not only the language will be different but so will be the on-line platform, as the only thing you'll find from me in PoliformaT is a link to this blog.

Contrary to PoliformaT, this blog is open, so you can read it even if you are not a student or you are not enrolled in this subject. Not that I think this will bring in many students to the subject but I do not see the point of being closed and I do not particularly enjoy typing my password away, plus my students doing the same everytime they want to access any information about the subject. It makes me think of the many hours of our lives we will be typing passwords.

This is not an easy subject, so at least I will try to keep the access to the subject's information as easy as possible. By the way the blog's name matches the subject code, in case you wondered.

In the first class next Friday 13th I will present the subject and I will give the first lecture about the Internet. If you can read Sections 1.1.1, 1.1.2 and 1.1.3 of the textbook you will have a better understanding of the topics. You can read it from the free sample chapter provided by the publisher or borrowing the book from the library.

Thursday, June 27, 2013

Farewell

Final marks have been emailed to each one of you.
In case you find an error, please let me know ASAP
so we can fix it the easy way.

While I guess I will see you around, I wish to say good-bye to all of you and to wish you a joyful summer vacation, but if you have to work during summer maybe you should consider yourself lucky too.

Best wishes for you all and remember that my door is open even if you are no longer one of my students.


Monday, May 20, 2013

Double reminder

This Wednesday there will not be a lab session. The Lab exam will be held next Wednesday, May 29th, in the lab at the usual time (8:00am).

On the other hand, this Friday we will have a quick test in the classroom at 9:00am about Chapter 7 (Link Layer) content.


Thursday, May 16, 2013

Tuesday, May 7, 2013

Eighth and last lab

This is the last lab for this term. We will use Windows and OPNET simulation software for modeling a network and its traffic.

Please note that next lab session will be open for you to redo any second-term lab you might have missed, and in the other next lab we conduct the lab exam.

Oops, I have forgot telling you: requested exercise is not required four our group.

Tuesday, April 30, 2013

Third exam is marked

The general feeling of the last exam is that you guys did an effort and it shows. I am glad that the average is such good marks, that means most of the topics of the chapter are well understood. I am particularly impressed by Christian and Isabel performance, good job.

You can get the marks from the usual place.

The marked exams are here, so you can look for any mistakes I might have made during the grading process. If you find a mistake, send me an email and I will look into it.


Monday, April 22, 2013

Seventh lab

It is available here. And it covers IPtables command that allows you to control what packets your system listens to or ignores. It is just a very basic introduction that will enable you to create basic traffic-filtering rules.

Friday, April 19, 2013

Exam reminder

Please note next April 29th we will have a new exam, covering exclusively Chapter 6, that is, the Network Layer.

Monday, April 15, 2013

Chapter 6 test results

You can get the solved quiz here.

I have found the results a bit unfair. It seems that no one understood how fragmentation works, maybe the lab about it was not enough. So let me explain it once more:

Datragrams are fragmented so resulting fragments have a total length (header + payload) lower than the MTU of the network they are forwarded to. However, as fragmentation offset values represent blocks of eight bytes, fragmentation may only happen on certain points of the payload (those that happen to be multiples of eight).  Thus, the resulting fragment it is made of a header (typically 20 bytes for IPv4) plus the data payload (whose length is a multiple of eight). This number, the total fragment length, has to be equal or lower than the MTU.

So all the fragments (but the last) for a network of MTU=512 have to be 508 bytes long (or smaller). Though 512 is a valid size, a fragment whose length is a multiple of eight cannot be 492 bytes long, as 492 (which is 512-20) is not a multiple of eight. Therefore, the maximum fragment length would be 488 bytes (which is the closest but lower multiple of eight to 492). If data size is 488 then the total fragment size (once header is included) would be 488 + 20 = 508 bytes.

Please note that the marks, which are available in the usual place, have an average mark of 25%, an all time low. Considering we have an exam in a couple of weeks about these topics, you all know that there is a lot to improve if you want to pass that exam.

Sixth lab

This lab is about ARP (aka Address Resolution Protocol). This happens every time your computer wants to send a a datagram to another destination in the same subnet (direct dialog). Remember that those destinations outside your subnet can be reached through the proper router (what we call indirect dialog).

Tuesday, April 9, 2013

Fifth lab

It is available. And it is about ICMP protocol. No need to bring the exercise to the lab though.

Tuesday, April 2, 2013

Keeping you busy during the holidays

There is one solved exam in the repository. You should attempt to solve the exercises without looking at the answers.

Just in case the temptation is too strong, these are other exercises for which answers are not provided.

Exercises you solve at home, can be turned in when we are back to classes. Please note this is not a mandatory homework.

Monday, March 25, 2013

Fourth lab

Before Easter holidays we will have on Wednesday this fourth lab. The file includes some canned Wireshark captures together with the lab text. This lab is about Network Address and Port Translation (NAT).

Tuesday, March 19, 2013

Third lab

Just back from Fallas and they keep us working in this third lab. Please note the linked file is a ZIP file that contains a couple of canned Wireshark captures plus the lab text in PDF format.

Monday, March 11, 2013

Second lab this week

This new lab is about IP fragmentation and includes an exercise for you to do at home and to bring it to the lab.

Tuesday, February 19, 2013

Some homework for next class

A given computer has the IP address 10.10.9.10/23. Please answer the following questions:
  1. What is the network address? 
  2. Provide an expression to obtain it.
  3. What is the broadcast address?
  4. Provide an expression to obtain it.
  5. Does the address 10.10.8.27 belongs to the same network? And 10.10.10.27?
  6. What are the subnets obtained when you split the network from question 1 into two equal-size subnets? Please indicate the maximum number of hosts each one of them may have.
Have a look at Network Address Translation (in  4.4) and sections 4.4.3, 4.4.4 and 4.4.5. See you on Friday.

Thursday, February 7, 2013

Friday's class

We continue with Network Layer, we will cover sections 4.4.1 & 4.4.2 of Kurose's book after finishing some details about call setup in virtual circuit networks.

Monday, February 4, 2013

... and we are back.

I've uploaded the slides of book's chapters 4 & 5. According to our plan, we start now with the Network Layer to continue with Link Layer next.

For these week's classes you can have a look at sections 4.1 & 4.2. We will complely skip section 4.3.

Please remember we will have lectures this week on Wednesday and Friday at 9:00am both days.

Wednesday, January 30, 2013

1st term is over, marks are out!

I've marked yesterday's exam and you can check (only for a limitted time) the scanned marked exams.

Marks are in the usual place, those with a red number in the mark have failed the semester. Please note this is just for internal consumption as the only official mark will be the one obtained at the end of the 2nd term.

If you think a mistake has been made in your exam's grading, please email me with the details and I'll have a look a it.

Please note that the average of all the assessment during the first term is a pass mark, which means those who failed will have a difficult time blaming the subject.

Tuesday, January 29, 2013

Back to classes

Though next Friday February 1st starts the second term, by popular request we are moving this class to next week's Wednesday February 6th, same classroom as usual at 9:00am. I have been told this will cause no collision with any other teaching teaching activity.

The online poll for this change got 12 votes for changing the class, 5 votes didn't care, and no votes against. Though I've learned today that not all the students have a facebook acount, I still think the result is pretty conclusive.

See you Wednesday. BTW, first exams corrected show a very good average.

Monday, January 21, 2013

Exam reminder

Next week's Tuesday, January 29, 2013, the second exam of the 1st term will be held at building 1G classroom 1.5.

Start time is 10:00am and the exam duration is one and a half hours. Topics will be from Chapters 3, 4 & 5. Remember Chapter 3 was covered in the lab (Socket Network Programming), while Chapters 4 & 5 are based on (Chapters 3 & 8 from Kurose's book).

Regarding Computer Security you may find interesting this video resource.

Saturday, January 12, 2013

Solved homework


  1. Host A connects to host B using TCP to perform an HTTP request. Host B closes the connection once it has provided a response. Request size is 500 bytes and response size is 3000 bytes. The initial sequence number on A is 1000 and the initial sequence number on B is 5000. MSS for both hosts is 1460 bytes. Please detail the sequence of TCP segments exchanged from the beginning till the end of the connection (for each segment list: sender, sequence number, acknowledgement sequence number, active flags and number of data bytes) under the following conditions:
  1. No flow control, no congestion control. Regular acknowledgements.
No flow control means you are free to assume that receiver is always happy to receive new data, so it is ok to assume recv_window >= 1 MSS anytime.
No congestion control means that your sending is not restricted by any value of the congestion windows, that you can assume anytime cong_win == infinite.
Initial sequence numbers are increased by one due to the SYN segment exchange at the beginning, so first data byte from A will be 1001 (and 5001 from B).
Request from A can be sent in a single segment with sequence number 1001 (containing 500 data bytes) that will be acknowledged with number 1501.  Response from B has to be splitted into three segments of sizes 1460, 1460 and 80 data bytes each.
But the three segments can be transmitted without waiting for any delay (remember, no flow or congestion control). Each one of these segments will carry value 1501 for the acknowledgement number.

Connection will be closed by B, so this is started by sending a FIN segment, with sequence number
  1. Same as before but using delayed acknowledgements.
  2. Same as (2) but using congestion control. What is the congestion window size on each end when FIN is received?
  1. Write a simple UDP echo server. (No need to create a class or method, just the main server loop).
DatagramSocket ds = new DatagramSocket(7777);
//Port of the server is not mentioned, so we use the one we want
Datagram packet dp = new DatagramPacket(new byte[1024],1024);
// these lines above are not needed in a valid answer.
while(true) {
        ds.receive(dp);        // received datagram packet over socket
        ds.send(dp);                // send it back to the source
}
  1. During a TCP connection, one end receives a segment with recv_window = 0. What does it mean? What does this end do if there is application data to be transmitted?
Broadly speaking it means that we no longer can transmit more data (flow-control in action) until a new received segment reports a larger-than-zero value. Retransmissions are possible though.

However, if you look at the RFC 793, page 41:  The sending TCP must be prepared to accept from the user and send at  least one octet of new data even if the send window is zero. The sending TCP must regularly retransmit to the receiving TCP even when the window is zero. Two minutes is recommended for the retransmission interval when the window is zero. This retransmission is essential to guarantee that when either TCP has a zero window the re-opening of the  window will be reliably reported to the other.
Therefore, if more application data is pending, this sender will wait till it can be transmitted (but it will send 1 byte segments every now and then). No error condition is signal to the application (as this condition is perfectly normal).
  1. Assuming all TCP segments transmitted are acknowledged right away, what is the value of the congestion window after sending 35 segments after a Timeout if Threshold = 3

Friday, January 11, 2013

Solved test

You can check your class project presentation mark in this page. (Link has been updated, it was wrong before).

And you can have a look at the solved test below:


Saturday, January 5, 2013

RSA explained

First of all I want to wish you a happy new year.

We will be covering public key encryption in the next class, but time might be a bit tight, so you may want to have a look at these lessons.

Please remember that next Tuesday January 8 is the last chance to present your Java project and that on Friday January 11 a quick test will be held too.