Assignment 3 Submission Log

Some of you are anxious if we have received your Assignment 3 submission or not, especially those who slipped the answer sheet under my door.

This is good, because this means you understand well how reliable protocol works, and you are waiting for an ACK from the receiver! You are also worried that Trudy might have intercepted your submission.

Instead of sending back an ACK to individual students, I will broadcast the ACK periodically. So here is the Google Doc that lists the hardcopy answer sheets to Assignment 3 that we have received. The list will be updated a few more times until the deadline.

List of Assigment 3 Received (Hardcopy Submission Only)

Assignment 3: Update on Submission Instructions

Since the deadline falls on a public holiday, we have decided to allow softcopy submission in addition to hardcopy.

If you decide to submit a hardcopy, you can still pass them to either Wei Tsang or Saeid as per instructions.

If you wish to submit a softcopy, please read and following the instructions below carefully.

  1. A PDF answer form has been made available.
  2. Use any decent PDF viewer/editor to fill up the form with your answers. Remember to save the form after you fill it up with your answers.
  3. Rename the form a3-A1234567X.pdf, replacing A1234567X with your matriculation number.
  4. Submit the form into IVLE workbin here, before the deadline.

WARNING:

  1. Please do not submit any other forms of softcopy (e.g., something scanned from a scanner, an image of the answer sheet taken with your phone, a text file edited with vim, etc.) Only the filled up version of the PDF form above is acceptable.
  2. Please do not email us the softcopy. Do not submit a floppy disk containing the softcopy either!
  3. Please name the PDF file according to the convention a3-<matric number>.pdf. Do NOT name it as a3-<nusnet ID>.pdf. (Your matriculation number ends with an alphabet).

There is a 1-point penalty for each violation of instruction above.

Assignment 2 Solution

I have finished grading Assignment 2.

There are couple of common mistakes that worth highlighting here:

  1. If you receive a corrupted packet, you should not look at the content of the packet, since you cannot tell which bit is corrupted! Many of you still assume that p.seq is valid even when p.isCorrupted is true. For this, I takes off two points.
  2. Another common bug is that you did not make sure that all timers are cancelled when the connection is closed. As a result, the sender goes into infinite loop sending forever (and encountering exceptions forever).
  3. The last packet should be treated as any other packet. This means the sender should still ensure that it is received correctly, by repeated retransmitting until it does. Some of you forgot about this and only ensures that the packets are sent correctly, except the last one!

Assignment 3: Clarification 1

Dear Students,

There were three typos in the pdf file of Assignment 3. We updated the pdf file and uploaded on the blog. Please either re-download the pdf file here or consider the three below points:

1. Question 3 – part (c) – second and third line: the correct URI is daisy.ubuntu.com instead of diasy.ubuntu.com

2.Question 4 – second line: the correct sentence is “Right click on Packet 145 and choose ..” instaed of “Right click on Packet 36 and choose ..”

3. Question 4 – forth line: the correct IP addres is “172.26.191.153″ instead of “172.126.187.16″

Thanks!

Saeid

Assignment 3

Here’s your Assignment 3 on understanding packet traces.

This is an INDIVIDUAL assignment, due 18 April 2014, 6:00pm.

Please write your answers in the answer sheet and submit a hardcopy to Wei Tsang before the deadline.

(Please ignore the Assignment 3 posted in IVLE — we were struggling to get online assignment working in IVLE, resulting in delay releasing the assignment.)

Assignment 1: Comments

The grades for Assignment 1 has been posted in your IVLE gradebook. Please take a look at the comments, and report back to us if there is anything surprising.

Some of the common mistakes are:

  • Returning incorrect HTTP response headers. Some of you return 200 OK, even if the request is incorrect (e.g., requesting for a non-existing file). Some of you return two HTTP status codes, or no HTTP status code, or two lines of content-type. Some of you return content-length with incorrect number of bytes. Despite being the easiest part of the assignment to get right (just following the format!), your submission is surprisingly buggy in this aspect.
  • Strong assumption about HTTP request headers. The HTTP request header format does not dictate the order of the fields, except that the first line must be the request line (with method, resource, and version). You cannot assume content-type and content-length appears in a certain order, nor can you assume that the last line in the header is of certain fields.
  • For a POST request, you should not assume that the body contains “——WebKitFormBoundary”. In fact, you need not know about the format of the POST body at all, as indicated in the assignment description.
  • Some of you did not follow the instructions, which require that you take in the port number as a command line argument. Those who hardcoded the port number loose one point needlessly for not following instructions.

Assignment 2: Test Your Code

I hope everyone is having fun writing your own reliable file transfer program in Assignment 2.

I am releasing the code we will use to test your program. You can use it to check if your code will survive our test cases.

To run the test, execute

~sadm/a2/check.sh <port>

on cs2105-z.comp.nus.edu.sg (replace <port> with your favourite port number).

Note that, passing the test cases just means that your code behaves correctly when tested, it does not mean that your code is correct.

The test script is experimental, so please report if it fails to run.

Assignment 2

Here’s your Assignment 2 on simulating alternating-bit protocol. This is a simple assignment (the solution is only ~40 lines of code) to be completed and submitted INDIVIDUALLY before 30 March, 2014, 11:59PM. Despite the simplicity, please start early!

Assignment 1 Q&A Schedule

This post will be updated at least once daily.

Wednesday, 5 March, 2014

The following takes place in MR6, AS6 #05-10

1100 OON ZI GUI, TAN MEI LING
1105 SUN HANG, GAO RISHENG
1110 WANG ZHE, KOH JUN XIANG
1115 DAO THAI DUY, HO TUAN DUONG
1120 NURWIDYA UTAMI JATI, LEWIS HARIS NATA
1130 LIM HONG HUI EUGENE, CAO YUBO
1135 TRAN THAI TRI TAN, NGUYEN VAN THE
1140 YANG HUIYU, YUEN SHU HUI
1145 LAI YIT HANN, TAN WEI YOUNG
1150 NGOC THANH, LIU PEIYU

The following takes place in Wei Tsang’s office, AS6 #05-14.

1040 SITI NORFAEQAH BINTE POWZAN, GANGADEVI D/O BALAKRISHNAN
1045 HUANG QINGHUI NICOLAS, CHENG WEN ZHAO
1050 SHIWANI AGARWAL, ASHISH TAYAL
1100 CHUA RUI JUN, LOW KIT YEE

1600 HUANG YUE, ZHOU WEI
1605 TAMANA ANNA THARAKAN, IPSITA MOHAPATRA
1610 JOANNE MAH JIA WEN, FAN YUXIN
1615 LIN BAOYU, LIM WEI KE
1620 CHIA WEI MENG ALEXANDER
1630 CHNG YUAN ZHANG MAURICE, GAN JIA HUI
1635 STEFANI LETICIA, LEE HUI SHAN
1640 TAN JUN KAI, QUEK JUN JIE
1645 XIE CHENHONG, SU HAN
1650 A YUSUF SHAMIR, ATUL NANDAKUMAR

1700 FLORENCE WAI TZE YUN, CHUA YI JING
1705 CHIAM ZHIJIE JONATHAN, IAN LEOW TZE WEI
1710 WANG YI, CHEN TONGTONG

The following takes place in DR5, AS6 #02-08.

1645 CHRISTOPHER MARSHALL LAIRD, AI YUE GUO
1650 ADINDA AYU SAVITRI, ONG CHEE CHIN

1700 CHU BING HAN BRYAN, SAN WENYIN
1705 KHAN SAIM SAEED, SENGUPTA DEBOPAM
1710 HE LINGFEI, XIA LU
1715 GUNESS VARSHA, MICHELLE SINN SHWE YE OO
1720 CHANG YAN QIAN, LIM YU DE
1730 SEAH SHAO CHENG, JACOB TAN JIA WEN
1735 LI HO YEUNG, KIN FUNG ANTONY TSE
1740 SONG YI, LI YUANDA
1745 WANG WENZHU, WANG GAOYING

1800 JOEY HOK WAI YI, JAYARAMAN ARCHANA
1805 YE SHUJIAN, LU XI
1810 ZHANG MENGDI, YEO JEONG HOUN

Continue reading

Assignment 1 Q&A

Please book your slots for Q&A here.

Here are the rules:

  1. Each team will indicate the one-hour slots where both team members are available, from which we will allocate 5 minutes for each team.
  2. We will need to stick to the clock exactly, so you must come on time and end on time.
  3. We will randomly ask each student to explain a random part of the code.  Your answer will constitute 2 marks of your individual Assignment 1′s grade.
  4. If you missed your slot or is late, there will be no rescheduling and no extra time.
  5. Both team members must show up on the same time slot.
  6. At the doodle site, in the column that says “Your Name”, please enter the matriculation numbers of both team members.
  7. You will receive an email confirming your slots. Further schedule will be updated in another blog post.
  8. The last slot will be 6pm, 5 March, 2014. After this time, no further booking online possible.

Assignment 1: Clarifications II

A few clarifications/tips related to Assignment 1.

  • You can assume that the browsers generate properly formatted HTTP requests. You only need to handle user errors, such as, when users enter a URL pointing to a non-existing file.
  • Beware of Runtime.exec(String[] cmdarray, String[] envp). If the standard environmental variables, such as HOME is missing from the parameter envp, the perl script will not run properly. The script expects that HOME to be set to the user’s home directory. The symptoms of this bug is that todo.pl tries to create a folder /a1/data, which it does not have permission to.
  • Beware of readline(). It returns only after it encounters a new line character. Note that neither HTTP request or response BODY guarantees that it ends with a new line character. If you use readline(), you may have to wait forever for it to return.
  • If you are ssh-ing into cs2105-z from Windows ssh client, you may have key mapping issues when you use vim. You can copy my .vimrc from ~ooiwt/.vimrc on cs2105-z, which maps the keys properly, to resolve this issue.

Assignment 1: Clarifications

We received several FAQs about Assignment 1 last week. Please take note of them.

1. Can we use existing libraries that handle HTTP / CGI for this assignment?

NO. The purpose of this assignment is for you to learn about how HTTP and CGI work together, and demonstrate that to us by solving the assignment. If you use existing libraries or wrapper class (such as HttpURLConnection) you will not learn (and showed us that you know how) the internals of how HTTP/CGI works.

2. We want to implement delete/edit first, before we implement add. How can we manually create TODO entries for testing?

I have edited the file “TODO” and the files under the “data” directory so that they have three items in the list. You can copy them over to your own a1 directory.

cp ~sadm/a1/TODO $HOME/a1
cp -r ~sadm/a1/data $HOME/a1

3. Where can we find WebServer.java? How to run WebServer.java?

Somehow many of you missed this blog post. The code from Lecture 3 is posted there. As to how to run (or compile), please refer to . If you not as comfortable with command line as you should, you are free to use your favorite IDE (Eclipse, NetBeans, etc) to compile and run the server.

Assignment 1

Here is your first assignment. You may download the PDF version of Assignment 1 here. You have three weeks to complete this assignment in a team of two. The assignment is due on 21 February 2014. Some word of advice:

  1. Start early. Plan your time properly.
  2. Write your own code. Do not copy from your class mates.
  3. Read the description carefully. It is long, but is full of useful information. The assignment is rather straight forward once you understand what to do.
  4. Read the instructions carefully and follow them exactly.
  5. Ask for help from teaching staff if you have questions.

Assignment 0

Assignment 0 is an ungraded programming exercise for warming up towards your Assignments 1 and 2. You may download the PDF version of Assignment 0 here. The exercise is intentionally not well defined. It is meant to introduce you to some Java classes that you will be using in CS2105. So, play around with the classes, code as much as you like, go crazy, and have fun!