Recent Updates RSS Toggle Comment Threads | Keyboard Shortcuts

  • NQH 4:58 pm on October 25, 2009 Permalink | Reply  

    Midterm solution + Project 1 Stats 

    • Midterm solution is posted (under “assignments” section of the course’ webpage)
    • Statistics for Project 1: (email one of the TAs for grade)
      • CSE 489:min = 20, max = 100, average = 79.25, median = 85

      • CSE 589: min = 20, max = 100, average = 70.79, median = 80
     
  • NQH 8:47 pm on October 21, 2009 Permalink | Reply
    Tags:   

    Some statistics for HW1 

    • CSE 489: min = 21, max = 50, average = 38.1, median = 39
    • CSE 589: min = 29.6, max = 54, average = 45.6, median = 46
    • The maximum possible score is 60. (10 points per problem.)
     
  • NQH 5:14 am on October 20, 2009 Permalink | Reply  

    Solution to assignment 2 posted 

    There might be some errors in there. Please check and post questions ASAP before the midterm. Questions should be on the comment part of this post.

     
    • Zach 2:52 pm on October 20, 2009 Permalink

      I’m sure this is trivial but I thought I would bring it up. When I calculated 622Mpbs (and other transfer rates) I did not use 622 *10^6 but rather, 622 Mbps = 652 214 272 bits per second (used google calculator). I explained that in my solutions. Will this be worth full credit or should I just use 622 * 10^6 for convenience?

    • Hung Q. Ngo 3:23 pm on October 20, 2009 Permalink

      Well, I guess it’s ok to think of 1M as 2^{20}. You will get full credit for using that. However, remember (for later assignments) that we applied the convention stated in the beginning of the assignment description (1K = 1000, 1M = 1000000, etc.)

    • vallisha 4:08 pm on October 20, 2009 Permalink

      This is what I have done for Problem 4:
      4000 •8/ (622 •10^6) = 5.1446945337620578778135048231511e-5.
      0.1 + 4000 •8/ (622 •10^6) = 0.10005144694533762057877813504823.
      Hence,
      (0.9 * 0.10005144694533762057877813504823)/ (5.1446945337620578778135048231511e-5)
      = 1750.275
      So the answer I have got is > 1750 rather than >= 1801 , as I have not rounded off the decimal places.
      will this be worth full credit?

    • Pradeep 10:25 pm on October 20, 2009 Permalink

      Respected Professor

      I have a doubt in the way the calculation of extra parity bits needs to be done.since parity is to be added on all the three dimensions, assuming x, y and z were the dimensions of the initial matrix, then after adding parity we get (x+1)(y+1)(z+1) matrix. So I thought overhead must be (x+1)(y+1)(z+1) – xyz. This gives 331 bytes as overhead.
      Can you please clarify how to calculate parity bits?

    • Hung Q. Ngo 10:54 pm on October 20, 2009 Permalink

      Pradeep, thank you! It was my mistake. I have updated the solution.

      Vallisha, as long as your computation method is correct, off-by-small-amount errors are OK.

    • sp 5:02 pm on October 21, 2009 Permalink

      What is the point breakdown for the each assignment? My graded assignment 1 just has numbers next to each question.

    • pradeep 7:06 pm on October 21, 2009 Permalink

      I have a doubt on problem 5, is it alright if we perform minima on overhead instead of the fraction overhead/ Total number of bits. I have done differentiation on just overhead (r + 1000/r +1) , this gives an r value equal to 31.6. will I get some credit?

  • NQH 11:54 am on October 18, 2009 Permalink | Reply
    Tags: Midterm   

    Sample midterm exam posted 

    You can find it here. I will not post the solution.

     
    • vallisha 6:11 pm on October 18, 2009 Permalink

      The sample exam paper is not accessible as its hyperlink is missing.

    • Hung Q. Ngo 6:27 pm on October 18, 2009 Permalink

      Try reloading; your browser displayed a cached version

    • vallisha 8:33 pm on October 18, 2009 Permalink

      that resolved the problem. Thanks!

  • NQH 8:49 pm on October 16, 2009 Permalink | Reply  

    Programming Project 2 Posted 

    • The source code for my implementation of Project 1 is posted. Please at least take a glance. If you didn’t finish Project 1 properly, there are probably quite a few things you can learn from it.
    • Project 2 is out. Due on Dec 11. You have to start early. All questions about the description should be posted as comments to this post.
     
    • Sirak 8:21 am on October 28, 2009 Permalink

      For the tracker files, I tried make and it reported an error “/usr/bin/ld: cannot find -lz
      collect2: ld returned 1 exit status
      make: *** [opentracker] Error 1 ”
      I have ubuntu, and I think gmake is the same as make on ubuntu. Had to make soft link between gmake and make, b/c it wasn’t recognizing gmake. After that gmake was returning the same error as make. Is there a different variation of gmake for ubuntu, or what should I do about this?

      Thank you

    • Hung Q. Ngo 9:41 am on October 28, 2009 Permalink

      Sirak, the problem isn’t make/gmake. It looks like you don’t have zlib installed. Try to install this package http://packages.ubuntu.com/en/source/dapper/zlib. (I don’t use Ubuntu, But i’m sure you can use a package manager to find and install zlib instead of downloading directly from the given link.)

    • sirak 10:44 am on October 28, 2009 Permalink

      That worked. Thank you!

  • NQH 10:40 am on October 12, 2009 Permalink | Reply
    Tags:   

    A simple model for TCP congestion control 

    Network congestion is unavoidable under the “best-effort” paradigm. There are several ways to deal with congestion. TCP chooses to dynamically adjust the sending rate. When there’s congestion, reduce the rate; otherwise increase the rate. We want the total load on any link (total data rate sent by all users using that link) to be oscillating around a knee point. When the load increases pass the knee, congestion becomes exponentially worse. “Users” are the TCP connections whose paths go through the link.

    Knee and Cliff

    As a simple model, we can view the problem this way: the “network” is either congested or not, the “users” can detect congestion either by automatic inference or by explicit feedback from the “network”. The key questions are: (1) how fast should the rate increase be when the network is not congested, (2) how fast should the rate decrease be when the network is congested, and (3) what exactly is (are) the main optimization objective(s)?

    We can answer these questions roughly with a simple control model. Say there are n users. At time t user i sends data with rate x_i(t). The network gives a feedback (implicit or explicit) y(t) which is 0 if there’s no congestion and 1 if there’s congestion. The users are supposed to adjust their sending rate x_i(t+1) accordingly.

    Picture4

    Thus, we want to find a function f which helps the rate adjustment:

    x_i(t+1) = f(x_i(t), y(t))

    What properties should this rate adjustment function satisfy? There are four main criteria:

    • Efficiency: let X_{goal} be the target total rate, and X(t) := \sum_ix_i(t). Then network is congested at time t if X(t) > X_{goal}, in which case the feedback is y(t)=1; otherwise, y(t)=0. We want to increase the total load toward the goal when y(t)=0 and decrease the total load when y(t)=1. Thus, it should hold that
      y(t)=0 \Rightarrow X(t+1)>X(t), and
      y(t)=1 \Rightarrow X(t+1)<X(t).
    • Distributedness: the adjustment for one user cannot be dependent on the rates of other users or the total number of users. There’s no way, in a realistic scenario, for a user to know precisely the sending rates of other users and the total number of users in the network.
    • Fairness: there are many ways to define this tricky notion. We will take the most obvious one: the rates should be roughly equal. The fairness level F(t) at time t is defined to be:
      F(t) = \frac{\left(\sum_i x_i(t)\right)^2}{n\left(\sum_ix_i^2(t)\right)}.
      This function has several nice properties: (a) 0 \leq F(t) \leq 1, (b) F(t)=1/n \to 0 if one user takes all the channel capacity, (c) F(t) = 1 if the rate allocation is totally fair.
    • Convergence: we want our adjustment protocol to “converge” nicely to good efficiency and fairness.

    There are infinitely many functions f to choose from. The first thing to try is always a linear function of some kind. Let’s consider the family of functions f defined as follows:

    y(t)=0 \Longrightarrow x_i(t+1) = a_I + b_Ix(t) (the subscript ‘I’ stands for ‘increase‘)

    y(t)=1 \Longrightarrow x_i(t+1) = a_D + b_Dx(t) (the subscript ‘D’ stands for ‘decrease’)

    As long as the coefficients a_I, b_I, a_D, b_D do not depend on n and the sending rates, the distributedness property is satisfied. Consider the efficiency property, which requires that

    (1) na_I + (b_I-1)X(t) > 0, for any n\geq 1 and X(t) \geq 0, and

    (2) na_D + (b_D-1)X(t) < 0, for any n \geq 1 and X(t) > 0. (The only way for the network to be congested is for X(t) > X_{goal} \geq 0.)

    Condition (1) requires that a_I > 0 and b_I \geq 1.

    Condition (2) requires that a_D \leq 0 and b_D \leq 1, and that a_D^2 + (b_D-1)^2>0 (i.e. the equalities cannot hold at the same time).

    What about the convergence to fairness requirement? To simplify notations, let a be either a_I or a_D and b be either b_I or b_D depending on whether y(t)=0 or 1. Also, define c=a/b. Then, we want F(t+1) \geq F(t) and that F(t) eventually increases as t increases.

    F(t+1) = \frac{(nc+X(t))^2}{n\sum_i(c+x_i(t))^2}

    F(t) = \frac{(X(t))^2}{n\sum_ix_i^2(t)}

    For F(t+1) \geq F(t), we will need c\geq 0. Moreover, F(t+1)-F(t) is an increasing function in c. Thus, for good convergence to fairness we will need c to be as large as possible. Thus, we must either have

    \frac{a_I}{b_I} > 0 and \frac{a_D}{b_D} \geq 0or

    \frac{a_I}{b_I} \geq 0 and \frac{a_D}{b_D} > 0.

    Since a_D, b_D must be of the same sign, and a_D\leq 0, b_D \leq 1, and they cannot be both negative (or else we’ll have negative rates). It must hold that a_D = 0 and 0 \leq b_D < 1. Thus, during congestion c=0 (no improvement in fairness). When there’s no congestion, we should try to improve fairness as much as possible. In particular, for c to be large in the no congestion case, we want b_I to be as small as possible, which is 1.

    We have nailed down our function to be:

    y(t) = 0 \Longrightarrow x_i(t+1) = a_I + x_i(t) (the additive increase phase)

    y(t)=1 \Longrightarrow x_i(t+1) = b_Dx_i(t) (the multiplicative decrease phase)

    If we only care about fairness, then obviously a_I should be really large. However, setting a_I to be large will overshoot X_{goal}, resulting in very large smoothness. Finding optimal values of a_I, b_D requires complete knowledge of the system, which is impossible. TCP does that experimentally. It is also easy to see that an increase in responsiveness will result in a decrease in smoothness.

     
  • NQH 5:30 pm on October 10, 2009 Permalink | Reply
    Tags:   

    Project 1’s due date/time 

    is supposed to be 1am Oct 12, i.e. Sunday night.

     
    • Steve 8:29 pm on October 10, 2009 Permalink

      thank you for the clarification

    • Amol Agarwal 9:07 pm on October 11, 2009 Permalink

      I am using send which sends message to all TCP connections.
      is this format correct or there are any other way of sending messager that need to be implemented?

    • Amol Agarwal 9:08 pm on October 11, 2009 Permalink

      sorry format i am using is “send “.

    • Amol Agarwal 9:10 pm on October 11, 2009 Permalink

      format is “send message”.
      sorry again .. i don’t know why it is not displayed correctly in 2 previous posts.

  • NQH 6:49 pm on October 9, 2009 Permalink | Reply
    Tags:   

    How to send a TCP “packet”? 

    There have been a few (very late, I might add) questions about how to send a TCP packet. There are typically 2 ways to do this:

    int32_t a=1;
    int16_t b=2;
    
    writen(sock, &a, 4);
    writen(sock, &b, 2);

    or

    char s[6];
    
    memcpy(s, &a, 4);
    memcpy(s+4, &b, 2);
    writen(sock, s, 6);

    If you write a struct, you might run into memory alignment problems which make your program not inter-operable with mine.

    If you start project 2 this late, you will not be able to complete it. So please, start early!

     
    • vallisha 10:19 pm on October 9, 2009 Permalink

      in the above memcpy example:
      I think the second memcpy statement should have been memcpy(s+4, &b, 2). If this is not the case then there will be a memory overlap and the first 2 bytes will be overwritten. Please do let me know if I have got this right.

    • MJ 10:19 pm on October 9, 2009 Permalink

      thank u very much sir

    • Hung Q. Ngo 12:23 am on October 10, 2009 Permalink

      Thanks Vallisha, I’ve fixed the error.

  • NQH 7:41 pm on October 8, 2009 Permalink | Reply
    Tags:   

    How to submit your programming project 

    Suppose you put all source files in a directory named project1

    • tar -cvf project1.tar project1/*
    • submit_cse489 project1.tar or submit_cse589 project1.tar, depending on which course you’re registered for.

    If your have special compilation instructions, please put them in a README file in the directory project1. If it’s just a simple make, then you do not have to create the README file. It may still be helpful to put the names and IDs of you and your partner in the README though.

    Finally, if you have any “special” explanation on how your program works (or, more bluntly, how and in which way it doesn’t work), please put them in the README file.

     
    • Philip Matuskiewicz 4:54 pm on October 9, 2009 Permalink

      What happens if my partner is in 489 but I’m in 589 (BS/MS)?

    • Hung Q. Ngo 6:52 pm on October 9, 2009 Permalink

      Philip, please submit one copy — using either one of the commands. Put both of your names in the README file.

    • vallisha 7:19 pm on October 9, 2009 Permalink

      I was able to test my project copy on timberlake but I am not able to figure out what I need to do, to execute the project on Sun OS.
      Here is what I did:
      1. connected to Pollux
      2. run gmake in my project folder (I had made the changes to the make file which were posted on the blog earlier).
      3. now if I type in ./PingPong

      it states:

      ./PingPong: invalid argument. (this is not the error message which I am displaying to the user)

      Please do let me know what am I doing wrong here to get this working.

    • vallisha 7:22 pm on October 9, 2009 Permalink

      some problem with adding tags.
      I gave the input as ./PingPong 4000 4001

    • Bob Wagner 12:16 am on October 10, 2009 Permalink

      @vallisha try it without the ./
      So just PingPong 4000 4001

    • Steve 5:20 pm on October 10, 2009 Permalink

      I have a question regarding the actual due date…

      On your site you have it listed as,
      “Due on Monday Oct 11 at 1:00am [i.e. Sunday night!]”
      Monday is the 12th however, so is it due at 1am on the 11th(sunday) or 1am on the 12th(monday)???

    • Hung Q. Ngo 5:29 pm on October 10, 2009 Permalink

      It’s supposed to be 1am on the 12th, i.e. Sunday night

  • NQH 3:22 am on October 5, 2009 Permalink | Reply
    Tags: Homeroks, ,   

    A few announcements 

    • There’s a small update to lecture 10 (one slide added on timer management).
    • Lectures 11 & 12 uploaded.
    • Solution to homework 1 uploaded.
    • Homework 2 uploaded. Due on Monday, Oct 19. This homework probably takes more time than hw1. Please be warned.
    • Grading criteria for programming project 1 uploaded.
     
    • bctello 8:40 pm on October 5, 2009 Permalink

      In your grading rubric you state: “If user wants to send to an invalid connection ID, tell the user so, don’t exit on them.” But in the project definition the send command takes the form: send . We are asked to send to all of the open connections. Should we allow the user to input a CID to send to as well or was this just a typo?

      -Thanks!

    • bctello 8:42 pm on October 5, 2009 Permalink

      Oops, the < tags in my last message got interpreted as XML or something. I meant to say that the send command takes the form: send "string". Sorry

    • jeffkeller27 9:17 pm on October 5, 2009 Permalink

      Should pingpong accept default parameters (like the generic server example) if the two ports are not specified at runtime, or should it just not run and tell the user to specify both arguments?

      Thanks

    • Hung Q. Ngo 5:39 pm on October 6, 2009 Permalink

      @bctello, thanks for pointing out the error. I meant to say that if the user type “send” without a message, don’t quit or crash on her.

      @jeff, it would be nice to have default ports.

    • John 8:19 pm on October 9, 2009 Permalink

      Regarding Homework 2, question 1 – the environment variable on pollux doesn’t seem to be set properly.

      pollux {~} > dig berkley.edu
      dig: Command not found.
      pollux {~} > whereis dig
      dig: /usr/sbin/dig /usr/man/man1m/dig.1m
      pollux {~} > /usr/sbin/dig berkley.edu

      ; <> DiG 9.3.6-P1 <> berkley.edu
      ;; global options: printcmd

    • Hung Q. Ngo 12:26 am on October 10, 2009 Permalink

      Hi John, *your* environment variable on pollux wasn’t set properly. Please add /usr/sbin to your $PATH; or type /usr/sbin/dig directly.

    • Dan 2:36 am on October 15, 2009 Permalink

      I also got:

      pollux {~} > dig berkley.edu
      dig: Command not found.

    • John 2:55 am on October 15, 2009 Permalink

      That is because dig is in /usr/sbin/ on Pollux (/usr/bin/ on most other cse servers), and /usr/sbin/ is *not* in the default path on pollux.

      As per Ken Smith – “We don’t have it [/usr/sbin/] in peoples’ default path because all the commands there are related to systems administration type activities. Odds are that if you think you need something from /usr/sbin you won’t be able to actually do it. There are a few minor exceptions…” (such as dig)

      Just run the following instead:
      pollux {~} > /usr/sbin/ berkley.edu

    • John 2:56 am on October 15, 2009 Permalink

      That should have been

      Just run the following instead:
      pollux {~} > /usr/sbin/dig berkley.edu

      hth

c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
esc
cancel