~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 578.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Dec 12 09:18:14 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mBCHIEDC010317 for ; Fri, 12 Dec 2008 09:18:14 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mBCHL0gY007820 for ; Fri, 12 Dec 2008 09:21:00 -0800 Message-Id: <200812121721.mBCHL0gY007820@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Extra homework Date: Fri, 12 Dec 2008 09:21:00 -0800 From: Bill Cheng Someone wrote: > In extra HW WFQ problem, the last line says: > > "Sort according to finish times and apply tie breaking rule, the packet will > leave in the following order" > > So what is the general tie-breaking rule to be chosen ? Alphabetical order > or anything else ? You mean in real routers? I would guess that it's router specific. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 577.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Dec 11 22:15:12 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mBC6FCRe003195 for ; Thu, 11 Dec 2008 22:15:12 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mBC6HpF4005196 for ; Thu, 11 Dec 2008 22:17:51 -0800 Message-Id: <200812120617.mBC6HpF4005196@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS 551 final exam room has been changed to GFS 106 (same as midterm)! Date: Thu, 11 Dec 2008 22:17:51 -0800 From: Bill Cheng Hi everyone, Just a final reminder that the final exam has been moved to GFS 106 (same room as our midterm exam). See you tomorrow at 11am! -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Thu, 11 Dec 2008 11:47:04 -0800 From: Bill Cheng To: cs551@merlot.usc.edu Subject: CS 551 final exam room has been changed to GFS 106 (same as midterm) ! Hi everyone, The final exam will be in GFS 106, same location as the midterm exam! Sorry about the short notice. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Thu, 11 Dec 2008 08:49:13 -0800 From: Bill Cheng To: cs551@merlot.usc.edu Subject: CS 551 final exam *ROOM CHANGE*! Hi everyone, Well, I decided to take a walk to THH 116 just to make sure and I'm glad I did. The room is too small! I've asked DEN to look for another room for us. Please stay tuned for the room change e-mail! Sorry about the inconvenience. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Thu, 11 Dec 2008 08:23:25 -0800 From: Bill Cheng To: cs551@merlot.usc.edu Subject: Reminder about final exam tomorrow! Hi everyone, Just a reminder that the final exam is 11am-1pm tomorrow (Friday, 12/12/2008) in THH 116. Please try not to be late. If you are late, you still need to finish the exam at 1pm. Please see the class home page regarding details of the final exam. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 576.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Dec 11 22:13:54 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mBC6DsYT003146 for ; Thu, 11 Dec 2008 22:13:54 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mBC6GXw5005171 for ; Thu, 11 Dec 2008 22:16:33 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.14.2/8.14.1/Submit) id mBC6GX6c005170 for cs551@merlot; Thu, 11 Dec 2008 22:16:33 -0800 Date: Thu, 11 Dec 2008 22:16:33 -0800 From: Bill Cheng Message-Id: <200812120616.mBC6GX6c005170@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Final project part (2) regrade... Hi everyone, I just want to mention that there is no requirement that you be physically present at a regrade. If you have run through the grading guidelines and are fairly sure that the grader has made a mistake, you just need to e-mail the details to the grader and she can verify if she had made a mistake. Please remember that the grader is authorized to refuse to regrade your project if you have not run through the scrips and provide her with your results in *some* detail. If you want to do regrades via e-mail, one thing you can do is to use the "script" command. For example, if you do: script ~/my_script [ run through a part of a grading guidelines ] exit Then ~/my_script will contain a transcript of everything that was displayed and you can e-mail it to the grader. You must *not* delete anything from the transcript. But if there are sections of it that you are not asking the grader to reconsider, you can mark sections of your transcript to make it very clear what she should read. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 575.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Dec 11 21:56:35 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mBC5uZ64002956 for ; Thu, 11 Dec 2008 21:56:35 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mBC5xEdu005072 for ; Thu, 11 Dec 2008 21:59:14 -0800 Message-Id: <200812120559.mBC5xEdu005072@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS 551 Date: Thu, 11 Dec 2008 21:59:14 -0800 From: Bill Cheng Someone wrote: > if a similar type of question is asked in the final exam tomorrow, is > it necessary that we do it the same way as shown in the posted > solution online (using -ve bucket size) or is it ok if we do it with > our own method, as long as the final answer is correct! If a question does not require you to use a particular method, you can pretty much use any method you want. -- Bill Cheng // bill.cheng@usc.edu On Thu, Dec 11, 2008 at 6:46 PM, Bill Cheng wrote: > Someone wrote: > > > In homework - Pr.4, for the part (2) , how did the solution come to > > the conclusion that the bucket size of 2 that we arrived at is > > sufficient? > > If B = 2, then everything in the Bucket Volume column will be > bumped up by 2. Then nothing will be negative. So, B = 2 > is sufficient. > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 574.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Dec 11 19:05:38 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mBC35cov001075 for ; Thu, 11 Dec 2008 19:05:38 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mBC38FHG001886 for ; Thu, 11 Dec 2008 19:08:15 -0800 Message-Id: <200812120308.mBC38FHG001886@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Lecture 17 slide 9 Date: Thu, 11 Dec 2008 19:08:14 -0800 From: Bill Cheng Someone wrote: > Ok. I get it. > Now, can there be a case where (C-x1-x2-....-xn-1) be less than xn > (since Flow n is the only flow thats left)? > in that case, flow 1 will not be able to acquire that much bandwidth. The algorithm stops at some point. You probably should watch the lecture video or lookup max-min fairness on the web. -- Bill Cheng // bill.cheng@usc.edu Bill Cheng wrote: > Someone wrote: > > > I am a bit confused about how are the requests served in Max Min. As the > > slide mentions, x1 is served and then the distribution takes place again. > > I want to know that when x1 is served, nothing is served to others right > > ? that means, it is not round robin in this case. > > x1 was not "served". Max-min fairness is about "bandwidth > allocation". Flow 1 asked for x1 (bits/sec) and it was > allocated x1. > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 573.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Dec 11 18:49:51 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mBC2npDp000875 for ; Thu, 11 Dec 2008 18:49:51 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mBC2qSu0001642 for ; Thu, 11 Dec 2008 18:52:28 -0800 Message-Id: <200812120252.mBC2qSu0001642@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Sensor nw ques Date: Thu, 11 Dec 2008 18:52:28 -0800 From: Bill Cheng Someone wrote: > Ques about sensor networks : > > 1) Please explain 'gradient establisment' Sorry! The time for such a question was during lectures. Please read the paper. > 2) slide 11 : > Directed diffusion uses attribute-based naming > b) sensors publish sensor IS acoustic; target EQ *; > lat IS 100.5; long IS 43.05 > a) sinks subscribe to sensor EQ acoustic; target IS lions; > lat GT 100; lat LT 101; long GT 43; long LT 44 > Understood point a . Plz explain point b. Are a and b related ? (a) and (b) are separate examples. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 572.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Dec 11 18:46:23 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mBC2kNKU000824 for ; Thu, 11 Dec 2008 18:46:23 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mBC2mxrK001602 for ; Thu, 11 Dec 2008 18:48:59 -0800 Message-Id: <200812120248.mBC2mxrK001602@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Lecture 17 slide 9 Date: Thu, 11 Dec 2008 18:48:59 -0800 From: Bill Cheng Someone wrote: > I am a bit confused about how are the requests served in Max Min. As the > slide mentions, x1 is served and then the distribution takes place again. > I want to know that when x1 is served, nothing is served to others right > ? that means, it is not round robin in this case. x1 was not "served". Max-min fairness is about "bandwidth allocation". Flow 1 asked for x1 (bits/sec) and it was allocated x1. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 571.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Dec 11 18:43:43 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mBC2hh34000756 for ; Thu, 11 Dec 2008 18:43:43 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mBC2kKL3001566 for ; Thu, 11 Dec 2008 18:46:20 -0800 Message-Id: <200812120246.mBC2kKL3001566@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS 551 Date: Thu, 11 Dec 2008 18:46:20 -0800 From: Bill Cheng Someone wrote: > In homework - Pr.4, for the part (2) , how did the solution come to > the conclusion that the bucket size of 2 that we arrived at is > sufficient? If B = 2, then everything in the Bucket Volume column will be bumped up by 2. Then nothing will be negative. So, B = 2 is sufficient. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 570.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Dec 11 13:40:38 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mBBLecAR030238 for ; Thu, 11 Dec 2008 13:40:38 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mBBLhBpr032084 for ; Thu, 11 Dec 2008 13:43:11 -0800 Message-Id: <200812112143.mBBLhBpr032084@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Regarding Extra homework problem 4 Date: Thu, 11 Dec 2008 13:43:11 -0800 From: Bill Cheng Someone wrote: > I mean: > If question says to assume the bucket is full initially, why are we starting > with empty bucket in the solution? > Shouldn't we start with full bucket while solving the problem? How? What value should you use? The problem is asking you to find the bucket depth! -- Bill Cheng // bill.cheng@usc.edu On Thu, Dec 11, 2008 at 12:22 PM, Bill Cheng wrote: > Someone wrote: > > > Extra homework problem# 4 says" > > > > (1) * Assuming that the bucket is initially full*, what bucket > depth > > does the flow need for a token rate of 2 packets per second? > > > > (2) Assuming that the bucket is initially full, what bucket depth > > does the flow need for a token rate of 4 packets per second? > > > > But the solution says: > > Let's pretend the bucket volume can be negative. We will have the > > following situation *if we start with an empty bucket (bucket volume = > 0): * > > > > It creates a confusion about what should be the initial bucket > condition. > > It's just a trick to solve the problem! > > I'm not sure what you are asking. > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 569.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Dec 11 12:19:48 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mBBKJmdh029385 for ; Thu, 11 Dec 2008 12:19:48 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mBBKMKAb031213 for ; Thu, 11 Dec 2008 12:22:20 -0800 Message-Id: <200812112022.mBBKMKAb031213@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Regarding Extra homework problem 4 Date: Thu, 11 Dec 2008 12:22:20 -0800 From: Bill Cheng Someone wrote: > Extra homework problem# 4 says" > > (1) * Assuming that the bucket is initially full*, what bucket depth > does the flow need for a token rate of 2 packets per second? > > (2) Assuming that the bucket is initially full, what bucket depth > does the flow need for a token rate of 4 packets per second? > > But the solution says: > Let's pretend the bucket volume can be negative. We will have the > following situation *if we start with an empty bucket (bucket volume = 0): * > > It creates a confusion about what should be the initial bucket condition. It's just a trick to solve the problem! I'm not sure what you are asking. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 568.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Dec 11 11:44:33 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mBBJiXUi029001 for ; Thu, 11 Dec 2008 11:44:33 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mBBJl4tj030984 for ; Thu, 11 Dec 2008 11:47:04 -0800 Message-Id: <200812111947.mBBJl4tj030984@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: CS 551 final exam room has been changed to GFS 106 (same as midterm)! Date: Thu, 11 Dec 2008 11:47:04 -0800 From: Bill Cheng Hi everyone, The final exam will be in GFS 106, same location as the midterm exam! Sorry about the short notice. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Thu, 11 Dec 2008 08:49:13 -0800 From: Bill Cheng To: cs551@merlot.usc.edu Subject: CS 551 final exam *ROOM CHANGE*! Hi everyone, Well, I decided to take a walk to THH 116 just to make sure and I'm glad I did. The room is too small! I've asked DEN to look for another room for us. Please stay tuned for the room change e-mail! Sorry about the inconvenience. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Thu, 11 Dec 2008 08:23:25 -0800 From: Bill Cheng To: cs551@merlot.usc.edu Subject: Reminder about final exam tomorrow! Hi everyone, Just a reminder that the final exam is 11am-1pm tomorrow (Friday, 12/12/2008) in THH 116. Please try not to be late. If you are late, you still need to finish the exam at 1pm. Please see the class home page regarding details of the final exam. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 567.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Dec 11 10:21:02 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mBBIL2gI028065 for ; Thu, 11 Dec 2008 10:21:02 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mBBINWas029887 for ; Thu, 11 Dec 2008 10:23:32 -0800 Message-Id: <200812111823.mBBINWas029887@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: DupACK Spoofing Date: Thu, 11 Dec 2008 10:23:32 -0800 From: Bill Cheng Someone wrote: > I don't think I'm completely understanding the reasoning or benefit behind > DupACK Spoofing. So I understand the following happens after a triple > DupACK: cwnd = cwnd/2 + 3*SMSS. After this, each additional DupACK causes: > cwnd = cwnd + 1. So this should cause the sender to send one new packet. I > assume then that the receiver would continue to send additional DupACK's, > each one resulting in one new packet of data being sent by the sender. > However, this should only be able to continue until the sender's cwnd > reaches the receiver's advertised window. At this point, to receive any more > data from the sender, the receiver must send a new ACK, which would reset > the sender's cwnd to ssthresh, which is half of the original cwnd (before > the DupACK's started) due to Fast Recovery. > > So really the only benefit was a momentary increase in bandwidth to the > receiver until the sender's cwnd is reset, and at that point the cwnd is > only half of what it originally was. Maybe the receiver could benefit more > by advertising a very large window so that the sender simply continues to > increase its cwnd? > > Does any of this sound about right? :) We didn't really go over any details about this in class. Usually, DupACK Spoofing is not done during fast recovery. Imagine if you are at the beginning of slow start. When you send out the first packet, you get 20 ACKs for this packet. You will retransmit the first packet, but you will also inflate the window size when you are not suppose to. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 566.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Dec 11 10:09:26 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mBBI9Po6027931 for ; Thu, 11 Dec 2008 10:09:25 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mBBIBu2C029714 for ; Thu, 11 Dec 2008 10:11:56 -0800 Message-Id: <200812111811.mBBIBu2C029714@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Lecture 17, Slide 15 Date: Thu, 11 Dec 2008 10:11:56 -0800 From: Bill Cheng Someone wrote: > A follow up to the last question: > > > (X1, Z1, Y2, X3 where in Queue so Logical time would advance by 0.25) > > Isn't this incorrect, as the slope is determined by the number of active > flows/queues, and not the number of packets? So even though there are four > packets, there are only three flows/queues, so the logical time would > advance by 0.333? Sorry that I didn't answer that part in my previous e-mail since I answered it in my message with timestamp "Sat 06 Dec 14:01". I was focusing on the rest of the previous e-mail. You are correct and so were the slides. > Also, is there ever an interest for mapping the logical time back to real > time? By that I mean (at least as I understand it), the logical clock only > advances after each round (a 'pass through' of all the active flows/queues), > and as such, X1 and Z1 both depart at logical time 2. But, as there is only > one actual channel to exit on, either X1 must go first, or Z1 must go first, > so they must have different physical departure times, even though they have > the same logical departure times. Am I thinking of this correctly? If so, > how do you determine which packet goes first, and is there ever an interest > for mapping the logical time back to real time? Your thinking was correct. When I talked about slide 16 of lecture 17, I mentioned that a simple tie breaking rule was used since the finish time for packets X1 and Z1 are the same. We simply used the rule that, in case there is a tie, X goes before Y and Y goes before Z. The physical schedule comes from the sort order deteremined by the finish times of the packets. -- Bill Cheng // bill.cheng@usc.edu On Thu, Dec 11, 2008 at 8:20 AM, Bill Cheng wrote: > Someone wrote: > > > At Physical time = 4, Z4 arrives.Before that at Physical Time = 3, Logical > > time was 1.833 (X1, Z1, Y2, X3 where in Queue so Logical time would advance > > by 0.25). > > so at Physical time = 4, Logical time would be 1.833 + 0.25 = 2.083. > > > > But in the slide it is shown Arrival time of Z4 as 2.25 instead of 2.083 ??? > > > > 'm not sure if it means the same or not but was just confused :( > > It's probably more clear if you look at slide 14. > > When logical clock equals 2, packets X1 and Z1 left the system > and only packets X3 and Y2 are in the system. So, the slope > starting at logical clock = 2 (and physical clock = 3.5) is 1/2. > > The blue text in the picture shows what packets are currently > being served (and that determines the slope). > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 565.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Dec 11 08:46:43 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mBBGkhcj027069 for ; Thu, 11 Dec 2008 08:46:43 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mBBGnDVI028570 for ; Thu, 11 Dec 2008 08:49:13 -0800 Message-Id: <200812111649.mBBGnDVI028570@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: CS 551 final exam *ROOM CHANGE*! Date: Thu, 11 Dec 2008 08:49:13 -0800 From: Bill Cheng Hi everyone, Well, I decided to take a walk to THH 116 just to make sure and I'm glad I did. The room is too small! I've asked DEN to look for another room for us. Please stay tuned for the room change e-mail! Sorry about the inconvenience. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Thu, 11 Dec 2008 08:23:25 -0800 From: Bill Cheng To: cs551@merlot.usc.edu Subject: Reminder about final exam tomorrow! Hi everyone, Just a reminder that the final exam is 11am-1pm tomorrow (Friday, 12/12/2008) in THH 116. Please try not to be late. If you are late, you still need to finish the exam at 1pm. Please see the class home page regarding details of the final exam. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 564.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Dec 11 08:20:56 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mBBGKu81026809 for ; Thu, 11 Dec 2008 08:20:56 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mBBGNPaA028304 for ; Thu, 11 Dec 2008 08:23:25 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.14.2/8.14.1/Submit) id mBBGNPV6028303 for cs551@merlot; Thu, 11 Dec 2008 08:23:25 -0800 Date: Thu, 11 Dec 2008 08:23:25 -0800 From: Bill Cheng Message-Id: <200812111623.mBBGNPV6028303@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Reminder about final exam tomorrow! Hi everyone, Just a reminder that the final exam is 11am-1pm tomorrow (Friday, 12/12/2008) in THH 116. Please try not to be late. If you are late, you still need to finish the exam at 1pm. Please see the class home page regarding details of the final exam. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 563.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Dec 11 08:17:47 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mBBGHl5l026756 for ; Thu, 11 Dec 2008 08:17:47 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mBBGKGXv028242 for ; Thu, 11 Dec 2008 08:20:16 -0800 Message-Id: <200812111620.mBBGKGXv028242@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Lecture 17, Slide 15 Date: Thu, 11 Dec 2008 08:20:16 -0800 From: Bill Cheng Someone wrote: > At Physical time = 4, Z4 arrives.Before that at Physical Time = 3, Logical > time was 1.833 (X1, Z1, Y2, X3 where in Queue so Logical time would advance > by 0.25). > so at Physical time = 4, Logical time would be 1.833 + 0.25 = 2.083. > > But in the slide it is shown Arrival time of Z4 as 2.25 instead of 2.083 ??? > > 'm not sure if it means the same or not but was just confused :( It's probably more clear if you look at slide 14. When logical clock equals 2, packets X1 and Z1 left the system and only packets X3 and Y2 are in the system. So, the slope starting at logical clock = 2 (and physical clock = 3.5) is 1/2. The blue text in the picture shows what packets are currently being served (and that determines the slope). -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 562.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Dec 10 18:23:19 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mBB2NJOq017960 for ; Wed, 10 Dec 2008 18:23:19 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mBB2PdLf024492 for ; Wed, 10 Dec 2008 18:25:39 -0800 Message-Id: <200812110225.mBB2PdLf024492@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551 Exam Location Date: Wed, 10 Dec 2008 18:25:39 -0800 From: Bill Cheng Someone wrote: > Could you please confirm the exam location. Thank you. It's on the class web page: 11am-1pm, Fri, 12/12/2008 in THH 116 -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 561.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Dec 10 17:59:08 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mBB1x8B9017695 for ; Wed, 10 Dec 2008 17:59:08 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mBB21RJk024189 for ; Wed, 10 Dec 2008 18:01:27 -0800 Message-Id: <200812110201.mBB21RJk024189@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: lecture 22 slide 1 Date: Wed, 10 Dec 2008 18:01:27 -0800 From: Bill Cheng Someone wrote: > in lect. 22 slide 1, how come successor(1)=1, shouldn't it be > successor(1)=3 ? Normally, content hash of a file does not collide with the content hash of a node's address. This is the unusual case. So, if the content hash of a file collides with the content hash of a node's address, then successor(k) is k where k is the content hash. You can also look at slide 5 of lecture 22. Successor(k) is what the successor pointer of k's predecessor points to. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 560.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Dec 10 14:33:21 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mBAMXLmZ015668 for ; Wed, 10 Dec 2008 14:33:21 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mBAMZdab023497 for ; Wed, 10 Dec 2008 14:35:39 -0800 Message-Id: <200812102235.mBAMZdab023497@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Doubts in Weight fair Queueing example!! Date: Wed, 10 Dec 2008 14:35:39 -0800 From: Bill Cheng Someone wrote: > In the weighted queueing example, A[X3] = 1.75. So F[X3] should be 2.75 > Right?? > But in the solution, F[X3] is calculated as 3. So Is 2.75 rounded off to > 3??? No. Since the finish time of X1 is 2 (which is greater than 1.75), the finish time of X3 is 2+1=3. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 559.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Dec 9 19:43:14 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mBA3hEAX003702 for ; Tue, 9 Dec 2008 19:43:14 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mBA3jgCF016844 for ; Tue, 9 Dec 2008 19:45:42 -0800 Message-Id: <200812100345.mBA3jgCF016844@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: doubt about the DEC-bit scheme Date: Tue, 09 Dec 2008 19:45:42 -0800 From: Bill Cheng Someone wrote: > The DEC-bit scheme relies on the acknowledgement provided by the receiver to > the sender to convey information about congestion to the sender. However, > what about connectionless transport-layer protocols such as UDP that do no > provide any acknowledgement. It won't be able to use it. DEC-bit is a feedback mechanism. If there is no ACK, there would be no feedback. > In this context, is the DEC-bit scheme still fair to ALL users ? As I've mentioned in class, nothing is fair to all users because it's hard to even define "fair to all users"! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 558.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Dec 9 13:07:31 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mB9L7VCx032014 for ; Tue, 9 Dec 2008 13:07:31 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mB9L9te9013431 for ; Tue, 9 Dec 2008 13:09:55 -0800 Message-Id: <200812092109.mB9L9te9013431@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: slide 3 of lecture 22 Date: Tue, 09 Dec 2008 13:09:55 -0800 From: Bill Cheng Someone wrote: > The key value is a random value generated by hashing right ? Umm... I used the term "content hash". > If not then could you please explain how the key for node 0 was 6, 1 was 1 > and for 3 was 2 ? That's not what I said. Please read it carefully. I said: Node 0 stores a file whose content hash key is 6, node 1 stores a file whose content hash key is 1, and node 3 stores a file whose content hash key is 2. > Also, in that case what happens to the key value of node 6 in the join > example ? On slide 6 of lecture 22, it showed the file whose content hash is 6 got moved from node 0 to node 6 because this file should be stored on node 6 since its content hash is 6. -- Bill Cheng // bill.cheng@usc.edu On Sun, Dec 7, 2008 at 7:37 PM, Bill Cheng wrote: > Someone wrote: > > > For Lecture 22 slide 3, why is the sum of the keys 9. 0 has 6 keys, > > 1 has 1 key and 2 has 2 keys. Why wouldn't it be 8? > > Slide 3 of lecture 22 is the Finger Tables Example slide. > I'm not sure what you were referring to since I could not > find any reference to the number 8 or 9. > > In this example, each node stores one key/file. Node 0 > stores a file whose content hash key is 6, node 1 stores a > file whose content hash key is 1, and node 3 stores a file > whose content hash key is 2. > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 557.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Dec 8 12:26:11 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mB8KQBip016390 for ; Mon, 8 Dec 2008 12:26:11 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mB8KSI4f004598; Mon, 8 Dec 2008 12:28:18 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.14.2/8.14.1/Submit) id mB8KSIg8004597; Mon, 8 Dec 2008 12:28:18 -0800 Date: Mon, 8 Dec 2008 12:28:18 -0800 From: Bill Cheng Message-Id: <200812082028.mB8KSIg8004597@bourbon.usc.edu> To: cs551@merlot.usc.edu, usc-cs-351@googlegroups.com, usc-cs-531@googlegroups.com, usc-cs-558l@googlegroups.com Subject: Office Hours these two weeks... Hi everyone, I will not be holding regular office hours these two weeks. If you would like to see me, please send me e-mail to make an appointment at least 24 hours in advance. Thanks! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 556.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Dec 7 19:39:37 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mB83dbdu002114 for ; Sun, 7 Dec 2008 19:39:37 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mB83fWfR031228 for ; Sun, 7 Dec 2008 19:41:32 -0800 Message-Id: <200812080341.mB83fWfR031228@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Weighted fair Queueing Date: Sun, 07 Dec 2008 19:41:32 -0800 From: Bill Cheng SOmeone wrote: > In the weighted fair queuing example in slide 19 of lecture 17, > you indicated that we shrink packet sizes by 2 > Does this imply that if Y2 arrives at logical time 1.5, it will > depart at logical time 2 because packet size is now half (instead > of the original departure at 2.5)? Exactly! For a packet whose weight is 2, it's packet size is effectively shrunk by 50%. > You also indicated that we count Y twice when queue Y is not > empty. Does thisimply that we can have a slope of 1/4 if we have > up to two packets from Y in service and both X and Z also have a > packet each in service? No exactly. The slope is 1/4 if there is at least one packet in each queue. (The slope is 1/3 if there is at least one packet in queue Y and at least one packet in queue X or Z.) -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 555.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Dec 7 19:36:02 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mB83a1sw002021 for ; Sun, 7 Dec 2008 19:36:01 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mB83bv5P031199 for ; Sun, 7 Dec 2008 19:37:57 -0800 Message-Id: <200812080337.mB83bv5P031199@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: slide 3 of lecture 22 Date: Sun, 07 Dec 2008 19:37:57 -0800 From: Bill Cheng Someone wrote: > For Lecture 22 slide 3, why is the sum of the keys 9. 0 has 6 keys, 1 has 1 > key and 2 has 2 keys. Why wouldn't it be 8? Slide 3 of lecture 22 is the Finger Tables Example slide. I'm not sure what you were referring to since I could not find any reference to the number 8 or 9. In this example, each node stores one key/file. Node 0 stores a file whose content hash key is 6, node 1 stores a file whose content hash key is 1, and node 3 stores a file whose content hash key is 2. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 554.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Dec 6 13:59:42 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mB6LxgPb019616 for ; Sat, 6 Dec 2008 13:59:42 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mB6M1IWk022021 for ; Sat, 6 Dec 2008 14:01:18 -0800 Message-Id: <200812062201.mB6M1IWk022021@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: slide 14 of lecture 17 Date: Sat, 06 Dec 2008 14:01:18 -0800 From: Bill Cheng Someone wrote: > On slide 14 of Lecture 17 should there be a knot at x=x3? And the slope > should change to 1/4? There are only 3 queues, so packet X3 got queued behind packet X1. Since there are 3 queues active, the slope is 1/3. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 553.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Dec 5 13:33:51 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mB5LXpiR009435 for ; Fri, 5 Dec 2008 13:33:51 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mB5LZBxs003860 for ; Fri, 5 Dec 2008 13:35:11 -0800 Message-Id: <200812052135.mB5LZBxs003860@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Nov 3rd , slide 16 Date: Fri, 05 Dec 2008 13:35:11 -0800 From: Bill Cheng Someone wrote: > It is mentioned that we would change the window size after detecting > congestion every (W+W') ACKS. > > Can you please give a numerical example on this ? For example, if you are doing multiplicative decrease, W=32 and W'=32*0.875=28. Then W+W'=60. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 552.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Dec 4 17:09:49 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mB519nZm032710 for ; Thu, 4 Dec 2008 17:09:49 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mB51AtqA028555 for ; Thu, 4 Dec 2008 17:10:55 -0800 Message-Id: <200812050110.mB51AtqA028555@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Example of Ad-hoc network Date: Thu, 04 Dec 2008 17:10:55 -0800 From: Bill Cheng Someone wrote: > Sorry for the miss-communication. I was actually asking if you > would consider it as an example of ad-hoc computing. On the web > site it says that it is based on 802.11s. > > My understanding of the project from following the news about it > is as follows: > The OLPC initiative is to provide laptops to children in > developing countries. The laptops are designed to be rugged and > have low power consumption. They connect to each other if they > are in range, allowing the children to communicate and share > information and learn together. The idea is to allow them to > create a 'mesh' network. If one computer was connected to the > Internet, it would allow all the others to access through it's > connection. I don't know the details about it. From scanning the wiki page, looks like it qualifies as a Ad hoc network. The nodes can address each other and there is a routing protocol to route packets in a multi-hop fashion. The wiki page does not talk about mobility. I assume that when nodes move around, it tries to stay connected. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: Bill Cheng Date: Thursday, December 4, 2008 12:53 am Subject: Re: Example of Ad-hoc network To: cs551@merlot.usc.edu > Someone wrote: > > > Wouldn't the behavior of the OLPC mesh network be a good example > > of ad-hoc computing? > > > > http://wiki.laptop.org/go/Mesh_Network_Details > > > > When you brought up the subject, the first two things I thought > > of were the military sensor networks, and the > > One-laptop-per-child initiative. > > Are you asking about why the lecture slides said that there > are no non-military *applications*? > > I'm not familiar with the OLPC mesh network. Do you know > what is the killer app for this network? > -- > Bill Cheng // bill.cheng@usc.edu > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 551.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Dec 4 05:55:07 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mB4Dt7ia028172 for ; Thu, 4 Dec 2008 05:55:07 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mB4Du4qM021284; Thu, 4 Dec 2008 05:56:04 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.14.2/8.14.1/Submit) id mB4Du4fB021283; Thu, 4 Dec 2008 05:56:04 -0800 Date: Thu, 4 Dec 2008 05:56:04 -0800 From: Bill Cheng Message-Id: <200812041356.mB4Du4fB021283@bourbon.usc.edu> To: cs551@merlot.usc.edu, usc-cs-351@googlegroups.com, usc-cs-531@googlegroups.com, usc-cs-558l@googlegroups.com Subject: Office hour moved up half an hour today... Hi everyone, I need to move up the office hour today by half an hour (so it will be from 10:30am to 11:30am). Sorry about the short notice. If you need to see me but cannot make it to the office hour, please send me an e-mail to make an appointment. Thanks! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 550.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Dec 3 21:40:36 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mB45eak5024373 for ; Wed, 3 Dec 2008 21:40:36 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mB45fTqx019040 for ; Wed, 3 Dec 2008 21:41:29 -0800 Message-Id: <200812040541.mB45fTqx019040@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Example of Ad-hoc network Date: Wed, 03 Dec 2008 21:41:29 -0800 From: Bill Cheng Someone wrote: > Wouldn't the behavior of the OLPC mesh network be a good example > of ad-hoc computing? > > http://wiki.laptop.org/go/Mesh_Network_Details > > When you brought up the subject, the first two things I thought > of were the military sensor networks, and the > One-laptop-per-child initiative. Are you asking about why the lecture slides said that there are no non-military *applications*? I'm not familiar with the OLPC mesh network. Do you know what is the killer app for this network? -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 549.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 26 21:21:57 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAR5LvZJ001146 for ; Wed, 26 Nov 2008 21:21:57 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAR5L1b7011024 for ; Wed, 26 Nov 2008 21:21:01 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.14.2/8.14.1/Submit) id mAR5L1WF011023 for cs551@merlot; Wed, 26 Nov 2008 21:21:01 -0800 Date: Wed, 26 Nov 2008 21:21:01 -0800 From: Bill Cheng Message-Id: <200811270521.mAR5L1WF011023@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Final project part (2) submission deadline is tonight! Hi everyone, Just want to mention that if you have not submitted anything for part (2) by now, you should make a clean submission file and submit something soon (and please make backup and be very careful and do not wipe out anything you don't want to lose). Please also verify your submission: http://merlot.usc.edu/cs551-f08/submit.html#verify We need to be fair to all. So, if you miss submitting a file, there's nothing we can do after the deadline. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 548.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 26 20:03:00 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAR430Wd000371 for ; Wed, 26 Nov 2008 20:03:00 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAR423OA009983 for ; Wed, 26 Nov 2008 20:02:04 -0800 Message-Id: <200811270402.mAR423OA009983@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: search result Date: Wed, 26 Nov 2008 20:02:03 -0800 From: Bill Cheng Someone wrote: > When we enter search command, should we display results > immediately when receiving any packets? or display results until > all packets are received? It's because if I do the 2nd choice, > there will be no results on the screen unless either press CTRL+C > or time expired. You should do it as soon as possible. The spec says: When the user presses ^C (Control-c) on the keyboard, the displaying of search results is terminated (although the node may be receiving more search results) and a command prompt should be displayed. This sort of implies that you should display the results as soon as you get them. If you don't, you need to make sure that when is pressed, you should display all the results you have received so far. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 547.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 26 14:06:11 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAQM6BBa030064 for ; Wed, 26 Nov 2008 14:06:11 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAQM5BQ5006918 for ; Wed, 26 Nov 2008 14:05:11 -0800 Message-Id: <200811262205.mAQM5BQ5006918@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Project 2 Date: Wed, 26 Nov 2008 14:05:11 -0800 From: Bill Cheng Someone wrote: > Is it alright to use mkdir command in our code, or do we assume the > files directory has been created You can assume that the "files" directory exists under HomeDir. The ~csci551b/bin/resetf2 script creates all these directories and as you can see, this script is run before any test. If you need to create other directories, you should call mkdir(). -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 546.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 26 13:52:41 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAQLqfxA029927 for ; Wed, 26 Nov 2008 13:52:41 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAQLpemX006647 for ; Wed, 26 Nov 2008 13:51:40 -0800 Message-Id: <200811262151.mAQLpemX006647@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Project 2 Date: Wed, 26 Nov 2008 13:51:40 -0800 From: Bill Cheng Someone wrote: > In the file metadata, a ^M appears at end of each line if the \r \nis > used , is that ok? ^M (i.e., ) *is* \r (i.e., 0x0d). And by the way, ^J (i.e., ) *is* \n (i.e., 0x0a). -- Bill Cheng // bill.cheng@usc.edu On Wed, Nov 26, 2008 at 11:23 AM, Bill Cheng wrote: > Someone wrote: > > > if the reset command is specified, do we have to remove the > > init_neighbor_list file and assume that it will be placed back in the > > home dir > > Yes! > > In general, you shouldn't worry about things like this! > If we've made a mistake in grading, it can easily be > fixed! > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 545.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 26 11:24:39 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAQJOdlu028235 for ; Wed, 26 Nov 2008 11:24:39 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAQJNbiL028249 for ; Wed, 26 Nov 2008 11:23:37 -0800 Message-Id: <200811261923.mAQJNbiL028249@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Project 2 Date: Wed, 26 Nov 2008 11:23:37 -0800 From: Bill Cheng Someone wrote: > if the reset command is specified, do we have to remove the > init_neighbor_list file and assume that it will be placed back in the > home dir Yes! In general, you shouldn't worry about things like this! If we've made a mistake in grading, it can easily be fixed! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 544.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 26 10:12:44 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAQICiLY027287 for ; Wed, 26 Nov 2008 10:12:44 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAQIBfoX026368 for ; Wed, 26 Nov 2008 10:11:41 -0800 Message-Id: <200811261811.mAQIBfoX026368@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: a little long email Date: Wed, 26 Nov 2008 10:11:41 -0800 From: Bill Cheng Someone wrote: > [1] [Fri, 14 Nov 2008 13:02:17] > Correct! This is mainly for grading purpose! If you flood a delete > with an invalid password, nodes should not delete the corresponding > file. > > [2] [Fri, 21 Nov 2008 13:42:52] > No. If you do not have a file that matches the FileName, you cannot > even verify that the SHA1 you have entered is correct. So, don't need > to prompt. Although you should print an error message because it may > be just a typo. > > [3] [Tue, 25 Nov 2008 11:49:17] > One important feature of the SERVANT network is that it provides > anonymity. It's not just about you cannot know who initiate a STORE > or who initiated a GET. > > [4] [Tue, 25 Nov 2008 22:34:56] > If there is no such file that matches FileName, SHA1, *and* Nonce, > then you should not prompt and just tell the user that there is no > such file on this node. > > We are doing this whole random-password thing for grading purpose. In > which case if there is no password information for a file on the node > where a delete was issued there is no way that file will ever be > deleted based on any random password. ( I remember you had announced a > prize for someone who finds sha1 collisions). According to point [3] > it is not difficult to prove that a certain node has no knowledge of > the files that may be present elsewhere in the network. This makes it > more difficult to argue that a delete command for a certain file > abcd.xyz on a certain node will be a "TYPO" just because IT does not > have this file. That file may be present on some other node and by not > sending a delete message we do not give it a fair chance to try out > the random password. If point [1] is valid for grading purposes then > we SHOULD ask for a random password in EVERY other case that we do not > have a matching fname,sha1,nonce. > > Bottom line is, we have to be fair to every node at trying out a > random password (sounds like our academic integrity policy) and since > we cannot say which file is where we have to ALWAYS ask a random > password when we have no hit and cannot assume that a filename or sha1 > will be a typo just because you don't have that file. > > I think there was no bug in the earlier grading guidelines. I agree with what you've said. The main reason I changed the grading guidelines was that I was inconsistent. Being inconsistent caused a "bug in the grading guidelines" because it did not match what I was talling everyone. Now you are pointing out that by changing the grading guidelines, I'm being inconsistent again! I think you are right. So, I've just changed the grading guidelines so that both cases are allowed! I splitted the +2 points between (A.1.a) and (A.2.a). In (A.1.a), the Nonce was wrong. So, you can either print an error message and not prompt; or, you can prompt the user for a random password. In (A.2.a), FileName, SHA1, and Nonce are all correct, but the node does not have the password. Therefore, you must prompt the user for a random password. Sorry about the confusion! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 543.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 26 09:54:58 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAQHswxw026948 for ; Wed, 26 Nov 2008 09:54:58 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAQHrtHr026018 for ; Wed, 26 Nov 2008 09:53:55 -0800 Message-Id: <200811261753.mAQHrtHr026018@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551: Final Project 2 : Delete Msg Date: Wed, 26 Nov 2008 09:53:55 -0800 From: Bill Cheng Someone wrote: > Any ideas on how do we convert unsigned char * to ASCII character array ? You mean from binary data (unsigned char *) to ASCII string (also unsigned char *)? To convert one byte of binary data to a string of length 2 in ASCII, you can do the following: void BinaryCharToTwoAsciiChars(unsigned char ch, unsigned char buf[2]) { unsigned char hi_nibble = ch >> 4; unsigned char lo_nibble = ch & 0x0f; switch (hi_nibble & 0x0f) { case 0x0: buf[0] = '0'; break; case 0x1: buf[0] = '1'; break; case 0x2: buf[0] = '2'; break; ... case 0xe: buf[0] = 'e'; break; case 0xf: buf[0] = 'f'; break; } switch (lo_nibble & 0x0f) { case 0x0: buf[1] = '0'; break; case 0x1: buf[1] = '1'; break; case 0x2: buf[1] = '2'; break; ... case 0xe: buf[1] = 'e'; break; case 0xf: buf[1] = 'f'; break; } } -- Bill Cheng // bill.cheng@usc.edu On Tue, Nov 25, 2008 at 11:11 PM, Bill Cheng wrote: > Someone wrote: > > > While sending the delete msg we have the format > > FileName=foo > > SHA1=63de... > > Nonce=fcca... > > Password=bac9... > > > > So we have to store all values as characters .. correct ? > > ASCII characters. > > > i.e the length of SHA1, Nonce and Password will be 40 bytes. > > 40 ASCII characters (which takes 40 bytes each to send). > > > and the total data part length will be > 120. > > Yes. > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 542.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Nov 25 23:12:19 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAQ7CJhb020827 for ; Tue, 25 Nov 2008 23:12:19 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAQ7B9fu018870 for ; Tue, 25 Nov 2008 23:11:09 -0800 Message-Id: <200811260711.mAQ7B9fu018870@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551: Final Project 2 : Delete Msg Date: Tue, 25 Nov 2008 23:11:09 -0800 From: Bill Cheng Someone wrote: > While sending the delete msg we have the format > FileName=foo > SHA1=63de... > Nonce=fcca... > Password=bac9... > > So we have to store all values as characters .. correct ? ASCII characters. > i.e the length of SHA1, Nonce and Password will be 40 bytes. 40 ASCII characters (which takes 40 bytes each to send). > and the total data part length will be > 120. Yes. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 541.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Nov 25 22:36:07 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAQ6a7pF020518 for ; Tue, 25 Nov 2008 22:36:07 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAQ6YuIY018351 for ; Tue, 25 Nov 2008 22:34:56 -0800 Message-Id: <200811260634.mAQ6YuIY018351@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: random password Date: Tue, 25 Nov 2008 22:34:56 -0800 From: Bill Cheng Someone wrote: > The grading guidelines has the following: > > delete FileName=chess.jpg SHA1=f7917fe4976d2c24f225bc4b6c2334e554b91c28 > Nonce=8ae005585be9c44ef1910d25dd6f8da58c432ab5 > should prompt the user to see if it's okay to > use a random password, type "yes" > > In this, the filename and sha1 will match but the nonce will not match. So > should it still prompt for a random password? or should it warn the user of > a typo? If there is no such file that matches FileName, SHA1, *and* Nonce, then you should not prompt and just tell the user that there is no such file on this node. So, it looks like the grading guidelines is saying that you should prompt. So, the grading guidelines seem to have a bug! As I've mentioned before, the grading guidelines may have bugs with the one-time password stuff and you should tell me about bugs as soon as possible! Anyway, this test won't work in section (A.1.*) since there is only one node in the system. So I have to move it to (A.2.a). As a result, the corresponding 2 points have been moved to (A.1.a) to (A.2.a). Sorry about the late change in the grading guidelines! -- Bill Cheng // bill.cheng@usc.edu On Tue, Nov 25, 2008 at 9:04 PM, Bill Cheng wrote: > > Someone wrote: > > > Continuing from your answer below: > > have a nonce index, so I first check the nonce index and then verify the > > sha1 and filename (using the indexes). In this case my code prints out "File > > with these details not found" > > Again, you don't need a nonce index. You can just use the > SHA1 index to locate a file number. Then you open the > metadata file for each file having the same SHA1 value > and check the FileName and Nonce. For every FileName and > Nonce that match the commandline, you check if a password > exists. > > If you cannot not find a file with the specified SHA1, > FileName, *and* Nonce, you can print out an error message > like you mentioned above. > > > Or should an error message be printed only when the sha1 and filename do not > > match? > > You mean the Nonce matched but SHA1 and FileName do not match? > Then it's the same situation since *all* 3 things must match. > -- > Bill Cheng // bill.cheng@usc.edu > > > > > test case: A > > > (+2 points) > > > delete FileName=chess.jpg > > > SHA1=f7917fe4976d2c24f225bc4b6c2334e554b91c28 > > > Nonce=8ae005585be9c44ef1910d25dd6f8da58c432ab5 > > > should prompt the user to see if it's okay > > to > > > use a random password, type "yes" > > > nothing should get deleted, > > > type "status files 1 00.out", look at > > "00.out", > > > there should still be two files > > > > > > say now if i enter some non-existant filename, > > > > > > SERVANT XXXXX> delete FileName=abcd.xyz SHA1=3a5f........ > > > should it prompt for random password? > > > > No. If you do not have a file that matches the FileName, > > you cannot even verify that the SHA1 you have entered is > > correct. So, don't need to prompt. Although you should > > print an error message because it may be just a typo. > > -- > > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 540.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Nov 25 22:09:09 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAQ698dW020224 for ; Tue, 25 Nov 2008 22:09:09 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAQ67v8c017749 for ; Tue, 25 Nov 2008 22:07:57 -0800 Message-Id: <200811260607.mAQ67v8c017749@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Join and Check Date: Tue, 25 Nov 2008 22:07:57 -0800 From: Bill Cheng Someone wrote: > Since join and check are not there, what does a non beacon do after > receiving a notify? Log it! > Should it just continue to participate in the connection. Yes. > So, if its neighbor count falls below min neighbors, it should just exit ? It should not work like that even for part (1)! Remember, MinNeighbor is only checked when a node *comes up*. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 539.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Nov 25 21:06:10 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAQ56ANa019766 for ; Tue, 25 Nov 2008 21:06:10 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAQ54wLe016825 for ; Tue, 25 Nov 2008 21:04:58 -0800 Message-Id: <200811260504.mAQ54wLe016825@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: random password Date: Tue, 25 Nov 2008 21:04:58 -0800 From: Bill Cheng Someone wrote: > Continuing from your answer below: > have a nonce index, so I first check the nonce index and then verify the > sha1 and filename (using the indexes). In this case my code prints out "File > with these details not found" Again, you don't need a nonce index. You can just use the SHA1 index to locate a file number. Then you open the metadata file for each file having the same SHA1 value and check the FileName and Nonce. For every FileName and Nonce that match the commandline, you check if a password exists. If you cannot not find a file with the specified SHA1, FileName, *and* Nonce, you can print out an error message like you mentioned above. > Or should an error message be printed only when the sha1 and filename do not > match? You mean the Nonce matched but SHA1 and FileName do not match? Then it's the same situation since *all* 3 things must match. -- Bill Cheng // bill.cheng@usc.edu > test case: A > > (+2 points) > > delete FileName=chess.jpg > > SHA1=f7917fe4976d2c24f225bc4b6c2334e554b91c28 > > Nonce=8ae005585be9c44ef1910d25dd6f8da58c432ab5 > > should prompt the user to see if it's okay > to > > use a random password, type "yes" > > nothing should get deleted, > > type "status files 1 00.out", look at > "00.out", > > there should still be two files > > > > say now if i enter some non-existant filename, > > > > SERVANT XXXXX> delete FileName=abcd.xyz SHA1=3a5f........ > > should it prompt for random password? > > No. If you do not have a file that matches the FileName, > you cannot even verify that the SHA1 you have entered is > correct. So, don't need to prompt. Although you should > print an error message because it may be just a typo. > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 538.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Nov 25 21:00:29 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAQ50Thu019712 for ; Tue, 25 Nov 2008 21:00:29 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAQ4xHwX016643 for ; Tue, 25 Nov 2008 20:59:17 -0800 Message-Id: <200811260459.mAQ4xHwX016643@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS 551 Date: Tue, 25 Nov 2008 20:59:17 -0800 From: Bill Cheng Someone wrote: > If a node did not do a store on a file which it is trying to delete, then > should it be prompted > > No one-time password found. > Okay to use a random password [yes/no]? > > If the node says yes, then should it be able to delete the files on > the network even if it wasnt the initiator of the store???? The only time you should delete a file is when you take a SHA1 hash of a password and see that the SHA1 output is identical to the Nonce of a file. Otherwise, you should not delete the file. (Of course, if you start your node with -reset, then you delete everything.) -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 537.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Nov 25 20:50:56 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAQ4ousX019633 for ; Tue, 25 Nov 2008 20:50:56 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAQ4nisp016531 for ; Tue, 25 Nov 2008 20:49:44 -0800 Message-Id: <200811260449.mAQ4nisp016531@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Get Flood Date: Tue, 25 Nov 2008 20:49:44 -0800 From: Bill Cheng Someone wrote: > In the specs, you have mentioned > > "Before you flood a GET message, you should use the FileID to determine if > the current node has the file.* If it does, you should not flood a GET > message*. In this case, if the existing file is in the cache space, its > status should be changed so that it is *"moved"* to the permanent space (you > should also do whatever adjustments that are necessary). " > > Isn't this a contradiction to what you mentioned ? Hmm... I don't see any contradiction. Could you elaborate? -- Bill Cheng // bill.cheng@usc.edu On Tue, Nov 25, 2008 at 11:49 AM, Bill Cheng wrote: > Someone wrote: > > > Can you explain what does plausible deniability mean? > > One important feature of the SERVANT network is that it > provides anonymity. It's not just about you cannot know > who initiate a STORE or who initiated a GET. You have > anonymity for all messages (except the ones that where > put in to allow grading). > > All messages are either flooded or forwarded. So, a node > can deny that it's the recipient of a message and claim > that it's only forwarding a message. Similarly, a node > can deny that it's the origin of a message and claim that > it's only forwarding a message. This way, unless the > authority can record most of the traffic in the SERVANT > network, it would be difficult for the authority to figure > out exactly who initiated a message and who was the intended > recipient of the message. > -- > Bill Cheng // bill.cheng@usc.edu > > > > > On Sat, Nov 22, 2008 at 8:27 AM, Bill Cheng > wrote: > > Someone wrote: > > > > > When get message is flooded, suppose a node gets the message and > > > identifies the fileid and sha1 as being the ones that belong to a > file > > > it has, then should it send the get response and not flood the > request > > > or should it still flood the request message. > > > > It should continue to flood the GET request for the reason > > of plausible deniability. > > -- > > Bill Cheng // bill.cheng@usc.edu http://merlot.usc.edu/william/usc/> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 536.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Nov 25 17:00:36 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAQ10aQ6017602 for ; Tue, 25 Nov 2008 17:00:36 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAQ0xMXi014942 for ; Tue, 25 Nov 2008 16:59:22 -0800 Message-Id: <200811260059.mAQ0xMXi014942@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Duplicate file in get response Date: Tue, 25 Nov 2008 16:59:22 -0800 From: Bill Cheng Someone wrote: > When a node initiates a get response, then after receivng the response, > it stores the file in its CWD and it checks in its filesystem if a file > already exists with the same filename, sha and nonce. My question is > that suppose a similar file exists in the cache, then it will discard > this new file but SHOULD it COPY the file from cache to perm storage ? It should simply change the bit to say that it's in perm storage now. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 535.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Nov 25 14:18:44 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAPMIi3s016339 for ; Tue, 25 Nov 2008 14:18:44 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAPMHR8b012800 for ; Tue, 25 Nov 2008 14:17:27 -0800 Message-Id: <200811252217.mAPMHR8b012800@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Get Response Date: Tue, 25 Nov 2008 14:17:27 -0800 From: Bill Cheng Someone wrote: > A node that initiates a get, upon getting a response stores the file in > its perm storage. > Now, what if a file (with the same fname, sha and nonce) exists in its > cache? > Should it discard the file in this case too ? Please read the "Additional Notes on File Retrieval (for Part 2 only)" section of the spec. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 534.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Nov 25 14:06:55 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAPM6tH6016193 for ; Tue, 25 Nov 2008 14:06:55 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAPM5dYn012582 for ; Tue, 25 Nov 2008 14:05:39 -0800 Message-Id: <200811252205.mAPM5dYn012582@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Doubt about Delete and Get message Date: Tue, 25 Nov 2008 14:05:39 -0800 From: Bill Cheng Someone wrote: > I have following queries, > > 1. When ever a node will initiate delete command, it will always check its > permanent storage to delete a file and not cache , is this right ? As I've mentioned several times, the cache and permanent storage should not be treated as separate storage! It should be treated as an attribute bit of a file. Then your question would answered itself! > 2. In Get, If a node initiate a get, and it finds that the file is in its > cache, it copies to permanent storage. While intermediate nodes forward > this file, if an intermediate node finds this file in its cache, then will > it copy that to its permanent storage ? or keep it in cache ? Cache. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 533.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Nov 25 11:50:35 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAPJoZ2q014852 for ; Tue, 25 Nov 2008 11:50:35 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAPJnHwv010576 for ; Tue, 25 Nov 2008 11:49:17 -0800 Message-Id: <200811251949.mAPJnHwv010576@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Get Flood Date: Tue, 25 Nov 2008 11:49:17 -0800 From: Bill Cheng Someone wrote: > Can you explain what does plausible deniability mean? One important feature of the SERVANT network is that it provides anonymity. It's not just about you cannot know who initiate a STORE or who initiated a GET. You have anonymity for all messages (except the ones that where put in to allow grading). All messages are either flooded or forwarded. So, a node can deny that it's the recipient of a message and claim that it's only forwarding a message. Similarly, a node can deny that it's the origin of a message and claim that it's only forwarding a message. This way, unless the authority can record most of the traffic in the SERVANT network, it would be difficult for the authority to figure out exactly who initiated a message and who was the intended recipient of the message. -- Bill Cheng // bill.cheng@usc.edu On Sat, Nov 22, 2008 at 8:27 AM, Bill Cheng wrote: > Someone wrote: > > > When get message is flooded, suppose a node gets the message and > > identifies the fileid and sha1 as being the ones that belong to a file > > it has, then should it send the get response and not flood the request > > or should it still flood the request message. > > It should continue to flood the GET request for the reason > of plausible deniability. > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 532.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Nov 25 11:45:37 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAPJjap7014800 for ; Tue, 25 Nov 2008 11:45:36 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAPJiI71010454 for ; Tue, 25 Nov 2008 11:44:18 -0800 Message-Id: <200811251944.mAPJiI71010454@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551: Final Project 2 : Delete Date: Tue, 25 Nov 2008 11:44:18 -0800 From: Bill Cheng Someone wrote: > For delete command, consider the scenario: > > there are 2 nodes > @ node - 1 commands are: store chess.jpg 1 tag="value" (assume that this > file will be cached at node 2, the probs are such) > @ node - 2 commands are: delete filename=chess.jpg sha1=(correct sha1) > nonce=(correct nonce) > > so at node 2, the following should happen, > it should check if it has a file with the same SHA1 and FileName and Nonce, > if the SHA1 and FileName and Nonce do not match, the node does nothing (no > flooding of delete commands too) > if it exists, the node has to then check if it has the one time password for > it too. > if the node does not have the one time password for this file, then it > should prompt the user for sending the delete based on a random password, > if the user says yes it has to flood delete requests to other nodes and also > delete the file copy which it has, else it should do nothing. Everything is correct so far, except that it should not delete the copy it has because the random password will not hash to the Nonce value. So, your node 2 is not authorized to delete this file. > now at node 1, (assuming node 2 flooded delete), the following shoud happen: > > it should check the SHA1 of the password in the delete message, with the > nonce inside the delete message. > if these do not match, the node should do nothing. > if these match, the node should go ahead, look for the file with this file > name, sha1 and nonce in its mini file system and if it finds the file, it > should be deleted. Correct. In this particular scenario, the chance of the password hashing into the same value as the Nonce is very minimal. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 531.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Nov 25 08:02:19 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAPG2JWS012877 for ; Tue, 25 Nov 2008 08:02:19 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAPG0xIu007991 for ; Tue, 25 Nov 2008 08:00:59 -0800 Message-Id: <200811251600.mAPG0xIu007991@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: The unit of CacheSize Date: Tue, 25 Nov 2008 08:00:59 -0800 From: Bill Cheng Someone wrote: > What's the unit of CacheSize? Is it KB? In the grading guideline, > CacheSize=600, but most files is bigger than 600 Byte. So I guess > CacheSize is 600KB not 600B. The spec says: CacheSize - The maximum total storage (in kilobytes) for cached files. The default value is 500. Please only count file sizes for the .data files. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 530.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 24 23:17:25 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAP7HPEo007955 for ; Mon, 24 Nov 2008 23:17:25 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAP7FwS3002489 for ; Mon, 24 Nov 2008 23:15:58 -0800 Message-Id: <200811250715.mAP7FwS3002489@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551: Final Project 2 : Reading Commandline Date: Mon, 24 Nov 2008 23:15:58 -0800 From: Bill Cheng Someone wrote: > For printing the "servant:10000>" at prompt we have used puts and then a > select call to check for any input at the prompt. however, puts appends a > '\n' at the end of every string it displays at the prompt so this is moving > the cursor on the second line for entering commands. Have you done "man puts"? It sounds like it's doing exactly what is advertised. > We tried printf, fputs, putchar and putc but displays due to all of these > are somehow getting suppressed if we use it with select. any ideas on what > can the possible error be ? > > This is how the code i described above looks: > > while(1) { > > printf("servant:%d> ",port); // we have puts currently which is working > at the same place. > .... > .... > select () call and things needed for that > if (timer expires) and (no input) > continue; > else > /* > processing logic > */ > } Have you tried calling fflush(stdout) right after the printf()? -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 529.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 24 22:06:52 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAP66q75007476 for ; Mon, 24 Nov 2008 22:06:52 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAP65PHg001540 for ; Mon, 24 Nov 2008 22:05:25 -0800 Message-Id: <200811250605.mAP65PHg001540@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Select from stdin Date: Mon, 24 Nov 2008 22:05:25 -0800 From: Bill Cheng Someone wrote: > I was facing a somewhat similar problem a couple of days back. This might > help. > > I made a variable true and forgot to make it false while looping. Something > like the following: > > if(message type is STOR) { > ....bigData = true) > } > > if(bigData is false) { > ....recv data into buffer > } > else { > ....recv byte by byte > //FORGOT TO MAKE IT FALSE > } Certainly, that's one out of many possible bugs. -- Bill Cheng // bill.cheng@usc.edu On Mon, Nov 24, 2008 at 9:15 PM, Bill Cheng wrote: > Someone wrote: > > > To read the commands from the user we are using select as follows: > > > > select(1,&readfds, NULL,NULL,NULL); > > > > This never gave us any problems earlier. Even now it works perfectly for > all > > the commands except for a "search keywords " command. In this case, it > does > > what "search keywords" asks it to do and then from there, it is not able > to > > detect ANY commands. > > Sounds like a bug somewhere. > > > We did a printf before the select and determined that it is blocking on > > select() and not detecting any sort of input commands after that "search > > keywords" operation is done. We have been trying to debug this for quite > > some time and are unable to come up with any solution. Could you please > help > > us regarding this ? Any hints or ideas on what could be causing this > problem > > ? > > If "search keywords" is the only command that breaks things, > my guess is that it's the usual memory corruption bug and > somehow it affects you reading from stdin. > > I don't have any great idea in how to find the bug. Sorry. > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 528.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 24 21:57:42 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAP5vgXi007398 for ; Mon, 24 Nov 2008 21:57:42 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAP5uEL3001338 for ; Mon, 24 Nov 2008 21:56:14 -0800 Message-Id: <200811250556.mAP5uEL3001338@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Memory Allocation Date: Mon, 24 Nov 2008 21:56:14 -0800 From: Bill Cheng Someone wrote: > I was wondering about allocation of 2D arrays. Suppose I declare an array > : arr[500][20]; , would this be considered to be greater than 8192 bytes > and would there be points deducted for this ? Yes. > Similarly, would that be the case with an array of struct as well, something > like: > > struct foo > { > unsigned char buff[20]; > } object[500]; Yes. I'm not understand why you would write code like this! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 527.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 24 21:32:04 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAP5W4Rg007147 for ; Mon, 24 Nov 2008 21:32:04 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAP5Ua8B000824 for ; Mon, 24 Nov 2008 21:30:36 -0800 Message-Id: <200811250530.mAP5Ua8B000824@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551: Final Project 2 : Query Date: Mon, 24 Nov 2008 21:30:36 -0800 From: Bill Cheng Someone wrote: > In the 1st test case we have : > at node 00: > > "store chess.jpg 1 categories="audio mp3" artist="Blondie" > > so we have to generate a file id and one time password for this file as node > 00 is initiating a store. , correct ? You don't need a FileID. You do need a one-time password. > search keywords="audio mp3 blondie" > should get a response, > then do > > get 1 > "chess.jpg" should be created in the current directory > > Then we have: > delete FileName=chess.jpg SHA1=f7917fe4976d2c24f225bc4b6c2334e554b91c28 > Nonce=8ae005585be9c44ef1910d25dd6f8da58c432ab5 > should prompt the user to see if it's okay to > use a random password, type "yes" > nothing should get deleted > type "status files 1 00.out", look at "00.out", > there should still be two files > > Why does it say that we should not delete the file? > is it because after a GET we have to store the new details of "chess.jpg" ? > And if so then do we need to update the FILE ID and ONE TIME PASSWORD when > we "GET" a file and if the same file exists at the node ? It's simply because the Nonce specified above does not match the Nonce of the file. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 526.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 24 21:26:24 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAP5QOBc007096 for ; Mon, 24 Nov 2008 21:26:24 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAP5OupX000709 for ; Mon, 24 Nov 2008 21:24:56 -0800 Message-Id: <200811250524.mAP5OupX000709@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: get Date: Mon, 24 Nov 2008 21:24:56 -0800 From: Bill Cheng Someone wrote: > So a get request does not add an inode to the mini file system, > it just adds the file to the cwd? If you are the node that *initiated* the GET request, then you have to save the file in the mini-filesystem *and* you save a copy in the current working directory. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 525.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 24 21:16:41 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAP5GekJ006967 for ; Mon, 24 Nov 2008 21:16:40 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAP5FCTT000565 for ; Mon, 24 Nov 2008 21:15:12 -0800 Message-Id: <200811250515.mAP5FCTT000565@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Select from stdin Date: Mon, 24 Nov 2008 21:15:12 -0800 From: Bill Cheng Someone wrote: > To read the commands from the user we are using select as follows: > > select(1,&readfds, NULL,NULL,NULL); > > This never gave us any problems earlier. Even now it works perfectly for all > the commands except for a "search keywords " command. In this case, it does > what "search keywords" asks it to do and then from there, it is not able to > detect ANY commands. Sounds like a bug somewhere. > We did a printf before the select and determined that it is blocking on > select() and not detecting any sort of input commands after that "search > keywords" operation is done. We have been trying to debug this for quite > some time and are unable to come up with any solution. Could you please help > us regarding this ? Any hints or ideas on what could be causing this problem > ? If "search keywords" is the only command that breaks things, my guess is that it's the usual memory corruption bug and somehow it affects you reading from stdin. I don't have any great idea in how to find the bug. Sorry. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 524.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 24 21:12:36 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAP5CaDN006929 for ; Mon, 24 Nov 2008 21:12:36 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAP5B8XX000468 for ; Mon, 24 Nov 2008 21:11:08 -0800 Message-Id: <200811250511.mAP5B8XX000468@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Project 2 Date: Mon, 24 Nov 2008 21:11:08 -0800 From: Bill Cheng Someone wrote: > I just tried sending some larget files and ran into trouble... I'm not sure what "ran into trouble" mean. I hope FBI didn't show up at your house. :-) > do you have to > use select or some other function to determine when the socket cand SEND > more data? There should be no need. You should just call send() or write(). If the buffer is full, your call will be blocked. You need to make sure that it's okay to block your writing thread. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 523.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 24 21:02:50 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAP52n4r006851 for ; Mon, 24 Nov 2008 21:02:50 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAP51LIV000322 for ; Mon, 24 Nov 2008 21:01:21 -0800 Message-Id: <200811250501.mAP51LIV000322@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551: Final Project 2 : FileID Date: Mon, 24 Nov 2008 21:01:21 -0800 From: Bill Cheng Someone wrote: > As it is given in the spec that ' Since FileID only matters when a user > enters a get user command, you only need to create a FileID if a > corresponding search reply was created.' So, if the search is performed for > a file on the same node, is it mandatory to print the FileID in the > corresponding search response as a search response isn't actually created > ?(it is only created when it is to be sent to some other node). Well, the idea is that you should simulate that a search response has been created. So, to be more accurate, the sentense you quoted should be: Since FileID only matters when a user enters a get user command, you only need to create a FileID if a you respond to a search request. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 522.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 24 20:08:16 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAP48G19006471 for ; Mon, 24 Nov 2008 20:08:16 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAP46mun032301 for ; Mon, 24 Nov 2008 20:06:48 -0800 Message-Id: <200811250406.mAP46mun032301@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551: Final Project: Get and Search Timeout Date: Mon, 24 Nov 2008 20:06:48 -0800 From: Bill Cheng Someone wrote: > What would be the time out values for Get and Search responses ? > > For search is it valid to assume it as MsgLifeTime ? Same as other message types. > And for get, can we assumet it as GetMsgLifeTime ? Of course! > Also, what would be the behaviour when we press ctrl c when a get command is > in progress ?? means short-circuit (as explained before). So, if you have not received all the data for the file you are receiving, you should delete what you have received so far. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 521.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 24 19:57:55 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAP3vtuA006383 for ; Mon, 24 Nov 2008 19:57:55 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAP3uQCZ032185 for ; Mon, 24 Nov 2008 19:56:26 -0800 Message-Id: <200811250356.mAP3uQCZ032185@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551_proj2 Date: Mon, 24 Nov 2008 19:56:26 -0800 From: Bill Cheng Someone wrote: > In the test case for three beacon nodes after we do a store of > blondie and we attempt to get blondie from one of our neighbors; > because the third node is idle and has not received keepalive > from the 2 busy nodes, it sends a notify to them while transfer > is still ongoing and disconnects from the network. How should we > handle this behavior. I use same mutex for all sends so I don't > send anything while transfer is in progress. Are you saying that the node is taking too long to transfer the file? You should find out why it's taking so long. >From nunki to nunki is basically zero hop, so it should be fast! May be your node is sleeping when it should not?! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 520.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 24 19:55:02 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAP3t2wT006356 for ; Mon, 24 Nov 2008 19:55:02 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAP3rXTT032153 for ; Mon, 24 Nov 2008 19:53:33 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.14.2/8.14.1/Submit) id mAP3rXHM032152 for cs551@merlot; Mon, 24 Nov 2008 19:53:33 -0800 Date: Mon, 24 Nov 2008 19:53:33 -0800 From: Bill Cheng Message-Id: <200811250353.mAP3rXHM032152@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Updated statistics for final project part (1)... Hi, Someone is asking about the updated statistics for final project part (1). This is the latest: Count = 50 Avg = 60.94 StdDev = 41.25 Max = 115.00 Min = 1.00 9 110+ XXXXXXXXX 2 105+ XX 2 100+ XX 0 95+ 4 90+ XXXX 0 85+ 2 80+ XX 3 75+ XXX 4 70+ XXXX 1 65+ X 0 60+ 1 55+ X 1 50+ X 1 45+ X 2 40+ XX 3 35+ XXX 0 30+ 0 25+ 4 20+ XXXX 1 15+ X 0 10+ 0 5+ 10 0+ XXXXXXXXXX The average has gone up 3 points (out of 115). -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 519.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 24 14:08:33 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAOM8WXo003977 for ; Mon, 24 Nov 2008 14:08:32 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAOM70OW029878 for ; Mon, 24 Nov 2008 14:07:00 -0800 Message-Id: <200811242207.mAOM70OW029878@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Project 2 Date: Mon, 24 Nov 2008 14:07:00 -0800 From: Bill Cheng Someone wrote: > For deleting files is it ok to use either unlink() or remove(), or any > specific function. You can use unlink(). I'm not familiar with remove(). -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 518.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 24 10:54:42 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAOIsgQm002538 for ; Mon, 24 Nov 2008 10:54:42 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAOIr7uR016464 for ; Mon, 24 Nov 2008 10:53:07 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.14.2/8.14.1/Submit) id mAOIr73t016463 for cs551@merlot; Mon, 24 Nov 2008 10:53:07 -0800 Date: Mon, 24 Nov 2008 10:53:07 -0800 From: Bill Cheng Message-Id: <200811241853.mAOIr73t016463@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Two points about final project part (2)... Hi everyone, 1) Grading for part (2) *will* follow the grading guidelines! So, if you have not tried out the grading guidelines yet, I strongly urge that you try it out as soon as possible! 2) Those of you who declared that you have a partner for part (1) only must send in new commitment e-mails even if you have the same partner for part (2). If you have a new partner for part (2), please make sure that you have sent in commitment e-mail before the submission deadline of part (2). Please see: http://merlot.usc.edu/cs551-f08/projects.html#group -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 517.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Nov 23 22:22:04 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAO6M4Rl024269 for ; Sun, 23 Nov 2008 22:22:04 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAO6KLGN031451 for ; Sun, 23 Nov 2008 22:20:21 -0800 Message-Id: <200811240620.mAO6KLGN031451@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551: Final Project 2 : FileID Date: Sun, 23 Nov 2008 22:20:21 -0800 From: Bill Cheng Someone wrote: > The Spec says: > "A FileID distinguishes one copy of X from another copy of X. Since FileID > only matters when a user enters a get user > command, > you only need to create a FileID if a corresponding search reply was > created. " > But is it okay if we create the fileID every time we store a file in > SERVANT? Sure! I've mentioned that in my message with timestamp "Sat 22 Nov 08:31". > so say when i receive a store request and if i am caching that file, can i > generate a file id for that file ? or is the above statement a strict > constraint ? You can do it either way. > Also, the one time password, is also to be created everytime we store a file > in permanent or cache space ? > when can be a scenario where we dont create a one time password ? Only when you *initiate* a STORE, you need to create a one-time password. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 516.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Nov 23 21:18:41 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAO5If7A023804 for ; Sun, 23 Nov 2008 21:18:41 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAO5GvxW031013 for ; Sun, 23 Nov 2008 21:16:57 -0800 Message-Id: <200811240516.mAO5GvxW031013@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Regarding status -files Date: Sun, 23 Nov 2008 21:16:57 -0800 From: Bill Cheng Someone wrote: > I have a question regarding status -files. When status response is sent > to the node who initiated the request, should the sender send the > metadata of the files which are there in cache? Or it should just send > the metadata of the files which are there in permanent storage > (excluding cache)? Both types. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 515.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Nov 23 19:59:41 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAO3xfZ7023222 for ; Sun, 23 Nov 2008 19:59:41 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAO3vu1J029823 for ; Sun, 23 Nov 2008 19:57:56 -0800 Message-Id: <200811240357.mAO3vu1J029823@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Project 2 Date: Sun, 23 Nov 2008 19:57:56 -0800 From: Bill Cheng Someone wrote: > So is it fine if I create a nonce index as well? Sure! You can have any additional index structures and files as you see fit. But since you already have a SHA1 index and a FileName index and either SHA1 or FileName will be available, there is really no need to create a Nonce index. It's just one extra data structure to keep track of. -- Bill Cheng // bill.cheng@usc.edu On Sun, Nov 23, 2008 at 7:50 PM, Bill Cheng wrote: > Someone wrote: > > > Continuing from the message below: > > Wouldn't nonce be enough to identify a file uniquely? > > Yes, unless there are some strange bugs that caused > non-unique nonces to be greated. Anyway, you should > check FileName, SHA1, and Nonce. > > Since there is no index for nonces, you should use > the SHA1 index or the FileName index to search. > -- > Bill Cheng // bill.cheng@usc.edu > > > > > On Sun, Nov 23, 2008 at 3:47 PM, Bill Cheng > wrote: > > > Someone wrote: > > > > > > > The format for delete command is 'delete FileName=foo SHA1=6b6c... > > > > Nonce=fe18..' . Are all the 3 arguments mandatory and shud be in > this > > > fixed > > > > order ? > > > > > > All are mandatory. Given our rules of not keeping files > > > with duplicate FileName, SHA1, *and* Nonce, this should > > > match at most one file in your mini-filesystem. > > > -- > > > Bill Cheng // bill.cheng@usc.edu http://merlot.usc.edu/william/usc/> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 514.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Nov 23 19:52:24 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAO3qOFu023138 for ; Sun, 23 Nov 2008 19:52:24 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAO3od2u029511 for ; Sun, 23 Nov 2008 19:50:39 -0800 Message-Id: <200811240350.mAO3od2u029511@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Project 2 Date: Sun, 23 Nov 2008 19:50:39 -0800 From: Bill Cheng Someone wrote: > Continuing from the message below: > Wouldn't nonce be enough to identify a file uniquely? Yes, unless there are some strange bugs that caused non-unique nonces to be greated. Anyway, you should check FileName, SHA1, and Nonce. Since there is no index for nonces, you should use the SHA1 index or the FileName index to search. -- Bill Cheng // bill.cheng@usc.edu > On Sun, Nov 23, 2008 at 3:47 PM, Bill Cheng wrote: > > Someone wrote: > > > > > The format for delete command is 'delete FileName=foo SHA1=6b6c... > > > Nonce=fe18..' . Are all the 3 arguments mandatory and shud be in this > > fixed > > > order ? > > > > All are mandatory. Given our rules of not keeping files > > with duplicate FileName, SHA1, *and* Nonce, this should > > match at most one file in your mini-filesystem. > > -- > > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 513.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Nov 23 19:50:16 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAO3oGud023110 for ; Sun, 23 Nov 2008 19:50:16 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAO3mU6x029482 for ; Sun, 23 Nov 2008 19:48:30 -0800 Message-Id: <200811240348.mAO3mU6x029482@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: LRU Date: Sun, 23 Nov 2008 19:48:30 -0800 From: Bill Cheng Someone wrote: > LRU is updated everytime we access a file. > Please correct me if I am wrong here: We should update LRU everytime we > search on a file and everytime we are sending a get response? Please see slide 17 of lecture 18. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 512.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Nov 23 19:48:50 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAO3moIk023081 for ; Sun, 23 Nov 2008 19:48:50 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAO3l540029449 for ; Sun, 23 Nov 2008 19:47:05 -0800 Message-Id: <200811240347.mAO3l540029449@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Reset Question Date: Sun, 23 Nov 2008 19:47:05 -0800 From: Bill Cheng Someone wrote: > What all has to happen when we use the 'reset' switch? > > 1. On startup, delete all the previously cached and permanent files, index > files, .. (Should we also delete the initNeighborList at this stage? Yes. > If yes, the nonBeacon Nodes donot have the initNeighbor Information..) Correct. > 2. Before shutdown, delete log file and initNeighborList. No. If your program is started with the -reset commandline argument, you do all your deletes *before* you do anything else. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 511.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Nov 23 16:37:33 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAO0bXXd021668 for ; Sun, 23 Nov 2008 16:37:33 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAO0ZkIq027894 for ; Sun, 23 Nov 2008 16:35:46 -0800 Message-Id: <200811240035.mAO0ZkIq027894@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Bit Vector Date: Sun, 23 Nov 2008 16:35:46 -0800 From: Bill Cheng Someone wrote: > When we read the bit-vector from the metadata file, we need to convert the > 256 byte bit-vector string to its 128 byte binary equivalent to store it in > the index structure. We are having trouble with that. How should we go about > doing that? If you can convert a 40 byte ASCII representation of SHA1 to a 20 byte binary data, you can use the same thing with the bit-vector. Please see my message with timestamp "Sun 16 Nov 10:56". -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 510.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Nov 23 16:06:10 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAO06AMN021447 for ; Sun, 23 Nov 2008 16:06:10 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAO04NoN027302 for ; Sun, 23 Nov 2008 16:04:23 -0800 Message-Id: <200811240004.mAO04NoN027302@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: lru Date: Sun, 23 Nov 2008 16:04:23 -0800 From: Bill Cheng Someone wrote: > should the LRU list be added from the end or from the front. Depends on how you remove things from the list. > for test case 2(c) > node *01 and node *02 should have at most two of these files > > -- so will these be f1.wav and f7.wav > or f6.wav and f7.wav You should remove the file that was Least Recently Used! You should justify that you are doing things correctly! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 509.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Nov 23 16:03:34 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAO03YXc021409 for ; Sun, 23 Nov 2008 16:03:34 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAO01kRq027265 for ; Sun, 23 Nov 2008 16:01:46 -0800 Message-Id: <200811240001.mAO01kRq027265@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: doubt regarding caching Date: Sun, 23 Nov 2008 16:01:46 -0800 From: Bill Cheng Someone wrote: > According to the LRU algorithm, if a file has to be removed from the cache , > it should be the one that has not been accessed yet. i.e that has not come > up as a result of a search request yet. Not quite. LRU stands for Least Recently Used. > Now if a new file has to be cached > and none of the already cached files have yet been accessed using search. In > this case, which file should we remove? should we remove the cached file > that was cached least recently? You should removed the file in the cache that's Least Recently Used. When you put a file in the cache, it's the first time the file was *used*. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 508.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Nov 23 15:49:33 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mANNnXZL021277 for ; Sun, 23 Nov 2008 15:49:33 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mANNljiR027077 for ; Sun, 23 Nov 2008 15:47:45 -0800 Message-Id: <200811232347.mANNljiR027077@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Project 2 Date: Sun, 23 Nov 2008 15:47:45 -0800 From: Bill Cheng Someone wrote: > The format for delete command is 'delete FileName=foo SHA1=6b6c... > Nonce=fe18..' . Are all the 3 arguments mandatory and shud be in this fixed > order ? All are mandatory. Given our rules of not keeping files with duplicate FileName, SHA1, *and* Nonce, this should match at most one file in your mini-filesystem. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 507.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Nov 23 15:46:51 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mANNkpb6021248 for ; Sun, 23 Nov 2008 15:46:51 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mANNj3ln027010 for ; Sun, 23 Nov 2008 15:45:03 -0800 Message-Id: <200811232345.mANNj3ln027010@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Project 2 Date: Sun, 23 Nov 2008 15:45:03 -0800 From: Bill Cheng Someone wrote: > If you receive a msg with a ttl of 0 you do not forward it, but would you > respond to it. In other words if the ttl is 0 does that mean the msg is not > examined at all? You should never receive a message with TTL of 0. If you get a message with TTL of 0, you can just drop it and pretend that you've never seen it. Recall that messages such as KeepAlive has a TTL of 1. After you've received it, you decrement TTL and get 0 and you don't forward it. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 506.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Nov 23 09:11:20 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mANHBKHg016926 for ; Sun, 23 Nov 2008 09:11:20 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mANH9S51023787 for ; Sun, 23 Nov 2008 09:09:28 -0800 Message-Id: <200811231709.mANH9S51023787@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Project 2 Date: Sun, 23 Nov 2008 09:09:28 -0800 From: Bill Cheng Someone wrote: > I noticed that there is no Retry key in the test data .ini files....and the > default retry value is 30 sec. I was wondering if that is what we want > because it might slow down testing quit a bit, right? Hmm... I cannot think of a case where it would. Could you give me an example? -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 505.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Nov 23 09:07:28 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mANH7SqY016884 for ; Sun, 23 Nov 2008 09:07:28 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mANH5ZIk023693 for ; Sun, 23 Nov 2008 09:05:35 -0800 Message-Id: <200811231705.mANH5ZIk023693@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Query on Delete Date: Sun, 23 Nov 2008 09:05:35 -0800 From: Bill Cheng Someone wrote: > I was just wondering the use of password for deleting a file. The > spec says, when we dont have a password for a particular file > then we should just generate one and flood the message. Here no > node will actually do anything as the nonce using this new > password will not match the nonce of the file. So we are just > wasting bandwidth when we can actually do a check at the node > where the delete command is called upon. > > Is there any significance for using the random password like > anonymity ? Please see my message (4th answer) with timestamp "Fri 14 Nov 13:02". -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 504.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Nov 23 09:02:06 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mANH2619016842 for ; Sun, 23 Nov 2008 09:02:06 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mANH0Dav023616 for ; Sun, 23 Nov 2008 09:00:13 -0800 Message-Id: <200811231700.mANH0Dav023616@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Regarding Deleting files from cache and Get response message Date: Sun, 23 Nov 2008 09:00:13 -0800 From: Bill Cheng Someone wrote: > Do we need to separate permanent storage with cache storage physically. To separage them physically is not a good idea. > For example, under files directory, it has 1,2,3,4,5 files, and 1,3,5 > are in permanent, 2,4 are in cache. It has a file says: "permanent: 1 3 > 5; cache: 2 4". Is it OK? Of course. It's up to you. My suggestion is that since your LRU file says "4 2" or "2 4", you can just use that. Everything on the LRU is in cache. Everything not on the LRU is in perm storage. > If it moves 2 to permanent, the file will change to "permanent: 1 2 3 5; > cache: 4". Correct? That's fine. -- Bill Cheng // bill.cheng@usc.edu Bill Cheng wrote: > Someone wrote: > > > We are maintaining a separate directory for cache. > > Now to maintain the size of the cache we need to delete the LRU files from > > the cache. > > So while deleting should we delete the meta as well as the data file from > > the cache? > > Of course! > > > Suppose there are three nodes > > A-----------> B--------------------> C > > > > A sends a search which gets flooded to B and C. Now after the search > > responses are received, A sends the get request for a file on C. > > Does node B have to cache the file? > > Depends on CacheProb. > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 503.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Nov 23 08:58:59 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mANGwxE5016801 for ; Sun, 23 Nov 2008 08:58:59 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mANGv7tH023581 for ; Sun, 23 Nov 2008 08:57:07 -0800 Message-Id: <200811231657.mANGv7tH023581@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Store Prob. and cache Date: Sun, 23 Nov 2008 08:57:07 -0800 From: Bill Cheng Someone wrote: > When a node receiving a store message decides to store it, then it > checks for available cache size. > Will there be a case when even after emptying the cache, the file is not > able to be stored in the cache. If you are asking if it's every possible, then the answer is of course yes. If you are asking about grading, please see the grading guidelines > if YES, then we should discard the file. After discarding the file, do > we still forward the store message ? The flooding behavior is independent of whether there is space to cache on this node. > In get, an intermediate node calculates cache prob to store the file in > its cache. If it decides not to store the file, then will it forward the > file or not forward it (like storeprob)? The forwading behavior is independent of whether there is space to cache on this node. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 502.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Nov 22 20:54:11 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAN4sBR7008516 for ; Sat, 22 Nov 2008 20:54:11 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAN4qAnd016850 for ; Sat, 22 Nov 2008 20:52:11 -0800 Message-Id: <200811230452.mAN4qAnd016850@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Project 2 Date: Sat, 22 Nov 2008 20:52:10 -0800 From: Bill Cheng Someone wrote: > In the grding guidelines why do you mention that cache probaility is > useless for beacon-only networks? Because all nodes are connected to each other directly, So, if a node sees an indirect message, it's *most likely* a duplicate message will get dropped. As a result, the GET response will only travel one hop. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 501.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Nov 22 20:43:51 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAN4hoU6008429 for ; Sat, 22 Nov 2008 20:43:50 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAN4foQC016736 for ; Sat, 22 Nov 2008 20:41:50 -0800 Message-Id: <200811230441.mAN4foQC016736@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Question regarding get response Date: Sat, 22 Nov 2008 20:41:50 -0800 From: Bill Cheng Someone wrote: > In this mail, I meant that a node initiating a search and get upon > receiving the get response, stores the file in the cwd. > My question is that, along with storing the file in its cwd, should it > also store the file in its cache or permanent storage? Please see slide 16 of lecture 18. -- Bill Cheng // bill.cheng@usc.edu Bill Cheng wrote: > Someone wrote: > > > 1) Whenever a node gets a get response, should it store the file in its > > cache too(with the cache prob) along with saving it in its cwd? > > I assume you are talkinag the case where this node did not > initiate the GET request. Then the situation is the same > as a node who did not initiate a STORE request. Please see > my message with timestamp "Wed 19 Nov 19:54". > > > 2) If the file was in the cache of the node that initiated the get and > > search, should it be copied to its permanent folder too? > > Please read the "Additional Notes on File Retrieval (for Part > 2 only)" section of the spec. > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 500.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Nov 22 20:37:30 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAN4bU3N008376 for ; Sat, 22 Nov 2008 20:37:30 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAN4ZTXF016637 for ; Sat, 22 Nov 2008 20:35:29 -0800 Message-Id: <200811230435.mAN4ZTXF016637@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551: Final Project 2 : Search and Get commands Date: Sat, 22 Nov 2008 20:35:29 -0800 From: Bill Cheng Someone wrote: > this is the sequence of commands i meant in the previous case: > > servant:XXXXX> search filename=foo > /* > search results, 1,2,3... > */ > servant:XXXXX> gte 2 > /* > error message, as its a wrong input > */ > servant:XXXXX> get 2 > > what would be the behaviour now ? If you've made a typo in your command, it should be treated as if you have never entered the command. Your user interface should have a state, which can be the last valid command that was processed. -- Bill Cheng // bill.cheng@usc.edu On Fri, Nov 21, 2008 at 8:37 AM, Bill Cheng wrote: > Someone wrote: > > > we have the following: > > "Please note that a get command should not be allowed if it does not > > immediately follow a search or a get command." > > > > now, if a user performs the following at the prompt, should it be > allowed or > > not ? > > > > servant:XXXXX> search filename=foo > > /* > > search results, 1,2,3... > > */ > > servant:XXXXX> get 2 > > /* > > error message, as its a wrong input > > */ > > servant:XXXXX> get 2 > > > > should the last get command be processed ? > > I don't know why you said that the first "get 2" has a "wrong input". > > If the first "get 2" was successful, then for the 2nd "get 2", > you should follow the first bullet in the "Additional Notes > on File Retrieval (for Part 2 only)" section of the spec. > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 499.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Nov 22 08:36:22 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAMGaMVY003034 for ; Sat, 22 Nov 2008 08:36:22 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAMGYDrc011925 for ; Sat, 22 Nov 2008 08:34:13 -0800 Message-Id: <200811221634.mAMGYDrc011925@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: BitVector In-reply-to: <200811221538.mAMFc7gJ011102@bourbon.usc.edu> References: <200811221538.mAMFc7gJ011102@bourbon.usc.edu> Comments: In-reply-to Bill Cheng message dated "Sat, 22 Nov 2008 07:38:07 -0800." Date: Sat, 22 Nov 2008 08:34:13 -0800 From: Bill Cheng Sorry, I meant to say "that *could* just mean that the same mistake was made". Of course, it's possible that I have made a mistake. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Sat, 22 Nov 2008 07:38:07 -0800 From: Bill Cheng To: cs551@merlot.usc.edu Subject: Re: BitVector Someone wrote: > I get the same bit vector as the ones in the grading guidelines. That would just mean that the same mistake was made! By evidence, I meant you need to tell me which bit is wrong and why it is wrong! For example, start with one word, show me all your calculation in the same way as: http://merlot.usc.edu/cs551-f08/projects/final.html#bitvecex -- Bill Cheng // bill.cheng@usc.edu On Fri, Nov 21, 2008 at 9:58 PM, Bill Cheng wrote : > Someone wrote: > > > For file v.gif with keywords : desc viterbi usc gif we get bitvector > > > > > Bit-vector=00000000000000000000000000200000000000000000000000000000000000 000000000000000000 > > > 2008000000000000000000000000000000040000000000000000000000000000000000000 000000000000000000 > > > 0400008000000000000000000000000000000000000000000000000000000001000000000 000000000000 > > > > > > while the grading guidelines says > > > > Bit-vector= \ > > 0000000000000000000000002000000000000000000000 \ > > 0000000000000000000000000000002008000000000000 \ > > 0000000000000000040000000000000000000000000000 \ > > 0000000000000000000000000040000800000000000000 \ > > 0000000000000000000000000000000000000000c00000 \ > > 00000000000000 > > > > Kindly confirm which one is correct. > > Ref: test case A 3 > > If you think my solution is incorrect, please provide > some evidence! > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 498.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Nov 22 08:35:04 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAMGZ4cL003007 for ; Sat, 22 Nov 2008 08:35:04 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAMGWuYl011853 for ; Sat, 22 Nov 2008 08:32:56 -0800 Message-Id: <200811221632.mAMGWuYl011853@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: About search response Date: Sat, 22 Nov 2008 08:32:56 -0800 From: Bill Cheng Someone wrote: > If a node gets a search request and doesn't have the file, it should > send a search response with no information *about files*? Or it should > not send search response at all? Please see: http://merlot.usc.edu/cs551-f08/projects/final2-faq.html#no_hit -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 497.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Nov 22 08:33:51 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAMGXpfS002920 for ; Sat, 22 Nov 2008 08:33:51 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAMGVgk7011805 for ; Sat, 22 Nov 2008 08:31:42 -0800 Message-Id: <200811221631.mAMGVgk7011805@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: About FileID Date: Sat, 22 Nov 2008 08:31:42 -0800 From: Bill Cheng Someone wrote: > When a node receive a search request and find it has the file, it > generate a FileID for the file and send a search response back. It > should remember the FileID so if it receive a get msg later, it can send > the file back. My question is, "how long will it keep the FileID? " Forever! Well, until the node goes down since this only has to be an in-memory data structure. > Basically, the question is same as "if later another node send a search > request for the same file, would it generate another FileID, or just use > the one it has used before?" (If it's the second case, I guess we should > save the FileID as a file) You can use the same FileID as the one in your in-memory data structure. It's also perfectly valid to have a permanent FileID. When you decide to keep a file in your mini-filesystem, you can generate a random FileID and store it in #.fileid. The important thing for a FileID is that it's unique network-wide so you only retrieve one file when you do a GET. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 496.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Nov 22 08:30:16 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAMGUGqt002837 for ; Sat, 22 Nov 2008 08:30:16 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAMGS7Zg011733 for ; Sat, 22 Nov 2008 08:28:07 -0800 Message-Id: <200811221628.mAMGS7Zg011733@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Get messgae message lifetime Date: Sat, 22 Nov 2008 08:28:07 -0800 From: Bill Cheng Someone wrote: > What is the message lifetime for a get mesasge ? > Moreover, how long should a user wait to get a get response ? GetMsgLifetime. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 495.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Nov 22 08:29:28 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAMGTSfa002808 for ; Sat, 22 Nov 2008 08:29:28 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAMGRJnE011701 for ; Sat, 22 Nov 2008 08:27:19 -0800 Message-Id: <200811221627.mAMGRJnE011701@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Get Flood Date: Sat, 22 Nov 2008 08:27:19 -0800 From: Bill Cheng Someone wrote: > When get message is flooded, suppose a node gets the message and > identifies the fileid and sha1 as being the ones that belong to a file > it has, then should it send the get response and not flood the request > or should it still flood the request message. It should continue to flood the GET request for the reason of plausible deniability. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 494.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Nov 22 08:27:24 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAMGROni002778 for ; Sat, 22 Nov 2008 08:27:24 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAMGPFC7011652 for ; Sat, 22 Nov 2008 08:25:15 -0800 Message-Id: <200811221625.mAMGPFC7011652@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Question regarding get response Date: Sat, 22 Nov 2008 08:25:15 -0800 From: Bill Cheng Someone wrote: > 1) Whenever a node gets a get response, should it store the file in its > cache too(with the cache prob) along with saving it in its cwd? I assume you are talkinag the case where this node did not initiate the GET request. Then the situation is the same as a node who did not initiate a STORE request. Please see my message with timestamp "Wed 19 Nov 19:54". > 2) If the file was in the cache of the node that initiated the get and > search, should it be copied to its permanent folder too? Please read the "Additional Notes on File Retrieval (for Part 2 only)" section of the spec. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 493.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Nov 22 08:16:32 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAMGGW34002669 for ; Sat, 22 Nov 2008 08:16:32 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAMGENkS011538 for ; Sat, 22 Nov 2008 08:14:23 -0800 Message-Id: <200811221614.mAMGENkS011538@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: BitVector Date: Sat, 22 Nov 2008 08:14:23 -0800 From: Bill Cheng Someone wrote: > If thats the case I guess something is wrong with my code. > I was getting correct bitvector for all the cases except this > one. Just wanted to verify the rite answer. > Sorry for any confusion and inconvinience. Well, let's take the first word "desc" as an example. echo -n "desc" | openssl md5 returns 1dee80c7d5ab2c1c90aa8d2f7dd47256. The last 9 bits is 0x056. 0x056 equals 86. Each character in the bit-vector represents 4 bits. So, 86 = 4*21 + 2. So, if you count from the right, you need to skip 21 characters. Now, if the remainder was zero, then the corresponding character in the bit-vector would be have the "1" position set. You have a "1" there. Since the remainer is 2, the corresponding character in the bit-vector should have the "4" position set (1 shifted to the left by 2 bit positions). I have a "c" there. So, the "4" bit is set. -- Bill Cheng // bill.cheng@usc.edu ________________________________ From: Bill Cheng To: cs551@merlot.usc.edu Sent: Friday, November 21, 2008 9:58:47 PM Subject: Re: BitVector Someone wrote:   > For file v.gif with keywords : desc viterbi usc gif we get bitvector   >   > Bit-vector=00000000000000000000000000200000000000000000000000000000000000000000000000000000   > 2008000000000000000000000000000000040000000000000000000000000000000000000000000000000000000   > 0400008000000000000000000000000000000000000000000000000000000001000000000000000000000   >   >   > while the grading guidelines says   >   > Bit-vector= \   >  0000000000000000000000002000000000000000000000 \   >  0000000000000000000000000000002008000000000000 \   >  0000000000000000040000000000000000000000000000 \   >  0000000000000000000000000040000800000000000000 \   >  0000000000000000000000000000000000000000c00000 \   >  00000000000000   >   > Kindly confirm which one is correct.   > Ref: test case A 3 If you think my solution is incorrect, please provide some evidence! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 492.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Nov 22 07:40:16 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAMFeGQn002320 for ; Sat, 22 Nov 2008 07:40:16 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAMFc7gJ011102 for ; Sat, 22 Nov 2008 07:38:07 -0800 Message-Id: <200811221538.mAMFc7gJ011102@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: BitVector Date: Sat, 22 Nov 2008 07:38:07 -0800 From: Bill Cheng Someone wrote: > I get the same bit vector as the ones in the grading guidelines. That would just mean that the same mistake was made! By evidence, I meant you need to tell me which bit is wrong and why it is wrong! For example, start with one word, show me all your calculation in the same way as: http://merlot.usc.edu/cs551-f08/projects/final.html#bitvecex -- Bill Cheng // bill.cheng@usc.edu On Fri, Nov 21, 2008 at 9:58 PM, Bill Cheng wrote: > Someone wrote: > > > For file v.gif with keywords : desc viterbi usc gif we get bitvector > > > > > Bit-vector=00000000000000000000000000200000000000000000000000000000000000000000000000000000 > > > 2008000000000000000000000000000000040000000000000000000000000000000000000000000000000000000 > > > 0400008000000000000000000000000000000000000000000000000000000001000000000000000000000 > > > > > > while the grading guidelines says > > > > Bit-vector= \ > > 0000000000000000000000002000000000000000000000 \ > > 0000000000000000000000000000002008000000000000 \ > > 0000000000000000040000000000000000000000000000 \ > > 0000000000000000000000000040000800000000000000 \ > > 0000000000000000000000000000000000000000c00000 \ > > 00000000000000 > > > > Kindly confirm which one is correct. > > Ref: test case A 3 > > If you think my solution is incorrect, please provide > some evidence! > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 491.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Nov 21 22:07:43 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAM67giQ029645 for ; Fri, 21 Nov 2008 22:07:42 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAM65RIS007041 for ; Fri, 21 Nov 2008 22:05:27 -0800 Message-Id: <200811220605.mAM65RIS007041@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Regarding Deleting files from cache and Get response message Date: Fri, 21 Nov 2008 22:05:27 -0800 From: Bill Cheng Someone wrote: > We are maintaining a separate directory for cache. > Now to maintain the size of the cache we need to delete the LRU files from > the cache. > So while deleting should we delete the meta as well as the data file from > the cache? Of course! > Suppose there are three nodes > A-----------> B--------------------> C > > A sends a search which gets flooded to B and C. Now after the search > responses are received, A sends the get request for a file on C. > Does node B have to cache the file? Depends on CacheProb. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 490.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Nov 21 22:05:28 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAM65ROT029617 for ; Fri, 21 Nov 2008 22:05:27 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAM63CKc007000 for ; Fri, 21 Nov 2008 22:03:12 -0800 Message-Id: <200811220603.mAM63CKc007000@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Doubt with storing files Date: Fri, 21 Nov 2008 22:03:12 -0800 From: Bill Cheng Someone wrote: > In the case when a file exists and we try to overwrite it after asking the > user, instead of the original file being overwritten we get a new copy of > the file with an additional "?" appended to the original filename. > For eg. if "foo.wav" exists and we try to overwrite "foo.wav", instead of > "foo.wav" being overwritten, we get a copy of foo.wav stored as "foo.wav?". > When we compute the Sha1 hash of the file "foo.wav?" using the "openssl sha1 > foo1.wav"? command, the sha1 hash has the same value with the output > displayed as Sha1(foo.wav) and not Sha1(foo.wav?). Any clue on why the "?" > is being appended at the end? A bug?! Did you go into the debugger and see exactly what filename you are writing to? -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 489.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Nov 21 22:01:03 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAM6134j029577 for ; Fri, 21 Nov 2008 22:01:03 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAM5wlh6006921 for ; Fri, 21 Nov 2008 21:58:47 -0800 Message-Id: <200811220558.mAM5wlh6006921@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: BitVector Date: Fri, 21 Nov 2008 21:58:47 -0800 From: Bill Cheng Someone wrote: > For file v.gif with keywords : desc viterbi usc gif we get bitvector > > Bit-vector=00000000000000000000000000200000000000000000000000000000000000000000000000000000 > 2008000000000000000000000000000000040000000000000000000000000000000000000000000000000000000 > 0400008000000000000000000000000000000000000000000000000000000001000000000000000000000 > > > while the grading guidelines says > > Bit-vector= \ > 0000000000000000000000002000000000000000000000 \ > 0000000000000000000000000000002008000000000000 \ > 0000000000000000040000000000000000000000000000 \ > 0000000000000000000000000040000800000000000000 \ > 0000000000000000000000000000000000000000c00000 \ > 00000000000000 > > Kindly confirm which one is correct. > Ref: test case A 3 If you think my solution is incorrect, please provide some evidence! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 488.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Nov 21 20:36:22 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAM4aMMD028994 for ; Fri, 21 Nov 2008 20:36:22 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAM4Y5Zv005614 for ; Fri, 21 Nov 2008 20:34:05 -0800 Message-Id: <200811220434.mAM4Y5Zv005614@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Doubt regarding file storages Date: Fri, 21 Nov 2008 20:34:05 -0800 From: Bill Cheng Someone wrote: > I have a few questions regarding the storage of files: > > 1) Whenever a store is given, we store the files in the mini-filesystem as > #.meta and #.data. These files are called the "cached" files right ? You need to follow the rules to determine if they are in the cache or in permanent storage. We have many many postings talking about this issue. > In the > single beacon node case, should we "always" store the file or is it also > dependent on the "StoreProb" ? Please just following the protocol! If the protocol doesn't say anything about if a node is a beacon node, then it applies to all nodes. > 2) Suppose the user enters "get 3" and it turns out that the filename is > "chess.jpg". This has to be stored in the CWD right ? Please see my message with timestamp "Wed 19 Nov 10:05". > 3) Also, its mentioned in the spec that if the file "chess.jpg" already > exists, we must ask the user if he wants to replace it. Now what would > happen if this newer version of chess.jpg we want to store is actually a > different file with a different "sha1" value. Should we still over write it > and store it in our CWD anyway ? If the user says yes, you should overwrite it. (If you want to help the user out by providing more information, you can print the old filesize and new filesize. But this is not required.) -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 487.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Nov 21 20:31:42 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAM4VgHg028939 for ; Fri, 21 Nov 2008 20:31:42 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAM4TQAW005556 for ; Fri, 21 Nov 2008 20:29:26 -0800 Message-Id: <200811220429.mAM4TQAW005556@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Final project part2: Reset Question Date: Fri, 21 Nov 2008 20:29:26 -0800 From: Bill Cheng Someone wrote: > In case of reset do we need to delete the mini file system also or we should > not touch the file system. You should delete all files in the mini-filesystem. Although you don't need to delete the "files" directory. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 486.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Nov 21 20:30:35 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAM4UZkg028926 for ; Fri, 21 Nov 2008 20:30:35 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAM4SIFI005528 for ; Fri, 21 Nov 2008 20:28:18 -0800 Message-Id: <200811220428.mAM4SIFI005528@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: 551 - GET Date: Fri, 21 Nov 2008 20:28:18 -0800 From: Bill Cheng Someone wrote: > 1) If there is *only* 1 node then "search" can be terminated after > displaying the results right? Correct. This node knows that it has no neighbors, so it knows that nothing was flooded. But if you don't want to do anything special and wait for the some timer to expire, that would be fine too. > 2) The spec says: > Please note that a get command should not be allowed if it does not > immediately follow a search or a get command. > > What if the search does not return any results?, and the user types "get 1 > file" > Should I say "get not allowed"? > or Should I say "incorrect file id 1"? > > I feel the first one is correct. You should say something like "Search result set was empty. There is nothing to GET" or "Search result set was empty. [1] was not a valid file identifier." -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 485.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Nov 21 18:26:36 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAM2Qa5G028004 for ; Fri, 21 Nov 2008 18:26:36 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAM2OIio004232 for ; Fri, 21 Nov 2008 18:24:18 -0800 Message-Id: <200811220224.mAM2OIio004232@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Project 2 Date: Fri, 21 Nov 2008 18:24:18 -0800 From: Bill Cheng Someone wrote: > Do we have to prompt the user to create a random password even if > that file does not exist? Please see my message with timestamp "Fri 21 Nov 13:42". -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 484.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Nov 21 18:25:29 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAM2PTjO027976 for ; Fri, 21 Nov 2008 18:25:29 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAM2NASt004205 for ; Fri, 21 Nov 2008 18:23:10 -0800 Message-Id: <200811220223.mAM2NASt004205@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Project 2 Date: Fri, 21 Nov 2008 18:23:10 -0800 From: Bill Cheng Someone wrote: > Does deleting a file also involve deleting the metadata files > and its password? Yes. Everything about the file. If you have anything that references the file, the reference should also be deleted. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 483.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Nov 21 18:24:20 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAM2OKuD027962 for ; Fri, 21 Nov 2008 18:24:20 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAM2M23l004173 for ; Fri, 21 Nov 2008 18:22:02 -0800 Message-Id: <200811220222.mAM2M23l004173@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Reg:Keywords Date: Fri, 21 Nov 2008 18:22:02 -0800 From: Bill Cheng Someone wrote: > If keywords in store is specified as follows > cat="blonde mp3" art="yes no" > then should the key words be > 1)cat > 2)blonde > 3)mp3 > 4)art > 5)yes > 6)no Correct. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 482.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Nov 21 13:45:13 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mALLjDlI025855 for ; Fri, 21 Nov 2008 13:45:13 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mALLgqYu002537 for ; Fri, 21 Nov 2008 13:42:52 -0800 Message-Id: <200811212142.mALLgqYu002537@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: random password Date: Fri, 21 Nov 2008 13:42:52 -0800 From: Bill Cheng Someone wrote: > spec says :- If it does not have the corresponding password, it should > prompt the user to see if it is okay to send a delete message based on > the random password > > does this means we prompt for permission to send *random password* > only if we find the file with matching filename,sha1,nonce in our file > system but no .pass file > > or > > do we prompt user for random password even if there was *no matching* > filename,sha1,nonce (i.e. ask for random password in every other case) If the password file/information exists, you do not prompt the user and just flood DELETE messages. If the password file/information does not exist, you prompt the user. If the answer is "yes", you generate a random password and flood that. If the answer is "no", don't do anything. > test case: A > (+2 points) > delete FileName=chess.jpg > SHA1=f7917fe4976d2c24f225bc4b6c2334e554b91c28 > Nonce=8ae005585be9c44ef1910d25dd6f8da58c432ab5 > should prompt the user to see if it's okay to > use a random password, type "yes" > nothing should get deleted, > type "status files 1 00.out", look at "00.out", > there should still be two files > > say now if i enter some non-existant filename, > > SERVANT XXXXX> delete FileName=abcd.xyz SHA1=3a5f........ > should it prompt for random password? No. If you do not have a file that matches the FileName, you cannot even verify that the SHA1 you have entered is correct. So, don't need to prompt. Although you should print an error message because it may be just a typo. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 481.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Nov 21 08:39:36 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mALGdaku023433 for ; Fri, 21 Nov 2008 08:39:36 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mALGbBv6031343 for ; Fri, 21 Nov 2008 08:37:11 -0800 Message-Id: <200811211637.mALGbBv6031343@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551: Final Project 2 : Search and Get commands Date: Fri, 21 Nov 2008 08:37:11 -0800 From: Bill Cheng Someone wrote: > we have the following: > "Please note that a get command should not be allowed if it does not > immediately follow a search or a get command." > > now, if a user performs the following at the prompt, should it be allowed or > not ? > > servant:XXXXX> search filename=foo > /* > search results, 1,2,3... > */ > servant:XXXXX> get 2 > /* > error message, as its a wrong input > */ > servant:XXXXX> get 2 > > should the last get command be processed ? I don't know why you said that the first "get 2" has a "wrong input". If the first "get 2" was successful, then for the 2nd "get 2", you should follow the first bullet in the "Additional Notes on File Retrieval (for Part 2 only)" section of the spec. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 480.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Nov 20 19:04:21 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAL34L37016548 for ; Thu, 20 Nov 2008 19:04:21 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAL31lUT026184 for ; Thu, 20 Nov 2008 19:01:47 -0800 Message-Id: <200811210301.mAL31lUT026184@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Search Response Display Date: Thu, 20 Nov 2008 19:01:47 -0800 From: Bill Cheng Someone wrote: > After getting a search response, is there a tab between the number and > the start of the metadata while displaying the search results: Are you talking about this? [1] FileID=02adefc1dfc97a082fa18a5ef1e8c487259b7fb4 FileName=foo FileSize=123 SHA1=b83a758fecbefcd3ea547fbf0f9a97eba0ea984c Nonce=01b7a1bd6f169dde22518a865ab2f44c70fcab82 Keywords=key1 key2 key3 [2] FileID=45929c03a7c84687a73543cc348484edc3829496 FileName=bar FileSize=4567 SHA1=6b6c5636c484d47599d20191c3023b8a29b2fe11 Nonce=fe1834fdf8cd7356ca11e0c77ac38d387e228f94 Keywords=key4 key5 [3] ... As long as all the keys line up on the left, it doesn't matter if you use a tab or not. If you use space characters, it's fine if everything gets shifted to the right by one character after [10]. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 479.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Nov 20 19:02:01 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAL321Ls016512 for ; Thu, 20 Nov 2008 19:02:01 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAL2xR4Y026147 for ; Thu, 20 Nov 2008 18:59:27 -0800 Message-Id: <200811210259.mAL2xR4Y026147@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: About search and get Date: Thu, 20 Nov 2008 18:59:27 -0800 From: Bill Cheng Someone wrote: > I have a very trivial doubt regarding get response and search. > Whenever a search response is received, then after a get message, the > node gets the file. Now we need to discard the search response list right ? No. You can do multiple GETs. Please see the grading guidelines for examples. > And if the user wnats another file then it needs to initiate the serach > again Right ?. No. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 478.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Nov 20 18:57:17 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAL2vHPu016403 for ; Thu, 20 Nov 2008 18:57:17 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAL2shng025975 for ; Thu, 20 Nov 2008 18:54:43 -0800 Message-Id: <200811210254.mAL2shng025975@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551_Final2_index files Date: Thu, 20 Nov 2008 18:54:43 -0800 From: Bill Cheng Someone wrote: > Why did we add this requirement? [BC: Added 11/19/2008] The > "name_index" and "sha1_index" must be sorted. > > If we arent using the sorting because there is no efficiency > requirement (i.e. they are sorted, but we search linearly) then what is the benefit? Well, I wouldn't say that we have *no* efficiency requirement. They are index files, so they need to resemble some sort of an index. The requirement of using Binary Search Tree has already been relaxed. The *minimum* requirement of having a sorted list is reasonable. I don't think one can get more minimum than this and still call it an index. With a sorted list, the expected time to find an item, I think is 1/3 of the length of the list. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 477.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Nov 20 14:04:19 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAKM4JXJ014017 for ; Thu, 20 Nov 2008 14:04:19 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAKM1flx023598 for ; Thu, 20 Nov 2008 14:01:41 -0800 Message-Id: <200811202201.mAKM1flx023598@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Doubt in Get Request Date: Thu, 20 Nov 2008 14:01:41 -0800 From: Bill Cheng Someone wrote: > So, suppose we have a copy in the files directory as 0.meta and 0.data, and > we request for a copy of the same file from another node, we flood the Get > Request and actually get the file from another node. > > So, now we have another copy as 1.data and 1.meta right?, also all our index > structures will have 2 entries for the same file copies, isnt it? > > Or, are we supposed to just maintain one copy and delete 1.meta and 1.data? The rule is that you must not store two files with the same FileName, SHA1, *and* Nonce in your node, no matter what! > I think, the case should be similar to the one, where we do a GET for the > same fileID twice. Are we supposed to keep both 0.* and 1.* ? > > Also for cached files, if we already have cached a file , we should not > cache it again, even if it passes through once many times. right? You should apply the same rule as above. -- Bill Cheng // bill.cheng@usc.edu On Thu, Nov 20, 2008 at 1:28 PM, Bill Cheng wrote: > Someone wrote: > > > We had a doubt regarding the Get command: > > Suppose, In a get request, we request for a file on another node. But, a > > copy of the same file(Filename, sha1, Nonce) exists on the current node. > > Then, should we just copy the local file, or do we have to flood a get > > request, so that the file becomes popular?? > > You must flood a GET message in this case for the reason you stated. > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 476.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Nov 20 13:31:21 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAKLVLWZ013743 for ; Thu, 20 Nov 2008 13:31:21 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAKLSinI023234 for ; Thu, 20 Nov 2008 13:28:44 -0800 Message-Id: <200811202128.mAKLSinI023234@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Doubt in Get Request Date: Thu, 20 Nov 2008 13:28:44 -0800 From: Bill Cheng Someone wrote: > We had a doubt regarding the Get command: > Suppose, In a get request, we request for a file on another node. But, a > copy of the same file(Filename, sha1, Nonce) exists on the current node. > Then, should we just copy the local file, or do we have to flood a get > request, so that the file becomes popular?? You must flood a GET message in this case for the reason you stated. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 475.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Nov 20 08:25:21 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAKGPLJR011244 for ; Thu, 20 Nov 2008 08:25:21 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAKGMeKs020277 for ; Thu, 20 Nov 2008 08:22:40 -0800 Message-Id: <200811201622.mAKGMeKs020277@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551_Final2_index files Date: Thu, 20 Nov 2008 08:22:40 -0800 From: Bill Cheng Someone wrote: In previous mail, the result comes from input with: > store usctommy.gif 1 category="picture gif" > store usctommy.gif 1 category="picture gif" > store blondie1.mp3 1 title="Heart of Glass" > store blondie1.mp3 1 title="Heart of Glass" > store chess.jpg 1 categories="audio mp3" artist="Blondie" If I didn't understand spec wrong, these 5 store should all work, right? Don't know! You need to convince yourself if it is correct or not -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 474.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Nov 20 08:23:35 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAKGNYb5011215 for ; Thu, 20 Nov 2008 08:23:34 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAKGKr1e020236 for ; Thu, 20 Nov 2008 08:20:53 -0800 Message-Id: <200811201620.mAKGKr1e020236@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551_Final2_index files Date: Thu, 20 Nov 2008 08:20:53 -0800 From: Bill Cheng Someone wrote: > [BC: Added 11/19/2008] > The "name_index" and "sha1_index" must be sorted. > > I've also updated the grading guidelines to add the sorting > requirement to name_index and sha1_index. > > For sort, I sort name_index by key which is filename, and it looks like > > 1 > blondie1.mp3 > 4 > blondie1.mp3 > 2 > chess.jpg > 3 > usctommy.gif > 5 > usctommy.gif > > and same manner for sha1_index > 3 > 11CDDF2A0378D6A892CF43198847CE379E85D149 > 5 > 11CDDF2A0378D6A892CF43198847CE379E85D149 > 2 > F7917FE4976D2C24F225BC4B6C2334E554B91C28 > 1 > FFD3B197E1C0F0C27E7BDC219F553A3E6B139DFB > 4 > FFD3B197E1C0F0C27E7BDC219F553A3E6B139DFB > > I guess this should be ok, right? You need to have a "conflict resolution chain" in your index. Therefore, I would have: blondie1.mp3,1,4 chess.jpg,2 usctommy.gif,3,5 and: 11CDDF2A0378D6A892CF43198847CE379E85D149,3,5 F7917FE4976D2C24F225BC4B6C2334E554B91C28,2 FFD3B197E1C0F0C27E7BDC219F553A3E6B139DFB,1,4 -- Bill Cheng // bill.cheng@usc.edu > On Wed, Nov 19, 2008 at 10:27 PM, Bill Cheng wrote: > > > Someone wrote: > > > > > Can we simply use structures to store the names,SHA1 values and > > bitvectors > > > of all the files present on a node. > > > Although it is given in the Spec to use linear list and binary search > > tree. > > > Can't we create object of a structure whenever a file gets stored on a > > node > > > and when a search is to be performed, we can search through all the > > objects > > > to find a match. This won't be efficient but atleast correct, Right ? > > > > The spec explicitly asks you to implement these structures. > > To make it even more clear, I've just updated the spec to > > include the following: > > > > [BC: Added 11/19/2008] > > The "name_index" and "sha1_index" must be sorted. > > > > I've also updated the grading guidelines to add the sorting > > requirement to name_index and sha1_index. > > > > > It is given in the spec that 'The file names must be "kwrd_index", " > > > name_index", "sha1_index". These files are disk images of the > > corresponding > > > memory index structures.' > > > Is there any fixed format of how these files should look like ? Or can > > we > > > simply use any format > > > > Correct. > > > > > Like for kwrd_index file, it contains > > > bitvector1 > > > bitvector2 > > > . > > > .. > > > ... > > > bitvectorN > > > > Well, they need to be "correct". In your example, you > > have include at least the corresponding file number. So, > > it can look like the following: > > > > bitvector1 fn1 > > bitvector2 fn2 > > . > > .. > > ... > > bitvectorN fnN > > > > where fn# refers to a file number in the HomeDir/files > > directory. > > > > Similarly, for name_index, you can use an ASCII format > > for it. For example: > > > > filename1,fn11,fn12 > > filename2,fn21,fn22,fn23,fn24 > > . > > .. > > ... > > filenameM,fnM1 > > > > There can be multiple file numbers per filename since > > multiple files may have the same original FileName. > > > > You can also do the same thing for sha1_index. So, they > > are actually quite easy to implement, especially because > > they are not required to be trees! > > -- > > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 473.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Nov 20 08:11:42 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAKGBgd6011058 for ; Thu, 20 Nov 2008 08:11:42 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAKG91sJ020053 for ; Thu, 20 Nov 2008 08:09:01 -0800 Message-Id: <200811201609.mAKG91sJ020053@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551_Final2_index files Date: Thu, 20 Nov 2008 08:09:01 -0800 From: Bill Cheng Someone wrote: > *So name_index should be sorted alphabetically. How will sha1_index be > sorted ? Will it be in the decreasing order of ascii values of SHA1* ? It's up to you. You need to be a little more careful if you store SHA1 in binary. If you use a comma or a tab as a delimeter between fields, it is possible that the SHA1 value may contain this character. So, when you read the sha1_index file, you should read 20 bytes first and then start looking for the delimeter (if you use one). Or you can just have everything in binary. > *Can u give an example.* If you convert the 20-byte SHA1 to all lowercase ASCII (40 characters long), you can just use strcmp(): int result=strcmp(str1, str2); if (result == 0) { /* str1 is the same as str2 */ } else if (result > 0) { /* str1 is "bigger" than str2 */ } else { /* str1 is "smaller" than str2 */ } If you are keeping the SHA1 value binary, you can use memcmp() in a very similar way as above. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 472.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 19 22:40:06 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAK6e6MP005974 for ; Wed, 19 Nov 2008 22:40:06 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAK6bJr9016051 for ; Wed, 19 Nov 2008 22:37:19 -0800 Message-Id: <200811200637.mAK6bJr9016051@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551: Final Project 2 : Filenumber Date: Wed, 19 Nov 2008 22:37:19 -0800 From: Bill Cheng Someone wrote: > as per the naming convnetions, we name the files 1.data, 2.data, 3.data etc. > > now if any of these data files is deleted, are we supposed to reuse that > number ? No. > say if 2.data got deleted (by any means by the program) then are we supposed > to use this number '2' before we use the number '4' ? No. So, somewhere in your mini-filesystem, you should keep information about what's the next number to use. You should at least write out this number when your node gets shutdown. When your node gets restarted again, it should read this file and know what number it should use next. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 471.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 19 22:30:18 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAK6UIRI005867 for ; Wed, 19 Nov 2008 22:30:18 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAK6RUKO015854 for ; Wed, 19 Nov 2008 22:27:30 -0800 Message-Id: <200811200627.mAK6RUKO015854@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551_Final2_index files Date: Wed, 19 Nov 2008 22:27:30 -0800 From: Bill Cheng Someone wrote: > Can we simply use structures to store the names,SHA1 values and bitvectors > of all the files present on a node. > Although it is given in the Spec to use linear list and binary search tree. > Can't we create object of a structure whenever a file gets stored on a node > and when a search is to be performed, we can search through all the objects > to find a match. This won't be efficient but atleast correct, Right ? The spec explicitly asks you to implement these structures. To make it even more clear, I've just updated the spec to include the following: [BC: Added 11/19/2008] The "name_index" and "sha1_index" must be sorted. I've also updated the grading guidelines to add the sorting requirement to name_index and sha1_index. > It is given in the spec that 'The file names must be "kwrd_index", " > name_index", "sha1_index". These files are disk images of the corresponding > memory index structures.' > Is there any fixed format of how these files should look like ? Or can we > simply use any format Correct. > Like for kwrd_index file, it contains > bitvector1 > bitvector2 > . > .. > ... > bitvectorN Well, they need to be "correct". In your example, you have include at least the corresponding file number. So, it can look like the following: bitvector1 fn1 bitvector2 fn2 . .. ... bitvectorN fnN where fn# refers to a file number in the HomeDir/files directory. Similarly, for name_index, you can use an ASCII format for it. For example: filename1,fn11,fn12 filename2,fn21,fn22,fn23,fn24 . .. ... filenameM,fnM1 There can be multiple file numbers per filename since multiple files may have the same original FileName. You can also do the same thing for sha1_index. So, they are actually quite easy to implement, especially because they are not required to be trees! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 470.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 19 22:15:56 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAK6FuLT005661 for ; Wed, 19 Nov 2008 22:15:56 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAK6D8D8015729 for ; Wed, 19 Nov 2008 22:13:08 -0800 Message-Id: <200811200613.mAK6D8D8015729@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Search & Store Date: Wed, 19 Nov 2008 22:13:08 -0800 From: Bill Cheng Someone wrote: > I have a few questions regarding the search/store operations: > > 1) If we type the same store command thrice, would we have multiple > instances of those bitvectors in our index structures, or do we have > to determine if we have already stored that file earlier and discard > it ? Please see my message with timestamp "Sun 16 Nov 20:25". > 2) In keyword based searches, it has been mentioned that the keyword > searches are an "AND" based search. But in the grading guidelines, > consider the following cases: > > 1. store chess.jpg 1 categories="audio mp3" artist="Blondie" > 2. search keywords=mp3 ......... should get a response > > So how is it returning a hit here when it is an "AND" based > search ? Should it return a hit only if all the keywords i.e. > categories audio mp3 artist Blondie are entered ? The "AND" based search applies when you enter multiple keywords *in your search command*. So, if you enter: search keywords="mp3 blondie" you should get a hit. But if you enter: search keywords="mp3 song" you should not get a hit. > 3) Assuming that we get a 'hit' in the second case for 'mp3' , it will > return all the files that has the keyword 'mp3' right ? For a single keyword search, yes. For a two-keyword search, it should return all files that has *both* the keywords. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 469.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 19 21:15:50 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAK5FnBW005227 for ; Wed, 19 Nov 2008 21:15:49 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAK5D0Z9015230; Wed, 19 Nov 2008 21:13:00 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.14.2/8.14.1/Submit) id mAK5D0Ec015229; Wed, 19 Nov 2008 21:13:00 -0800 Date: Wed, 19 Nov 2008 21:13:00 -0800 From: Bill Cheng Message-Id: <200811200513.mAK5D0Ec015229@bourbon.usc.edu> To: cs551@merlot.usc.edu, usc-cs-531@googlegroups.com Subject: Online course evaluation forms for *DEN students* only are available... Hi everyone, The online course evaluations for DEN students are now available. Please check the News (red) section of the class web page and click on a link there. These online evaluations are available for *DEN students only*. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 468.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 19 20:47:54 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAK4ls8R004850 for ; Wed, 19 Nov 2008 20:47:54 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAK4j5Vc014594 for ; Wed, 19 Nov 2008 20:45:05 -0800 Message-Id: <200811200445.mAK4j5Vc014594@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551_Final2_delete Date: Wed, 19 Nov 2008 20:45:05 -0800 From: Bill Cheng Someone wrote: > I have a question about delete message below . > How is the password used since it was not stored anywhere in > metadata or anywhere else when doing a store or a probabilistic > storing/cacheing of a file. So, you must devise a way to store it! For example, you can use 1.password. > Is Nonce not sufficient to implement > a delete since I can push all Nonce's into a list whenever a node > initiates a store command and when it's time to delete, I just > check through the list to see if the nonce in the delete matches > any of the ones I already stored; if it does, I simply delete the > file and flood the message. Then other nodes in the network will be able to delete a file you've stored into the network. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 467.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 19 20:03:51 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAK43p5Z004458 for ; Wed, 19 Nov 2008 20:03:51 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAK4123b014184 for ; Wed, 19 Nov 2008 20:01:02 -0800 Message-Id: <200811200401.mAK4123b014184@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CSCI 551: final project 2 : Doubt in delete Date: Wed, 19 Nov 2008 20:01:02 -0800 From: Bill Cheng Someone wrote: > I am a little confused about delete? If the user entering delete has the one > time password, he should delete the file from the cwd and the > minifilesystem and then flood a delete message. The file in the current working directory should not be deleted. Just the file in the mini-filesystem and flood a DELETE message. > In this case everyone who > receives this message would check the password using SHA1 and the nonce and > it if was correct they would delete the file, if not they would do nothing > and forward it along. Correct. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 466.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 19 19:57:32 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAK3vW2I004399 for ; Wed, 19 Nov 2008 19:57:32 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAK3sg9G014114 for ; Wed, 19 Nov 2008 19:54:42 -0800 Message-Id: <200811200354.mAK3sg9G014114@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551 Final2 - disk quota Date: Wed, 19 Nov 2008 19:54:42 -0800 From: Bill Cheng Someone wrote: > If you receive a store request msg. A file is added to the minifile system > with #.data .meta etc, but no file is added to the cwd correct? Correct. In this case, the job of a node is to cache a copy of the file in the server side of the node. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- From: Bill Cheng [mailto:william@bourbon.usc.edu] Sent: Wednesday, November 19, 2008 10:05 AM To: cs551@merlot.usc.edu Subject: Re: CS551 Final2 - disk quota Someone wrote: > A Get request should place a file in the mini file system, as > well as the cwd with the filename given at the commandline or > the default if the file is not specified? For the copy in the mini-filesystem, the file name should be #.data where # is a number. For the copy in the current working directory, if the filename is not given in the commandline, you should use the filename from the file metadata. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 465.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 19 19:54:31 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAK3sUYn004366 for ; Wed, 19 Nov 2008 19:54:30 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAK3pfJG014078 for ; Wed, 19 Nov 2008 19:51:41 -0800 Message-Id: <200811200351.mAK3pfJG014078@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Project Part 2: Get command Date: Wed, 19 Nov 2008 19:51:41 -0800 From: Bill Cheng Someone wrote: > Or even before we decide to service the Get request, we can do a local check > to see if another file with the same filename exists and if the user wants > to overwrite this file? If the User says Yes Overwrite, then proceed else > just dont do anything. Am I getting something wrong here? You should not do that. If the user is interested in the file, you should retrieve the file so that nodes in the middle of the network has an opportunity to cache the file. If a file is popular, you want it to get copied. -- Bill Cheng // bill.cheng@usc.edu On Wed, Nov 19, 2008 at 2:47 PM, Omkar Govardhan Prabhu wrote: > When we do a "get ", and successfully retrieve a > file, Suppose another file with the same filename exists in the Nodes > Current Working Directory. In this case, the User is asked if he/she "wants > to overwrite the file", right?(Also at this stage there is a file created in > the files directory for e.g. 3.data) > > Now, suppose the user says He DOESNOT want to overwrite the file.So, should > the 3.data in the files directory be deleted and should this node not serve > the file anymore? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 464.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 19 19:51:49 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAK3pnYv004329 for ; Wed, 19 Nov 2008 19:51:49 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAK3mxmA014030 for ; Wed, 19 Nov 2008 19:48:59 -0800 Message-Id: <200811200348.mAK3mxmA014030@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Project Part 2: Get command Date: Wed, 19 Nov 2008 19:48:59 -0800 From: Bill Cheng Someone wrote: > When we do a "get ", and successfully retrieve a file, > Suppose another file with the same filename exists in the Nodes Current > Working Directory. In this case, the User is asked if he/she "wants to > overwrite the file", right?(Also at this stage there is a file created in > the files directory for e.g. 3.data) Yes. > Now, suppose the user says He DOESNOT want to overwrite the file.So, should > the 3.data in the files directory be deleted and should this node not serve > the file anymore? 3.data should *not* be deleted. This situation is analygous to the case where the user decides to keep the file in the current working directory and later delete the copy in the current working directory. In a way, what happens in the current working directory should not affect what goes on on the server side of the node. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 463.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 19 14:28:53 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAJMSrXu001922 for ; Wed, 19 Nov 2008 14:28:53 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAJMQ0G5012031 for ; Wed, 19 Nov 2008 14:26:00 -0800 Message-Id: <200811192226.mAJMQ0G5012031@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CSCI 551: final project 2 : Doubt in store Date: Wed, 19 Nov 2008 14:26:00 -0800 From: Bill Cheng Someone wrote: > I meant the store message for the file blondie1.mp3 ( size around 5 > MB). Should the entire file be sent at one go ? I'm not sure what you are referring to. The maximum buffer size allowed for part (2) is 8192 bytes. So, you cannot read the whole file into a 5MB buffer. So, you must read it 8192 bytes at a time and write it out 8192 bytes at a time (which is not much different from reading/writing one byte at a time in warmup #1). But all of these goes into one messages. > "For part (2), the maximum size of a memory buffer is limited to 8,192 > bytes. There is no limit for part (1). " > > What does this statement mean then ? > > I was under the assumption that a huge file greater than 8192 bytes > needs to be sent in parts in order to adhere to the 8192 limit. TCP has a stream abstraction. You can write the stream one byte at a time (as was done in warmup #1), or you can write it 8192 bytes at a time. But this it *not* "sent int parts". There is only one stream. -- Bill Cheng // bill.cheng@usc.edu On Wed, Nov 19, 2008 at 1:52 PM, Bill Cheng wrote: > Someone wrote: > > > I have 2 questions in final project 2: > > > > 1. When I flood the store message to my neighbors - Assume i am > > sending the file in parts : Say 4 parts. > > Is it fine if all these parts have the same UOID in message header ? > > I'm not sure what you meant by parts. In one STORE message, > you have to put all the data of the file int it. There is > only one message! May be you should come see me during > office hours about this! > > > 2. Suppose a node gets a store request from its neighbor. If it wants > > to forward the store, Can it generate a new UOID for the forwarded msg > > ? Or should it have the same UOID as the original store msg. > > If you are *forwarding* a message (of *any* type), the only > thing you can change in the message is the TTL. You must > *not* change anything else in the message > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 462.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 19 14:06:42 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAJM6gdp001687 for ; Wed, 19 Nov 2008 14:06:42 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAJM3mIc011693 for ; Wed, 19 Nov 2008 14:03:48 -0800 Message-Id: <200811192203.mAJM3mIc011693@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551: Final Project 2 : cached and permanent files Date: Wed, 19 Nov 2008 14:03:41 -0800 From: Bill Cheng Someone wrote: > i had questions about the cached and permanent files. > > 1. is the same naming order to be continued for cached and permanent files ? > > i.e. suppose you store a file 1.data in permanent space then you get a > request to cache a file, should we name this file 2.data (and there is a > flag which will determine whether its cached or permanent) ? or should we > start a seperate numbering for cached files and name this new file as 1.data > (still the flag being there which says if its cached or stored). ? I would say that you should not start a separate list. You can also create files 1.in_cache which just has a 0 in it and 2.in_cache which just has a 1 in it. If you need to move a file from cache to perm, you just open its .in_cache file and change the number! You would also need to delete it from the LRU list. > 2. we start a node, store 2 files 1.data and 2.data, one of which is in > cache space and the other in permanent space. > then we shutdown the node. > we start up the same node again (without -reset option) then in this case, > will our files directory have both the files 1.data and 2.data which we > saved in the previous instance or will it have only 2.data which was stored > in the permanent space ? You should have all the files! This is like your web browser. If you close your browser, all the files in its cache will still be there when you start your browser again (unless you explicitly clear the cache). -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 461.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 19 13:59:52 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAJLxqLd001599 for ; Wed, 19 Nov 2008 13:59:52 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAJLuwsU011608 for ; Wed, 19 Nov 2008 13:56:58 -0800 Message-Id: <200811192156.mAJLuwsU011608@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551: Final Project 2 : Queries Date: Wed, 19 Nov 2008 13:56:58 -0800 From: Bill Cheng Someone wrote: > I had the following queries about final project part 2: > > 1. LRU - If the cache at a node is full, we need to replace the file using > LRU replacement policy. > > Now, in the follwing scenario, what would be the expected solution. > The total cache size is 10K. > There are 3 files in the cache, with size and time stamp of last access of > that file as below: > file1 2k 2.5sec > file2 4k 3.5sec > file3 4k 4.5sec > > Now, at this node, if we get a request to cache another file, file 4 (size > 3k) . But since there is no more free cache space we need to do an LRU > replacement of the existing files. > If we run the LRU on the cache mentioned above, the file1 will be removed > (because its the LRU file) and we will try to store the new file, file4 at > this place but the free space now is only 2k (after removing file1) and we > need 3k. > so what do we do in this case ? > a. drop the new file and give an error message that there is not enough > space in cache ? > b., run the lru again and replace the file which might not be the LRU file > but is of size greater than or equal to the new file size ? Slide 17 of lecture 18 says: while (filesize + current usage > CacheSize) start deleting files from the head of the LRU list (this would decrease current usage) So, in your example, you will delete both file1 and file2 so that you can add your new file. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 460.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 19 13:55:41 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAJLte9e001551 for ; Wed, 19 Nov 2008 13:55:41 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAJLqliS011563 for ; Wed, 19 Nov 2008 13:52:47 -0800 Message-Id: <200811192152.mAJLqliS011563@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CSCI 551: final project 2 : Doubt in store Date: Wed, 19 Nov 2008 13:52:47 -0800 From: Bill Cheng Someone wrote: > I have 2 questions in final project 2: > > 1. When I flood the store message to my neighbors - Assume i am > sending the file in parts : Say 4 parts. > Is it fine if all these parts have the same UOID in message header ? I'm not sure what you meant by parts. In one STORE message, you have to put all the data of the file int it. There is only one message! May be you should come see me during office hours about this! > 2. Suppose a node gets a store request from its neighbor. If it wants > to forward the store, Can it generate a new UOID for the forwarded msg > ? Or should it have the same UOID as the original store msg. If you are *forwarding* a message (of *any* type), the only thing you can change in the message is the TTL. You must *not* change anything else in the message -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 459.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 19 10:08:13 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAJI8CZj032057 for ; Wed, 19 Nov 2008 10:08:12 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAJI5GUV007423 for ; Wed, 19 Nov 2008 10:05:16 -0800 Message-Id: <200811191805.mAJI5GUV007423@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551 Final2 - disk quota Date: Wed, 19 Nov 2008 10:05:16 -0800 From: Bill Cheng Someone wrote: > A Get request should place a file in the mini file system, as > well as the cwd with the filename given at the commandline or > the default if the file is not specified? For the copy in the mini-filesystem, the file name should be #.data where # is a number. For the copy in the current working directory, if the filename is not given in the commandline, you should use the filename from the file metadata. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 458.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 19 08:18:02 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAJGI2vP031001 for ; Wed, 19 Nov 2008 08:18:02 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAJGF5gQ004680 for ; Wed, 19 Nov 2008 08:15:05 -0800 Message-Id: <200811191615.mAJGF5gQ004680@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551 Final2 - disk quota Date: Wed, 19 Nov 2008 08:15:05 -0800 From: Bill Cheng Someone wrote: > Do we have to check disk space for saving files in permanent space? > If so, what system call should we use? You generally cannot find out how much disk space is available to you. So, you must do the following. When you write to the file, you must check return code. When you close the file, you must check return code. If something failed, you must delete the file and tell the user that there is no space (so that the user can create space by removing files). You don't need to change your code much to get this done. If your original code (without error checking) is: while (writing_to_file) { fwrite(N bytes to file); } fclose(...); All you need is to change it to the following: boolean something_wrong=false; while (writing_to_file) { if (fwrite(N bytes to file) != N) { something_wrong = true; } } if (fclose() == EOF) { something_wrong = true; } if (something_wrong) { print error message to user unlink(the_file_you_were_writing_to); } -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 457.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Nov 18 21:13:26 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAJ5DQ0J025186 for ; Tue, 18 Nov 2008 21:13:26 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAJ5AMeF000397 for ; Tue, 18 Nov 2008 21:10:22 -0800 Message-Id: <200811190510.mAJ5AMeF000397@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: cs 551 question on tcp Date: Tue, 18 Nov 2008 21:10:22 -0800 From: Bill Cheng Someone wrote: > My question stated two nodes neither of which had ever called store, meaning > neither a store message or store command had ever been generated. In that > case nothing would be returned. In other words all files have to originate > from a store command or a store message? You can also get files into your mini-filesystem from forwardig a GET message or iniitating a GET. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- From: Bill Cheng [mailto:william@bourbon.usc.edu] Sent: Tuesday, November 18, 2008 8:11 PM To: cs551@merlot.usc.edu Subject: Re: cs 551 question on tcp Someone wrote: > In the message dated, 11/17/2008 9:06 AM, you said that search response > should contain all the files that matched (whether is permanent storage > or cache). > Then, even if a node has not initiated a store, it could have stored > some files in its cache from other store commands issued by other nodes. > So this conflicts with whats mentioned below. I am a bit confused now. Hmm... I thought the original question was about the nodes have never received a STORE *message*! Now that you have mentioned it, it wasn't clear if the original question was about the user's STORE command or STORE messages. Certainly, if the user has never entered a STORE command, it is possible that the node could have received STORE messages from other nodes and could have cached files in its mini-filesystem. In this case, it would return status responses. Furthermore, if there is a search hit, it should return search responses. -- Bill Cheng // bill.cheng@usc.edu Bill Cheng wrote: > Oops! I didn't notice that the question asked about two things! > Sorry! > > For "status files", a node has nothing should return a status > response with no information returned. > > For "search", a node that does not have a hit should *not* > generate a search response. > -- > Bill Cheng // bill.cheng@usc.edu > > > > -----Original Message----- > Date: Tue, 18 Nov 2008 19:45:03 -0800 > From: Bill Cheng > To: cs551@merlot.usc.edu > Subject: Re: cs 551 question on tcp > > Someone wrote: > > > Files can only be added with a store correct? So if you have two nodes up > > that have never called store, then status files and search will always > > return nothing correct? > > Correct. > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 456.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Nov 18 20:13:50 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAJ4DoxW024742 for ; Tue, 18 Nov 2008 20:13:50 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAJ4AjSV032470 for ; Tue, 18 Nov 2008 20:10:45 -0800 Message-Id: <200811190410.mAJ4AjSV032470@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: cs 551 question on tcp Date: Tue, 18 Nov 2008 20:10:45 -0800 From: Bill Cheng Someone wrote: > In the message dated, 11/17/2008 9:06 AM, you said that search response > should contain all the files that matched (whether is permanent storage > or cache). > Then, even if a node has not initiated a store, it could have stored > some files in its cache from other store commands issued by other nodes. > So this conflicts with whats mentioned below. I am a bit confused now. Hmm... I thought the original question was about the nodes have never received a STORE *message*! Now that you have mentioned it, it wasn't clear if the original question was about the user's STORE command or STORE messages. Certainly, if the user has never entered a STORE command, it is possible that the node could have received STORE messages from other nodes and could have cached files in its mini-filesystem. In this case, it would return status responses. Furthermore, if there is a search hit, it should return search responses. -- Bill Cheng // bill.cheng@usc.edu Bill Cheng wrote: > Oops! I didn't notice that the question asked about two things! > Sorry! > > For "status files", a node has nothing should return a status > response with no information returned. > > For "search", a node that does not have a hit should *not* > generate a search response. > -- > Bill Cheng // bill.cheng@usc.edu > > > > -----Original Message----- > Date: Tue, 18 Nov 2008 19:45:03 -0800 > From: Bill Cheng > To: cs551@merlot.usc.edu > Subject: Re: cs 551 question on tcp > > Someone wrote: > > > Files can only be added with a store correct? So if you have two nodes up > > that have never called store, then status files and search will always > > return nothing correct? > > Correct. > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 455.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Nov 18 20:05:52 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAJ45qxo024667 for ; Tue, 18 Nov 2008 20:05:52 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAJ42l7U032373 for ; Tue, 18 Nov 2008 20:02:47 -0800 Message-Id: <200811190402.mAJ42l7U032373@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: cs 551 question on tcp In-reply-to: <200811190352.mAJ3qCjS032279@bourbon.usc.edu> References: <200811190345.mAJ3j3Qa032153@bourbon.usc.edu> <200811190352.mAJ3qCjS032279@bourbon.usc.edu> Comments: In-reply-to Bill Cheng message dated "Tue, 18 Nov 2008 19:52:12 -0800." Date: Tue, 18 Nov 2008 20:02:47 -0800 From: Bill Cheng Sorry, I need to be more careful. For "status files", I should have said: For "status files", a node has nothing should return a status response with no information *about files* returned. It should still fill the first 4 fields (UOID, Host Info Length, Host Port, and Hostname) in the status response. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Tue, 18 Nov 2008 19:52:12 -0800 From: Bill Cheng To: cs551@merlot.usc.edu Subject: Re: cs 551 question on tcp Oops! I didn't notice that the question asked about two things! Sorry! For "status files", a node has nothing should return a status response with no information returned. For "search", a node that does not have a hit should *not* generate a search response. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Tue, 18 Nov 2008 19:45:03 -0800 From: Bill Cheng To: cs551@merlot.usc.edu Subject: Re: cs 551 question on tcp Someone wrote: > Files can only be added with a store correct? So if you have two nodes up > that have never called store, then status files and search will always > return nothing correct? Correct. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 454.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Nov 18 19:55:18 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAJ3tINS024578 for ; Tue, 18 Nov 2008 19:55:18 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAJ3qCjS032279 for ; Tue, 18 Nov 2008 19:52:12 -0800 Message-Id: <200811190352.mAJ3qCjS032279@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: cs 551 question on tcp In-reply-to: <200811190345.mAJ3j3Qa032153@bourbon.usc.edu> References: <200811190345.mAJ3j3Qa032153@bourbon.usc.edu> Comments: In-reply-to Bill Cheng message dated "Tue, 18 Nov 2008 19:45:03 -0800." Date: Tue, 18 Nov 2008 19:52:12 -0800 From: Bill Cheng Oops! I didn't notice that the question asked about two things! Sorry! For "status files", a node has nothing should return a status response with no information returned. For "search", a node that does not have a hit should *not* generate a search response. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Tue, 18 Nov 2008 19:45:03 -0800 From: Bill Cheng To: cs551@merlot.usc.edu Subject: Re: cs 551 question on tcp Someone wrote: > Files can only be added with a store correct? So if you have two nodes up > that have never called store, then status files and search will always > return nothing correct? Correct. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 453.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Nov 18 19:49:31 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAJ3nV1u024462 for ; Tue, 18 Nov 2008 19:49:31 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAJ3kPMd032177 for ; Tue, 18 Nov 2008 19:46:25 -0800 Message-Id: <200811190346.mAJ3kPMd032177@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: cs 551 question on tcp Date: Tue, 18 Nov 2008 19:46:25 -0800 From: Bill Cheng Someone wrote: > Also I assume a search command should only return > responses from other nodes not yourself? You must search the current node also. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 452.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Nov 18 19:48:09 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAJ3m9RR024448 for ; Tue, 18 Nov 2008 19:48:09 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAJ3j3Qa032153 for ; Tue, 18 Nov 2008 19:45:03 -0800 Message-Id: <200811190345.mAJ3j3Qa032153@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: cs 551 question on tcp Date: Tue, 18 Nov 2008 19:45:03 -0800 From: Bill Cheng Someone wrote: > Files can only be added with a store correct? So if you have two nodes up > that have never called store, then status files and search will always > return nothing correct? Correct. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 451.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 17 20:27:36 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAI4RarU010144 for ; Mon, 17 Nov 2008 20:27:36 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAI4OFbK002023 for ; Mon, 17 Nov 2008 20:24:15 -0800 Message-Id: <200811180424.mAI4OFbK002023@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: cs 551 question on tcp Date: Mon, 17 Nov 2008 20:24:15 -0800 From: Bill Cheng Someone wrote: > Suppose I have 2 messages queued up at my socket stream. A is a store msg > that was flooded and B is something else, say a keepalive. In part 1 I would > receive the entire message before i begin to process it. But now i first > peek into the message to see if its a store by receiving the header first > and then write the data in to a file in chunks. Now if the coin flip says > "no", there is no point in reading and writing to a file as it will be > deleted later on. So is there anyway to delete part of message A from the > socket buffer without hurting the next message B. Like the next "datalen of > A" bytes from the socket stream, so that the next recv() call will start > reading from msg B. TCP's stream of bytes abstraction does not allow you to do it! Since it's a stream of bytes, there is no concept of a message boundary. This is a problem with the protocol design of the SERVANT network. If it is going to be a real peer-to-peer network, we need to fix this. (Not a bad final exam question if we were to have long essay questions! But since we don't have long essay questions, this will not be on the exam.) -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 450.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 17 20:06:30 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAI46UNR009957 for ; Mon, 17 Nov 2008 20:06:30 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAI438V5001660 for ; Mon, 17 Nov 2008 20:03:08 -0800 Message-Id: <200811180403.mAI438V5001660@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS 551 project 2 Date: Mon, 17 Nov 2008 20:03:08 -0800 From: Bill Cheng Someone wrote: > For displaying the search responses on screen, should the bit vector > be displayed or only uptill the keywords field? There is no need to display the bit vector. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 449.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 17 10:56:21 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAHIuLEI005309 for ; Mon, 17 Nov 2008 10:56:21 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAHIqr5q027250 for ; Mon, 17 Nov 2008 10:52:53 -0800 Message-Id: <200811171852.mAHIqr5q027250@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Store question Date: Mon, 17 Nov 2008 10:52:53 -0800 From: Bill Cheng Someone wrote: > So if i receive a command like: > > " store mall.c 1 type="code" " from the user first time, i will store the > file mall.c in the files directory. Well, you need to store the file as "N.data" where N is a number. > Now, if the user enters the same command, no change at all , is this > considered as a duplicate file ? No. It will be a new version of the same file. > or anything from the prompt is always > assumed to be unique. This can happen after n commands after the user gave > the first store command too. Correct. > If say we have match in the above scenario i.e. both the files are same, > then do we need to inform the user that the file already exists on the node, > the second time he tries to save it and stop processing the Store further ? > or shud we just process the command normally ?? You do not need to check if the file is already in the node since every time you initiate a STORE, you will have to generate a Nonce, and that will make the new file different from what's already stored. -- Bill Cheng // bill.cheng@usc.edu On Mon, Nov 17, 2008 at 9:11 AM, Bill Cheng wrote: > Someone wrote: > > > Upon your comments about STORE message below, I conclude that when > > receiving STORE message, the node doesn't need to check if it already > > has a copy of the file. Because it's impossible since the nonce must be > > different. > > Correct. > > > What about when forwarding GET message? I think after it flips the > > coin and decides to cache the file, it needs to check if it already has > > a copy of the file, correct? > > Correct. > > > If it is correct, besides forwarding GET message and receiving GET > > message, is there any other situation we need to check if it already has > > a copy of the file? > > I cannot think of anything at this point. If you see a > situation where it needs to be done, then you need to write > code for it. > -- > Bill Cheng // bill.cheng@usc.edu > > > > > > Bill Cheng wrote: > > Someone wrote: > > > > > Had a few doubts on the store feature ... > > > Is it possible for the same file to be stored twice on the > > > network? > > > > Yes. > > > > > Seems possible so when I get a store response on a node > > > I need to check if the file already exists on the node before > > > storing it (in the Cache area). > > > > You don't need to check if you already has a copy of the file > > if you are just caching it. (Of course, you need check if > > you have seen the *message* by looking at the message UOID > > and discard duplicate messages -- this is what you do for > > messages of all types anyway.) > > > > > While matching should the > > > filename and the SHA value be enough or should we match the > > > keywords also ? > > > > No. FileName, SHA1, *and* Nonce. > > > > > Should we consider the files to be different if > > > they have the same name and content but different keywords ? > > > > Just FileName, SHA1, *and* Nonce. If the keywords are > > different for the same file, Nonce must also be different! > > > > > If I already have the file do I still need to probabilistically > > > flood it ? > > > > Yes. You should *not* even be checking if you have the > > file already if you are forwarding a file. > > -- > > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 448.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 17 09:15:17 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAHHFH6Y004240 for ; Mon, 17 Nov 2008 09:15:17 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAHHBnTW024667 for ; Mon, 17 Nov 2008 09:11:49 -0800 Message-Id: <200811171711.mAHHBnTW024667@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Store question Date: Mon, 17 Nov 2008 09:11:48 -0800 From: Bill Cheng Someone wrote: > Upon your comments about STORE message below, I conclude that when > receiving STORE message, the node doesn't need to check if it already > has a copy of the file. Because it's impossible since the nonce must be > different. Correct. > What about when forwarding GET message? I think after it flips the > coin and decides to cache the file, it needs to check if it already has > a copy of the file, correct? Correct. > If it is correct, besides forwarding GET message and receiving GET > message, is there any other situation we need to check if it already has > a copy of the file? I cannot think of anything at this point. If you see a situation where it needs to be done, then you need to write code for it. -- Bill Cheng // bill.cheng@usc.edu Bill Cheng wrote: > Someone wrote: > > > Had a few doubts on the store feature ... > > Is it possible for the same file to be stored twice on the > > network? > > Yes. > > > Seems possible so when I get a store response on a node > > I need to check if the file already exists on the node before > > storing it (in the Cache area). > > You don't need to check if you already has a copy of the file > if you are just caching it. (Of course, you need check if > you have seen the *message* by looking at the message UOID > and discard duplicate messages -- this is what you do for > messages of all types anyway.) > > > While matching should the > > filename and the SHA value be enough or should we match the > > keywords also ? > > No. FileName, SHA1, *and* Nonce. > > > Should we consider the files to be different if > > they have the same name and content but different keywords ? > > Just FileName, SHA1, *and* Nonce. If the keywords are > different for the same file, Nonce must also be different! > > > If I already have the file do I still need to probabilistically > > flood it ? > > Yes. You should *not* even be checking if you have the > file already if you are forwarding a file. > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 447.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 17 09:10:21 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAHHAKmg004195 for ; Mon, 17 Nov 2008 09:10:20 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAHH6q4B024632 for ; Mon, 17 Nov 2008 09:06:52 -0800 Message-Id: <200811171706.mAHH6q4B024632@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Search Response Date: Mon, 17 Nov 2008 09:06:52 -0800 From: Bill Cheng Someone wrote: > I have a doubt in the search response. > Do we also search for the search type in the files that are in cache? or > is it only done for permanent files ? All files! > If we consider searching in the cache, then should we have a separate > indexes for files in cache or should we just add them to the existing > structures? You should not use a different data structure for cache and permanent storage! Whether a file is in the cache or in permanent storage is conceptually an one-bit attribute of the file. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 446.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 17 08:59:39 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAHGxdeL004074 for ; Mon, 17 Nov 2008 08:59:39 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAHGuAqI024237 for ; Mon, 17 Nov 2008 08:56:10 -0800 Message-Id: <200811171656.mAHGuAqI024237@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Store Format Date: Mon, 17 Nov 2008 08:56:10 -0800 From: Bill Cheng Someone wrote: > Do the characters account for 2 bytes in the packet ? Yes, for each line. > Basically, do we have to put 2 newline characters in the file, one for > and one for ? How are these characters stored exactly ? They are not 2 newline characters. is "carriage return" and is "line feed" which is the newline character. Normally for UNIX, if you want to write out a line to the terminal, you would do something like: printf("hello\n"); The last character is . To print the same line with , you can do: printf("hello\r\n"); "\r" is . -- Bill Cheng // bill.cheng@usc.edu On Sun, Nov 16, 2008 at 10:31 PM, Bill Cheng wrote: > Someone wrote: > > > It has been mentioned that all the metadata parameters are followed by a > > . I understand that we have to include them while writing to a > > file, but do we also have to append the characters while > forming > > the store packet as well ? > > Yes. (When you format the STORE message, you should just > read the metadata file and copy the data into the message. > So, if the is already there, you don't need to do > anything extra. > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 445.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Nov 16 22:34:51 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAH6YpvN030563 for ; Sun, 16 Nov 2008 22:34:51 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAH6VFQm019219 for ; Sun, 16 Nov 2008 22:31:15 -0800 Message-Id: <200811170631.mAH6VFQm019219@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Store Format Date: Sun, 16 Nov 2008 22:31:15 -0800 From: Bill Cheng Someone wrote: > It has been mentioned that all the metadata parameters are followed by a > . I understand that we have to include them while writing to a > file, but do we also have to append the characters while forming > the store packet as well ? Yes. (When you format the STORE message, you should just read the metadata file and copy the data into the message. So, if the is already there, you don't need to do anything extra. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 444.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Nov 16 20:38:33 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAH4cXoc029621 for ; Sun, 16 Nov 2008 20:38:33 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAH4YuN1017292 for ; Sun, 16 Nov 2008 20:34:56 -0800 Message-Id: <200811170434.mAH4YuN1017292@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: status msg Date: Sun, 16 Nov 2008 20:34:56 -0800 From: Bill Cheng Someone wrote: > a status request has a request type, but a status response doesn't > have one. so how do we distinguish between status responses of that > for "neighbors" and that for "files". Do we do it by setting a global > variable, like... > > while sending status request : > if(status request) > { > if(status "neighbors") type=1 > > if(status "files") type = 2 > } > > and while receiving responses > if(status response) > { > if(type=1) then expect status neighbors > if(type=2) then expect status files > > } Yes. Your user interface can only be doing one thing at a time when it initiates something. So, you can store a state for the user interface (you used this variable called "type" above). If it's waiting for a "status files" response, it cannot be waiting for a "status neighbors" response at the same time. You don't even need a lock! > in this case , if a node receives a status request for files but is > delayed in sending a reply because it cannot acquire some lock > and user presses ctrl c at the receiver side and sends a status > neighbor request immediately and now our node acquired that lock and > sent the status files response, the receiver will crash. shouldnt > status response also have a type field? What I said above is about a node who has *initiated* a "status files" or a "statue neighbors". I don't see how this can be related to a node *receiving* "status files" or "status neighbors". They seem to be completely unrelated. I think you need to make sure that initiating a status command is not related to processing another status message (or I'm just missing some subtle points here). -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 443.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Nov 16 20:28:56 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAH4SuWf029540 for ; Sun, 16 Nov 2008 20:28:56 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAH4PI5g017107 for ; Sun, 16 Nov 2008 20:25:18 -0800 Message-Id: <200811170425.mAH4PI5g017107@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Confusion with nonce Date: Sun, 16 Nov 2008 20:25:18 -0800 From: Bill Cheng Someone wrote: > What if a user tries to store the same file (identical sha1 and filename) > multiple times with a store command? Would they be allowed to do that > because the newly stored file will have a different nonce than the existing > copy(since the nonce is not data dependent)? Yes. They must be allowed to do that. Since the nonce will be new, it's considered a different file. Also, the 2nd time the file is store, the user may enter different set of keywords. > It seems like nonces are only > used for probablisitic forwarding and deleting. A nonce is used to distinguish different versions of the same file having the same FileName and SHA1. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- From: Bill Cheng [mailto:william@bourbon.usc.edu] Sent: Sunday, November 16, 2008 7:03 PM To: cs551@merlot.usc.edu Subject: Re: Confusion with nonce Someone wrote; > The spec defines nonce as: > A nonce can be used to distinguish different versions of the same file. > (If a file with a certain SHA1 value is created by a user and, at a > later time, the same file with the same SHA1 value is created by the > same user or another user, these 2 files will have different nonces.) > *Therefore, we consider that file Y is a copy of file X if X and Y have > identical FileName, SHA1, and Nonce (everything else about X and Y are > assumed to be identical).* > > I am not very clear about the line in bold. Does it mean that if a node > sees a file with the same filename, sha1 and nonce as another file that > is stored in the node, it has to discard that file? Right ? Correct! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 442.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Nov 16 20:13:18 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAH4DHDe029426 for ; Sun, 16 Nov 2008 20:13:18 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAH49eR5016936 for ; Sun, 16 Nov 2008 20:09:40 -0800 Message-Id: <200811170409.mAH49eR5016936@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: init_neighbor_list question Date: Sun, 16 Nov 2008 20:09:40 -0800 From: Bill Cheng Someone wrote: > When a Non-Beacon Node starts up we need to parse the > init_neighbor_list present in the home directory. > What is the default name for this file ? In the grading guidelines > there are 4 files init-i.02, init-i.03 etc, are these the names ? No. The file name is *exactly* "init_neighbor_list" and it will be in your HomeDir. Please make sure you don't miss-spell this! > Since, you have told us we will be given good neighbor_list file.. Can > we assume these files will exist, and exit if they are not present ? In the grading guidelines, the following command setups the init_neighbor_list files: ~csci551b/public/final2/scripts/setup-r789 $HOME Please read the "~csci551b/public/final2/scripts/setup-r789" file if you have not sure. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 441.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Nov 16 20:06:58 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAH46weY029367 for ; Sun, 16 Nov 2008 20:06:58 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAH43LGU016820 for ; Sun, 16 Nov 2008 20:03:21 -0800 Message-Id: <200811170403.mAH43LGU016820@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Storage Space Date: Sun, 16 Nov 2008 20:03:21 -0800 From: Bill Cheng Someone wrote: > The spec says that if there is not enough space in the system, then the > file should be discarded (when in permanent storage) or LRU is used > (when in cache). > I have a doubt here: > While receiving a file in store, I temporarily store the file in my CWD > and at the time of probabilistically deciding if I need to store the > file, I move it to my files dir. > And then delete this temporary copy of the file. > Now, what if there is space in the files dir but not enough space in the > CWD ? > What should I do in that case? First of all, it's never a good idea to create temporary files in the current working directory (CWD)! For temporary files, you should either create it in /tmp or you can have a tmp subdirectory under HomeDir. If you cannot create a temporary file, you should give up on saving a copy of the temporary file. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 440.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Nov 16 20:02:37 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAH42aXG029328 for ; Sun, 16 Nov 2008 20:02:36 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAH3wxgm016783 for ; Sun, 16 Nov 2008 19:58:59 -0800 Message-Id: <200811170358.mAH3wxgm016783@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Store question Date: Sun, 16 Nov 2008 19:58:59 -0800 From: Bill Cheng Someone wrote: > Had a few doubts on the store feature ... > Is it possible for the same file to be stored twice on the > network? Yes. > Seems possible so when I get a store response on a node > I need to check if the file already exists on the node before > storing it (in the Cache area). You don't need to check if you already has a copy of the file if you are just caching it. (Of course, you need check if you have seen the *message* by looking at the message UOID and discard duplicate messages -- this is what you do for messages of all types anyway.) > While matching should the > filename and the SHA value be enough or should we match the > keywords also ? No. FileName, SHA1, *and* Nonce. > Should we consider the files to be different if > they have the same name and content but different keywords ? Just FileName, SHA1, *and* Nonce. If the keywords are different for the same file, Nonce must also be different! > If I already have the file do I still need to probabilistically > flood it ? Yes. You should *not* even be checking if you have the file already if you are forwarding a file. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 439.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Nov 16 19:06:50 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAH36ojE028922 for ; Sun, 16 Nov 2008 19:06:50 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAH33Bgi016325 for ; Sun, 16 Nov 2008 19:03:11 -0800 Message-Id: <200811170303.mAH33Bgi016325@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Confusion with nonce Date: Sun, 16 Nov 2008 19:03:11 -0800 From: Bill Cheng Someone wrote; > The spec defines nonce as: > A nonce can be used to distinguish different versions of the same file. > (If a file with a certain SHA1 value is created by a user and, at a > later time, the same file with the same SHA1 value is created by the > same user or another user, these 2 files will have different nonces.) > *Therefore, we consider that file Y is a copy of file X if X and Y have > identical FileName, SHA1, and Nonce (everything else about X and Y are > assumed to be identical).* > > I am not very clear about the line in bold. Does it mean that if a node > sees a file with the same filename, sha1 and nonce as another file that > is stored in the node, it has to discard that file? Right ? Correct! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 438.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Nov 16 11:14:48 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAGJEln6025216 for ; Sun, 16 Nov 2008 11:14:48 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAGJB4Lm012760 for ; Sun, 16 Nov 2008 11:11:04 -0800 Message-Id: <200811161911.mAGJB4Lm012760@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Misunderstanding TCP stream? Date: Sun, 16 Nov 2008 11:11:04 -0800 From: Bill Cheng Someone wrote: > If we receive a search request and there are no hits do we need to respond > with a search response? If so do we just put 0 in the lengt field? That would be fine, but the right thing to do is not to generate a search response. For a network like this, it is expected that most of the messages in the network will be search related. So, you should not send unnecessary search related messages. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- From: Bill Cheng [mailto:william@bourbon.usc.edu] Sent: Saturday, November 15, 2008 7:35 AM To: cs551@merlot.usc.edu Subject: Re: Misunderstanding TCP stream? Someone wrote: > Due to the buffer size constraints, I first send the message common header > and metadata. I then iteratively read in 'chunks' of the file data, and send > each 'chunk' individually. The common header of course tells the client how > much data to expect, including the file data. > > When I attempt this though, for some reason, the client reads in the correct > number of bytes, but the file data bytes are incorrect. And then a few > seconds later the client seg faults. Am I misunderstanding / misusing the > TCP stream? I thought this should work? Sounds like you are doing it correctly. This is also what we did for warmup #1 (except that instead of reading and writing one block at a time, we were reading and writing one byte at a time). If your warmup #1 is working properly, you can change it to do it the same way you are doing and you should see that it works. So, my guess is that the bug is somewhere else. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 437.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Nov 16 11:00:33 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAGJ0XTr024936 for ; Sun, 16 Nov 2008 11:00:33 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAGIunIc012527 for ; Sun, 16 Nov 2008 10:56:49 -0800 Message-Id: <200811161856.mAGIunIc012527@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Misunderstanding TCP stream? Date: Sun, 16 Nov 2008 10:56:49 -0800 From: Bill Cheng Someone wrote: > How would we read in a our sha1 hash hex encoded string and convert it into > a 20 byte buffer? Well, you can write a function that convert 2 characters to one byte: unsigned char HexstringOfTwoToOneByte(char *in) /* assuming that everything in in[] are lowercase */ { unsigned char hi_nibble=0; unsigned char lo_nibble=0; switch (in[0]) { case '0': hi_nibble = 0; break; case '1': hi_nibble = 1; break; ... case 'e': hi_nibble = 14; break; case 'f': hi_nibble = 15; break; } switch (in[1]) { case '0': lo_nibble = 0; break; case '1': lo_nibble = 1; break; ... case 'e': lo_nibble = 14; break; case 'f': lo_nibble = 15; break; } return (hi_nibble*16)+lo_nibble; } Then call this function 20 times with the input buffer shifted by 2 characters each time and the output buffer shifted by 1 byte each time. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- From: Bill Cheng [mailto:william@bourbon.usc.edu] Sent: Saturday, November 15, 2008 7:35 AM To: cs551@merlot.usc.edu Subject: Re: Misunderstanding TCP stream? Someone wrote: > Due to the buffer size constraints, I first send the message common header > and metadata. I then iteratively read in 'chunks' of the file data, and send > each 'chunk' individually. The common header of course tells the client how > much data to expect, including the file data. > > When I attempt this though, for some reason, the client reads in the correct > number of bytes, but the file data bytes are incorrect. And then a few > seconds later the client seg faults. Am I misunderstanding / misusing the > TCP stream? I thought this should work? Sounds like you are doing it correctly. This is also what we did for warmup #1 (except that instead of reading and writing one block at a time, we were reading and writing one byte at a time). If your warmup #1 is working properly, you can change it to do it the same way you are doing and you should see that it works. So, my guess is that the bug is somewhere else. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 436.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Nov 15 07:39:32 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAFFdV1u008294 for ; Sat, 15 Nov 2008 07:39:31 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAFFZTSU025675 for ; Sat, 15 Nov 2008 07:35:29 -0800 Message-Id: <200811151535.mAFFZTSU025675@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Misunderstanding TCP stream? Date: Sat, 15 Nov 2008 07:35:29 -0800 From: Bill Cheng Someone wrote: > Due to the buffer size constraints, I first send the message common header > and metadata. I then iteratively read in 'chunks' of the file data, and send > each 'chunk' individually. The common header of course tells the client how > much data to expect, including the file data. > > When I attempt this though, for some reason, the client reads in the correct > number of bytes, but the file data bytes are incorrect. And then a few > seconds later the client seg faults. Am I misunderstanding / misusing the > TCP stream? I thought this should work? Sounds like you are doing it correctly. This is also what we did for warmup #1 (except that instead of reading and writing one block at a time, we were reading and writing one byte at a time). If your warmup #1 is working properly, you can change it to do it the same way you are doing and you should see that it works. So, my guess is that the bug is somewhere else. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 435.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Nov 14 19:53:12 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAF3rCmd032209 for ; Fri, 14 Nov 2008 19:53:12 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAF3n2oX020822 for ; Fri, 14 Nov 2008 19:49:02 -0800 Message-Id: <200811150349.mAF3n2oX020822@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Store Flood Date: Fri, 14 Nov 2008 19:49:02 -0800 From: Bill Cheng Someone wrote: > When node B gets a store message from node A, after it calculates the > "storeprob" and decides that it doesn't need to store the copy in its > cache, it should still forward it to its neighbors. Right ? Please see my message with timestamp "Thu 06 Nov 18:26". -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 434.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Nov 14 13:06:32 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAEL6WD8028428 for ; Fri, 14 Nov 2008 13:06:32 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAEL2Hr1017248 for ; Fri, 14 Nov 2008 13:02:17 -0800 Message-Id: <200811142102.mAEL2Hr1017248@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: 5 questions about cs551 final project Date: Fri, 14 Nov 2008 13:02:17 -0800 From: Bill Cheng Someone wrote: > 1. In the spec, "All 3 index structures must have a disk image so that > after a node restarts (after a crash or a shutdown), it can reconstruct > the in-memory index structures in a timely fashion." > Does it mean whenever we change in-memory index structures, we have > to change the disk image(the file) immediately? (in case it crash suddenly) That's one way to do it. (If you are sure you code does not have any bugs, then you can write things out when your node goes down. But if a power outage happens, then it would be problematic.) > 2. In the Bit-vector part of spec, "If the left half of the resulting > bit-vector is not a vector of zeros, and the right half of the resulting > bit-vector is not a vector of zeros, then it is possible that there may > be keyword match" > What if we enter 3 keywords, and only one keyword match in the > bit-vector(only one bit is set in the left half and only one bit is set > in the right half), do we consider this as potential match and continue > compare all keywords in the file? If you enter 2 or more keywords, then you should do the following. Construct a query bit-vector; let's call this Q. For each file bit-vector B, we do a bit-wise AND of Q and B. If the result equals Q, then we have a potential match (and proceed with string compares). Otherwise, we declare that there is no match and move to the next file bit-vector. > 3. In the spec, "Please note that a get command should not be allowed if > it does not immediately follow a search or a get command" > I don't quite understand why a get command would follow another get > command. If your search returns 7 results, you should be able to do "get 1 file1", immediately followed by "get 2 file2", immediately followed by "get 3 file3", etc. > 4. About deleting a file in the spec, "If it does not have the > corresponding password, it should prompt the user to see if it is okay > to send a delete message based on the random password" > I don't quite understand that since it doesn't have the password, > this illustrate that this node is not the original owner of the file, it > shouldn't have authorization to delete this file. Correct! This is mainly for grading purpose! If you flood a delete with an invalid password, nodes should not delete the corresponding file. > 5. Continue with Q4, when a node receive a delete message, should it > compute SHA1 of password inside the message and compare it with the > nonce? If it matches, I delete; if it doesn't I ignore this message. Exactly! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 433.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Nov 14 12:30:03 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAEKU3uU028079 for ; Fri, 14 Nov 2008 12:30:03 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAEKPmPP016700 for ; Fri, 14 Nov 2008 12:25:48 -0800 Message-Id: <200811142025.mAEKPmPP016700@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: SHA1 function returning incorrect hash value Date: Fri, 14 Nov 2008 12:25:48 -0800 From: Bill Cheng Someone wrote: > So is the following correct to check the SHA1 of a file itself?: > > cat blondie1.mp3 | openssl sha1 > > The reason I ask is that my SHA1 output for blondie1.mp3 matches the output > from the above, but it doesn't match the output in the spec, so I just want > to double check. The FileSize also did not match because the file, "blondie1.mp3", is actually different! (I think "blondie1.mp3" is not even a MP3 file.) I've updated the SHA1 and FileSize values in the spec. Sorry about the confusion. -- Bill Cheng // bill.cheng@usc.edu On Mon, Nov 10, 2008 at 9:47 PM, Bill Cheng wrote: > Someone wrote: > > > Is there any similar utility like the one we had for warmup1 ( > > ~csci551b/bin/filemd5 [-o offset] [file]) to check the SHA1 value ? > > You can run "openssl sha1 [file]". > > If you have a short ASCII string, you can do: > > echo -n "YOURSTRING" | openssl sha1 > -- > Bill Cheng // bill.cheng@usc.edu > > > > > On Mon, Nov 10, 2008 at 7:45 PM, Bill Cheng > wrote: > > > Someone wrote: > > > > > When I used SHA1() / MD5 function to calculate hash value of a string > I > > do > > > get incorrect value. > > > > Could you give an example? > > > > > But if I used *SHA1_Init()*, *SHA1_Update()* and *SHA1_Final()* , > > > collectively I do get correct hash value ? > > > Same is the case with MD5. > > > > > > What could be the reason for this ? > > > > Bugs?! > > > > > Or its safe to use *SHA1_Init()*, * > > > SHA1_Update()* and *SHA1_Final()* functions always ? > > > > They are equivalent. For example, in GetUOID(), we call > > SHA1() directly. It would be an overkill to use > > SHA1_Init(), SHA1_Update(), and SHA1_Final(). > > -- > > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 432.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Nov 13 18:44:51 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAE2ipXD019109 for ; Thu, 13 Nov 2008 18:44:51 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAE2eOej008462 for ; Thu, 13 Nov 2008 18:40:24 -0800 Message-Id: <200811140240.mAE2eOej008462@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Status files and store Date: Thu, 13 Nov 2008 18:40:24 -0800 From: Bill Cheng Someone wrote: > I want to know that if a node initiates a "store" command, then what > will happen if the store flood is not yet completed and it enters a > "status files" command? I'm not sure why it matters! If another node is doing a STORE while your node is doing "staus file", it's the same situation! > Or does it wait for the store flood to get over before entering the > status files command. For STORE, you should return the prompt pretty much right away. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 431.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Nov 13 07:55:18 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mADFtI9V014051 for ; Thu, 13 Nov 2008 07:55:18 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mADFoit3031654 for ; Thu, 13 Nov 2008 07:50:44 -0800 Message-Id: <200811131550.mADFoit3031654@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: search and get Date: Thu, 13 Nov 2008 07:50:44 -0800 From: Bill Cheng Someone wrote: > "If the existing file is in the permanent space, then you are > done".... we can check if the file we are GET'ting is already in our > file system just BEFORE we actually send out the get request (since we > have sha1,nonce,filename with us from the search responses) > in this case why request the file from some node just to have it > discarded at the end. only copying the file to current directory is > good enough. Doing a GET in this case will only make other nodes > update their lru's, maybe cache the file etc etc. Originally, what you said in the last sentence is what I thought that needs to be done. But come to think of it, this will allow one node to make a file more popular artificially. So, you are correct that this should not be done. I've added another bullet in the section you mentioned: [BC: Bullet added 11/13/2008] Before you flood a GET message, you should use the FileID to determine if the current has the file. If it does, you should not flood a GET message. In this case, if the existing file is in the cache space, its status should be changed so that it is "moved" to the permanent space (you should also do whatever adjustments that are necessary). -- Bill Cheng // bill.cheng@usc.edu On Wed, Nov 12, 2008 at 2:26 PM, Bill Cheng wrote: > Someone wrote: > > > scene: > > > > nodes A,B,C > > > > node A gives store command to store file X, which also gets flodded > > and stored (storeprob +ve) at B and C (and obviously A) so now we have > > 3 copies of same file (same name, sha1 and nonce) > > node A does a search for X and gets back 3 results from A,B and C > > (different fileID's) > > node A does a get for file X stored at node B > > > > now, > > according to spec - If the user at node A attempts to retrieve file X > > and file X was successfully retrieved, node A must serve file X (i.e., > > respond properly to future search messages). File X should be stored > > in the permanent area and not stored in its cache > > > > here, node A already has the file X in its permanent storage, then > > should it save that file again or check if it already has the file. > > would this involve opening all files to compare name,sha1 and nonce? > > FileName, SHA1, and Nonce together uniquely identifies a file. > So, if everything matches, a 2nd copy of the file should not > be saved. > > Once you have received a file, you can use either the filename > index (or the sha1 index) to find all file numbers having the > same filename (or sha1 value). For every one of these files, > you should open the corresponding metadata file and see if > they have the same nonce and sha1 value (or filename). > > > further, in the " additional notes " in the spec it says > > When a node performs a get and the file happens to be in the mini > > filesystem of this node, the following should happen. If the file is > > in the permanent space, a copy of the file should be placed in the > > node's current working directory. > > I think this paragraph was not phrased clearly. Sorry! I've > just rewritten it. Hopefully it's more clear now. Please see: > > http://merlot.usc.edu/cs551-f08/projects/final.html#nospace > > > continuing above example, a get only follows a search/get and in > > search we only display different fileID. so if I found 3 copies of > > file X and 'luckily' do a get for the file on my own node, only then > > will the above happen. in all other cases i will have multiple copies > > of same file on permament storage. If i do 50 gets for X stored on B i > > will end up with 51 copies of X on node A. > > If an action will cause an identical file (defined above) to > be saved, you should not save a copy of this file. > > For the copy you saved in the current working directory, if > there is already a file with the same filename (as in the > metadata), you should probably first prompt the user to see > if it's okay to overwite the file. > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 430.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 12 19:33:41 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAD3Xf29007373 for ; Wed, 12 Nov 2008 19:33:41 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAD3SwOs020698 for ; Wed, 12 Nov 2008 19:28:58 -0800 Message-Id: <200811130328.mAD3SwOs020698@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: cs551 regarding srand48() Date: Wed, 12 Nov 2008 19:28:58 -0800 From: Bill Cheng Someone wrote: > In order to implement a coin flip, you had suggested the use of drand48(). > The result of this depends on the seed that we give to srand48() which > ultimately decides whether to store the file or not. Is there a fixed seed > value that we have to give so that testing with the grading guidelines > remains consistent? Usually, you can just call time() and feed the return value to srand48(). If you want to make it a little more random, you can call gettimeofday() and add tv_sec and tv_usec together and feed the sum to srand48(). If you look at the grading guidelines, most tests use probability 0 or 1. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 429.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 12 14:31:19 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mACMVJi4004894 for ; Wed, 12 Nov 2008 14:31:19 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mACMQpB7018599 for ; Wed, 12 Nov 2008 14:26:51 -0800 Message-Id: <200811122226.mACMQpB7018599@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: search and get Date: Wed, 12 Nov 2008 14:26:51 -0800 From: Bill Cheng Someone wrote: > scene: > > nodes A,B,C > > node A gives store command to store file X, which also gets flodded > and stored (storeprob +ve) at B and C (and obviously A) so now we have > 3 copies of same file (same name, sha1 and nonce) > node A does a search for X and gets back 3 results from A,B and C > (different fileID's) > node A does a get for file X stored at node B > > now, > according to spec - If the user at node A attempts to retrieve file X > and file X was successfully retrieved, node A must serve file X (i.e., > respond properly to future search messages). File X should be stored > in the permanent area and not stored in its cache > > here, node A already has the file X in its permanent storage, then > should it save that file again or check if it already has the file. > would this involve opening all files to compare name,sha1 and nonce? FileName, SHA1, and Nonce together uniquely identifies a file. So, if everything matches, a 2nd copy of the file should not be saved. Once you have received a file, you can use either the filename index (or the sha1 index) to find all file numbers having the same filename (or sha1 value). For every one of these files, you should open the corresponding metadata file and see if they have the same nonce and sha1 value (or filename). > further, in the " additional notes " in the spec it says > When a node performs a get and the file happens to be in the mini > filesystem of this node, the following should happen. If the file is > in the permanent space, a copy of the file should be placed in the > node's current working directory. I think this paragraph was not phrased clearly. Sorry! I've just rewritten it. Hopefully it's more clear now. Please see: http://merlot.usc.edu/cs551-f08/projects/final.html#nospace > continuing above example, a get only follows a search/get and in > search we only display different fileID. so if I found 3 copies of > file X and 'luckily' do a get for the file on my own node, only then > will the above happen. in all other cases i will have multiple copies > of same file on permament storage. If i do 50 gets for X stored on B i > will end up with 51 copies of X on node A. If an action will cause an identical file (defined above) to be saved, you should not save a copy of this file. For the copy you saved in the current working directory, if there is already a file with the same filename (as in the metadata), you should probably first prompt the user to see if it's okay to overwite the file. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 428.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Nov 11 18:25:44 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAC2Pipp027370 for ; Tue, 11 Nov 2008 18:25:44 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAC2L3kl008620 for ; Tue, 11 Nov 2008 18:21:03 -0800 Message-Id: <200811120221.mAC2L3kl008620@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551: Final Project 2 : Permanent Size Date: Tue, 11 Nov 2008 18:21:03 -0800 From: Bill Cheng Someone wrote: > What I mean with my question about cache and permanent storage was that > whenever we either cache a file or permanently store a file, the operation > would be saving the file in a directory. > Now, is it the case that if we cache it then we should store it in a > seperate directory, say "homedir/files/Cache" and when we store it > permanently we should store it in "homedir/files" ? > or is there any alternate way to implement "cache" rather than implementing > it as a directory which stores all files to be "cached" ? Please see http://merlot.usc.edu/cs551-f08/msgs/bill/420.txt. Also, I've talked about this at the beginning of yesterday's lecture. -- Bill Cheng // bill.cheng@usc.edu On Tue, Nov 11, 2008 at 8:21 AM, Bill Cheng wrote: > Someone wrote: > > > When storing the file, we have to check if the permanent storage has > space > > sufficient enough to store the file or not, but the PermSize key is > > obsolete. So how do we get the size of permanent storage ? > > It's difficult to do, especially when disk quota is > enforced. > > > Do we have to use start on our HomeDir to get this size ? or is there > any > > other way we need to handle this ? > > It's actually quite easy. When you write to the filesystem > and when you close the file you were writing to, you must > check the return code! If write() or close() is not > successful, you need to take appropriate action. If you are > interacting with the user, you need to tell the user. You > should probably also log the condition into the logfile so > you know what has failed. > > > Also, can you provide some details as to what does cache mean over here > ? > > If you decide to keep a file in HomeDir/files, if it's not > in the permanent space, then it's "cached". If this doesn't > make sense, please ask me a more specific question. > > > caching will also be in a way saving the file in the directory then how > do > > we differ the permanent storage and cache ? > > If a file is not stored in the perm space, then it goes into > the cache space. Slide 16 of lecture 18 says: > > If a node *initiates* a GET or a STORE, the file goes > into its permanent space. > > So, if you decide to keep a file for another other reason than > the one stated above, you should keep it in the cache space. > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 427.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Nov 11 08:26:10 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mABGQ9AX021609 for ; Tue, 11 Nov 2008 08:26:09 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mABGLMGK000743 for ; Tue, 11 Nov 2008 08:21:22 -0800 Message-Id: <200811111621.mABGLMGK000743@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551: Final Project 2 : Permanent Size Date: Tue, 11 Nov 2008 08:21:22 -0800 From: Bill Cheng Someone wrote: > When storing the file, we have to check if the permanent storage has space > sufficient enough to store the file or not, but the PermSize key is > obsolete. So how do we get the size of permanent storage ? It's difficult to do, especially when disk quota is enforced. > Do we have to use start on our HomeDir to get this size ? or is there any > other way we need to handle this ? It's actually quite easy. When you write to the filesystem and when you close the file you were writing to, you must check the return code! If write() or close() is not successful, you need to take appropriate action. If you are interacting with the user, you need to tell the user. You should probably also log the condition into the logfile so you know what has failed. > Also, can you provide some details as to what does cache mean over here ? If you decide to keep a file in HomeDir/files, if it's not in the permanent space, then it's "cached". If this doesn't make sense, please ask me a more specific question. > caching will also be in a way saving the file in the directory then how do > we differ the permanent storage and cache ? If a file is not stored in the perm space, then it goes into the cache space. Slide 16 of lecture 18 says: If a node *initiates* a GET or a STORE, the file goes into its permanent space. So, if you decide to keep a file for another other reason than the one stated above, you should keep it in the cache space. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 426.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 10 22:02:43 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAB62hRt014768 for ; Mon, 10 Nov 2008 22:02:43 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAB5vnMt024839 for ; Mon, 10 Nov 2008 21:57:49 -0800 Message-Id: <200811110557.mAB5vnMt024839@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551_Final2_StoreProb Date: Mon, 10 Nov 2008 21:57:49 -0800 From: Bill Cheng Someone wrote: > In case of the store message, if node A initiates a store message > with TTL=5 and sends it to say node B and C but Node B does not > store/forward it because of the probability returned. If node C > on the other hand stores it and then forwards to B, should node B > ignore/drop it because it has seen it before or simply compute a > new probability to determine whether to store it or not? If it has seen it, it must drop the message! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 425.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 10 21:52:24 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAB5qNFL014676 for ; Mon, 10 Nov 2008 21:52:23 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAB5lTWd024563 for ; Mon, 10 Nov 2008 21:47:29 -0800 Message-Id: <200811110547.mAB5lTWd024563@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: SHA1 function returning incorrect hash value Date: Mon, 10 Nov 2008 21:47:29 -0800 From: Bill Cheng Someone wrote: > Is there any similar utility like the one we had for warmup1 ( > ~csci551b/bin/filemd5 [-o offset] [file]) to check the SHA1 value ? You can run "openssl sha1 [file]". If you have a short ASCII string, you can do: echo -n "YOURSTRING" | openssl sha1 -- Bill Cheng // bill.cheng@usc.edu On Mon, Nov 10, 2008 at 7:45 PM, Bill Cheng wrote: > Someone wrote: > > > When I used SHA1() / MD5 function to calculate hash value of a string I > do > > get incorrect value. > > Could you give an example? > > > But if I used *SHA1_Init()*, *SHA1_Update()* and *SHA1_Final()* , > > collectively I do get correct hash value ? > > Same is the case with MD5. > > > > What could be the reason for this ? > > Bugs?! > > > Or its safe to use *SHA1_Init()*, * > > SHA1_Update()* and *SHA1_Final()* functions always ? > > They are equivalent. For example, in GetUOID(), we call > SHA1() directly. It would be an overkill to use > SHA1_Init(), SHA1_Update(), and SHA1_Final(). > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 424.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 10 19:50:08 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAB3o8uX013694 for ; Mon, 10 Nov 2008 19:50:08 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAB3jCh7023440 for ; Mon, 10 Nov 2008 19:45:12 -0800 Message-Id: <200811110345.mAB3jCh7023440@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: SHA1 function returning incorrect hash value Date: Mon, 10 Nov 2008 19:45:12 -0800 From: Bill Cheng Someone wrote: > When I used SHA1() / MD5 function to calculate hash value of a string I do > get incorrect value. Could you give an example? > But if I used *SHA1_Init()*, *SHA1_Update()* and *SHA1_Final()* , > collectively I do get correct hash value ? > Same is the case with MD5. > > What could be the reason for this ? Bugs?! > Or its safe to use *SHA1_Init()*, * > SHA1_Update()* and *SHA1_Final()* functions always ? They are equivalent. For example, in GetUOID(), we call SHA1() directly. It would be an overkill to use SHA1_Init(), SHA1_Update(), and SHA1_Final(). -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 423.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 10 09:43:54 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAAHhs6Z007787 for ; Mon, 10 Nov 2008 09:43:54 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAAHcpbk010604 for ; Mon, 10 Nov 2008 09:38:51 -0800 Message-Id: <200811101738.mAAHcpbk010604@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551: Final Project 2 : Queries Date: Mon, 10 Nov 2008 09:38:51 -0800 From: Bill Cheng Someone wrote: > I had the following queries about final project part2: > > 1. For the store command, if the user enters a file name which is not > located in the CWD or the path which he specified, what should be the > behavior of the node ? You should tell the user "file not found" or something equivalent. > 2. File ID = A UOID that identifies a file, for getting this file id, do we > have to use the getUOID function with filename and other parameters as the > input? You need to make sure that FileID is unique across the network. Calling GetUOID() is a good way to make sure that it is the case. > 3. A random 20-byte long *one-time password* is first generated. How do we > generate this password ? Can you please explain a bit about this. Do we have > to use the openssl for this? GetUOID() is a good function to use to get a 20-byte long random-looking block of data. In order to make it even *more random*, you should put something random in the obj_type (2nd argument to GetUOID()). You can call gettimeofday() and get the tv_usec field, format it as a string, and pass it as obj_type. > 4. *FileName* - name of the file. Is this the value which the user enters at > the command prompt when the store command is entered ? or say if he entered > /home/scf-07/song.mp3 then we have to take only the "song.mp3" part of it > and store it in this field ? Correct! You can call strrchr() to find the position of the last '/' character in a string. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 422.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Nov 9 15:20:37 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mA9NKaTx029026 for ; Sun, 9 Nov 2008 15:20:36 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mA9NFLFl031054 for ; Sun, 9 Nov 2008 15:15:21 -0800 Message-Id: <200811092315.mA9NFLFl031054@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: FInal Project Date: Sun, 09 Nov 2008 15:15:21 -0800 From: Bill Cheng Someone wrote: > How long do we have to wait for all the search responses Please use the same logic as STATUS. > and what is > the TTL for the search request( because there is no mention of TTL in > the commandline syntax)? Same as for JOIN and CHECK, i.e., from startup configuration file. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 421.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Nov 8 21:38:21 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mA95cLQh012588 for ; Sat, 8 Nov 2008 21:38:21 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mA95WsZj018345 for ; Sat, 8 Nov 2008 21:32:54 -0800 Message-Id: <200811090532.mA95WsZj018345@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: FInal Project Date: Sat, 08 Nov 2008 21:32:54 -0800 From: Bill Cheng Someone wrote: > For transferring file metadata to another node, is it sent in the > format it is written to file(including [metadata]) Yes. The file metadata is 7 lines of ASCII text (with lines terminated with ). The 7 lines are: [metadata] FileName=... FileSize=... SHA1=... Nonce=... Keywords=... Bit-vector=... > or do they have individual field sizes? I'm not sure what you meant by "individual field sizes". -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 420.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Nov 8 19:21:17 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mA93LHOq011545 for ; Sat, 8 Nov 2008 19:21:17 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mA93Fn6d017433 for ; Sat, 8 Nov 2008 19:15:49 -0800 Message-Id: <200811090315.mA93Fn6d017433@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: One doubt regarding caching!! Date: Sat, 08 Nov 2008 19:15:48 -0800 From: Bill Cheng Someone wrote: > For caching, I am using a seperate directory (cache directory) to keep > track of the cached files and not using files directory. Is it fine ?? Yes. The small disadvantage of this is that if you need to move a file from cache space to perm space, you have to actually move the file from one directory to another. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 419.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Nov 8 14:22:34 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mA8MMY92008917 for ; Sat, 8 Nov 2008 14:22:34 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mA8MH2b5014976 for ; Sat, 8 Nov 2008 14:17:02 -0800 Message-Id: <200811082217.mA8MH2b5014976@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: cs551 large file transfer Date: Sat, 08 Nov 2008 14:17:02 -0800 From: Bill Cheng Someone wrote: > Consider the scenario in which a node X is connected to the servant network > through only one node Y > > like X--->Y--->(rest of the SERVANT) > > Now suppose a huge file transfer is taking place between X & Y, will X > receive other requests or responses from the network? Since we modelled it > as one connection per neighbor and this socket is currently busy, how can we > deliver those messages correctly without interfering the active file > transfer? X will *not* receive other messages from Y during the large file transfer due to TCP's stream abstraction! > Will node X remain unseen to the rest of the network? If there is another node behind X, X can still forward messages to the network. Therefore, you should make sure X can send to Y and receive from Y concurrently (with some amount of interleaving). -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 418.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Nov 8 07:56:48 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mA8Fumvc002569 for ; Sat, 8 Nov 2008 07:56:48 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mA8FpCPd009236 for ; Sat, 8 Nov 2008 07:51:12 -0800 Message-Id: <200811081551.mA8FpCPd009236@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: FInal Project Date: Sat, 08 Nov 2008 07:51:12 -0800 From: Bill Cheng Someone wrote: > In the file metadata, the SHA1 for the filename will always remain the > same right? The SHA1 value for a file is just that SHA1 hash of the file content. If the file content does not change, the SHA1 value should not change. > Also to get the nonce for a file, is this the following > way to do it > > 1)generate a random 20 byte SHA1 value > 2)compute the SHA1 value of the value generated above If you are initiating a STORE, then yes. What you generate in (1) is the one-time password. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 417.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Nov 7 21:04:52 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mA854pP3028309 for ; Fri, 7 Nov 2008 21:04:52 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mA84x8D3003702 for ; Fri, 7 Nov 2008 20:59:08 -0800 Message-Id: <200811080459.mA84x8D3003702@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: index structures Date: Fri, 07 Nov 2008 20:59:08 -0800 From: Bill Cheng Someone wrote: > Is it compulsary to use a BST for the filename and sha1 index structures? The spec says: There is no efficiency requirement here So, you can just use a linear list (just like the one you used in warmup #2 for Q1). -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 416.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Nov 7 19:50:37 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mA83oahq027714 for ; Fri, 7 Nov 2008 19:50:36 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mA83iq4I003114 for ; Fri, 7 Nov 2008 19:44:52 -0800 Message-Id: <200811080344.mA83iq4I003114@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Final_Part1_delete Date: Fri, 07 Nov 2008 19:44:52 -0800 From: Bill Cheng Someone wrote: > I was working on the delete message and wanted to confirm the specs: > " > delete message (MessageType=0xBC) > Byte Pos Name Description > 27+ File Spec The File Spec is a specification for the file to delete. The spec should contain 3 lines: > > FileName=foo > SHA1=63de... > Nonce=fcca... > Password=bac9... > > The lines are separated by (i.e., "\r\n"). > " > > Does this imply that we should concatenate one of the 4 lines above to get 3 lines? It's a typo. It's fixed to say "4 lines". Thanks for catching it. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 415.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Nov 7 07:35:48 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mA7FZmwP020559 for ; Fri, 7 Nov 2008 07:35:48 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mA7FTtPh026946 for ; Fri, 7 Nov 2008 07:29:55 -0800 Message-Id: <200811071529.mA7FTtPh026946@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Doubt in Final project 2 Date: Fri, 07 Nov 2008 07:29:55 -0800 From: Bill Cheng Someone wrote: > I have a doubt with respect to the index files in final project- 2 > > "All 3 index structures must have a disk image so that after a node > restarts (after a crash or a shutdown), it can reconstruct the > in-memory index structures in a timely fashion. T'herefore, you must > provide 3 different index files in the home directory of each node." > > What exactly is the meaning of re-contruct here ? Do we need to build > the contents of these files again. Or do we just start of from the > info already existing in it - assuming its true? The spec says "reconstruct the in-memory index structures". It means that just before the node shuts down, a in-memory index structure is in a certain state. After the node restarts, the same in-memory index structure should be reconstructed in such a way that the previous state was restored. This should be done by just reading the corresponding index file (i.e., the index file should contain enough information so that this reconstruction is possible). > Also, when a node shuts down and then restarts - and it finds some of > the data files are missing ( can this scenario be possible ?) If you don't touch what's inside HomeDir, then this should not happen if your code has no bugs. Of course, if nunki lost power and your node does not have a chance to write out the contents of your in-memory index structures, then it's possible to have inconsistencies. But for this project, you don't have to worry about that. > then all > the references to this file in the index file need to be deleted - So > a check at start-up should be done to validate the index file > contents right ? You mean you are going to scan the whole mini-filesystem? Well, that's not required. For most real systems, the OS will do a fairly complete filesystem check if the machine did not shutdown properly. So, if you have extra time and want to implement a similar check for your mini-filesystem, you can certainly do it (but you won't get credit for it as far as grading goes). -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 414.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Nov 6 18:32:07 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mA72W7Hw012954 for ; Thu, 6 Nov 2008 18:32:07 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mA72Q6kB019607 for ; Thu, 6 Nov 2008 18:26:06 -0800 Message-Id: <200811070226.mA72Q6kB019607@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: part 2 queries Date: Thu, 06 Nov 2008 18:26:06 -0800 From: Bill Cheng Someone wrote: > -> when a node(not the one which initiates the store) receives a store > request but does not store the file because storeprob coin flip > failed, should it still flood the store request? No. Please see the last bullet on slide 15 of lecture 18. > -> when store command is given at a node, should we wait for command > to complete(flood etc) before showing the prompt again Since there is no store response, you should just show the prompt. > -> since bit vector is 1024 bits long, thats 1024/8 = 128 > bytes(characters), spec says "Bit-vector - hexstring-encoded (256 > characters long) bit-vector for the keywords, followed by " > did I get something wrong here? 128 bytes encoded in hexstring format *is* 256 characters long. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 413.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Nov 6 16:41:56 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mA70fu07011957 for ; Thu, 6 Nov 2008 16:41:56 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mA70ZsGO018848 for ; Thu, 6 Nov 2008 16:35:54 -0800 Message-Id: <200811070035.mA70ZsGO018848@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Basic Socket Programming Date: Thu, 06 Nov 2008 16:35:54 -0800 From: Bill Cheng Someone wrote: > I have a question regarding the Basics of Socket Programming. > -> > We know that the server side of the socket listens on a particular which > is then approached for connection by the client side. > Let us just consider the server side of the socket. > Whenever the server accepts a connection, it generates a new socket > descriptor for that connection and continues to listen for new connections. > I would like to know that in addition to the socket descriptor, does it > also get a new temporary port to which all future messages for that > connection are assigned or does it keep using the same port it was > listening to and the connections are separated according to the sockfd? It keeps using the same port. Each socket file descriptor is associated with a separate *connection*. A connection is uniquely defined by the 4-tuple: (Host_A_IP, Host_A_Port, Host_B_IP, Host_B_Port). So, in the case you are talking about several connection may have the same (Host_A_IP, Host_A_Port), but the corresponding (Host_B_IP, Host_B_Port) will all be different. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 412.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Nov 1 10:01:59 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mA1H1xAs001774 for ; Sat, 1 Nov 2008 10:01:59 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mA1GsVef015286 for ; Sat, 1 Nov 2008 09:54:31 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.14.2/8.14.1/Submit) id mA1GsV6l015285 for cs551@merlot; Sat, 1 Nov 2008 09:54:31 -0700 Date: Sat, 1 Nov 2008 09:54:31 -0700 From: Bill Cheng Message-Id: <200811011654.mA1GsV6l015285@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Your CS 551 submissions... Hi everyone, I just want to mention that since people are still making submissions, most likely, I will not collect your most-recent submission until tomorrow morning. So, please do not send me e-mail and ask me if I have your submissions. If you have examined the output of "bsubmit" carefully, you should know if the server got your submission. Have a nice weekend! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 411.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 31 19:00:36 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mA120aBZ024779 for ; Fri, 31 Oct 2008 19:00:36 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mA11qwYU005837 for ; Fri, 31 Oct 2008 18:52:58 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.14.2/8.14.1/Submit) id mA11qwgH005836 for cs551@merlot; Fri, 31 Oct 2008 18:52:58 -0700 Date: Fri, 31 Oct 2008 18:52:58 -0700 From: Bill Cheng Message-Id: <200811010152.mA11qwgH005836@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Final project part (1) submission deadline is tonight! Hi everyone, I've only got 4 submissions so far! I strongly suggest that you submit something soon (and please make backup and be very careful and do not wipe out anything you don't want to lose). Please also verify your submission: http://merlot.usc.edu/cs551-f08/submit.html#verify We need to be fair to all. So, if you miss submitting a file, there's nothing we can do after the deadline. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 410.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 31 18:56:30 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mA11uUns024696 for ; Fri, 31 Oct 2008 18:56:30 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mA11mqKp005772 for ; Fri, 31 Oct 2008 18:48:52 -0700 Message-Id: <200811010148.mA11mqKp005772@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS 551 group commitment e-mails... Date: Fri, 31 Oct 2008 18:48:52 -0700 From: Bill Cheng Since part (1) submission deadline is tonight, if you are doing a group project and you have not submitted your commitment e-mails, please do so before the submission deadline tonight! -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Mon, 27 Oct 2008 18:38:45 -0700 From: Bill Cheng To: cs551@merlot.usc.edu Subject: CS 551 group commitment e-mails... Hi everyone, If you are doing final project part (1) with a partner, please make sure you have followed the instructions at: http://merlot.usc.edu/cs551-f08/projects.html#group and have received my confirmation e-mail! Once grading starts, it would be too late to claim that someone is your partner! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 409.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 31 18:52:48 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mA11qm4I024634 for ; Fri, 31 Oct 2008 18:52:48 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mA11jARB005651 for ; Fri, 31 Oct 2008 18:45:10 -0700 Message-Id: <200811010145.mA11jARB005651@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: restart Date: Fri, 31 Oct 2008 18:45:10 -0700 From: Bill Cheng Someone wrote: > The B-2-b) part in the guideline says differently. Please resolve the > confusion. > Thanks, > > type "shutdown" in the 2nd window > (node *09 should do a CHECK, which should be seen by > node *06) > (node *09 should notice that it has not received a > CHECK-response from a beacon node and delete its > init_neighbor_list and restart and rejoin the > network, it should put node *07 in its init_neighbor_list) > (after node *09 restarts, node *06 should do a CHECK, but > since it doesn't have a neighbor, it should not send > CHECK messages, then it should delete its > init_neighbor_list and restart and rejoin the > network, it should put node *07 or node *09 in its > init_neighbor_list) Since this is the grading guidelines, it does *not* describe everything is detail. So, where it said: > (node *09 should notice that it has not received a > CHECK-response from a beacon node and delete its > init_neighbor_list and restart and rejoin the Some details were skipped. Node *09 cannot get a CHECK response, so it restarts. After it restarts, it cannot connect to the node in its init_neighbor_list, it deletes the init_neighbor_list, and so on. -- Bill Cheng // bill.cheng@usc.edu On Fri, Oct 31, 2008 at 9:12 AM, Bill Cheng wrote: > Someone wrote: > > > On not receiveing a check response within the stipulated time or when > not > > able to connect to enough neighbors in init_neighbor_list file, we do a > > soft-restart so do we delete the init_neighbor_list file in the former > case > > also or in both cases? > > In the first case (CHECK failed), you should not delete init_neighbor_list > file. > > In the 2nd case (when you start/restart with init_neighbor_list > file and cannot find MinNeighbors number of neighbors), then you > delete init_neihbor_list file. > > > Also should the log file be deleted for these cases ? > > No. You only delete the log file when your node is started with > -reset. > > > Also, should we assume that the startup.ini that is going to be > provided, > > will be in the home directory? > > No. It can be anywhere. Even in /tmp. It's a commandline > argument, you just need to open the file. You don't need to > do anything special with the filename. After you've parsed > the file, you know the HomeDir of this node. > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 408.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 31 18:46:49 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mA11knvZ024524 for ; Fri, 31 Oct 2008 18:46:49 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mA11dBAS005545 for ; Fri, 31 Oct 2008 18:39:11 -0700 Message-Id: <200811010139.mA11dBAS005545@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: 551 - server's time Date: Fri, 31 Oct 2008 18:39:11 -0700 From: Bill Cheng Someone wrote: > How can I check the time of the bistro server? http://merlot.usc.edu/bistro/myip.html -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 407.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 31 17:35:05 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mA10Z5KZ024016 for ; Fri, 31 Oct 2008 17:35:05 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mA10ksOn005176 for ; Fri, 31 Oct 2008 17:46:54 -0700 Message-Id: <200811010046.mA10ksOn005176@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: busy-waiting Date: Fri, 31 Oct 2008 17:46:54 -0700 From: Bill Cheng Someone wrote: > You just mentioned that our program shouldn't appear on TOP. > However, my program only uses 0.05% and still on TOP. If you only use 0.05% of the *CPU*, your job will not stay there very long! Remember, the rule is that it needs to stay over 1% for over 10 seconds. > Where is the very easy way to fix it that you said in the previous email? > I tried to find it but no luck. 0.05% is probably normal. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 406.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 31 16:21:41 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9VNLeo0023280 for ; Fri, 31 Oct 2008 16:21:41 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9VNXSDM004485 for ; Fri, 31 Oct 2008 16:33:28 -0700 Message-Id: <200810312333.m9VNXSDM004485@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551 Final1 Date: Fri, 31 Oct 2008 16:33:28 -0700 From: Bill Cheng Someone wrote: > Do the log files and neighbor list files have to be stored in the > 'files' folder under HomeDir or is it just under HomeDir? Just HomeDir. (For part (1), you don't need the "files" directory under HomeDir.) -- Bill Cheng // bill.cheng@usc.edu On Fri, Oct 31, 2008 at 12:17 PM, Bill Cheng wrote: > Hi Everyone, > > Just a clarification... Regarding busy-waiting, this > is about taking up lots of CPU time *persistently*. > > So, if your node is eating up lots of CPU time for a > long period of time (say 10 seconds), then this applies. > If you only show up in "top" for one second and then > disappaer, then it's not considered busy-waiting. > -- > Bill Cheng // bill.cheng@usc.edu > > > > -----Original Message----- > Date: Fri, 31 Oct 2008 07:44:23 -0700 > From: Bill Cheng > To: cs551@merlot.usc.edu > Subject: Re: CS551 Final1 > > Someone wrote: > > > What is the high percentage numbers for which it will be > > considered a busy wait? > > 1%. Why not just fix the bug? I've described a very simple > way to fix it. > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 405.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 31 16:20:27 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9VNKR2N023250 for ; Fri, 31 Oct 2008 16:20:27 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9VNWE8H004446 for ; Fri, 31 Oct 2008 16:32:14 -0700 Message-Id: <200810312332.m9VNWE8H004446@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: fprintf() Date: Fri, 31 Oct 2008 16:32:14 -0700 From: Bill Cheng Someone wrote: > Where will be the HomeDir obtained from the ini file be used ? e.g If the > HomeDir is a/b/n??, does it mean that the log file and the > init_neighbor_list file should be stored in a/b/n?? . Please see: http://merlot.usc.edu/cs551-f08/msgs/bill/313.txt The logfile name should be created in the same manner: char logfile_path[256]; snprintf(logfile_path, sizeof(logfile_path), "%s/servant.log", home_dir); > The HomeDir in all the .ini files is /tmp/final1/n??. Did you check out any of the startup configuration file referenced in the grading guidelines? None of them are in /tmp/final1. > So can we simply hardcode /tmp/final1/n?? for > the init_neighbor_list file & logfile path ? No! You should not hardcode *anything* (well, except when you need to create a temporary file by using mkstemp(), you can hardcode "/tmp" as the directory for temporary files). -- Bill Cheng // bill.cheng@usc.edu On Fri, Oct 31, 2008 at 1:40 PM, Bill Cheng wrote: > Someone wrote: > > > The status.out file should be stored in the current working directory > (where > > the code is being run from and where the executable is) right ? > > That's not the right definition of "current working directory". > The "current working directory" of your program is the > "working directory" of the shell program when you invoke > your program. In your UNIX shell, if you type: > > pwd > > it will print out the current working directory of your shell. > > Let's say that your source and executable are in > /home/somewhere/final/part1. I can run your program as follows: > > cd /tmp > pwd > /home/somewhere/final/part1/sv_node ~csci551b/public/final1/b1-n00.ini > > Then /tmp is your "current working directory". How would you > know? In your main(), you can do: > > char current_working_dir[256]; > > getcwd(current_working_dir, sizeof(current_working_dir)); > > and current_working_dir will be "/tmp". > > > When different nodes try to write to the file, sometimes the file is > blank > > for some nodes...all run the same code ! > > > > What could be the problem ? > > Don't know! Debug, debug, debug! > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 404.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 31 13:29:13 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9VKTDwh021497 for ; Fri, 31 Oct 2008 13:29:13 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9VKexU2002079 for ; Fri, 31 Oct 2008 13:40:59 -0700 Message-Id: <200810312040.m9VKexU2002079@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: fprintf() Date: Fri, 31 Oct 2008 13:40:59 -0700 From: Bill Cheng Someone wrote: > The status.out file should be stored in the current working directory (where > the code is being run from and where the executable is) right ? That's not the right definition of "current working directory". The "current working directory" of your program is the "working directory" of the shell program when you invoke your program. In your UNIX shell, if you type: pwd it will print out the current working directory of your shell. Let's say that your source and executable are in /home/somewhere/final/part1. I can run your program as follows: cd /tmp pwd /home/somewhere/final/part1/sv_node ~csci551b/public/final1/b1-n00.ini Then /tmp is your "current working directory". How would you know? In your main(), you can do: char current_working_dir[256]; getcwd(current_working_dir, sizeof(current_working_dir)); and current_working_dir will be "/tmp". > When different nodes try to write to the file, sometimes the file is blank > for some nodes...all run the same code ! > > What could be the problem ? Don't know! Debug, debug, debug! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 403.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 31 13:21:29 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9VKLTp3021330 for ; Fri, 31 Oct 2008 13:21:29 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9VKXFDo001866 for ; Fri, 31 Oct 2008 13:33:15 -0700 Message-Id: <200810312033.m9VKXFDo001866@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: User Input Date: Fri, 31 Oct 2008 13:33:15 -0700 From: Bill Cheng Someone wrote: > In case of User Input, is it always going to be the case that we get the > following commandline: > status neighbors TTL FILENAME. > or TTL and FILENAME are to be considered as options Neither TTL nor FILENAME are optional! If the user did not provide them, you can just print an error message and ask the user to try again. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 402.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 31 13:17:43 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9VKHhtZ021272 for ; Fri, 31 Oct 2008 13:17:43 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9VKTThW001758 for ; Fri, 31 Oct 2008 13:29:29 -0700 Message-Id: <200810312029.m9VKTThW001758@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Question regarding Notify Date: Fri, 31 Oct 2008 13:29:29 -0700 From: Bill Cheng Someone wrote: > I have a question. > In case of non-beacons, they should do a self restart if their neighbors > fall below minneighbor. That's not correct. Checking MinNeighbor is only required *when a node starts/restarts*. > So, in this case, if a non-beacon receives a > notify from another node, should it check the count of its neighbors > instead of sending a check message and soft restart or should it send > check anyway ? It should just flood a CHECK. So, even if MinNeighbor is 5, it is possible for a regular node to have just one active connection. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 401.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 31 12:58:37 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9VJwbRP021043 for ; Fri, 31 Oct 2008 12:58:37 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9VKANvK001324 for ; Fri, 31 Oct 2008 13:10:23 -0700 Message-Id: <200810312010.m9VKANvK001324@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: cs551 is it a bug in grading-guideline? Date: Fri, 31 Oct 2008 13:10:23 -0700 From: Bill Cheng Someone wrote: > Node doesn't fwd join request to temporary link(haven't receive hello), > is it correct? Correct. > So I guess in (c)(2)(a),(c)(3)(a), and(c)(3)(b), we should also wait 10 > seconds between the starting of the nodes. Otherwise, if we start all > regular nodes one after another very quickly, all regular nodes will > have neighbors only with beacon nodes. I think so, but not sure. Usually, it takes time to switch window. So, for JoinTimeout=5, we don't need to wait extra time. The grader will not be "starting nodes as fast as she can". The normal thing is to start a node, observe that it's doing the right thing, before starting another node. -- Bill Cheng // bill.cheng@usc.edu Bill Cheng wrote: > Someone wrote: > > > I'm not quite sure it's a bug in the grading-guideline: > > > > ------------------------------------------------------------------------------ > > (C) Network with 2 beacon nodes : +22 points > > ------------------------------------------------------------------------------ > > (2) (c) restart only 1 beacon plus all of the 4 regular nodes, > > all regular nodes should fail > > The conclusion is true only when start 4 regular with -reset. > > > > But if grader follows the sequence, (2)(a), (2)(b), (2)(c), > > after (2)(b), > > n03 has (n00,n01) in its init_neighbor_list; > > n02 has (n00,n03) in its init_neighbor_list; > > n08 has (n00,n01) in its init_neighbor_list. > > Then in (2)(c), after starting n03, if grader starts n02 quickly, > > n02 will connect n00 and n03 successfully, then keep alive. > > Then n03 got neighbor n02 plus original n00, then also survive. > > And n08 starts, thru n00, it could find new neighbors. > > > > I've tested it with my code, but not sure. > > I think you are correct if the nodes get started quickly. > Since JoinTimeout is 5 seconds, I should add "wait 10 seconds" > between the starting of the nodes to make sure that all > regular nodes will fail to start. > > I'll update the grading guidelines soon. Thanks for catching > the bug! > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 400.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 31 12:05:43 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9VJ5hXW020566 for ; Fri, 31 Oct 2008 12:05:43 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9VJHSWK000342 for ; Fri, 31 Oct 2008 12:17:28 -0700 Message-Id: <200810311917.m9VJHSWK000342@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551 Final1 Date: Fri, 31 Oct 2008 12:17:28 -0700 From: Bill Cheng Hi Everyone, Just a clarification... Regarding busy-waiting, this is about taking up lots of CPU time *persistently*. So, if your node is eating up lots of CPU time for a long period of time (say 10 seconds), then this applies. If you only show up in "top" for one second and then disappaer, then it's not considered busy-waiting. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Fri, 31 Oct 2008 07:44:23 -0700 From: Bill Cheng To: cs551@merlot.usc.edu Subject: Re: CS551 Final1 Someone wrote: > What is the high percentage numbers for which it will be > considered a busy wait? 1%. Why not just fix the bug? I've described a very simple way to fix it. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 399.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 31 09:55:30 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9VGtUZm019204 for ; Fri, 31 Oct 2008 09:55:30 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9VH7DJD030046 for ; Fri, 31 Oct 2008 10:07:13 -0700 Message-Id: <200810311707.m9VH7DJD030046@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: nam output Date: Fri, 31 Oct 2008 10:07:13 -0700 From: Bill Cheng Someone wrote: > In my nam output, i am getting duplicate nodes as well as links. > > so if i have 4 beacon network, i get a completed netwrk with everybody fully > connected and apart from that there are 3 nodes duplicates in the file which > are isolated i.e. these just appear in the o/p. > > is this nam o/p correct or do we need to avoid duplicates ? YOu need to avoid duplication of nodes (duplication of links are okay). It should be easy to do! -- Bill Cheng // bill.cheng@usc.edu On Fri, Oct 31, 2008 at 7:51 AM, Bill Cheng wrote: > Someone wrote: > > > My output of nam has many subnets and each subnet is not > > connected to another. > > Is it correct or should we make it become one network? > > The nam file should reflect what your network look like. > > Given the way we do STATUS requests and responses, it's > by definition that our network should be connected. > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 398.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 31 09:50:17 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9VGoHrb019047 for ; Fri, 31 Oct 2008 09:50:17 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9VH2AjK029861 for ; Fri, 31 Oct 2008 10:02:10 -0700 Message-Id: <200810311702.m9VH2AjK029861@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: cs551 is it a bug in grading-guideline? Date: Fri, 31 Oct 2008 10:02:10 -0700 From: Bill Cheng Someone wrote: > I'm not quite sure it's a bug in the grading-guideline: > > ------------------------------------------------------------------------------ > (C) Network with 2 beacon nodes : +22 points > ------------------------------------------------------------------------------ > (2) (c) restart only 1 beacon plus all of the 4 regular nodes, > all regular nodes should fail > The conclusion is true only when start 4 regular with -reset. > > But if grader follows the sequence, (2)(a), (2)(b), (2)(c), > after (2)(b), > n03 has (n00,n01) in its init_neighbor_list; > n02 has (n00,n03) in its init_neighbor_list; > n08 has (n00,n01) in its init_neighbor_list. > Then in (2)(c), after starting n03, if grader starts n02 quickly, > n02 will connect n00 and n03 successfully, then keep alive. > Then n03 got neighbor n02 plus original n00, then also survive. > And n08 starts, thru n00, it could find new neighbors. > > I've tested it with my code, but not sure. I think you are correct if the nodes get started quickly. Since JoinTimeout is 5 seconds, I should add "wait 10 seconds" between the starting of the nodes to make sure that all regular nodes will fail to start. I'll update the grading guidelines soon. Thanks for catching the bug! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 397.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 31 09:00:32 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9VG0Wkq018503 for ; Fri, 31 Oct 2008 09:00:32 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9VGCOdc028809 for ; Fri, 31 Oct 2008 09:12:24 -0700 Message-Id: <200810311612.m9VGCOdc028809@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: restart Date: Fri, 31 Oct 2008 09:12:24 -0700 From: Bill Cheng Someone wrote: > On not receiveing a check response within the stipulated time or when not > able to connect to enough neighbors in init_neighbor_list file, we do a > soft-restart so do we delete the init_neighbor_list file in the former case > also or in both cases? In the first case (CHECK failed), you should not delete init_neighbor_list file. In the 2nd case (when you start/restart with init_neighbor_list file and cannot find MinNeighbors number of neighbors), then you delete init_neihbor_list file. > Also should the log file be deleted for these cases ? No. You only delete the log file when your node is started with -reset. > Also, should we assume that the startup.ini that is going to be provided, > will be in the home directory? No. It can be anywhere. Even in /tmp. It's a commandline argument, you just need to open the file. You don't need to do anything special with the filename. After you've parsed the file, you know the HomeDir of this node. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 396.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 31 08:20:48 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9VFKmb2018091 for ; Fri, 31 Oct 2008 08:20:48 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9VFWd01028196 for ; Fri, 31 Oct 2008 08:32:39 -0700 Message-Id: <200810311532.m9VFWd01028196@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: timeout Date: Fri, 31 Oct 2008 08:32:39 -0700 From: Bill Cheng Someone wrote: > I have a quick question when I write timer thread. > > Could you tell me which understanding between the following is > correct? Let's take the join timeout for example. > > 1->Before Join timeout, the program just block there to receive > any amount of join_response message. After timeout, the node > select the nearest nodes to add to neighbor list. Then it send > hello message, and do the following thing.(Ctrl-C could interrupt > timeout) > > > 2->If before the join timeout, the node has received > enough(InitNeighbors) join response. Then it goes to the > following steps. In this case, the timeout is used to test when > timeout occurs, there are not enough nodes response the join > request. > > 1 or 2 is correct? (1) is more correct than (2). You should wait for the join timeout to expire. (You should also do a soft restart before you start making connections and saying hellos to your new neighbors.) -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 395.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 31 07:41:40 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9VEfe32017647 for ; Fri, 31 Oct 2008 07:41:40 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9VErVQA027707 for ; Fri, 31 Oct 2008 07:53:31 -0700 Message-Id: <200810311453.m9VErVQA027707@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: prompt at startup Date: Fri, 31 Oct 2008 07:53:31 -0700 From: Bill Cheng Someone wrote: > When our program just launched, do we have to show prompt > immediately? You mean like within 1 millisecond? There is no such requirement. But you should show the prompt and ready to accept user command when all threads *on this node* are up and running. > We plan to show prompt until every node is joined the network, > because it's possible that user enter status command but network > is not constructed. > Which way is correct? We have a peer-to-peer network, you may never know when every node has joined the network. Also, it's expected that some nodes will be down, although you are not suppose to know which ones. So, you should not wait as you are suggesting. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 394.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 31 07:39:09 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9VEd9N7017592 for ; Fri, 31 Oct 2008 07:39:09 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9VEp0tL027667 for ; Fri, 31 Oct 2008 07:51:00 -0700 Message-Id: <200810311451.m9VEp0tL027667@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: nam output Date: Fri, 31 Oct 2008 07:51:00 -0700 From: Bill Cheng Someone wrote: > My output of nam has many subnets and each subnet is not > connected to another. > Is it correct or should we make it become one network? The nam file should reflect what your network look like. Given the way we do STATUS requests and responses, it's by definition that our network should be connected. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 393.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 31 07:36:59 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9VEaxdR017545 for ; Fri, 31 Oct 2008 07:36:59 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9VEmogq027608 for ; Fri, 31 Oct 2008 07:48:50 -0700 Message-Id: <200810311448.m9VEmogq027608@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: cs551 about logging Date: Fri, 31 Oct 2008 07:48:50 -0700 From: Bill Cheng Someone wrote: > The spec says "The log file should deleted only when a node is started > with the -reset commandline option." So if node starts without -reset, > the records should be added at the end of the log file, right? Correct. If you use fopen(), the last argument should be "a". > So when node shutdown, we should add an line like "** node shutdown **", > otherwise we can't distinguish between two run times in the log, is it > correct? That would certainly help with grading if there are any issues. Please make sure you begin the line with "//". -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 392.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 31 07:32:32 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9VEWWMp017485 for ; Fri, 31 Oct 2008 07:32:32 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9VEiNGB027452 for ; Fri, 31 Oct 2008 07:44:23 -0700 Message-Id: <200810311444.m9VEiNGB027452@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551 Final1 Date: Fri, 31 Oct 2008 07:44:23 -0700 From: Bill Cheng Someone wrote: > What is the high percentage numbers for which it will be > considered a busy wait? 1%. Why not just fix the bug? I've described a very simple way to fix it. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 391.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Oct 30 21:20:36 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9V4Kaq2010755 for ; Thu, 30 Oct 2008 21:20:36 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9V4WKRB019499 for ; Thu, 30 Oct 2008 21:32:20 -0700 Message-Id: <200810310432.m9V4WKRB019499@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551 final1 - Notify Date: Thu, 30 Oct 2008 21:32:20 -0700 From: Bill Cheng Someone wrote: > Sorry, as a side note, I think you need to have a link of some kind too. Two > nodes wont do it Well, for our project, we are only displaying connected graphs. So, that's not an issue. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- From: Bill Cheng [mailto:william@bourbon.usc.edu] Sent: Thursday, October 30, 2008 9:21 PM To: cs551@merlot.usc.edu Subject: Re: CS551 final1 - Notify Someone wrote: > Does nam not work on files with only a single node...I tried a few with no > luck. Please see: http://merlot.usc.edu/cs551-f08/msgs/bill/362.txt -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 390.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Oct 30 21:09:03 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9V493RG010639 for ; Thu, 30 Oct 2008 21:09:03 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9V4KlAj019173 for ; Thu, 30 Oct 2008 21:20:47 -0700 Message-Id: <200810310420.m9V4KlAj019173@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551 final1 - Notify Date: Thu, 30 Oct 2008 21:20:47 -0700 From: Bill Cheng Someone wrote: > Does nam not work on files with only a single node...I tried a few with no > luck. Please see: http://merlot.usc.edu/cs551-f08/msgs/bill/362.txt -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 389.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Oct 30 18:23:55 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9V1Nt4l009309 for ; Thu, 30 Oct 2008 18:23:55 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9V1ZbPQ017520 for ; Thu, 30 Oct 2008 18:35:37 -0700 Message-Id: <200810310135.m9V1ZbPQ017520@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551 final1 - Notify Date: Thu, 30 Oct 2008 18:35:37 -0700 From: Bill Cheng Someone wrote: > When would we be needed to send notify messages ? > > The only times I can think of are when a user types the shutdown command or > when the Auto-shutdown timer runs out. Is there any other place where we > would need to send notify messages ? I'm not sure why you said that. The spec says: The notify message is used by a node to inform its neighbor that it is about to close the connection. It doesn't matter why you are closing the connection! -- Bill Cheng // bill.cheng@usc.edu On Mon, Oct 27, 2008 at 11:10 AM, Bill Cheng wrote: > Someone wrote: > > > For notify message, what is the 'error code' field when auto shutdown? > > I would use 1 or 3. (The actual code is not used by anything > else, so the value shouldn't really matter to anyone! You > can just choose something that you think is the closest.) > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 388.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Oct 30 18:20:51 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9V1Kpv3009263 for ; Thu, 30 Oct 2008 18:20:51 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9V1WXNZ017459 for ; Thu, 30 Oct 2008 18:32:33 -0700 Message-Id: <200810310132.m9V1WXNZ017459@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551 Final1 Date: Thu, 30 Oct 2008 18:32:33 -0700 From: Bill Cheng Someone wrote: > Professor- > > I occasionally cant open some file with nam and I don’t understand why as > the files look fine to me. I get the following error, but the attached file > looks fine? > > Unexpected end of line in: n -t * -s 16139 -c red -i black > Perhaps you are missing a value following the attribute flag. > Last parsed attribute flag was -i > > Unexpected end of line in: n -t * -s 16138 -c red -i black > :òPerhaps you are missing a value following the attribute flag. > Last parsed attribute flag was -i > > Unexpected end of line in: n -t * -s 16137 -c red -i black > ;å¨Perhaps you are missing a value following the attribute flag. > Last parsed attribute flag was -i > > Unexpected end of line in: n -t * -s 16136 -c red -i black > 7Р_ITEPerhaps you are missing a value following the attribute flag. > Last parsed attribute flag was -i I don't know what these error messages are about. As long as nam comes up and show the correct topology, then it's fine! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 387.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Oct 30 18:13:21 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9V1DLBl009192 for ; Thu, 30 Oct 2008 18:13:21 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9V1P3dZ017274 for ; Thu, 30 Oct 2008 18:25:03 -0700 Message-Id: <200810310125.m9V1P3dZ017274@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551 Final1 Date: Thu, 30 Oct 2008 18:25:03 -0700 From: Bill Cheng Someone wrote: > From the spec: "The check message is used by a node to see if it is still > connected to the core of the SERVANT network." > The Beacon node is a part of the core of the SERVANT network. If a beacon > node goes down, the rest of the beacon nodes would keep retrying to connect > to this node. Then why should a beacon node send check message? You are absolutely correct. Sorry, I miss-read the question! (I guess I've been anwering too many e-mails!) Although my answer was correct (except for the "yes" part). I thought the question was about NOTIFY. -- Bill Cheng // bill.cheng@usc.edu On Thu, Oct 30, 2008 at 2:22 PM, Bill Cheng wrote: > Someone wrote: > > > Does a beacon node need to send check message when it loses > > connection from one of its neighbors? > > Yes. Remember, the rule is that if you have sent HELLO, > you need to send GOOD-BYE (i.e., NOTIFY). > > > If a beacon node's NoCheck=1 and a non-beacon node's NoCheck = 0, > > the beacon node will ignore the check message, so it means that > > the non-beacon node will think itself is not part of the network, > > is it right? > > This will never happen during grading. Either NoCheck=0 for > all nodes, or NoCheck=1 for all nodes. This is done so that > your part (2) does not depend on part (1) *completely* working > properly. > > > For Error Code of notify message, which value does timeout (Auto > > shutdown) use? > > Please see: > > http://merlot.usc.edu/cs551-f08/msgs/bill/341.txt > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 386.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Oct 30 14:10:55 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9ULAt22007277 for ; Thu, 30 Oct 2008 14:10:55 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9ULMZ3J014852 for ; Thu, 30 Oct 2008 14:22:35 -0700 Message-Id: <200810302122.m9ULMZ3J014852@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551 Final1 Date: Thu, 30 Oct 2008 14:22:35 -0700 From: Bill Cheng Someone wrote: > Does a beacon node need to send check message when it loses > connection from one of its neighbors? Yes. Remember, the rule is that if you have sent HELLO, you need to send GOOD-BYE (i.e., NOTIFY). > If a beacon node's NoCheck=1 and a non-beacon node's NoCheck = 0, > the beacon node will ignore the check message, so it means that > the non-beacon node will think itself is not part of the network, > is it right? This will never happen during grading. Either NoCheck=0 for all nodes, or NoCheck=1 for all nodes. This is done so that your part (2) does not depend on part (1) *completely* working properly. > For Error Code of notify message, which value does timeout (Auto > shutdown) use? Please see: http://merlot.usc.edu/cs551-f08/msgs/bill/341.txt -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 385.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Oct 30 11:42:04 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,WEIRD_PORT autolearn=no version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9UIg4dF006010 for ; Thu, 30 Oct 2008 11:42:04 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9UIrgKO012993 for ; Thu, 30 Oct 2008 11:53:42 -0700 Message-Id: <200810301853.m9UIrgKO012993@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: gethostbyname giving error Date: Thu, 30 Oct 2008 11:53:42 -0700 From: Bill Cheng Someone wrote: > In the c8-n07.ini file, there is only 1 beacon node which is > localhost:18007, so when gethostname is called and say it returns > nunki,usc.edu, what should be done? "c8-n07.ini" looks like: [init] Port=18007 Location=30687 HomeDir=/home/scf-22/csci551b/tmp/final1/n07 AutoShutdown=90 MsgLifetime=15 KeepAliveTimeout=10 [beacons] nunki.usc.edu:18007= Let's say hostname_str contains "nunki.usc.edu" and port_str contains "18007", which is what you have read from the [init] section. Then you can do: char buf[256]; snprintf(buf, sizeof(buf), "%s:%s", hostname_str, port_str); Then you can see if what's in buf can be found as a key in the [beacons] section of the same startup configuration file. If it can be found, this node is a beacon node. Otherwise, it's regular node. -- Bill Cheng // bill.cheng@usc.edu On Thu, Oct 30, 2008 at 11:44 AM, Bill Cheng wrote: > Someone wrote: > > > Does a beacon node get its hostname from the startup configuration fle > > or by gethostname()? > > A node first calls gethostname() and then compare it with > what's in the startup configuration to determine if it is a > beacon node. > -- > Bill Cheng // bill.cheng@usc.edu > > > > > On Thu, Oct 30, 2008 at 8:53 AM, Bill Cheng wrote: > > Someone wrote: > > > > > gethostbyname is returning null, saying Too many open files. Please help. > > > > If you write a small program with just a call to gethostbyname() > > in it, I assume that works. Therefore, the problem is not > > gethostbyname(). May be you have too many files/sockets opened. > > Do you know how many files/sockets you have opened? > > > > In general, you need to know how much resources you are using. > > -- > > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 384.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Oct 30 11:32:52 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9UIWqjV005909 for ; Thu, 30 Oct 2008 11:32:52 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9UIiTJt012538 for ; Thu, 30 Oct 2008 11:44:29 -0700 Message-Id: <200810301844.m9UIiTJt012538@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: gethostbyname giving error Date: Thu, 30 Oct 2008 11:44:29 -0700 From: Bill Cheng Someone wrote: > Does a beacon node get its hostname from the startup configuration fle > or by gethostname()? A node first calls gethostname() and then compare it with what's in the startup configuration to determine if it is a beacon node. -- Bill Cheng // bill.cheng@usc.edu On Thu, Oct 30, 2008 at 8:53 AM, Bill Cheng wrote: > Someone wrote: > > > gethostbyname is returning null, saying Too many open files. Please help. > > If you write a small program with just a call to gethostbyname() > in it, I assume that works. Therefore, the problem is not > gethostbyname(). May be you have too many files/sockets opened. > Do you know how many files/sockets you have opened? > > In general, you need to know how much resources you are using. > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 383.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Oct 30 09:32:35 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9UGWZXl004609 for ; Thu, 30 Oct 2008 09:32:35 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9UGiBcF009842 for ; Thu, 30 Oct 2008 09:44:11 -0700 Message-Id: <200810301644.m9UGiBcF009842@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: cs551 final1 Date: Thu, 30 Oct 2008 09:44:11 -0700 From: Bill Cheng Someone wrote: > On Thu, Oct 30, 2008 at 8:56 AM, Bill Cheng wrote: > > Someone wrote: > > > > > Two quick questions about final part1 > > > 1) Autoshutdown won't be changed by any event, right? > > > (e.g. restart won't reset autoshutdown) > > > > Correct! > > > > -------> > This node must therefore rejoin the network (delete its > init_neighbor_list file, gracefully shut itself down, and start itself > again as if it has never been part of the network) Should'nt this > restart the autoshutdown timer? No. > If a node with auto shutdown of 60 > seconds rejoins the network because it lost connectivity to core of > network at the 58th second, will it shutdown in 2 seconds? Yes. Just like warmup #1, the main reason for having autoshutdown is to make sure that you don't have a job running on nunki forever! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 382.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Oct 30 08:45:00 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9UFj0Vt004125 for ; Thu, 30 Oct 2008 08:45:00 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9UFua64008661 for ; Thu, 30 Oct 2008 08:56:36 -0700 Message-Id: <200810301556.m9UFua64008661@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: cs551 final1 Date: Thu, 30 Oct 2008 08:56:36 -0700 From: Bill Cheng Someone wrote: > Two quick questions about final part1 > 1) Autoshutdown won't be changed by any event, right? > (e.g. restart won't reset autoshutdown) Correct! > 2) spec doesn't mention where the log file path and its name, > I suppose it should be in HomeDir (like init_neighbor_list) and > its name is servant.log, is it right? Correct, if nothing in the startup configuration file overrides this. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 381.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Oct 30 08:41:47 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9UFflIL004080 for ; Thu, 30 Oct 2008 08:41:47 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9UFrNS5008549 for ; Thu, 30 Oct 2008 08:53:23 -0700 Message-Id: <200810301553.m9UFrNS5008549@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: gethostbyname giving error Date: Thu, 30 Oct 2008 08:53:23 -0700 From: Bill Cheng Someone wrote: > gethostbyname is returning null, saying Too many open files. Please help. If you write a small program with just a call to gethostbyname() in it, I assume that works. Therefore, the problem is not gethostbyname(). May be you have too many files/sockets opened. Do you know how many files/sockets you have opened? In general, you need to know how much resources you are using. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 380.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Oct 30 08:39:41 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9UFdfol004006 for ; Thu, 30 Oct 2008 08:39:41 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9UFpGpX008420 for ; Thu, 30 Oct 2008 08:51:16 -0700 Message-Id: <200810301551.m9UFpGpX008420@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CPU Hog Date: Thu, 30 Oct 2008 08:51:16 -0700 From: Bill Cheng Hi, I'm forwarding an e-mail from a student. I'm not sure if this is related to the same problem another student was talking about. But here it is. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Thu, 30 Oct 2008 00:24:27 -0700 From: "Brian A. Trimmer" To: Bill Cheng Subject: Re: CPU Hog Not sure if this is the same case, but I had a similar situation and solved it by reblocking SIGINT once I had caught it: while (true) { /** define sigs to catch **/ sigaddset(&sigs, SIGINT); pthread_sigmask(SIG_UNBLOCK, &sigs, NULL); sigwait(&sigs,&caught); //caught a sig pthread_sigmask(SIG_BLOCK, &sigs, NULL); //block any further sigs /** do stuff **/ } This way the SIGINT is blocked until the next time around the while loop, where it is unblocked and caught On Wed, Oct 29, 2008 at 7:42 PM, Bill Cheng wrote: > Someone wrote: > > > I am using pthread_sigmask to unblock the SIGINT signal in my command line > > handler thread. I am catching and handling the signal in the same thread. > > But my thread is not able to catch more than one SIGINT. I called sighandler > > within sighandler but nothing seems to be working. My program terminates on > > the second Ctrl+C. > > I just tried the code in "man pthread_sigmask" again (with a > little modification so that it loops forever) and it seems to > work just fine. I can send after and it > kept going. > > In that code, it uses sigaction() to specify a signal handler. > Are you doing that? Or are you using signal()? > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 379.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Oct 29 21:46:43 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00, LOCALPART_IN_SUBJECT autolearn=no version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9U4khT0028414 for ; Wed, 29 Oct 2008 21:46:43 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9U4wBhD029419 for ; Wed, 29 Oct 2008 21:58:11 -0700 Message-Id: <200810300458.m9U4wBhD029419@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: cs551 Date: Wed, 29 Oct 2008 21:58:11 -0700 From: Bill Cheng Someone wrote: > When a non-beacon node receives a notify message from one of its > neighbors(who has been shutdown/autoshutdown), shud it permanently remove it > from its init_neighbor_list file ? The init_neighbor_list is a write-once file. Once it has been created, the only thing you can do to it is to delete it. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 378.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Oct 29 21:00:48 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9U40lCB028059 for ; Wed, 29 Oct 2008 21:00:47 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9U4CF41028593 for ; Wed, 29 Oct 2008 21:12:15 -0700 Message-Id: <200810300412.m9U4CF41028593@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: non-beacon node notify and log dropped message Date: Wed, 29 Oct 2008 21:12:15 -0700 From: Bill Cheng Someone wrote: > I am trying to get nam to work and I don't really know how. I went to > http://www.isi.edu/nsnam/nam/index.html downloaded the windows version and > tries to open my nam file and I didn't look like anything. I also tried nam > in an xwin session and it wasn't familiar with the nam command. Any ideas? I just tried "Nam 1.0a11a" from the web page you referenced and it ran fine on my Windows XP machine. I used the "status.out" from our spec: http://merlot.usc.edu/cs551-f08/projects/status.out (although I need to rename it to "status.nam"). I select Open from the File menu on nam and it displayed the sample file correctly. Please try this file first and let me know if that works with "Nam 1.0a11a". -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 377.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Oct 29 19:57:44 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9U2viL2027396 for ; Wed, 29 Oct 2008 19:57:44 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9U39B0S027965 for ; Wed, 29 Oct 2008 20:09:11 -0700 Message-Id: <200810300309.m9U39B0S027965@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551 Final1 - Deadlock Date: Wed, 29 Oct 2008 20:09:11 -0700 From: Bill Cheng Someone wrote: > I got 'Deadlock situation detected/avoided' message when executing the > program. Who's printing out this message? I have never heard of it. > Under gdb, I use 'next' cmd to run step by step and roughly know where/which > thread may cause deadlock. > But it is still hard to catch the bug. Do you know any tips to catch > deadlock? Thank you very much! I don't know a good way. I would go back to the beginning and look at the design and identify all threads and all shared resources. Then look at who is trying to acquire a lock while it is holding another lock. That's the source of deadlock! I'd like to add that it's okay to try to lock a resource while you are holding another lock. But you can pretty much only do this if you have planned to have a locking hierarchy. If you didn't plan for it, then it probably can cause deadlock. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 376.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Oct 29 19:31:17 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9U2VHbi027064 for ; Wed, 29 Oct 2008 19:31:17 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9U2gi3h027679 for ; Wed, 29 Oct 2008 19:42:44 -0700 Message-Id: <200810300242.m9U2gi3h027679@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CPU Hog Date: Wed, 29 Oct 2008 19:42:44 -0700 From: Bill Cheng Someone wrote: > I am using pthread_sigmask to unblock the SIGINT signal in my command line > handler thread. I am catching and handling the signal in the same thread. > But my thread is not able to catch more than one SIGINT. I called sighandler > within sighandler but nothing seems to be working. My program terminates on > the second Ctrl+C. I just tried the code in "man pthread_sigmask" again (with a little modification so that it loops forever) and it seems to work just fine. I can send after and it kept going. In that code, it uses sigaction() to specify a signal handler. Are you doing that? Or are you using signal()? -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 375.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Oct 29 18:38:51 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9U1cps6026627 for ; Wed, 29 Oct 2008 18:38:51 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9U1oIN0026726 for ; Wed, 29 Oct 2008 18:50:18 -0700 Message-Id: <200810300150.m9U1oIN0026726@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: non-beacon node notify and log dropped message Date: Wed, 29 Oct 2008 18:50:17 -0700 From: Bill Cheng Someone wrote: > The spec says: > You must log all messages seen at a node > > To determine if a packets is duplicate, a node has to see it right? Then > shouldn't the node log it as well? You are right! I don't know why I said it before. Somehow, I thought that neither "r", "f", nor "s" were appropriate. Clearly, "r" is appropriate for this! Sorry about my mistake. -- Bill Cheng // bill.cheng@usc.edu On Wed, Oct 29, 2008 at 9:51 AM, Bill Cheng wrote: > Someone wrote: > > > 1. Should we write dropped message information to logfile? > > No. But if you want to log it, you can do it and just > start the line with "//". > > > 2. When a non-beacon node is at join timeout and try to close > > socket, does it need to send notify? > > No. You only send NOTIFY on a connection if you have sent > HELLO before. > > > 3. In the spec, "Please note that neighbor is a bi-directional > > relationship. Therefore, when node B gets a hello message from > > node A, and node A is not currently node B's neighbor, node B > > should send a hello message to node A." So should B add A to B's > > neighbor list? > > Are you asking about the init_neighbor_list file? The > init_neighbor_list is a write-once file. Once it's created, > it's never modified. So, you must not modify the > init_neighbor_list file. What's in the init_neighbor_list > file are a node's *initial neighbors*. A node may get more > neighbors when other nodes connect to it. > > In (3) above, B becomes A's neighbor in memory. B does not > become one of A's "initial neighbors". > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 374.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Oct 29 13:49:23 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9TKnNen023911 for ; Wed, 29 Oct 2008 13:49:23 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9TL0kSC023005 for ; Wed, 29 Oct 2008 14:00:46 -0700 Message-Id: <200810292100.m9TL0kSC023005@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Problem in Project Date: Wed, 29 Oct 2008 14:00:46 -0700 From: Bill Cheng Someone wrote: > but i am facing this problem from many days, > when i am creating a socket in multiple threads, same socket descriptor is > created, > i.e whenever a successful connect is done in multiple threads, same socketfd > is returned. > Could you please give some pointers what i am doing wrong. Hmm... I've never heard of something like this and I don't know what can cause this. Can you make your warmup #1 do the same thing? Sorry that I cannot be more helpful. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 373.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Oct 29 11:49:24 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9TInOMR022677 for ; Wed, 29 Oct 2008 11:49:24 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9TJ0kcV021065 for ; Wed, 29 Oct 2008 12:00:46 -0700 Message-Id: <200810291900.m9TJ0kcV021065@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551: Final Project: Status response Date: Wed, 29 Oct 2008 12:00:45 -0700 From: Bill Cheng Someone wrote: > Quick question ... > When I output my trace file do I need to create all my nodes > before I start the links or I can create a node after a line of link ? Please see: http://merlot.usc.edu/cs551-f08/msgs/bill/337.txt -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 372.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Oct 29 09:46:47 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9TGklUh021117 for ; Wed, 29 Oct 2008 09:46:47 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9TGw82p018396 for ; Wed, 29 Oct 2008 09:58:08 -0700 Message-Id: <200810291658.m9TGw82p018396@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CPU Hog Date: Wed, 29 Oct 2008 09:58:08 -0700 From: Bill Cheng Someone wrote: > And yes, this problem is quite inconsistent. Its not always that I see > my process in one of the top slots. You need to debug! My guess is that you have an uninitialized variable somewhere so your timer thread sleeps a random number of microseconds! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 371.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Oct 29 09:45:10 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9TGjAnB021085 for ; Wed, 29 Oct 2008 09:45:10 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9TGuUJc018343 for ; Wed, 29 Oct 2008 09:56:30 -0700 Message-Id: <200810291656.m9TGuUJc018343@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CPU Hog Date: Wed, 29 Oct 2008 09:56:30 -0700 From: Bill Cheng Someone wrote: > I noticed that my process hogs the CPU sometimes. > And that is because if the "timer thread" that i have. > I am using a 1 second select timeout mechanism. What could be a problem > with this timer? Have you demonstrate to yourself that it's waking up only once per second? Run your code under the debugger and press and step through your code and find out why it's not sleeping! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 370.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Oct 29 09:41:37 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9TGfbSe021008 for ; Wed, 29 Oct 2008 09:41:37 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9TGqvmo018272 for ; Wed, 29 Oct 2008 09:52:58 -0700 Message-Id: <200810291652.m9TGqvmo018272@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551: Final Project: Status response Date: Wed, 29 Oct 2008 09:52:57 -0700 From: Bill Cheng Someone wrote: > I had question about status response, > > a node will forward the status request to all its neighbors, (if the ttl > permits) and also respond with its neighbor information. > now if a node receives status and has only one neighbor, the one who sent it > the request, what will be the data part of the status response of this node > ? Correct. > or it wont send any status response ? It should *always* respond. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 369.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Oct 29 09:40:24 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9TGeNR7020983 for ; Wed, 29 Oct 2008 09:40:24 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9TGpi6L018219 for ; Wed, 29 Oct 2008 09:51:44 -0700 Message-Id: <200810291651.m9TGpi6L018219@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: non-beacon node notify and log dropped message Date: Wed, 29 Oct 2008 09:51:44 -0700 From: Bill Cheng Someone wrote: > 1. Should we write dropped message information to logfile? No. But if you want to log it, you can do it and just start the line with "//". > 2. When a non-beacon node is at join timeout and try to close > socket, does it need to send notify? No. You only send NOTIFY on a connection if you have sent HELLO before. > 3. In the spec, "Please note that neighbor is a bi-directional > relationship. Therefore, when node B gets a hello message from > node A, and node A is not currently node B's neighbor, node B > should send a hello message to node A." So should B add A to B's > neighbor list? Are you asking about the init_neighbor_list file? The init_neighbor_list is a write-once file. Once it's created, it's never modified. So, you must not modify the init_neighbor_list file. What's in the init_neighbor_list file are a node's *initial neighbors*. A node may get more neighbors when other nodes connect to it. In (3) above, B becomes A's neighbor in memory. B does not become one of A's "initial neighbors". -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 368.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 28 22:34:56 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9T5YutD013497 for ; Tue, 28 Oct 2008 22:34:56 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9T5k8rk009236 for ; Tue, 28 Oct 2008 22:46:08 -0700 Message-Id: <200810290546.m9T5k8rk009236@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: csci-551 final#1 Date: Tue, 28 Oct 2008 22:46:08 -0700 From: Bill Cheng Someone wrote: > you had mentioned that the timeout for the check response is same as > that of status message, but in the specs it says it is the join > timeout which has to be used You are absolutely right! Sorry that I have forgotten about it. -- Bill Cheng // bill.cheng@usc.edu On Sun, Oct 26, 2008 at 1:38 PM, Bill Cheng wrote: > Someone wrote: > > > How is the check request msg going to get initiated..? I suppose it is to be > > handled via commandline but i couldn't find its format in the spec. > > Not via commandline. In paragraph 6 of the Peer-to-Peer > section of the spec: > > http://merlot.usc.edu/cs551-f08/projects/final.html#p2p > > it says: > > When a node loses connection with one of its neighbors, > it is possible that it may be disconnect from the SERVANT > network. In order to make sure that it is still connected > to the network, the node must intiatiate a connectivity > check by flooding a check message. > > So, you must flood a CHECK when you lose *any* connection > with a neighbor (unless this node is shutting down of course). > > > Also it is mentioned in the spec that 'The flooding of check messages stops > > at a beacon node where the beacon node sends a check response message > > towards the node from which it received the check message'. What should the > > requesting node of check msg set the TTL to to ensure that it stops at a > > beacon node and not anywhere before. > > You should use the TTL from the startup configuration file. > > > The timeout we can use for check response msg is JoinTimeOut, right ? > > No. You should use the same logic as for the status command: > > http://merlot.usc.edu/cs551-f08/projects/final-faq.html#done-status > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 367.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 28 21:44:05 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9T4i4VK013096 for ; Tue, 28 Oct 2008 21:44:05 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9T4tHdf008705 for ; Tue, 28 Oct 2008 21:55:17 -0700 Message-Id: <200810290455.m9T4tHdf008705@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551 final1 - getpeerbyaddr Date: Tue, 28 Oct 2008 21:55:17 -0700 From: Bill Cheng Someone wrote: > yea, I did this. My problem happens when a regular node sending join to > beacon node.how should that beacon node knows who send this packet. I am > trying to find a generic way > to distinguish. Because all other beacon nodes will get this JOIN_REQ too. > I'd like to treat them > all in the same way. Thanks The first message a node receives is either a HELLO or a JOIN request. In either case, the hostname and port number are in the message! So, you need to associate a socket with this hostname and port number and you only need to do it right after you have received the first message. -- Bill Cheng // bill.cheng@usc.edu On Tue, Oct 28, 2008 at 7:58 PM, Bill Cheng wrote: > Someone wrote: > > > For generating log message, if I use getpeername() to get remote host's > ip > > and > > gethostbyaddr() with that ip, it seems gethostbyaddr() can't get an > hostname > > of local ip. > > Is there any other way to get an hostname by the socket file descriptor. > > When you get a HELLO from your neighbor, you need to remember > the hostname and port number inside the HELLO message! Please > see: > > http://merlot.usc.edu/cs551-f08/msgs/bill/309.txt > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 366.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 28 21:06:12 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9T46CQW012792 for ; Tue, 28 Oct 2008 21:06:12 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9T4HOGb008394 for ; Tue, 28 Oct 2008 21:17:24 -0700 Message-Id: <200810290417.m9T4HOGb008394@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: 551 - final Date: Tue, 28 Oct 2008 21:17:24 -0700 From: Bill Cheng Someone wrote: > Yes I code on Windows and then sync it with nunki. So does "make clean" > resolve the problem or should I code directly on nunki? "make clean" would be fine. -- Bill Cheng // bill.cheng@usc.edu On Tue, Oct 28, 2008 at 8:59 PM, Bill Cheng wrote: > Someone wrote: > > > Many times I face this weird problem: > > > > I change something in one of my .h files, and then do a "make". After > this > > the code starts giving errors. > > Then if I do a "make clean" and them "make", things start working as > > expected. > > > > Sometimes this happens even if I change my .cc file. > > > > Why does this happen? > > May be the dependencies you have specified in your makefile > is incorrect. > > Or, I've seen some people do everything on Windows and have > things sync with nunki. I'm not sure if the file time is > set correctly when you do a sync. I've seen some software > that will try to change the timestamp on the nunki file to > be the same as the timestamp on the Windows file. I guess > that may cause problem. > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 365.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 28 20:48:24 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9T3mOXU012638 for ; Tue, 28 Oct 2008 20:48:24 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9T3xaKV007920 for ; Tue, 28 Oct 2008 20:59:36 -0700 Message-Id: <200810290359.m9T3xaKV007920@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: 551 - final Date: Tue, 28 Oct 2008 20:59:36 -0700 From: Bill Cheng Someone wrote: > Many times I face this weird problem: > > I change something in one of my .h files, and then do a "make". After this > the code starts giving errors. > Then if I do a "make clean" and them "make", things start working as > expected. > > Sometimes this happens even if I change my .cc file. > > Why does this happen? May be the dependencies you have specified in your makefile is incorrect. Or, I've seen some people do everything on Windows and have things sync with nunki. I'm not sure if the file time is set correctly when you do a sync. I've seen some software that will try to change the timestamp on the nunki file to be the same as the timestamp on the Windows file. I guess that may cause problem. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 364.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 28 19:47:31 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9T2lVXD011767 for ; Tue, 28 Oct 2008 19:47:31 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9T2wgT6006661 for ; Tue, 28 Oct 2008 19:58:42 -0700 Message-Id: <200810290258.m9T2wgT6006661@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551 final1 - getpeerbyaddr Date: Tue, 28 Oct 2008 19:58:42 -0700 From: Bill Cheng Someone wrote: > For generating log message, if I use getpeername() to get remote host's ip > and > gethostbyaddr() with that ip, it seems gethostbyaddr() can't get an hostname > of local ip. > Is there any other way to get an hostname by the socket file descriptor. When you get a HELLO from your neighbor, you need to remember the hostname and port number inside the HELLO message! Please see: http://merlot.usc.edu/cs551-f08/msgs/bill/309.txt -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 363.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 28 19:41:23 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,WEIRD_PORT autolearn=no version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9T2fMsS011696 for ; Tue, 28 Oct 2008 19:41:23 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9T2qX0L006597 for ; Tue, 28 Oct 2008 19:52:33 -0700 Message-Id: <200810290252.m9T2qX0L006597@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: neighbor Date: Tue, 28 Oct 2008 19:52:33 -0700 From: Bill Cheng Someone wrote: > in the grading guidelines: > > (a) (+3 points) one beacon node, 3 regular nodes, linear network > topology: n07* <- n04 <- n09 <- n06 > > more ~/tmp/final1/n04/init_neighbor_list > (this should contain something like > "nunki.usc.edu:18007") > > spec says :- Please note that neighbor is a bi-directional relationship > so when 9 makes 4 its neighbor, shouldnt 4 make 9 its neighbor. thus > souldnt init_neighbor list for n04 contain n07 and n09 ? Please see: http://merlot.usc.edu/cs551-f08/projects/final-faq.html#non-beacon-neighbor -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 362.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 28 16:38:27 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9SNcRHR010289 for ; Tue, 28 Oct 2008 16:38:27 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9SNnaI8004879 for ; Tue, 28 Oct 2008 16:49:36 -0700 Message-Id: <200810282349.m9SNnaI8004879@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: 551 - final In-reply-to: <200810282323.m9SNN4L7004286@bourbon.usc.edu> References: <200810282323.m9SNN4L7004286@bourbon.usc.edu> Comments: In-reply-to Bill Cheng message dated "Tue, 28 Oct 2008 16:23:04 -0700." Date: Tue, 28 Oct 2008 16:49:36 -0700 From: Bill Cheng Regarding (2) below, it looks like if there is only one node, nam does not display properly. I guess that's okay. For this case, the grader will look at your output file and make sure the right informatin is in it. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Tue, 28 Oct 2008 16:23:04 -0700 From: Bill Cheng To: cs551@merlot.usc.edu Subject: Re: 551 - final Someone wrote: > 1) A '\n' or 'endl' flushes the buffer of printf/cout right? No. > I put an 'endl' > after I write a line to a file. I am currently not doing f.flush() after > writing to a file. I am still able to see meaningful output when I run th e > 'tail' command. So is 'endl' sufficient or should I do a flush as well? You need to do a flush() to make sure. > 2) I am not able to see anything in NS if I just have 1 node. I have the > initialization line and a line for the first node. Hmm... I don't remember if this is suppose to work. I'll try it when I get to a Linux machine. > 3) When a node sends a notify to its neighbors, is it sending the same > message to its N neighbors, or is it N messages to N neighbors. Rephrasin g > my question, does the node create N UOID's for the N messages, or is it o nly > 1 UOID for all the N messages? Since TTL is 1 for NOTIFY messages, it doesn't matter because its neighbor will not forward the message! Right?! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 361.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 28 16:11:55 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9SNBt1Q010040 for ; Tue, 28 Oct 2008 16:11:55 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9SNN4L7004286 for ; Tue, 28 Oct 2008 16:23:04 -0700 Message-Id: <200810282323.m9SNN4L7004286@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: 551 - final Date: Tue, 28 Oct 2008 16:23:04 -0700 From: Bill Cheng Someone wrote: > 1) A '\n' or 'endl' flushes the buffer of printf/cout right? No. > I put an 'endl' > after I write a line to a file. I am currently not doing f.flush() after > writing to a file. I am still able to see meaningful output when I run the > 'tail' command. So is 'endl' sufficient or should I do a flush as well? You need to do a flush() to make sure. > 2) I am not able to see anything in NS if I just have 1 node. I have the > initialization line and a line for the first node. Hmm... I don't remember if this is suppose to work. I'll try it when I get to a Linux machine. > 3) When a node sends a notify to its neighbors, is it sending the same > message to its N neighbors, or is it N messages to N neighbors. Rephrasing > my question, does the node create N UOID's for the N messages, or is it only > 1 UOID for all the N messages? Since TTL is 1 for NOTIFY messages, it doesn't matter because its neighbor will not forward the message! Right?! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 360.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 28 16:04:59 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9SN4xH3009986 for ; Tue, 28 Oct 2008 16:04:59 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9SNG7eX004151 for ; Tue, 28 Oct 2008 16:16:07 -0700 Message-Id: <200810282316.m9SNG7eX004151@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: reagarding select() Date: Tue, 28 Oct 2008 16:16:07 -0700 From: Bill Cheng Someone wrote: > So i am receiving in an while(1) loop .So i will have call : > FD_ZERO(&fds); > FD_SET(fd, &fds); > before calling every select ? Please don't ask me if this is right. You need to understand what each statement is doing and figure out if it's right for you. -- Bill Cheng // bill.cheng@usc.edu On Tue, Oct 28, 2008 at 2:25 PM, Bill Cheng wrote: > Someone wrote: > > > The syntax for select is > > int select( int nfds,fd_set *read,fd_set *write, fd_set *error,Struct > > timeval *timeout)) > > > > Now , i have multiple readind threads calling select().Each select() scans > > socket descriptors from 0 to nfds-1. > > Will a reading thread 's(with sock fd =5) select() unblock if another > > reading thread (with sock fd = 3) receives data . > > Beacause the former's select will scan from sock fds 0-4. > > You need to use FD_SET() to specify which file descriptors > are you interested in for a specific select() call. For > example, if your thread is only interested in reading fd=5, > then you should do: > > fd_set fds; > struct timeval timeout; > > FD_ZERO(&fds); /* it's imperative that you initialize all variables */ > FD_SET(fd, &fds); > .... /* set timeout */ > return_code = select(fd+1, &fds, NULL, NULL, &timeout); > > Although it will *scan* from file descriptors 0 through 5, it > will skip the ones that you did not call FD_SET() on. > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 359.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 28 14:14:23 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9SLENdM008851 for ; Tue, 28 Oct 2008 14:14:23 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9SLPUFF002686 for ; Tue, 28 Oct 2008 14:25:30 -0700 Message-Id: <200810282125.m9SLPUFF002686@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: reagarding select() Date: Tue, 28 Oct 2008 14:25:30 -0700 From: Bill Cheng Someone wrote: > The syntax for select is > int select( int nfds,fd_set *read,fd_set *write, fd_set *error,Struct > timeval *timeout)) > > Now , i have multiple readind threads calling select().Each select() scans > socket descriptors from 0 to nfds-1. > Will a reading thread 's(with sock fd =5) select() unblock if another > reading thread (with sock fd = 3) receives data . > Beacause the former's select will scan from sock fds 0-4. You need to use FD_SET() to specify which file descriptors are you interested in for a specific select() call. For example, if your thread is only interested in reading fd=5, then you should do: fd_set fds; struct timeval timeout; FD_ZERO(&fds); /* it's imperative that you initialize all variables */ FD_SET(fd, &fds); .... /* set timeout */ return_code = select(fd+1, &fds, NULL, NULL, &timeout); Although it will *scan* from file descriptors 0 through 5, it will skip the ones that you did not call FD_SET() on. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 358.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 28 11:23:37 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9SINbws007036 for ; Tue, 28 Oct 2008 11:23:37 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9SIYg3c032281 for ; Tue, 28 Oct 2008 11:34:42 -0700 Message-Id: <200810281834.m9SIYg3c032281@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Auto Shut Down and Shut Down Date: Tue, 28 Oct 2008 11:34:42 -0700 From: Bill Cheng Someone wrote: > During the shut down phase and autoshutdown should we wait to > make sure that notify message to other nodes is sent ? > At present I am waiting arbitrary 1 sec to make sure that notify > is sent (I need to wait as I am using a queue for each socket .. > I can short circuit it but I am avoiding it) .. is that okay or > should I short circuit it and send it directly on that socket > (still we will have to wait atleast for the TCP buffer.) You should send NOTIFY when you are going to disconnect. You are also suppose to shutdown gracefully. Therefore, when it comes time to shutdown, you should set a global flag so that no thread will serve anything new. You can also delete all existing jobs from all queues and tell each sender to send their last NOTIFY message. Then all thread should self terminate. Finally, your main thread terminates. I don't see the need to sleep for 1 second. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 357.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 28 11:19:53 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9SIJrxP006994 for ; Tue, 28 Oct 2008 11:19:53 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9SIUwWb032204 for ; Tue, 28 Oct 2008 11:30:58 -0700 Message-Id: <200810281830.m9SIUwWb032204@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: problem with nunki? Date: Tue, 28 Oct 2008 11:30:58 -0700 From: Bill Cheng Someone wrote: > could there be a problem on nunki? wat worked yesterday is not working today > and i havnt changed even 1 line of code or even recompiled! Please see my message with timestamp "Tue 28 Oct 07:29". -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 356.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 28 07:42:25 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9SEgPGG004672 for ; Tue, 28 Oct 2008 07:42:25 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9SErWNc028976 for ; Tue, 28 Oct 2008 07:53:32 -0700 Message-Id: <200810281453.m9SErWNc028976@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: not enough neighbors after soft restart Date: Tue, 28 Oct 2008 07:53:32 -0700 From: Bill Cheng Someone wrote: > you mentioned that "After you get join responses, you > wait for JoinTimeout (or " > so, if i get a ctrl + c, when i still getting all the join reponses or > fiding my neighbors, what should i do ? > 1. the node which wants to join the network, goes down ? or > 2. the node considers only the responses it received till that time and > based on that joins the servant or goes down ? Please see: http://merlot.usc.edu/cs551-f08/projects/final-faq.html#cntrl_c > also,i had a question about the general sequence of events that will happen > when you start the program by > "sv_node ". > the node will perform all its functions i.e. join, hello etc. and finally > when it becomes an active node in the network, we give the user the prompt > where he/she can enter the commands he/she wants to execute. > in the background it will still be doing its functions like keepalive, check > etc., now in the course of time if it finds that it needs to go down due to > some reason then should it display a message to the user that it needs to > shutdown due to xyz reason and shut itself down. > > the above execution will however differ when it is a beacon or non beacon > but in general terms is this how a node should work ? Pretty much! The difference between a beacon and a non-beacon node is fairly minor. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 355.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 28 07:33:11 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9SEXBYP004532 for ; Tue, 28 Oct 2008 07:33:11 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9SEiIam028767 for ; Tue, 28 Oct 2008 07:44:18 -0700 Message-Id: <200810281444.m9SEiIam028767@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551 final1 - pass argument to threads Date: Tue, 28 Oct 2008 07:44:18 -0700 From: Bill Cheng Someone wrote: > When beacon create threads connecting to other beacons, > I use a for-loop which calls pthread_create and pass the iterator 'i' > into the thread as argument. > I found that created thread cannot get that argument correctly unless > wait for certain time, like 10ms. > For example, when i=3 and pass into thread#3. thread#3 may get 4 due > to for-loop increment that variable. > This looks like a bad way to use thread, but how to achieve my purpose? Are you passing i by value or passing by reference? You can actually pass i by value if that's what you want. The last argument to pthread_create() is of type (void*). So, if you just typecast i to (void*), you will copy the value of i to the thread function. If you don't like typecasting to (void*), you can first typecast to (char*): (void*)(char*)i -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 354.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 28 07:28:44 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00, LOCALPART_IN_SUBJECT autolearn=no version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9SESijo004473 for ; Tue, 28 Oct 2008 07:28:44 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9SEdpoa028707 for ; Tue, 28 Oct 2008 07:39:51 -0700 Message-Id: <200810281439.m9SEdpoa028707@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: cs551 Date: Tue, 28 Oct 2008 07:39:51 -0700 From: Bill Cheng Someone wrote: > One of the tests in the grading guidelines is the following > > (c) (+2 points) one beacon node, 3 regular nodes, linear network, > killing the only beacon node > > Restart the beacon node in the first window as follows: > ./sv_node c8-n07.ini > (wait for all nodes to start) > > in 2nd window, do: > ./sv_node c8-n04.ini > (wait for all nodes to start) > > in 3rd window, do: > ./sv_node c8-n09.ini > (wait for all nodes to start) > > in 4th window, do: > ./sv_node c8-n06.ini > > type "shutdown" in the 1st window > (all nodes should eventually shutdown) > > *wait* for all nodes to autoshutdown > > *in 5th window, do: > more ~/tmp/final1/n04/init_neighbor_list > more ~/tmp/final1/n09/init_neighbor_list > more ~/tmp/final1/n06/init_neighbor_list > (none of these files should exist)* > > in 5th window, do: > more ~/tmp/final1/n04/servant.log > more ~/tmp/final1/n09/servant.log > more ~/tmp/final1/n06/servant.log > > > In this, it is said that the init_neighbor_list file should not exist for > the non-beacon nodes (highlighted by bold above). What is the reason for > this ? You are talking about the (B.2.c) case where there is only one beacon node (node 07) with topology: topology: n07* <- n04 <- n09 <- n06 If you shutdown the beacon node, node 04 will flood a CHECK and CHECK would fail. Then it restarts. It has only node 07 in its init_neighbor_list and cannot connect to node 07, so it deletes its init_neighbor_list and restart. Then it cannot find any beacon node, so it quits. Node 09 and 06 should also do the same thing eventually. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 353.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 28 07:22:05 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00, LOCALPART_IN_SUBJECT autolearn=no version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9SEM5p3004376 for ; Tue, 28 Oct 2008 07:22:05 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9SEXCPb028586 for ; Tue, 28 Oct 2008 07:33:13 -0700 Message-Id: <200810281433.m9SEXCPb028586@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: cs551 Date: Tue, 28 Oct 2008 07:33:12 -0700 From: Bill Cheng Someone wrote: > If there is a beacon (A) and a non-beacon(B) which form the network and > another non-beacon (C) comes up which comes to know that its distance from > B(which is a non-beacon) is less than its distance from A and C has > Initneighbors=1. Whom should C have in its init_neighbor_list ? B, of course! Are you thinking that beacon nodes somehow have priority over non-beacon nodes as init neighbors? Let's say that you have a network of 2 beacon nodes and many non-beacon nodes and the non-beacon nodes have InitNeighbors=2. Are you saying that *all* the non-beacon nodes will end up having the 2 beacon nodes in their init_neighbor_list files? -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 352.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 28 07:18:06 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9SEI6dg004327 for ; Tue, 28 Oct 2008 07:18:06 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9SETDWF028504 for ; Tue, 28 Oct 2008 07:29:13 -0700 Message-Id: <200810281429.m9SETDWF028504@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: problem in nunki Date: Tue, 28 Oct 2008 07:29:13 -0700 From: Bill Cheng Someone wrote: > I think there is a problem in nunki.I am just starting one node and it > automatically receives all d packets. I'm not sure what you are saying. What are "d packets"? > there is no other node where I am accepting the connection. > I have checked my code and it used to work before some time.I am not able to > make any changes also due to this problem. May be nunki is out of resources. It happens sometimes. Are you check *all* return codes of all your system calls? -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 351.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 27 21:16:28 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9S4GSkX028807 for ; Mon, 27 Oct 2008 21:16:28 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9S4RTnU021949 for ; Mon, 27 Oct 2008 21:27:29 -0700 Message-Id: <200810280427.m9S4RTnU021949@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: who submits the project Date: Mon, 27 Oct 2008 21:27:29 -0700 From: Bill Cheng Someone wrote: > for a group, who submits the project : either of us or both Doesn't matter! It would be best if only one of the team members submits (but that's not a requirement). -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 350.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 27 20:53:40 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9S3re5k028628 for ; Mon, 27 Oct 2008 20:53:40 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9S44ejN021552 for ; Mon, 27 Oct 2008 21:04:41 -0700 Message-Id: <200810280404.m9S44ejN021552@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: cs-551 Date: Mon, 27 Oct 2008 21:04:40 -0700 From: Bill Cheng Someone wrote: > Do we have reset the autoshutdown timer after receiving either a keepalive > or *any* other kind of message. When the auto-shutdown timer expires, you shutdown your node as if the user has typed "shutdown"! If your auto-shutdown works, your node won't run on nunki forever! > Also, is notify message to be sent when a > note shutdowns after the autoshutdown timer expires ? The spec says: The notify message is used by a node to inform its neighbor that it is about to close the connection. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 349.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 27 19:22:54 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9S2MsSn027826 for ; Mon, 27 Oct 2008 19:22:54 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9S2XsLL019825 for ; Mon, 27 Oct 2008 19:33:54 -0700 Message-Id: <200810280233.m9S2XsLL019825@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: not enough neighbors after soft restart Date: Mon, 27 Oct 2008 19:33:54 -0700 From: Bill Cheng Someone wrote: > I meant that : > After reception of join responses (in any case), the node connects to > init neighbors and add them into the file. It doesn't work this way! After you get join responses, you wait for JoinTimeout (or ), then you disconnect from the beacon node, create the init_neighbor_list file, and do a soft restart. > I want to know that if the responses returned are less than both init > and min neighbors, then should it do a soft restart or die out ? You need to ignore MinNeighbors at this point because you are still in the JOIN phase! The only thing that matters during the JOIN phase is InitNeighbors. Please read the part of the spec that explains these values again. If you cannot get more than or equal to InitNeighbors number of JOIN responses during JOIN, please see: http://merlot.usc.edu/cs551-f08/projects/final-faq.html#no-enough-join -- Bill Cheng // bill.cheng@usc.edu Bill Cheng wrote: > Someone wrote: > > > So, then in case of join, spec says the node should "rejoin" the network > > (based on the init neighbors). So, should it soft start or die out in > > this case ? > > Because, if it soft starts, then it could be softstarting for ever. > > I'm not sure what you are referring to. Everywhere in the spec > where it says "rejoin the network", it always say delete > init_neighbor_list first! So, it cannot do a "rejoin based > on the init neighbors". > > A regular node is either JOINing the network (when it does > not have an init_neighbor_list file) or participating in the > network (when it has an init_neighbor_list file). It cannot > do both. > -- > Bill Cheng // bill.cheng@usc.edu > > > > > > Someone wrote: > > > > > If the no of neighbors up are less than the min. neighbors then a node > > > does soft restart. > > > > And delete init_neighbor_list file. > > > > > what if , even after soft restart , the number of neighbors up are > > > less than min_neighbors, then what a node should do ? > > > > When it restarts, it's doing a JOIN, so it ignores MinNeighbors. > > During the JOIN, what matters is InitNeighbors. > > > > > Exit or try to send join requests continuously till it finds the > > > enough number of neighbors ? > > > > This JOIN is no different than other JOINs! > > -- > > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 348.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 27 18:31:50 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9S1Vo9A027325 for ; Mon, 27 Oct 2008 18:31:50 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9S1gniI019198 for ; Mon, 27 Oct 2008 18:42:49 -0700 Message-Id: <200810280142.m9S1gniI019198@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: not enough neighbors after soft restart Date: Mon, 27 Oct 2008 18:42:49 -0700 From: Bill Cheng Someone wrote: > So, then in case of join, spec says the node should "rejoin" the network > (based on the init neighbors). So, should it soft start or die out in > this case ? > Because, if it soft starts, then it could be softstarting for ever. I'm not sure what you are referring to. Everywhere in the spec where it says "rejoin the network", it always say delete init_neighbor_list first! So, it cannot do a "rejoin based on the init neighbors". A regular node is either JOINing the network (when it does not have an init_neighbor_list file) or participating in the network (when it has an init_neighbor_list file). It cannot do both. -- Bill Cheng // bill.cheng@usc.edu > Someone wrote: > > > If the no of neighbors up are less than the min. neighbors then a node > > does soft restart. > > And delete init_neighbor_list file. > > > what if , even after soft restart , the number of neighbors up are > > less than min_neighbors, then what a node should do ? > > When it restarts, it's doing a JOIN, so it ignores MinNeighbors. > During the JOIN, what matters is InitNeighbors. > > > Exit or try to send join requests continuously till it finds the > > enough number of neighbors ? > > This JOIN is no different than other JOINs! > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 347.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 27 18:27:46 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9S1RkQm027279 for ; Mon, 27 Oct 2008 18:27:46 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9S1cjgf019143 for ; Mon, 27 Oct 2008 18:38:45 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.14.2/8.14.1/Submit) id m9S1cjq9019142 for cs551@merlot; Mon, 27 Oct 2008 18:38:45 -0700 Date: Mon, 27 Oct 2008 18:38:45 -0700 From: Bill Cheng Message-Id: <200810280138.m9S1cjq9019142@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: CS 551 group commitment e-mails... Hi everyone, If you are doing final project part (1) with a partner, please make sure you have followed the instructions at: http://merlot.usc.edu/cs551-f08/projects.html#group and have received my confirmation e-mail! Once grading starts, it would be too late to claim that someone is your partner! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 346.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 27 18:23:01 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9S1N1FN027169 for ; Mon, 27 Oct 2008 18:23:01 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9S1Y1Y2018964 for ; Mon, 27 Oct 2008 18:34:01 -0700 Message-Id: <200810280134.m9S1Y1Y2018964@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: not enough neighbors after soft restart Date: Mon, 27 Oct 2008 18:34:01 -0700 From: Bill Cheng Someone wrote: > If the no of neighbors up are less than the min. neighbors then a node > does soft restart. And delete init_neighbor_list file. > what if , even after soft restart , the number of neighbors up are > less than min_neighbors, then what a node should do ? When it restarts, it's doing a JOIN, so it ignores MinNeighbors. During the JOIN, what matters is InitNeighbors. > Exit or try to send join requests continuously till it finds the > enough number of neighbors ? This JOIN is no different than other JOINs! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 345.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 27 18:20:54 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9S1KsZn027140 for ; Mon, 27 Oct 2008 18:20:54 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9S1VrxX018925 for ; Mon, 27 Oct 2008 18:31:53 -0700 Message-Id: <200810280131.m9S1VrxX018925@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: csci-551 Date: Mon, 27 Oct 2008 18:31:53 -0700 From: Bill Cheng Someone wrote: > What should happen if the user has started entering a command on the command > prompt and while he is midway, autoshutdown occurs ? I guess we should > ignore the command in that case, right ? Sure! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 344.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 27 16:26:16 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9RNQFZw026164 for ; Mon, 27 Oct 2008 16:26:15 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9RNbEFn017500 for ; Mon, 27 Oct 2008 16:37:14 -0700 Message-Id: <200810272337.m9RNbEFn017500@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: neighbor vs. HELLO Date: Mon, 27 Oct 2008 16:37:13 -0700 From: Bill Cheng Someone wrote: > My question is more that you get a hello msg from someone that is not your > neighbor, but you are their neighbor....do they become your neighbor or do > you just respond with a HLLO and not use it if you were to Flood a msg > later on? Sorry that I misunderstood your question. "Initial neighbor" is a one-way relationship, i.e., if B is in A's init_neighbor_list file, then B is A's "initial neighbor". So, this is about what's in the init_neighbor_list file. "Neighbor" is a two-way relationship, i.e., if X is Y's neighbor then Y is X's neighbor. In your scenario, A is not B's "initial neighbor". A should say HELLO back and now A and B are "neighbors" and this connection is now an active connection. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- From: Bill Cheng [mailto:william@bourbon.usc.edu] Sent: Monday, October 27, 2008 2:38 PM To: cs551@merlot.usc.edu Subject: RE: neighbor vs. HELLO Someone wrote: > Does this mean that B is a neighbor of A and A is a neighbor of B or that > you should just always respond to a Hello msg. Seems like it could be > interpreted either way? "Please note that neighbor is a bi-directional > relationship. Therefore, when node B gets a hello message from node A, and > node A is not currently node B's neighbor, node B should send a hello > message to node A." If you get a HELLO, you should always respond with a HELLO, *unless* there is another connection and you have decided that this connection should be closed. In this case, since this is an "extra" connection and you are going to close it anyway, it doesn't really matter how you close it. You don't have to send HELLO. But it's okay if you send HELLO and then close. If you'd like, you can also send HELLO and NOTIFY and then close. It doesn't really matter here. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 343.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 27 14:27:07 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9RLR6x9024764 for ; Mon, 27 Oct 2008 14:27:06 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9RLc3bS015581 for ; Mon, 27 Oct 2008 14:38:03 -0700 Message-Id: <200810272138.m9RLc3bS015581@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: RE: neighbor vs. HELLO Date: Mon, 27 Oct 2008 14:38:03 -0700 From: Bill Cheng Someone wrote: > Does this mean that B is a neighbor of A and A is a neighbor of B or that > you should just always respond to a Hello msg. Seems like it could be > interpreted either way? "Please note that neighbor is a bi-directional > relationship. Therefore, when node B gets a hello message from node A, and > node A is not currently node B's neighbor, node B should send a hello > message to node A." If you get a HELLO, you should always respond with a HELLO, *unless* there is another connection and you have decided that this connection should be closed. In this case, since this is an "extra" connection and you are going to close it anyway, it doesn't really matter how you close it. You don't have to send HELLO. But it's okay if you send HELLO and then close. If you'd like, you can also send HELLO and NOTIFY and then close. It doesn't really matter here. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 342.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 27 14:08:16 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9RL8GKr024632 for ; Mon, 27 Oct 2008 14:08:16 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9RLJCYY015322 for ; Mon, 27 Oct 2008 14:19:12 -0700 Message-Id: <200810272119.m9RLJCYY015322@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS 551 Date: Mon, 27 Oct 2008 14:19:12 -0700 From: Bill Cheng Someone wrote: > When we press a CTRL-C on any of the nodes say A, does the node A notify its > neighbors by sending a notify message? is a "short-circuit" for the user entered command. Your node should not disconnect from any neighbor. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 341.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 27 11:00:04 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9RI04tV022912 for ; Mon, 27 Oct 2008 11:00:04 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9RIAwmx011923 for ; Mon, 27 Oct 2008 11:10:58 -0700 Message-Id: <200810271810.m9RIAwmx011923@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551 final1 - Notify Date: Mon, 27 Oct 2008 11:10:58 -0700 From: Bill Cheng Someone wrote: > For notify message, what is the 'error code' field when auto shutdown? I would use 1 or 3. (The actual code is not used by anything else, so the value shouldn't really matter to anyone! You can just choose something that you think is the closest.) -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 340.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 27 10:56:31 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9RHuVL8022799 for ; Mon, 27 Oct 2008 10:56:31 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9RI7Qlv011792 for ; Mon, 27 Oct 2008 11:07:26 -0700 Message-Id: <200810271807.m9RI7Qlv011792@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Ok to call "normal" methods from "threaded" methods? Date: Mon, 27 Oct 2008 11:07:26 -0700 From: Bill Cheng Someone wrote: > Within the same file I have 'threaded' methods (for client, server, etc.) as > well as 'normal' methods (that are called normally, and not as individual > threads). The 'normal' methods are used simply to read/write from sockets > (id's passed as parameters) and do not access any shared variables. Could > calling these 'normal' methods from the 'threaded' methods possibly cause > any side effects? If your "normal" methods are "thread-safe", then they should not cause problems. Of course, supposed thread-safe methods or functions may not be actually thread-safe because there are bugs! Please remember that C and C++ are basically the same thing. Also, C functions and C++ methods are basically the same thing. The difference is that the corresponding C++ object is passed to C++ method as the first argument automatically and hidden from you. So, thread-safety applies the same way to C++ methods as they do to C functions. > I am seeing strange behavior from my threads around the times they call the > 'normal' methods (for example, seeming to block when they shouldn't be, > which causes my thread loops to simply not loop). Do you think it would be > better to include the code from the 'normal' methods directly into > 'threaded' methods, rather than separating them out? I don't think it would make any difference if there are bugs in these methods! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 339.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 27 10:46:05 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9RHk5CK022708 for ; Mon, 27 Oct 2008 10:46:05 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9RHux1P011332 for ; Mon, 27 Oct 2008 10:56:59 -0700 Message-Id: <200810271756.m9RHux1P011332@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551 final1 - TTL Date: Mon, 27 Oct 2008 10:56:59 -0700 From: Bill Cheng Someone wrote: > When forwarding any msg such as a hello msg we would just > decrement the ttl and send it along we would not change the > sender hostname and port in the data field correct? Correct! Just like IP! > HLLO is > slighlty different than JOIN in that it would make no sense to > change it for JOIN...I dont think. TTL for HELLO is 1, so there is no forwarding. Forwarding for JOIN messages is the same as forwarding for other types of messages. I'm not sure why you said that you don't need to change the message for JOIN. You should decrement TTL. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 338.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 27 08:47:24 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9RFlOHN021571 for ; Mon, 27 Oct 2008 08:47:24 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9RFwIdj005662 for ; Mon, 27 Oct 2008 08:58:18 -0700 Message-Id: <200810271558.m9RFwIdj005662@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS 551 Date: Mon, 27 Oct 2008 08:58:18 -0700 From: Bill Cheng Someone wrote: > I am using alarm to keep track of keep alive messages. I am resetting it > everytime i get a keepalive message. However, alarm(time) is a process > specific function and thus all threads share it. If A is connected to B and > C , and say B goes down then too the alarm doesnt go off for A since the > node C is still alive and keeps resetting the alarm. Is there some way to > make the alarm thread specific or is there a work around for the same ? Please don't use alarm for this! You should use one alarm for auto-shutdown. I've described how to handle timers at the end of lecture 9. You should go back to watch the lecture video. By the way, I'm not sure what you meant by "all threads share it". Are you saying that if you have a thread which blocks SIGALRM and it is blocked at sigwait() and you send SIGALRM to it, it will get the signal anyway?! That seems weird. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 337.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 27 08:40:04 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9RFe4Xk021434 for ; Mon, 27 Oct 2008 08:40:04 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9RFovWX005447 for ; Mon, 27 Oct 2008 08:50:57 -0700 Message-Id: <200810271550.m9RFovWX005447@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Status Msg Date: Mon, 27 Oct 2008 08:50:57 -0700 From: Bill Cheng Someone wrote: > Case B - 1 - a) in this  > start both nodes - beacon and non beacon > 2) call status for both > 3) shutdown beacon first > 4) more 04.out > >  Should the status file 04.out for nonbeacon be created??? Yes. Any neighbor information about itself and the status response messages it receives, it should report them in the output file. It doesn't matter if some nodes have gone down in the middle of this command. > more > general question - should we create status file on the fly or > wait to get all status reponses and create the file after the > timeout??? Either way. You need to make sure that if is pressed, you still generate the output file. Please note that you should *always* generate the output file. In the worst case, this node has no neighbors, so the nam file should contain just one node and no edges! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 336.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 27 08:30:43 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9RFUhdk021178 for ; Mon, 27 Oct 2008 08:30:43 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9RFfacL004865 for ; Mon, 27 Oct 2008 08:41:36 -0700 Message-Id: <200810271541.m9RFfacL004865@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Auto Shutdown Date: Mon, 27 Oct 2008 08:41:36 -0700 From: Bill Cheng Someone wrote: > When do we start the auto shutdown timer. After the join > process or before that ?? I just answered this question yesterday! I guess this makes it a FAQ! Please see: http://merlot.usc.edu/cs551-f08/projects/final-faq.html#autoshutdown -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 335.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 27 08:23:18 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9RFNIoO021043 for ; Mon, 27 Oct 2008 08:23:18 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9RFYBuv003996 for ; Mon, 27 Oct 2008 08:34:11 -0700 Message-Id: <200810271534.m9RFYBuv003996@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: cs551 - final - NAM Date: Mon, 27 Oct 2008 08:34:11 -0700 From: Bill Cheng Someone wrote: > I get the following when I run nam. > nam: duplicate edge (XXXXX,YYYYY) > > This is because I add the same edge twice (once when I put in my entries, > and again when I get a response from my neighbors). > I probably will fix this once I am done with the assignment. > > Since the end result in NAM is as expected, I wanted to know whether this > will be considered as a error? This will not be considered an error. If the topology of the network is displayed properly, it's not a problem. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 334.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 27 07:14:48 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9REEmpS020015 for ; Mon, 27 Oct 2008 07:14:48 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9REPfjM000889 for ; Mon, 27 Oct 2008 07:25:41 -0700 Message-Id: <200810271425.m9REPfjM000889@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Reg Flooding Date: Mon, 27 Oct 2008 07:25:41 -0700 From: Bill Cheng Someone wrote: > When 3 nodes are connected to each other, and one node sends a status > request to the other 2 nodes, the 3rd node may forward the join > request to the 1st node before it gets the status request directly > from the 1st node, what should be done in this scenario? I'm not sure what you are asking. Is this a question about JOIN or STATUS? I think I need a multiple choice question here to understand what you are trying to get at. -- Bill Cheng // bill.cheng@usc.edu On Sun, Oct 26, 2008 at 10:22 PM, Bill Cheng wrote: > Someone wrote: > > > It is mentioned that we have to drop the packets with the UOID which has > > already been seen once. > > > > While flooding join requests, which UOID should we consider for dropping the > > packets ? The UOID of the original requester.......or the UOID of the > > internediate node that did the flooding ? > > If I understand you correctly, I think you are generating new > UOID when you *forward* a message! You should not do that. > > When you forward a message, the only difference between the > out-going message and the one you received is TTL. All > copies of the join request message have identical UOID. > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 333.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 26 22:21:14 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9R5LERx014257 for ; Sun, 26 Oct 2008 22:21:14 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9R5W1EM027261 for ; Sun, 26 Oct 2008 22:32:01 -0700 Message-Id: <200810270532.m9R5W1EM027261@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551 final1 - TTL Date: Sun, 26 Oct 2008 22:32:01 -0700 From: Bill Cheng Someone wrote: > The spec indicates when receive a packet, decrease its TTL by 1 first. > Then if TTL = 0, drop it. Is this correct? or should I process it but do not > forward it? In the Peer-to-Peer section, the spec says: If a TTL reaches 0, no forwarding should be performed. In the TTL section, it also says: If the TTL is zero, the message is dropped, otherwise it is forwarded to the next node. So, it's inconsistent. The way this has been explained in class, the 2nd one is clearly incorrect. Sorry about the inconsistency. It has now been changed to: If the TTL is zero, the message is not forwarded to the next node [BC: Fixed 9/24/2008]. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 332.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 26 22:11:24 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9R5BOd5014089 for ; Sun, 26 Oct 2008 22:11:24 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9R5MBr6027123 for ; Sun, 26 Oct 2008 22:22:11 -0700 Message-Id: <200810270522.m9R5MBr6027123@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Reg Flooding Date: Sun, 26 Oct 2008 22:22:11 -0700 From: Bill Cheng Someone wrote: > It is mentioned that we have to drop the packets with the UOID which has > already been seen once. > > While flooding join requests, which UOID should we consider for dropping the > packets ? The UOID of the original requester.......or the UOID of the > internediate node that did the flooding ? If I understand you correctly, I think you are generating new UOID when you *forward* a message! You should not do that. When you forward a message, the only difference between the out-going message and the one you received is TTL. All copies of the join request message have identical UOID. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 331.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 26 22:09:01 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9R591L1014057 for ; Sun, 26 Oct 2008 22:09:01 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9R5JmoC027093 for ; Sun, 26 Oct 2008 22:19:48 -0700 Message-Id: <200810270519.m9R5JmoC027093@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Final Proj Part 1 (Doubt with join timeout) Date: Sun, 26 Oct 2008 22:19:48 -0700 From: Bill Cheng Someone wrote: > I have a doubt with the join timeout. Suppose I receive a join response > from a node, I wait for join timeout to get over before trying to > connect to the node. > What if one of the nodes has shut down the connection already? What > should be my system's behavior in this case? Remember, when you do a soft-restart, it's as if you shutdown your node and start it again. Anything can happen between the time you shutdown your node and start it again and you need to be ready to deal with it. In this case, it's just like when you start this node, it cannot connect to MinNeighbor number of nodes. You should delete init_neighbor_list file and do a soft-restart. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 330.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 26 21:14:52 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9R4EptD013525 for ; Sun, 26 Oct 2008 21:14:51 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9R4Pcba026687 for ; Sun, 26 Oct 2008 21:25:38 -0700 Message-Id: <200810270425.m9R4Pcba026687@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Two threads sending from same Socket? Date: Sun, 26 Oct 2008 21:25:38 -0700 From: Bill Cheng Someone wrote: > In my code it can happen that two threads might write on the same Socket > Descriptor. > Will i need a Lock on the "send" portion of my code in both thread > codes.Or the kernel takes care that only one thread writes into the socket > and will not context switch it out. I've heard both sides! Some say that you cannot send() and recv() at the same time. Some say that it's no problem. If simultaneous sending and receiving doesn't work for you, you should use a mutex. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 329.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 26 21:00:01 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9R401DW013392 for ; Sun, 26 Oct 2008 21:00:01 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9R4AmgQ026524 for ; Sun, 26 Oct 2008 21:10:48 -0700 Message-Id: <200810270410.m9R4AmgQ026524@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: A little confused on auto-shutdown Date: Sun, 26 Oct 2008 21:10:48 -0700 From: Bill Cheng Someone wrote: > For the auto-shutdown flag, is this timer an absolute timer or timer from > the last time traffic was received by the node? If it is the latter case, > then it sounds like there should be some sort of global variable to keep > track of this since traffic can be coming from numerous sources? It's from the time the node was started. It's not a function of traffic. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 328.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 26 19:44:19 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9R2iJDf012703 for ; Sun, 26 Oct 2008 19:44:19 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9R2t5xv025678 for ; Sun, 26 Oct 2008 19:55:05 -0700 Message-Id: <200810270255.m9R2t5xv025678@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551 final1 - flood packet Date: Sun, 26 Oct 2008 19:55:05 -0700 From: Bill Cheng Someone wrote: > I have an question on flood mechanism which is among > 1) duplicate received packet and put into each node's send() queue (so there > are n copies of the original packet) > 2) use a pointer to received packet, put the pointer into each node's send() > queue > > 2nd way is obviously scalable, light weighting and efficiency. However I > encounter memory corruption problem. > Do I have to use a lock when node's are send() by using 2nd way (pointer to > packet)? > I guess no because nobody modify the data. Is this correct? > > If no, then I probably have to add lock send(). This arises an efficiency > problem: each send() have to wait each other. > So both way have there down side. Which one is more popular design? I think you can make the 2nd way work without losing efficienty. You can use a reference count with the object. The key here is that the object is read-only (i.e., it does not change). When one sender finishes sending the data, it decrements the reference count. When the reference count reaches zero, it deletes the object. Of course, when you need to increment or decrement the reference count, you need to lock a mutex. But when you are sending data, I don't think you have to lock the object since the object never changes. Also, there is no way for the object to disappear as long as its reference count is > 0. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 327.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 26 18:34:23 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9R1YNV5012132 for ; Sun, 26 Oct 2008 18:34:23 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9R1j87X024939 for ; Sun, 26 Oct 2008 18:45:08 -0700 Message-Id: <200810270145.m9R1j87X024939@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: When non-beacon starts Date: Sun, 26 Oct 2008 18:45:08 -0700 From: Bill Cheng Someone wrote: > When a first non-beacon node comes up, Is it assumed that all beacon > nodes are up and are fully connected ? No. This is a peer-to-peer network where every node can be controlled independently by its owner. You really cannot assume anything. It's possible that none of the beacon nodes are up. Your node needs to behave properly under any condition! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 326.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 26 18:32:39 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9R1Wdaj012105 for ; Sun, 26 Oct 2008 18:32:39 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9R1hOoq024902 for ; Sun, 26 Oct 2008 18:43:24 -0700 Message-Id: <200810270143.m9R1hOoq024902@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: csci-551 final#1 Date: Sun, 26 Oct 2008 18:43:24 -0700 From: Bill Cheng Someone wrote: > Do we have to wait for Msglifetime to get all the status responses and > then print to file or can we write to file as and when the node gets > status responses? Either way! You also need to make sure that if the user presses , you short-circuit the waiting period and have the correct result generated. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 325.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 26 15:22:45 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9QMMiYQ010667 for ; Sun, 26 Oct 2008 15:22:45 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9QMXRk7023172 for ; Sun, 26 Oct 2008 15:33:28 -0700 Message-Id: <200810262233.m9QMXRk7023172@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551: Final Project: Log File Date: Sun, 26 Oct 2008 15:33:27 -0700 From: Bill Cheng Someone wrote: > In the spec, for logging, it says: > > "You should write error messages into you log file and you may also output > debugging information there. Please begin each debugging lines with // (like > a comment line in C++) and error messages with **. " > > Can you please explain what do we have to write as "error messages" and > "debugging information" ? Anything you want! The grader should be able to do the following to filter out any debugging messages you write into your log file: grep -v "^//" servant.log You should log any error conditions into your logfile. For example, if you cannot open a file or when you cannot write to a file. If you hardcode any filesystem paths, your program may not work in the grading account. If you log all these error messages, there may be a chance that you can do something about it during regrade! So, the bottomline is, you should write anything that you think may help you! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 324.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 26 14:10:51 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9QLApCF010048 for ; Sun, 26 Oct 2008 14:10:51 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9QLLXMm022208 for ; Sun, 26 Oct 2008 14:21:33 -0700 Message-Id: <200810262121.m9QLLXMm022208@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: FInal Project Date: Sun, 26 Oct 2008 14:21:33 -0700 From: Bill Cheng Someone wrote: > In between the join phase and the hello phase to any notify messages need to > be exchanged it doesn't seem to specify in the spec? During the join phase, you don't need to send notify messages on these temporary connections. > Does a Beacon Node have an init_neighbors_file since it is implicit? No. The "initial neighbors" of a beacon node are all the other beacon nodes. > It seems like there can bee weird arrangements between number of beacon > nodes, min neighborsand init_neighbors? Num Beacon Nodes has to be greater > than min neighbors? If you don't have less than initneighbors responses but > more than min neighbors is that okay? Yes, there can be cases where you may not be able to go forward. You just need to follow the spec. For a regular node, if it cannot get >= InitNeighbors number of join responses, it should just give up. -- Bill Cheng // bill.cheng@usc.edu > -----Original Message----- > From: Bill Cheng [mailto:william@bourbon.usc.edu] > Sent: Sunday, October 26, 2008 1:44 PM > To: cs551@merlot.usc.edu > Subject: Re: FInal Project > > Someone wrote: > > > When only 2 nodes are connected to each other, and one node sends a > > status request, does the second node reply back with any data as it is > > only connected to the node it received the status request from? > > Yes. A node must put *all* its neighbors in a status response message. > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 323.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 26 13:33:47 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9QKXlMq009683 for ; Sun, 26 Oct 2008 13:33:47 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9QKiTDF021464 for ; Sun, 26 Oct 2008 13:44:29 -0700 Message-Id: <200810262044.m9QKiTDF021464@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: FInal Project Date: Sun, 26 Oct 2008 13:44:29 -0700 From: Bill Cheng Someone wrote: > When only 2 nodes are connected to each other, and one node sends a > status request, does the second node reply back with any data as it is > only connected to the node it received the status request from? Yes. A node must put *all* its neighbors in a status response message. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 322.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 26 13:31:27 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9QKVRit009654 for ; Sun, 26 Oct 2008 13:31:27 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9QKg8Zl021405 for ; Sun, 26 Oct 2008 13:42:09 -0700 Message-Id: <200810262042.m9QKg8Zl021405@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: final project - routing table Date: Sun, 26 Oct 2008 13:42:08 -0700 From: Bill Cheng Someone wrote: > Is there any format we should conform when creating routing table? It's not part of the spec. You can do anything you want. > When will a node delete its routing table entry? For a message, if you put it in the routing table at time X, at time X+MsgLiftime, you can remove it. It doesn't have to be precisely X+MsgLifetime. > And, when a node receive a join message, > it will flood to all the nodes except from the receiving node, > what is this action when we write to the logfile? (send or forward) "send" is only for the node that *initiated* the message. For all other nodes, it should be "forward". > Also, I know we have to decrement the TTL when receiving a message, > but what is the TTL value when writing to logfile? > Is the TTL value we received or updated TTL value (TTL-1)? If the message is "received", then it should be the TTL on the received message. If the message is "forwarded", it should be the TTL on the out-going message. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 321.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 26 13:27:43 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9QKRhwt009613 for ; Sun, 26 Oct 2008 13:27:43 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9QKcPnK021370 for ; Sun, 26 Oct 2008 13:38:25 -0700 Message-Id: <200810262038.m9QKcPnK021370@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: csci-551 final#1 Date: Sun, 26 Oct 2008 13:38:25 -0700 From: Bill Cheng Someone wrote: > How is the check request msg going to get initiated..? I suppose it is to be > handled via commandline but i couldn't find its format in the spec. Not via commandline. In paragraph 6 of the Peer-to-Peer section of the spec: http://merlot.usc.edu/cs551-f08/projects/final.html#p2p it says: When a node loses connection with one of its neighbors, it is possible that it may be disconnect from the SERVANT network. In order to make sure that it is still connected to the network, the node must intiatiate a connectivity check by flooding a check message. So, you must flood a CHECK when you lose *any* connection with a neighbor (unless this node is shutting down of course). > Also it is mentioned in the spec that 'The flooding of check messages stops > at a beacon node where the beacon node sends a check response message > towards the node from which it received the check message'. What should the > requesting node of check msg set the TTL to to ensure that it stops at a > beacon node and not anywhere before. You should use the TTL from the startup configuration file. > The timeout we can use for check response msg is JoinTimeOut, right ? No. You should use the same logic as for the status command: http://merlot.usc.edu/cs551-f08/projects/final-faq.html#done-status -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 320.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 26 13:10:28 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9QKASfj009412 for ; Sun, 26 Oct 2008 13:10:28 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9QKL9OE021111 for ; Sun, 26 Oct 2008 13:21:09 -0700 Message-Id: <200810262021.m9QKL9OE021111@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Dos endline character Date: Sun, 26 Oct 2008 13:21:09 -0700 From: Bill Cheng Someone wrote: > pritnf("%10ld.%03d",sec,millisec) doesn't work for me. I think its because > milisec has more than 3 digits and it doesn truncate. Am I doing something > wrong? I'm not sure how millisec can be more than 1000. But if it does, then you just need to carry it over to sec. You can do: sec = sec + (int)(((int)millisec)/((int)1000)); millisec = millisec % 1000 -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 319.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 26 08:29:52 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9QFTqrI006204 for ; Sun, 26 Oct 2008 08:29:52 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9QFeVOH016893 for ; Sun, 26 Oct 2008 08:40:31 -0700 Message-Id: <200810261540.m9QFeVOH016893@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Dos endline character Date: Sun, 26 Oct 2008 08:40:31 -0700 From: Bill Cheng Someone wrote: > If .ini file is created in dos then it has extra end line character ^M. > If we parse this file then it gives error, with stat function, as the > home directory path is appended with ^M. > > while grading, shall we assume that we will have all .ini created in Unix ? Yes! If you want your code to work with both types of file, assuming that my_string is a *null-terminated ASCII string* that represents a *line* of input, you can simply do: if (strlen(my_string) > 0 && my_str[strlen(my_string)-1] == '\r') { my_str[strlen(my_string)-1] == '\0'); } -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 318.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 26 08:23:31 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9QFNVDf006117 for ; Sun, 26 Oct 2008 08:23:31 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9QFYASV016837 for ; Sun, 26 Oct 2008 08:34:10 -0700 Message-Id: <200810261534.m9QFYASV016837@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Check message time out Date: Sun, 26 Oct 2008 08:34:10 -0700 From: Bill Cheng Someone wrote: > What is the check message timeout, in seconds? > How much time should we wait for check message response, before self > shutting down. You can do that same thing as what you would do for status responses. Please see: http://merlot.usc.edu/cs551-f08/projects/final-faq.html#done-status -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 317.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 26 08:04:27 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,WEIRD_PORT autolearn=no version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9QF4Rff005882 for ; Sun, 26 Oct 2008 08:04:27 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9QFF6xa016685 for ; Sun, 26 Oct 2008 08:15:06 -0700 Message-Id: <200810261515.m9QFF6xa016685@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: FInal Project Date: Sun, 26 Oct 2008 08:15:06 -0700 From: Bill Cheng Someone wrote: > I was getting this error when i ran ~csci551/nam status.out > > nam: this isn't a Tk applicationcouldn't connect to display > "adsl-###-###-###-###.dsl.irvnca.pacbell.net:0" > > How do i correct this? nam is an X Windows application. If your PC runs an X server, then you can run nam remotely and have it opens the display on your PC. Are you running an X server on your PC? If you are not, you need to find one. From ITS, you can download XWin: http://www.usc.edu/its/doc/internet/xservers/xwin32/5.2/index.html Alternatively, you can run nam when you are on campus. If you are running an X server and you ssh'ed to nunki and you are getting this error, you need to enable X11-forwarding. For example, if you are running cygwin, you need to run ssh with either the -X or -Y commandline option. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 316.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 26 07:11:58 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9QEBvCJ005310 for ; Sun, 26 Oct 2008 07:11:58 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9QEMZj2016341 for ; Sun, 26 Oct 2008 07:22:35 -0700 Message-Id: <200810261422.m9QEMZj2016341@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Soft restart Date: Sun, 26 Oct 2008 07:22:35 -0700 From: Bill Cheng Someone wrote: > When we do a soft restart, we close sockets we are connected to during join. > After that the non-beacon comes up again, reads its init_neighbor_list file > and creates one thread to connect to each of its neighbors, and also creates > one server to accept connections. > > This newly created server is always getting a bind failed error. We have > tried from 2 different sets of port numbers. > > What could be the problem ? First, you need to isolate the problem and see if this happens under other conditions. Instead of doing a soft restart, you can let your code terminate normally and start it manually right away. Does this problem happen? If not, and if you have already been calling setsockopt() with SO_REUSEADDR and have closed your server's master socket properly, then you just need to find out what's the difference between soft restart and normal termination above. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 315.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Oct 25 20:15:49 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9Q3Fnhv025221 for ; Sat, 25 Oct 2008 20:15:49 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9Q3QK1F007223 for ; Sat, 25 Oct 2008 20:26:20 -0700 Message-Id: <200810260326.m9Q3QK1F007223@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: 551 - NS Date: Sat, 25 Oct 2008 20:26:20 -0700 From: Bill Cheng Someone wrote: > I am not able to install NS properly. > Whom should I contact? You, the TA or Alix? Please do *not* install ns! Please run the following on nunki: ~csci551/nam status.out -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 314.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Oct 25 20:13:15 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9Q3DFK6025192 for ; Sat, 25 Oct 2008 20:13:15 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9Q3NkjU007189 for ; Sat, 25 Oct 2008 20:23:46 -0700 Message-Id: <200810260323.m9Q3NkjU007189@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS 551 Date: Sat, 25 Oct 2008 20:23:46 -0700 From: Bill Cheng Someone wrote: > When we enter the status command at the prompt of a particular node A should > the nam file created contain the link information between B and C if A, B > and C are all connected to each other? Yes. The status request message is flooded to the whole network. So, node A should get the topology of the whole network and write that information to the nam file. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 313.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Oct 25 19:34:31 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9Q2YVMP024889 for ; Sat, 25 Oct 2008 19:34:31 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9Q2j2kV006865 for ; Sat, 25 Oct 2008 19:45:02 -0700 Message-Id: <200810260245.m9Q2j2kV006865@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS 551 Date: Sat, 25 Oct 2008 19:45:02 -0700 From: Bill Cheng Someone wrote: > How can i access the HomeDir provided in the .ini file so as to create a > "init_neighbor_list" file under the current node directory ? Well, let's say that you have successfully parsed the startup configuration file and have read the value of HomeDir into a variable: char home_dir[256]. You also have a variable: char init_neighbor_list_path[256]. You can then do: snprintf(init_neighbor_list_path, sizeof(init_neighbor_list_path), "%s/init_neighbor_list", home_dir); -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 312.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Oct 25 17:10:35 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9Q0AZMl023746 for ; Sat, 25 Oct 2008 17:10:35 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9Q0L4kt005923 for ; Sat, 25 Oct 2008 17:21:04 -0700 Message-Id: <200810260021.m9Q0L4kt005923@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS 551 Date: Sat, 25 Oct 2008 17:21:04 -0700 From: Bill Cheng SOmeone wrote: > The writeup says the following - > *"HomeDir* - The home directory for this node. If this directory does not > exist, your program should exit. This directory must contain a subdirectory > named files for storing cached and permanent files. If the > filessubdirectory does not exist, your program should create it > programmatically. > " > > My question is , where will be our sv_node.c and other files be stored > before running the program ? Will they be stored in the "final1" folder that > reflects in the HomeDir path ? You should pretend that your sv_node is installed in /usr/bin and another user is running your code from his/her directory and your source code has been deleted. Please do *not* hardcode *any* path! That's a sure way to have your code not working during grading. If you find yourself hardcoding any path, you need to find out how not to do that (you can send e-mail to me)! If you use a static buffer to store a filesystem path, you should make sure it's at least 256 bytes long and don't assume that your buffer is large enough to hope any filesystem path. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 311.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Oct 25 14:55:49 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9PLtm98022684 for ; Sat, 25 Oct 2008 14:55:49 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9PM6Hc9004303 for ; Sat, 25 Oct 2008 15:06:17 -0700 Message-Id: <200810252206.m9PM6Hc9004303@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: cs551- final1 Date: Sat, 25 Oct 2008 15:06:17 -0700 From: Bill Cheng SOmeone wrote: > The init_neighbor_list file for each node needs to be created inside its > home directory. So we will actually have to create all the directories on > the fly in our code so that the node searches for the file at the right > place (inside the right directory), right ? No. The spec for HomeDir says: If this directory does not exist, your program should exit. > Also for the status request, the 3rd argument which is the external file > readable by NAM (relative to the current working directory if it does not > begin with a / character). Does it mean that if we give the file as > /a/b/c/status.out , we will have to create directories a,b,c first and if > only status.out is given, it will create a status.out inside the directory > where all our code files are (not inside the home directory of each node) If the user specifies /a/b/c/status.out and /a/b/c does not exist, you can either create the directory or report an error and ask the user to specify the command again. If the user specifies just status.out, you will need to create status.out in the "current working directory" and *not* where the code is. The "current working directory" is the current directory before you start running the sv_node command. If I do: mkdir /tmp/mydir cd /tmp/mydir /pathtoyourcode/sv_node then the current working directory is /tmp/mydir. If you really need to know what the current working directory is, you can call getcwd(). -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 310.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Oct 25 14:42:31 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9PLgVfZ022574 for ; Sat, 25 Oct 2008 14:42:31 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9PLqxgJ003956 for ; Sat, 25 Oct 2008 14:52:59 -0700 Message-Id: <200810252152.m9PLqxgJ003956@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551: Final Project: join distance Date: Sat, 25 Oct 2008 14:52:59 -0700 From: Bill Cheng Someone wrote: > So the numeric distance might be negative. So does our protocol allow > negative distances? No. Would you say that the age difference between you and your cousin is -3 years? -- Bill Cheng // bill.cheng@usc.edu On Sat, Oct 25, 2008 at 8:43 AM, Bill Cheng wrote: > Someone wrote: > > > If node A sends join request to node B then, in the join response which > node > > B sends, the distance field will be absolute(location A - location B), > > correct ? > > The spec says: > > The distance is simply the numeric difference between the > location of this node and that of the joining node. > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 309.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Oct 25 14:40:17 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9PLeHgC022543 for ; Sat, 25 Oct 2008 14:40:17 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9PLojl5003850 for ; Sat, 25 Oct 2008 14:50:45 -0700 Message-Id: <200810252150.m9PLojl5003850@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: 551- node-id Date: Sat, 25 Oct 2008 14:50:45 -0700 From: Bill Cheng Someone wrote: > I agree that we have to log the KPAV message. I'll rephrase my original > question: > > For a KPAV message, we cannot retrieve the node id (for and > )from the message that is received, because there is no body. > Since we know the details of the connection on which it was received, we can > lookup our database and find out the node id of the sender. > > Just want to confirm that there is no way the receiver can get the node id > from the message header. If your node has a connection with a neighbor, you need to remember the node ID of who's on the other side! If you don't have this implemented, it's quite easy to add this. You can have a lookup table that associate a socket descriptor (or whatever you use to identify a connection) with a node ID. When you first receive a HELLO from a neighbor, you update this lookup table. When you disconnect, you remove the corresponding entry from the lookup table. -- Bill Cheng // bill.cheng@usc.edu On Sat, Oct 25, 2008 at 8:23 AM, Bill Cheng wrote: > Someone wrote: > > > While logging the entries, the and are the node id's like > > nunki.usc.edu_port#. > > Messages like KPAV which have no body - specifically sender's hostname > and > > port - we cannot extract the details from there. > > So we look up the table where we stored the information about our > > connections, right? > > For a KPAV message, although the part of the log entry is empty, > you still need to log and . > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 308.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Oct 25 14:35:17 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9PLZGI7022474 for ; Sat, 25 Oct 2008 14:35:16 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9PLjiLD003689 for ; Sat, 25 Oct 2008 14:45:44 -0700 Message-Id: <200810252145.m9PLjiLD003689@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551: Final Project: join distance Date: Sat, 25 Oct 2008 14:45:44 -0700 From: Bill Cheng Someone wrote: > So Does it mean that, the distance can be a negative number? No. Would you say that the numeric difference between 3 and 5 is -2? -- Bill Cheng // bill.cheng@usc.edu On Sat, Oct 25, 2008 at 8:43 AM, Bill Cheng wrote: > Someone wrote: > > > If node A sends join request to node B then, in the join response which node > > B sends, the distance field will be absolute(location A - location B), > > correct ? > > The spec says: > > The distance is simply the numeric difference between the > location of this node and that of the joining node. > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 307.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Oct 25 14:31:13 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9PLVDl4022422 for ; Sat, 25 Oct 2008 14:31:13 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9PLffjm003559 for ; Sat, 25 Oct 2008 14:41:41 -0700 Message-Id: <200810252141.m9PLffjm003559@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: cs551- final1- status msg Date: Sat, 25 Oct 2008 14:41:41 -0700 From: Bill Cheng Someone wrote: > Ttl should be an unsigned char since it is one byte correct? How could I > print that out as an integer with printf? If ttl is of the type (unsigned char), you can do: printf("%d", (int)(unsigned int)ttl); -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 306.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Oct 25 08:33:32 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9PFXV6D019140 for ; Sat, 25 Oct 2008 08:33:31 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9PFhus3032611 for ; Sat, 25 Oct 2008 08:43:56 -0700 Message-Id: <200810251543.m9PFhus3032611@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551: Final Project: join distance Date: Sat, 25 Oct 2008 08:43:56 -0700 From: Bill Cheng Someone wrote: > If node A sends join request to node B then, in the join response which node > B sends, the distance field will be absolute(location A - location B), > correct ? The spec says: The distance is simply the numeric difference between the location of this node and that of the joining node. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 305.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Oct 25 08:13:01 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9PFD1J5018972 for ; Sat, 25 Oct 2008 08:13:01 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9PFNO2s032312 for ; Sat, 25 Oct 2008 08:23:25 -0700 Message-Id: <200810251523.m9PFNO2s032312@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: 551- node-id Date: Sat, 25 Oct 2008 08:23:24 -0700 From: Bill Cheng Someone wrote: > While logging the entries, the and are the node id's like > nunki.usc.edu_port#. > Messages like KPAV which have no body - specifically sender's hostname and > port - we cannot extract the details from there. > So we look up the table where we stored the information about our > connections, right? For a KPAV message, although the part of the log entry is empty, you still need to log and . -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 304.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 24 15:30:00 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9OMU0xt009087 for ; Fri, 24 Oct 2008 15:30:00 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9OMeEZP021769 for ; Fri, 24 Oct 2008 15:40:14 -0700 Message-Id: <200810242240.m9OMeEZP021769@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: cs551- final1- status msg Date: Fri, 24 Oct 2008 15:40:14 -0700 From: Bill Cheng Someone wrote: > How does the status msg works ? Do we have to enter at the commandline of > any node 'status' to get the status responses from all its neighbors ? Correct. > So after entering 'status' the node should flood a status request msg with a > given TTL(where to get this TTL value from- is this the one in the startup > config file or the default TTL) with the status type set to (0x01 for > part1). Please use the TTL the user entered. > Then how long will it have to wait for all the status responses and > what is to be done after getting all the status responses? Please see: http://merlot.usc.edu/cs551-f08/projects/final-faq.html#done-status -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 303.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 24 14:38:00 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9OLc0cN008650 for ; Fri, 24 Oct 2008 14:38:00 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9OLmDc0021065 for ; Fri, 24 Oct 2008 14:48:13 -0700 Message-Id: <200810242148.m9OLmDc0021065@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: FInal Project Date: Fri, 24 Oct 2008 14:48:13 -0700 From: Bill Cheng Someone wrote: > Does the non-beacon node have to log entries into the log file when it > receives join requests or does it log entries only after it has become > a fully functional node? According to the grading guidelines, it should log its join request and all the join responses it got. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 302.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 24 13:23:45 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9OKNj46007818 for ; Fri, 24 Oct 2008 13:23:45 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9OKXwZN019624 for ; Fri, 24 Oct 2008 13:33:58 -0700 Message-Id: <200810242033.m9OKXwZN019624@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Final Proj Part 1 Date: Fri, 24 Oct 2008 13:33:58 -0700 From: Bill Cheng Someone wrote: > I have a question regarding "notify". Whenever a node is triggered to > send notify message to all its neighbors, should it first finish sending > everything thats there in its sending queue already or should it just > send notify right away ignoring whatever is there in its send queues? Sending notify usually means that this node is going down. If that is the case, you can just *delete* everything in its queue and send the notify message. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 301.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 24 13:13:53 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9OKDruv007703 for ; Fri, 24 Oct 2008 13:13:53 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9OKO6mW019532 for ; Fri, 24 Oct 2008 13:24:06 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.14.2/8.14.1/Submit) id m9OKO6dR019531 for cs551@merlot; Fri, 24 Oct 2008 13:24:06 -0700 Date: Fri, 24 Oct 2008 13:24:06 -0700 From: Bill Cheng Message-Id: <200810242024.m9OKO6dR019531@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Deleting the log file... Hi everyone, Please do *not* delete your log file (unless -reset is specified in the commandline). Please see: http://merlot.usc.edu/cs551-f08/projects/final-faq.html#delete-log -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 300.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 24 11:59:27 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9OIxRCx007035 for ; Fri, 24 Oct 2008 11:59:27 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9OJ9dIx018580 for ; Fri, 24 Oct 2008 12:09:39 -0700 Message-Id: <200810241909.m9OJ9dIx018580@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Problem with nunki Date: Fri, 24 Oct 2008 12:09:39 -0700 From: Bill Cheng Someone wrote: > I am having some problem with nunki. It is not giving permission > to open 2 sessions, even if it opens it has no prompt and my > session1 gives me "No more processes" if I give any command, even > for ps. One session is working fine. It was ok till sometime back > and started giving these problems with out any reason. Please > help me find a solution to the problem. Awaiting your reply. I'm sorry, but there is no solution to this problem! Nunki.usc.edu is a shared machine that many students use to do their assignments. I'm seen some simulators (used for EE classes) that eats up all the CPU cycles on nunki when it got close to some assignment due dates. The only thing you can do is to protect yourself from the effect of things like this. In general, you should always: Plan for the worst and hope for the best! One thing you can do is to start your work early! This is also why I suggested that you should try cygwin. Of course, the down side is that you need to write portable code and that can be more work. But then again, it's great to be able to write portable code. This makes you more valuable and more independent on nunki being not so busy. I've heard that Ubuntu Linux can be installed from Windows. It can partition your harddrive and install Linux a newly created drive. But you should only try this if you have a way to reinstall Windows just in case things don't work. Again, for this, you have to write portable code. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 299.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Oct 23 22:47:41 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9O5leOM030883 for ; Thu, 23 Oct 2008 22:47:40 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9O5vib0009000 for ; Thu, 23 Oct 2008 22:57:44 -0700 Message-Id: <200810240557.m9O5vib0009000@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: keepalive Date: Thu, 23 Oct 2008 22:57:44 -0700 From: Bill Cheng Someone wrote: > I understand that you have to send a KeepAlive message (or any other message > on that socket) every (keepalive/2) seconds. > > But what should be the course of action if you do not hear anything > (messages or keepalives) from one of your neighbors for a keepalive timeout, > will you terminate the connection with the neighbor ? Yes. That connection is considered dead. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 298.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Oct 23 21:23:25 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9O4NOR5030004 for ; Thu, 23 Oct 2008 21:23:24 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9O4XRpJ008331 for ; Thu, 23 Oct 2008 21:33:27 -0700 Message-Id: <200810240433.m9O4XRpJ008331@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551: Final Project: Date: Thu, 23 Oct 2008 21:33:27 -0700 From: Bill Cheng Someone wrote: > The spec says: > > "The above implies that a node should keep message UOIDs in memory and have > an efficient way to see if a message UOID has been seen before. Efficient > here is defined as O(log(n)), where n is the number of message UOIDs in your > data structure." > > Is it mandatory to implement it this way ? or can we use a linear search for > checking if a UOID has been seen before? If you keep on read the spec, within the same paragraph, it says that it is not a requirement. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 297.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Oct 23 20:36:18 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9O3aIta029628 for ; Thu, 23 Oct 2008 20:36:18 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9O3kLRa007826 for ; Thu, 23 Oct 2008 20:46:21 -0700 Message-Id: <200810240346.m9O3kLRa007826@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Soft restart Date: Thu, 23 Oct 2008 20:46:21 -0700 From: Bill Cheng Someone wrote: > We have got the responses from the beacons for the non-beacon nodes and we > store them in an init_neighbor_list file. > > The next step is that the non-beacon nodes do a 'soft restart' , come up, > read the ini_neighbor_list file and send hello messages to the beacon nodes. > Is this correct ? Yes. > Also, what exactly does a node do in a soft restart ? The idea is that you should write your code such that when you do a soft restart, it should be *exactly* like the case where you do a shutdown and then start your node again. So, I would so something like the following in main(): int main(...) { shutdown = FALSE; while (!shutdown) { Init(); /* initialize everything except for the shutdown variable */ DoEverything(); CleanUp(); /* clean up everything */ } } The only thing that set shutdown to TRUE if when the user types "shutdown" or when auto-shutdown happens. You can also have additional conditions where you set shutdown to be TRUE. Otherwise, you node should loop over and over again. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 296.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Oct 22 09:54:55 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9MGstlu008982 for ; Wed, 22 Oct 2008 09:54:55 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9MH4biD010495 for ; Wed, 22 Oct 2008 10:04:37 -0700 Message-Id: <200810221704.m9MH4biD010495@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Regarding BGP "unique" in policy routing Date: Wed, 22 Oct 2008 10:04:37 -0700 From: Bill Cheng Someone wrote: > I'm a little bit curious when in slide 50 of lecture 11, you say that BGP is > unique among deployed routing protocols in supporting policy based routing. > Wouldn't using OSPF or EIGRP with a custom administrative cost achieve the > same or similar goal? Or were you referring to only EGP routing protocols? I'm not familiar with EIGRP. OSPF does not support policy to the level BGP does. For example, for every *network prefix*, you can specify something like a LOCAL_PREF in BGP. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 295.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Oct 22 09:24:09 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9MGO9wI008667 for ; Wed, 22 Oct 2008 09:24:09 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9MGXoRX009801 for ; Wed, 22 Oct 2008 09:33:50 -0700 Message-Id: <200810221633.m9MGXoRX009801@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Extra homework Date: Wed, 22 Oct 2008 09:33:50 -0700 From: Bill Cheng Someone wrote: > Regarding the 2nd part of the 1st problem, would this be the format ? > > Orig. Name New Name Level LMs > a h.a.a 1 h > b h.a.b 0 h,a > c h.a.c 0 h,a > d > ... > h h.h.h 2 - > .... > > I have promoted 'h' to level 2 and 'a'&'o' to level 1. > > Considering that, are the above answers correct ? I didn't even realize that there was the "2nd part of the 1st problem"! The term "new name" was incorrect. It should be "addresses" because things like "h.a.a" is the address of landmark "a" and a landmark may have more than one addresses. I've just changed "new name" to "addresses" in the spec. Also, the "2nd part of the 1st problem" depends on your solution to the 1st part of the 1st problem. Since the solution of the 1st part was not given, we cannot talk about the solution to the 2nd part! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 294.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Oct 22 09:02:10 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9MG2AcA008399 for ; Wed, 22 Oct 2008 09:02:10 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9MGBpSB009278 for ; Wed, 22 Oct 2008 09:11:51 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.14.2/8.14.1/Submit) id m9MGBpxs009277 for cs551@merlot; Wed, 22 Oct 2008 09:11:51 -0700 Date: Wed, 22 Oct 2008 09:11:51 -0700 From: Bill Cheng Message-Id: <200810221611.m9MGBpxs009277@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Reminder about midterm today! Hi, Please make sure you don't go to the wrong room today! The exam will be in GFS 106. Please be on time! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 293.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 21 23:15:36 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9M6FaAP001859 for ; Tue, 21 Oct 2008 23:15:36 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9M6PBtQ001355 for ; Tue, 21 Oct 2008 23:25:11 -0700 Message-Id: <200810220625.m9M6PBtQ001355@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: 551- MED Date: Tue, 21 Oct 2008 23:25:11 -0700 From: Bill Cheng Someone wrote: > But it is optional and non-transitive right? > So does the bullet on Slide 48 mean Unrecognized *AND* optional *AND* > non-transitive attributes are ignored? Correct! -- Bill Cheng // bill.cheng@usc.edu On Tue, Oct 21, 2008 at 10:55 PM, Bill Cheng wrote: > Someone wrote: > > > Lec 11: > > Slide 39 (Policy 3 MED) says: > > MED is Optional, non-transitive attribute. > > > > Slide 48 (UPDATE Message Handling) says: > > Unrecognized, optional, non-transitive attributes are ignored. - This > > includes MED right? > > No, because MED is not unrecognized. > > > Slide 49 (Decision Process) says: > > Apply MED - Didn't we ignore MED in slide 48? > > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 292.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 21 23:08:37 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9M68bwV001715 for ; Tue, 21 Oct 2008 23:08:37 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9M6IC07001204 for ; Tue, 21 Oct 2008 23:18:12 -0700 Message-Id: <200810220618.m9M6IC07001204@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Lecture13: Slide 14 Date: Tue, 21 Oct 2008 23:18:12 -0700 From: Bill Cheng Someone wrote: > In the 5th step, the 'A' side sends an ACK only in the message. I think > there shouldn't be a new SEQ for just an ACK message. > > Shouldn't the SEQ remain at 100 as it has already sent all its data ? Hmm... I would agree with you. This page is copied from RFC 1337 and that's how they had it in RFC 1337. In RFC 1337, it mentioned that the first 5 steps were copied from RFC 793. If you read RFC 793, even in the 3-way handshake, the 3rd message had SEQ incremented! So, my guess is that it doesn't matter if it's incremented because the data part of the message is empty! (And that's the only explanation I can think of.) -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 291.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 21 22:46:11 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9M5kBGQ001508 for ; Tue, 21 Oct 2008 22:46:11 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9M5tkdN001045 for ; Tue, 21 Oct 2008 22:55:46 -0700 Message-Id: <200810220555.m9M5tkdN001045@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: 551- MED Date: Tue, 21 Oct 2008 22:55:46 -0700 From: Bill Cheng Someone wrote: > Lec 11: > Slide 39 (Policy 3 MED) says: > MED is Optional, non-transitive attribute. > > Slide 48 (UPDATE Message Handling) says: > Unrecognized, optional, non-transitive attributes are ignored. - This > includes MED right? No, because MED is not unrecognized. > Slide 49 (Decision Process) says: > Apply MED - Didn't we ignore MED in slide 48? -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 290.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 21 20:15:39 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9M3FdMh032083 for ; Tue, 21 Oct 2008 20:15:39 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9M3PCGm031932 for ; Tue, 21 Oct 2008 20:25:12 -0700 Message-Id: <200810220325.m9M3PCGm031932@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Nature of the midterm Date: Tue, 21 Oct 2008 20:25:12 -0700 From: Bill Cheng Someone wrote: > Is this the red rule? > Every LMi router is seen by at least one LM(i+1) router Yes! -- Bill Cheng // bill.cheng@usc.edu On Tue, Oct 21, 2008 at 7:48 PM, Bill Cheng wrote: > Someone wrote: > > > Is this the bottom up algorithm for building landmark hierarchy? > > An "algorithm" is not a "rule"! > -- > Bill Cheng // bill.cheng@usc.edu > > > > > On Tue, Oct 21, 2008 at 7:55 AM, Bill Cheng > wrote: > > Someone wrote: > > > > > I am not able to find the definition of "red rule" in the slides. > Please > > > suggest which lecture I should look for it. > > > > I've use this term many times during the landmark routing > > lecture. Please check out the lecture video! > > -- > > Bill Cheng // bill.cheng@usc.edu http://merlot.usc.edu/william/usc/> > > > > > > > > > > On Mon, Oct 20, 2008 at 1:58 PM, Bill Cheng > > wrote: > > > Someone wrote: > > > > > > > What are the types of question we can expect in midterm other > > > > that "ans in x words" or "problems on landmark routhing"? > > > > Please let us know > > > > > > Sorry, other than what's on: > > > > > > http://merlot.usc.edu/cs551-f08/description.html#examqs > > > > > > I cannot say much more. One obvious example (which I won't > > > ask during the exam) would be: > > > > > > In 15 words or less, please write down the "red rule". > > > -- > > > Bill Cheng // bill.cheng@usc.edu http://merlot.usc.edu/william/usc/> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 289.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 21 19:41:31 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9M2fV7q031852 for ; Tue, 21 Oct 2008 19:41:31 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9M2p4x0031604 for ; Tue, 21 Oct 2008 19:51:04 -0700 Message-Id: <200810220251.m9M2p4x0031604@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Doubt in HW assignment Question 2 Date: Tue, 21 Oct 2008 19:51:04 -0700 From: Bill Cheng Someone wrote: > Shouldn't the routing table for node h in HW Question 2 have entries > for all the nodes? > Node h has radius 8. Again, please do not confuse "seen" with "see". Node h does not "see" everyone. It is "seen" by everyone! Node h only has an entry for a node if it can "see" that node. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 288.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 21 19:39:13 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9M2dDYM031821 for ; Tue, 21 Oct 2008 19:39:13 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9M2mk1W031554 for ; Tue, 21 Oct 2008 19:48:46 -0700 Message-Id: <200810220248.m9M2mk1W031554@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Nature of the midterm Date: Tue, 21 Oct 2008 19:48:46 -0700 From: Bill Cheng Someone wrote: > Is this the bottom up algorithm for building landmark hierarchy? An "algorithm" is not a "rule"! -- Bill Cheng // bill.cheng@usc.edu On Tue, Oct 21, 2008 at 7:55 AM, Bill Cheng wrote: > Someone wrote: > > > I am not able to find the definition of "red rule" in the slides. Please > > suggest which lecture I should look for it. > > I've use this term many times during the landmark routing > lecture. Please check out the lecture video! > -- > Bill Cheng // bill.cheng@usc.edu > > > > > On Mon, Oct 20, 2008 at 1:58 PM, Bill Cheng > wrote: > > Someone wrote: > > > > > What are the types of question we can expect in midterm other > > > that "ans in x words" or "problems on landmark routhing"? > > > Please let us know > > > > Sorry, other than what's on: > > > > http://merlot.usc.edu/cs551-f08/description.html#examqs > > > > I cannot say much more. One obvious example (which I won't > > ask during the exam) would be: > > > > In 15 words or less, please write down the "red rule". > > -- > > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 287.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 21 19:36:02 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9M2a2AB031784 for ; Tue, 21 Oct 2008 19:36:02 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9M2jZ2C031421 for ; Tue, 21 Oct 2008 19:45:35 -0700 Message-Id: <200810220245.m9M2jZ2C031421@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: 551 - landmark problem Date: Tue, 21 Oct 2008 19:45:35 -0700 From: Bill Cheng Someone wrote: > In the landmark routing example in HW, the solution has the entries ordered > on the levels. Can I have it ordered on the node names (a,b,c...)? Sure! The order does not matter. > How is it stored in the routers? There is no implementation of Landmark routing! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 286.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 21 07:46:26 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9LEkQcc025090 for ; Tue, 21 Oct 2008 07:46:26 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9LEtpDO022734 for ; Tue, 21 Oct 2008 07:55:51 -0700 Message-Id: <200810211455.m9LEtpDO022734@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Nature of the midterm Date: Tue, 21 Oct 2008 07:55:51 -0700 From: Bill Cheng Someone wrote: > I am not able to find the definition of "red rule" in the slides. Please > suggest which lecture I should look for it. I've use this term many times during the landmark routing lecture. Please check out the lecture video! -- Bill Cheng // bill.cheng@usc.edu On Mon, Oct 20, 2008 at 1:58 PM, Bill Cheng wrote: > Someone wrote: > > > What are the types of question we can expect in midterm other > > that "ans in x words" or "problems on landmark routhing"? > > Please let us know > > Sorry, other than what's on: > > http://merlot.usc.edu/cs551-f08/description.html#examqs > > I cannot say much more. One obvious example (which I won't > ask during the exam) would be: > > In 15 words or less, please write down the "red rule". > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 285.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 20 20:21:57 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9L3LvaZ018300 for ; Mon, 20 Oct 2008 20:21:57 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9L3VF75015452 for ; Mon, 20 Oct 2008 20:31:15 -0700 Message-Id: <200810210331.m9L3VF75015452@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: TCP question Date: Mon, 20 Oct 2008 20:31:15 -0700 From: Bill Cheng Someone wrote: > In warmup-1 we are writing one byte at a time on to the socket. > Is this byte transferred immediately ? Of course not! Please see slide 16 of lecture 13. > To avoid the overhead > does the TCP have a stack where it waits for data to be of a > fixed size (or timed out). This has been bothering me lately. If > there is no stack then we did waste lot of bandwidth on headers > only. Not a stack! A buffer! By the way, during exams, I can only grade based on what's written down and not what in your head! So, if the answer is a "buffer" and you said "stack", you probably will not get much credit because I must assume that you know the difference between a "buffer" and a "stack". Technical words have specific meanings in the technical world. I do expect you all to get "professional" during exams. When you go on a technical interview, the expectation is that you meant every word you said and it is a very reasonable expectation! It's considered a "communication skill". So, please get use to using technical terms correctly! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 284.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 20 17:00:17 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9L00Hl6016601 for ; Mon, 20 Oct 2008 17:00:17 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9L09Yae013785 for ; Mon, 20 Oct 2008 17:09:34 -0700 Message-Id: <200810210009.m9L09Yae013785@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: MED example Date: Mon, 20 Oct 2008 17:09:34 -0700 From: Bill Cheng Someone wrote: > In Lecture 11 slide 44, > Can I do the same thing using AS-PATH inflation (instead of using MED)? > > AS1 exports: > 11.0/16: a(1) > 11.0/16: c(1 1) > 11.1/16: a(1 1) > 11.1/16: c(1) You can achieve the same effect if you are limited to this example. You can argue that it's not *exactly* the same thing because AS2 can ignore MED but it cannot ignore AS-PATH inflation. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 283.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 20 13:49:26 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9KKnQEk014946 for ; Mon, 20 Oct 2008 13:49:26 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9KKwfgc011334 for ; Mon, 20 Oct 2008 13:58:41 -0700 Message-Id: <200810202058.m9KKwfgc011334@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Nature of the midterm Date: Mon, 20 Oct 2008 13:58:41 -0700 From: Bill Cheng Someone wrote: > What are the types of question we can expect in midterm other > that "ans in x words" or "problems on landmark routhing"? > Please let us know  Sorry, other than what's on: http://merlot.usc.edu/cs551-f08/description.html#examqs I cannot say much more. One obvious example (which I won't ask during the exam) would be: In 15 words or less, please write down the "red rule". -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 282.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 19 20:21:53 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9K3LrL3004054 for ; Sun, 19 Oct 2008 20:21:53 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9K3UvQv025061 for ; Sun, 19 Oct 2008 20:30:57 -0700 Message-Id: <200810200330.m9K3UvQv025061@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Reg select() Date: Sun, 19 Oct 2008 20:30:57 -0700 From: Bill Cheng Someone wrote: > I have a question regarding the operation of the select syscall. If we add 3 > descriptors (say fd1 fd2 and fd3) to the "master set" descriptor from which > we will continuously poll to read data from and if there is data on all 3 to > be read, how will the data be serviced ? > > The code is something like: > > while( 1 ) > { > > // poll with select for data > > if( fd 1) > { > //serve fd1 > } > > else if (fd 2) > { > //serve fd2 > ) > ...... > ...... > } > > So if all fd's have data, then will it first serve fd1, loop back and then > serve fd2 , loop back and then serve fd3 ? I'm not sure what you meant. You asked, "will it first serve ...". The way you wrote your code (with "else if"), it will only one will be true. So, if you want to service all of them, you should change your code. But for your example, it's fine to server only one of them becuase next time you call select(), if should return right away since you have data ready to be read at the other 2 file descriptors. > Also, I was confused about what will happen if 2 or more nodes send data to > a single fd, say fd1. Is there an in-built queue ? How can the data of two different nodes wind up at the same fd? Your code is probably not structured correctly. You should probably come talk to me during office hours! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 281.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 19 20:08:29 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9K38Ti4003959 for ; Sun, 19 Oct 2008 20:08:29 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9K3HXAk024581 for ; Sun, 19 Oct 2008 20:17:33 -0700 Message-Id: <200810200317.m9K3HXAk024581@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: final part1 Date: Sun, 19 Oct 2008 20:17:33 -0700 From: Bill Cheng Someone wrote: > The "Servant" network we are doing is being implemented only on Nunki.That > is we are implicitly doing message passing between the processes on Nunki > and such the packets are not going out into the network. > the question is : > Should our code also consider the case where the messages > are being received from different machines because the startup.ini file > gives us only the Port numbers and not the IP addresses of other machines. Of course you should do things the right way! By the way, we don't use IP addresses in the messages. We use hostnames. You can get the name of the host by calling gethostname(). -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 280.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 19 20:01:40 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9K31eBg003883 for ; Sun, 19 Oct 2008 20:01:40 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9K3AioQ024456 for ; Sun, 19 Oct 2008 20:10:44 -0700 Message-Id: <200810200310.m9K3AioQ024456@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Multihoming Date: Sun, 19 Oct 2008 20:10:44 -0700 From: Bill Cheng Someone wrote: > Lecture 12 slide 11 has a bullet that says ISP1 routes directly. But I > didn't see how that related to the discussion. To reach Customer from ISP1, ISP1 has two choices. One has AS_PATH length of 1 and the other one has AS_PATH length of 2. So, it chooses the one with AS_PATH length of 1. ISP1 does not experience the same thing as ISP3 where longest prefix match will steer the traffic in the wrong direction. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 279.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Oct 18 17:17:47 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9J0HlVF019382 for ; Sat, 18 Oct 2008 17:17:47 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9J0QZZv026624 for ; Sat, 18 Oct 2008 17:26:35 -0700 Message-Id: <200810190026.m9J0QZZv026624@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Final Proj Date: Sat, 18 Oct 2008 17:26:35 -0700 From: Bill Cheng Someone wrote: > When a non-beacon receives the response of the join messages, it tries > to connect to all the neighbors. Well, I wouldn't put it this way. I would say, "when a non-beacon node comes up (including during a soft-restart), read its init_neighbor_list file, and try to connect to all the initial neighbors". > Now, does it have to keep trying to > connect to all the neighbors till it dies or should it just try the > connection once and if it fails, exit with an error message? It should try it only once. If it cannot connect to enough initial neighbors (i.e., less than MinNeighbors), it should delete its init_neighbor_list and do a soft-restart. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 278.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Oct 18 14:55:35 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9ILtZh7018161 for ; Sat, 18 Oct 2008 14:55:35 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9IM4Llx024869 for ; Sat, 18 Oct 2008 15:04:21 -0700 Message-Id: <200810182204.m9IM4Llx024869@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS 551 Final project #1 Date: Sat, 18 Oct 2008 15:04:21 -0700 From: Bill Cheng Someone wrote: > I guess I may be a little confused about the red rule in general. In the > slides it says that the red rule is used to route downward. To me this means > that if you are at an LM(i+1) node you need to be able to send the node to > and LM(i) node. In order to verify this you would need to walk LM(i+1) hops > from the each LM(i+1) router and make sure that every LM(i) node was > touched. But when in the lecture it seemed like we were checking the > oposite. We were walking LM(i) hopes from the LM(i+1) router. You meant r(i) hops. A LM(i) router can be seen by a node that's r(i) hops away from it. So, for a LM(i+1) router to see this LM(i) router, the LM(i+1) router needs to be within r(i) hops away from it. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 277.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Oct 18 14:51:00 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9ILp0NU018119 for ; Sat, 18 Oct 2008 14:51:00 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9ILxkcd024835 for ; Sat, 18 Oct 2008 14:59:46 -0700 Message-Id: <200810182159.m9ILxkcd024835@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Landmark routing Date: Sat, 18 Oct 2008 14:59:46 -0700 From: Bill Cheng Someone wrote: > I had a question about slide 9 of lecture 8. During the lecture after node 8 > was promoted to LM2 we verified the red rule. Yes. You need to verify the red rule for i=1, i.e., "every LM1 router is seen by at least one LM2 router". > Was this necessary since we > already verified that Node 3 was an LM1 router than could see everyone (you > could route downward to everyone with this information). Wouldn't we only > need to recheck the red rule if we had needed multiple level 1 routers > (which were potential "far" away from each other) to satisfy the red rule in > the previous iteration. May be for the particular network it works out. But in general, we must check after every round. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 276.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Oct 18 14:43:16 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9ILhFGA018034 for ; Sat, 18 Oct 2008 14:43:15 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9ILq2a9024759 for ; Sat, 18 Oct 2008 14:52:02 -0700 Message-Id: <200810182152.m9ILq2a9024759@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: proj questions Date: Sat, 18 Oct 2008 14:52:01 -0700 From: Bill Cheng Someone wrote: > I have 2 questions: > > Firstly, If in the startup.ini file, InitNeighbors is less than > MinNeighbors, a joining node will go in an infinite loop. should we > check this while parsing the init file and display an error, or assume > this condition will never occur. If this condition occurs, going into an infinite loop would be a correct behavior. But, if you want to check for this and report it and quit, that would be fine too. > Secondly, do the log entries have to be sorted on time. since things > happen so fast (like in join or status) sometimes more than 2 threads > wait on the mutex to write to the file and since when multiple threads > are waiting for a mutex, the order of acquisition is undefined we > might see a send entry before a receive entry, though they have the > correct times. > > eg. > > s 1224352227.708 xxxxxxxxxx JNRS xxxxxxxx > r 1224352227.707 xxxxxxxxxx JNRQ xxxxxxxx > > is it ok to have such an o/p. Yes! You are logging the time when an event happen. It's reasonable that this happens. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 275.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 17 23:14:34 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9I6EYAx006910 for ; Fri, 17 Oct 2008 23:14:34 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9I6NBsa012127 for ; Fri, 17 Oct 2008 23:23:11 -0700 Message-Id: <200810180623.m9I6NBsa012127@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS 551 Final project #1 Date: Fri, 17 Oct 2008 23:23:11 -0700 From: Bill Cheng SOmeone wrote: > I have a question regarding InitNeighbors and MinNeighbors. (for eg when > InitNeighbors=3 and MinNeighbors=1 for a non-beacon node) When there is only > one beacon in the network and the non-beacon node comes up. It will get > join_reply only from this 1 beacon node. So as the neighbors it has is 1 > (less than InitNeighbors=3), shud it shut down itself after deleting the > init_neighbor_list file & come up again or should it continue to form a > connection with this beacon and if its successful (it will satisfy > MinNeighbors=1). During JOIN, if the non-beacon node cannot get enough join responses, it should print an error message and quit. It does not need to try again. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 274.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 17 23:05:05 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9I655EY006773 for ; Fri, 17 Oct 2008 23:05:05 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9I6DgIk011986 for ; Fri, 17 Oct 2008 23:13:42 -0700 Message-Id: <200810180613.m9I6DgIk011986@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS 551 Servant Date: Fri, 17 Oct 2008 23:13:42 -0700 From: Bill Cheng Someone wrote: > I am sorry if this question has already been asked (I could not > find it tough) ... What should we use as our host name? It is not > defined in the ini file ... so I am using localhost at the moment > ... but while sending a join message what should be the host name > in the message ? You should call gethostname() to get the name of the host you are running on. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 273.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 17 13:34:43 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9HKYhgS002130 for ; Fri, 17 Oct 2008 13:34:43 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9HKhEEU007752 for ; Fri, 17 Oct 2008 13:43:14 -0700 Message-Id: <200810172043.m9HKhEEU007752@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Proj 3 Part 1 Date: Fri, 17 Oct 2008 13:43:14 -0700 From: Bill Cheng Someone wrote: > Once a non-beacon node has received a hello msg (after the joining ofcourse) > from a beacon node on atemporary connection, Does it have to use the same > socket which it used to receive the hello/join_reply for further > communication or should it try to form another connection(permanent this > time) using a different socket for doing further communication with the > beacon node. If a non-beacon node is doing a JOIN, then the connection is *not* a regular connection. Since it's not a regular connection, you must *not* exchange HELLO messages! For this JOINing non-beacon node, it should simply send a JOIN request and wait for all the responses (kind of like the client for warmup project #1). When timeout occurs (or is pressed), it should disconnect. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 272.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 17 13:31:40 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9HKVeaw002026 for ; Fri, 17 Oct 2008 13:31:40 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9HKeBG2007685 for ; Fri, 17 Oct 2008 13:40:11 -0700 Message-Id: <200810172040.m9HKeBG2007685@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Regarding breaking the tie Date: Fri, 17 Oct 2008 13:40:11 -0700 From: Bill Cheng Someone wrote: > I am thinking of the possible cases where I would need to break the tie for > the connection between two nodes. > It is possible when 2 beacon nodes try to exchange HELLO messages. > > I cannot think of any case where a non-beacon node would be involved. > A non-beacon node is considered a part of the network only after JOIN and > HELLO. > Say a non-beacon node A does JOIN, and sends HELLO to a some appropriate > nodes. When a node B will receive the HELLO from A, it'll send a HELLO back > on the same socket. Two non-beacon nodes can end up to be in each other's init_neighbor_list file. They can start (or soft-restart) at about the same time! I think everyone should just implement tie breaking and not worry about when can your code avoid this situation. Always check for this and your code will always work right. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 271.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 17 13:06:06 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9HK66ub001771 for ; Fri, 17 Oct 2008 13:06:06 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9HKEax4030056 for ; Fri, 17 Oct 2008 13:14:36 -0700 Message-Id: <200810172014.m9HKEax4030056@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CSCI 551- Final project Part 1 :Doubt Date: Fri, 17 Oct 2008 13:14:36 -0700 From: Bill Cheng Someone wrote: > I had a doubt with Signal and Wait. > > Say, there is a Thread X waiting on a Condition Variable CV. > > And there is a Thread Y signaling using CV. > > Ideally, Thread Y would signal and Thread X would wake up from Wait. > > However, if Thread X has not begun waiting yet, and Thread Y comes > along and signals (even when no one is waiting), then how is the > behavior ? Then thread X won't see the signal. > Will the Signal be buffered and used when Thread X executes wait ? No. That's not how pthread signals behave. > In CSCI-402, we used Monitor Variables to overcome this problem. But > here, will Pthreads handle the buffering, or will the signal be lost ? The signal will be lost. You can > Alternatively, can I use Monitor variables here as well ? I'm not sure exactly what you meant by "monitor variables". If you have variables that you want to share among threads, you need to use a mutex. Let's assume what you meant by a "monitor variable" is a variable protected by a mutex. I don't really see how a signal can be missed if you code it correctly! Let's say thread X wants to catch a signal and thread Y wants to send a signal and there is a mutex M and a condition variable C and a "monitor variable" V. So, thread X's code should look something like: pthread_lock(M); while (V does not have the desired value) pthread_cond_wait(M,C); ... Thread Y's code can look something like: pthread_lock(M); /* * you can switch the order of the next two lines of code * and it won't matter because thread Y has the mutex lock. */ pthread_cond_broadcast(C); set V to desired value; pthread_unlock(M); May be you did not signal the condition when the corresponding mutex is locked or you checked the value of V when you did not have the mutex locked. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 270.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 17 06:22:00 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9HDM0Cw029809 for ; Fri, 17 Oct 2008 06:22:00 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9HDURZA014332 for ; Fri, 17 Oct 2008 06:30:27 -0700 Message-Id: <200810171330.m9HDURZA014332@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Proj 3 Part 1 Date: Fri, 17 Oct 2008 06:30:27 -0700 From: Bill Cheng Someone wrote: > I have the following doubt: > After the beacon network is set up, a non-beacon comes to join the > network. It exchanges the join message and gets the response from all > the nodes through the beacon it contacted in the beginning. > Now, it connects to everyone that satisfy the distance constraint. I > want to know the amount of time the beacon should wait before closing > the connection if it did not receive a connection request from the non > beacon. I guess this applied to any connection, not just the one you described above. So, the question is, if you connect to another node and the other node never sends you anything, when should you timeout? I think you can just use the KeepAliveTimeout for this situation. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 269.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 17 06:18:46 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9HDIkgh029768 for ; Fri, 17 Oct 2008 06:18:46 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9HDRDOS014258 for ; Fri, 17 Oct 2008 06:27:13 -0700 Message-Id: <200810171327.m9HDRDOS014258@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551: Final Project : Lost Signal Date: Fri, 17 Oct 2008 06:27:13 -0700 From: Bill Cheng Someone wrote: > When we have multiple threads waiting on different condition variables or a > single thread waiting on a condition variable, sometimes the signal is not > received at all by the waiting thread and hence the thread gets stuck at the > wait. > is there any way in which we can handle this ? I assume you are using pthread_cond_broadcast(). I cannot think of a reason why you would lose a signal if that's the case! Then it must be a programming bug, i.e., one of your thread is not suppose to wait on this condition when it did. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 268.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 17 06:16:22 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9HDGMFq029719 for ; Fri, 17 Oct 2008 06:16:22 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9HDOmHK014200 for ; Fri, 17 Oct 2008 06:24:48 -0700 Message-Id: <200810171324.m9HDOmHK014200@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Regarding strlen/numbytes Date: Fri, 17 Oct 2008 06:24:48 -0700 From: Bill Cheng Someone wrote: > We are having an error with the string length of UOID printed out. > > For example: > > The first receive for the 27 bytes header is: > > if ((bnumbytes=recv(sockfd, &brecvBuf[0],27,0)) == -1) > { > perror("recv"); > } > > Then we do a memcpy for parsing header fields as follows: > > memcpy(&brecvmsgType,&brecvBuf[0],1); // Get the message > type > memcpy(&brecvUOID[0],&brecvBuf[1],20); // Get the UOID > cout<<"************uoid3 = "< This prints out UOID Length = 20 > > memcpy(&brecvTTL,&brecvBuf[21],1); // Get the TTL > cout<<"************uoid3 = > "< > memcpy(&bresField,&brecvBuf[22],1); // Get the reserved field > cout<<"************uoid3 = > "< > memcpy(&brecvmsgLength,&brecvBuf[23],4); // Get > the msglength > cout<<"************uoid3 = "< // THIS ALSO PRINTS OUT 21 > > If we print out the actual UOID received , the 20 byte UOID is same as was > sent by the sender. > > But the length of the UOID keeps changing due to some reason, and this > changes the total number of bytes sent henceforth, that results in an error > in all subsequent send/receives. > > All we are doing is a memcpy like warmup#1 , are we printing the string > length incorrectly ? UOID is the output of the SHA1() function. It's always 20 bytes long and it's *binary*, which means that it can contain 0x00. strlen() is a function that will return the length of a *null-terminated string*. As soon as it sees a 0x00, it returns the length of *what it thinks is a string*. Therefore, strlen() *cannot* be used with binary data. You also need to print binary data differently. You can use: for (i=0; i < 20; i++) { printf("%02x", (unsigned char)buf[i]); } -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 267.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Oct 15 19:29:14 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9G2TEWK010139 for ; Wed, 15 Oct 2008 19:29:14 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9G2bKoj010150 for ; Wed, 15 Oct 2008 19:37:20 -0700 Message-Id: <200810160237.m9G2bKoj010150@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: assigning short to char Date: Wed, 15 Oct 2008 19:37:20 -0700 From: Bill Cheng Someone wrote: > How can I assign a short value to a char? "short" in C/C++ means "short int" and it is two bytes long. > I tried something like this > > char x = (char) 0xAA; > > But when I again do... > > if(x==(char)0xAA), it always returns false. In the above code, you are not trying to assign a "short" to a char! If you are trying to assign 0xaa to a char, I think you are doing the right thing. I don't see why it would not work. May be you should set a break point right before the if statement and print out x and see if it equals 0xaa. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 266.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Oct 15 14:31:52 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9FLVqx1007829 for ; Wed, 15 Oct 2008 14:31:52 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9FLdsQP006955 for ; Wed, 15 Oct 2008 14:39:54 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.14.2/8.14.1/Submit) id m9FLds7d006954 for cs551@merlot; Wed, 15 Oct 2008 14:39:54 -0700 Date: Wed, 15 Oct 2008 14:39:54 -0700 From: Bill Cheng Message-Id: <200810152139.m9FLds7d006954@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Midterm summary of topics... Hi everyone, I have just posted a quick summary of the midterm topics at the class web site (not all topics covered are listed). Please take a look. The midterm exam will be closed book, closed notes, and closed everything (and no "cheat sheet"). Also, no calculators, cell phones, or any electronic gadgets are allowed. Please bring a photo ID. Your ID will be collected at the beginning of the exam and will be returned to you when you turn in your exam. There will be assigned seating. Regarding what type of questions will be asked on the exams... I have just added the following to: http://merlot.usc.edu/cs551-f08/description.html#examqs Question 2 in the "extra homework" is an example of one type of questions that I could ask. Many of the questions on the exam will be in the following form: "In N words or less, what is the answer to the following question?" For this type of question, you can write as many words as you'd like, but I will only read the *first N words* of your answer! You don't need to count the number of words in your answer, you just need to make sure that the most important part of your answer appears in the first N words! (There is no need to write complete English sentenses when you answer exam questions. Just give me the important stuff!) The reason I'm doing this is that I don't want a brain dump of everything you know about a topic and tell me that the answer is there and that I have to look for it! I want you to tell me what part of your answer *you think* is important and you need to distinguish between answers of different quality and put the best answer up front. Let me give a couple of silly examples (with questions that's not in the scope of the exam). 1) "In 20 words or less, for our programming assignments, when is 'plagiarism' considered taking place? If your answer is "when you take someone else's work and claim it to be yours", then you will get full credit. If your answer is, "when you submit someone else's work", you probably will not get full credit. 2) "In 20 words or less, what is the *fairness* policy of this class?" If your answer is, "whatever the instructor offer to one student, he must offer it to the rest of the class," then you will get full credit. If your answer is, "the instructor must be fair to every student," you probably will not get much credit. Can you tell why the first answers above are *better* than the second answers? In general, better answers may score more points. If you give very high level and generic answer that's generally true, you probably will get very little credit for it! You need to answer a specific question with a specific answer. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 265.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Oct 15 11:51:13 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9FIpDb3006191 for ; Wed, 15 Oct 2008 11:51:13 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9FIxDuW005027 for ; Wed, 15 Oct 2008 11:59:13 -0700 Message-Id: <200810151859.m9FIxDuW005027@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: cs551 Ruminations on global variables Date: Wed, 15 Oct 2008 11:59:13 -0700 From: Bill Cheng Someone wrote: > Continuing from the message below: > So should Ctrl-C restarts (expires) all the timers? I'm not sure what you meant by "all the timers". Your node has a commandline interface where the user can enter a command and your node "execute this command". For part (1), the commands you need to handle are "status neighbors..." and "shutdown". For part (2), you need to handle other commands. Some of these commands can take a while to "execute". The meaning of is to "short-circuit" the execution of these commands, i.e., pretend that the time for waiting has elapsed. does not "short-circuit" anything else in your node; just the commandline interface. > If this is true, then the *ONLY* way of terminating the program is to type > in "shutdown" right? Entering the "shutdown" command would be the only "normal" way. I guess you can always send the uncatchable SIGKILL (or "kill -9") to your process! Obviously, that's bad. -- Bill Cheng // bill.cheng@usc.edu On Mon, Oct 13, 2008 at 7:08 PM, Bill Cheng wrote: > Someone wrote: > > > You mentioned during a lecture that there was a message default for a > status > > neighbors request, but I couldn't find that in the spec. If there is > one, > > what is it, if there isnt, how do you know when you are done receiving > data? > > You can assume that after MsgLifetime, all the nodes in the > middle of the network will not be forwarding response > messages for your request. So, you can use a timeout value > that's slightly longer than MsgLifetime. > > By the way, you also need to handle properly. If > the user press before your timer expires, you must > treat this as if the timer has expired and you should perform > your normal processing of the status response messages. > should never cause your program to terminate. > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 264.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Oct 15 11:28:40 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9FISeaW005880 for ; Wed, 15 Oct 2008 11:28:40 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9FIaeYo004561 for ; Wed, 15 Oct 2008 11:36:40 -0700 Message-Id: <200810151836.m9FIaeYo004561@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: cs 551 - regarding signal? Date: Wed, 15 Oct 2008 11:36:40 -0700 From: Bill Cheng Someone wrote: > a basic question. in the following codes, if thread is sleeping and got a > SIGINT or SIGUSR, it will do interrupt routine and what next will go? > should go back to sleep, if it still has 10 secs not ready to finish. > or should go to code 2? > > while (true) > { > // code 1 > sleep(30); > // code 2 > } > thanks in advanced It will go back to sleep. That's why you should use select() to sleep instead of using sleep() to sleep! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 263.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Oct 15 10:16:47 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9FHGlAo005173 for ; Wed, 15 Oct 2008 10:16:47 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9FHOkK5003536 for ; Wed, 15 Oct 2008 10:24:46 -0700 Message-Id: <200810151724.m9FHOkK5003536@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Waiting for Join Response Date: Wed, 15 Oct 2008 10:24:46 -0700 From: Bill Cheng Someone wrote: > When a non-beacon node comes up, it sends Join Request to any one of the > Beacon Node. > Now this beacon node will flood this Join message to all its neighbors. > But how long should the requesting non-beacon node wait for the response > since it is not aware of number of nodes in the network and also has no idea > of the network condition. If you really want to use a timeout, you can use a small multiple (say 1.1) of MsgLifetime since after MsgLifetime, other nodes in the network will not forward responses for the JOIN request message in question. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 262.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Oct 15 09:16:11 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9FGGBSt004546 for ; Wed, 15 Oct 2008 09:16:11 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9FGOAgk002302 for ; Wed, 15 Oct 2008 09:24:10 -0700 Message-Id: <200810151624.m9FGOAgk002302@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Landmark Hierarchy Practice Problems Date: Wed, 15 Oct 2008 09:24:10 -0700 From: Bill Cheng Someone wrote: > If you could post a couple of problems on Landmark Hierarchy with their > solutions, it would be very helpful for the midterm exam preparation Please see problem 2 of: http://merlot.usc.edu/cs551-f08/homeworks/hw-extra.html -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 261.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 14 21:24:08 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9F4O8Gc029157 for ; Tue, 14 Oct 2008 21:24:08 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9F4W06I025399 for ; Tue, 14 Oct 2008 21:32:00 -0700 Message-Id: <200810150432.m9F4W06I025399@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: CS 551 Warmup Project #2 Grader Office Hours for Regrades... Date: Tue, 14 Oct 2008 21:32:00 -0700 From: Bill Cheng Hi everyone, The grader has reserved SAL 222 on next Tuesday, Oct 21, between 2pm and 4pm for warmup project #2 regrade. Please read the previous e-mail (the one with your grade in it) carefully and follow the instructions there regarding what you need to do in order to request a regrade. Thanks! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 260.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 14 20:47:24 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9F3lOBE028842 for ; Tue, 14 Oct 2008 20:47:24 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9F3tF1r023755 for ; Tue, 14 Oct 2008 20:55:15 -0700 Message-Id: <200810150355.m9F3tF1r023755@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551 : Mid Term Question Date: Tue, 14 Oct 2008 20:55:15 -0700 From: Bill Cheng Someone wrote: > I wanted to know if the following topics will be covered for the midterm or > not: > > 1. Lecture 3: ns tutorial > 2. Lecture 4: Research There will be no questions on ns-2 or "what is research" in the midterm exam. The midterm exam will cover till part of tomorrow's lecture! I'll announce in the middle of lecture tomorrow exactly where will be the end of the midterm coverage. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 259.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 14 08:05:58 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9EF5wRU018936 for ; Tue, 14 Oct 2008 08:05:58 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9EFDgjR012377 for ; Tue, 14 Oct 2008 08:13:42 -0700 Message-Id: <200810141513.m9EFDgjR012377@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: sha.h Date: Tue, 14 Oct 2008 08:13:42 -0700 From: Bill Cheng Someone wrote: > I am getting this error with regards to sha.h on nunki > /home/scf-22/csci551b/openssl/include/openssl/sha.h:109: error: > expected declaration specifiers or '...' before 'size_t' > > how do i correct this error You should add: #include I've just updated the spec and put this right above the GetUOID() function. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 258.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 13 21:24:06 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9E4O6J0011319 for ; Mon, 13 Oct 2008 21:24:06 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9E4Vg7n002171 for ; Mon, 13 Oct 2008 21:31:42 -0700 Message-Id: <200810140431.m9E4Vg7n002171@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: hello msg Date: Mon, 13 Oct 2008 21:31:42 -0700 From: Bill Cheng Someone wrote: > the spec says - "Please note that neighbor is a bi-directional > relationship. Therefore, when node B gets a hello message from node A, > and node A is not currently node B's neighbor, node B should send a > hello message to node A" > > Since there is no concept of 'init_neighbor_list' for a beacon node, > when a beacon node say X sends "hello" to another beacon node say Y, Y > knows it is connecting to a beacon node, then why does it need to send > a 'hello' message back. the grading guidelines mention 2 hello > messages be exchanged for every beacon-to-beacon connect. Actually, you've got a point! If X initiates a connection to Y, only X needs to tell Y who X is. So, only one HELLO message from X to Y is necessary. But since the spec says that our protocol requires that you must exchange HELLO messages, you need to do it because it's a bit late to change the protocol now! So, please exchange HELLO messages. Thanks! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 257.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 13 19:00:26 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9E20QqB009948 for ; Mon, 13 Oct 2008 19:00:26 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9E2823e019942 for ; Mon, 13 Oct 2008 19:08:02 -0700 Message-Id: <200810140208.m9E2823e019942@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: cs551 Ruminations on global variables Date: Mon, 13 Oct 2008 19:08:02 -0700 From: Bill Cheng Someone wrote: > You mentioned during a lecture that there was a message default for a status > neighbors request, but I couldn't find that in the spec. If there is one, > what is it, if there isnt, how do you know when you are done receiving data? You can assume that after MsgLifetime, all the nodes in the middle of the network will not be forwarding response messages for your request. So, you can use a timeout value that's slightly longer than MsgLifetime. By the way, you also need to handle properly. If the user press before your timer expires, you must treat this as if the timer has expired and you should perform your normal processing of the status response messages. should never cause your program to terminate. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 256.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 13 07:36:46 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9DEajDg003204 for ; Mon, 13 Oct 2008 07:36:45 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9DEiEO6031275 for ; Mon, 13 Oct 2008 07:44:14 -0700 Message-Id: <200810131444.m9DEiEO6031275@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: 551- final Date: Mon, 13 Oct 2008 07:44:14 -0700 From: Bill Cheng Someone wrote: > - For a beacon node, it needs to connect to all other beacon ndoes. > > Since a beacon does not send any message on a connect to another beacon, how > does the beacon know that it has received a connection from a beacon node? > > or am I missing something? I read the previous posts, but couldn't figure > this out. On a "regular" connection, two nodes (it doesn't matter if they are beacon nodes or non-beacon nodes) *must* exchange HELLO as the first message. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 255.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 12 19:54:58 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9D2svsf027594 for ; Sun, 12 Oct 2008 19:54:57 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9D32Jxp022053 for ; Sun, 12 Oct 2008 20:02:19 -0700 Message-Id: <200810130302.m9D32Jxp022053@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Final Part 1 Date: Sun, 12 Oct 2008 20:02:19 -0700 From: Bill Cheng Someone wrote: > I had a similar problem as mentioned in this mail regarding the broken pipe. > > After receiving a connection, termination your sleeping child thread which > is trying to connect to the server you just received a connection from might > solve the issue. But it is *possible* (although unlikely) that right before you want to kill this thread, the thread wakes up and tries to connect to this beacon node! So, if this will get a SIGPIPE, it's best to understand why this is happening and fix the bug! -- Bill Cheng // bill.cheng@usc.edu On Sun, Oct 12, 2008 at 7:38 PM, Bill Cheng wrote: > Someone wrote: > > > I am getting a "broken pipe" error when connecting beacons with each > > other on parallel connections. > > For example, I have two beacons, the first one gets a connection request > > from the second one. The messages are exchanged. Now, the first one > > comes out of the retry mode and tries to connect to the second one. > > Connection is established successfully but when it tries to send to the > > second, I get the broken pipe error. What could be a possible reason for > > the same. I am trying this case to test in case of simultaneous > > connections. > > My code however runs fine when upon accepting a connection, I do not try > > to connect to the same port again. > > I don't know why this is happening. My guess is that > it's just a silly bug that's causing the problem! > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 254.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 12 19:52:22 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9D2qMCd027567 for ; Sun, 12 Oct 2008 19:52:22 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9D2xiR0022013 for ; Sun, 12 Oct 2008 19:59:44 -0700 Message-Id: <200810130259.m9D2xiR0022013@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Final Part 1 Date: Sun, 12 Oct 2008 19:59:44 -0700 From: Bill Cheng Someone wrote: > I am facing the exactly similar problem. I tried every possible > solution, but none worked. > When first node sends "hello" to second one, if second also sends > connect at the same time it says "Broken pipe". Debug, debug, debug! If you want to talk about this in detail, you can come to one of my office hours. -- Bill Cheng // bill.cheng@usc.edu Bill Cheng wrote: > Someone wrote: > > > I am getting a "broken pipe" error when connecting beacons with each > > other on parallel connections. > > For example, I have two beacons, the first one gets a connection request > > from the second one. The messages are exchanged. Now, the first one > > comes out of the retry mode and tries to connect to the second one. > > Connection is established successfully but when it tries to send to the > > second, I get the broken pipe error. What could be a possible reason for > > the same. I am trying this case to test in case of simultaneous > > connections. > > My code however runs fine when upon accepting a connection, I do not try > > to connect to the same port again. > > I don't know why this is happening. My guess is that > it's just a silly bug that's causing the problem! > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 253.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 12 19:31:11 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9D2VBKX027407 for ; Sun, 12 Oct 2008 19:31:11 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9D2cXWw021688 for ; Sun, 12 Oct 2008 19:38:33 -0700 Message-Id: <200810130238.m9D2cXWw021688@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Final Part 1 Date: Sun, 12 Oct 2008 19:38:33 -0700 From: Bill Cheng Someone wrote: > I am getting a "broken pipe" error when connecting beacons with each > other on parallel connections. > For example, I have two beacons, the first one gets a connection request > from the second one. The messages are exchanged. Now, the first one > comes out of the retry mode and tries to connect to the second one. > Connection is established successfully but when it tries to send to the > second, I get the broken pipe error. What could be a possible reason for > the same. I am trying this case to test in case of simultaneous > connections. > My code however runs fine when upon accepting a connection, I do not try > to connect to the same port again. I don't know why this is happening. My guess is that it's just a silly bug that's causing the problem! -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 252.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 12 19:21:36 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9D2LaXB027312 for ; Sun, 12 Oct 2008 19:21:36 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9D2Sv14021450 for ; Sun, 12 Oct 2008 19:28:57 -0700 Message-Id: <200810130228.m9D2Sv14021450@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: General Question Date: Sun, 12 Oct 2008 19:28:57 -0700 From: Bill Cheng Someone wrote: > While going through online forums I have often come > across the terms "thread safe" and "signal safe". > > Could you please explain what exactly do those > terms mean ? Thanks ! "Thread-safe" functions are functions where multiple threads can call this function simultaneously and it's no problem. If a function is not thread-safe, you should use a mutex and make sure that only one thread is allowed to call it at a time. I'm not familiar with the term "signal-safe". On wikipedia, it's defined as functinos that can be safely called from a signal handler. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 251.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 12 19:15:53 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9D2Fr8l027262 for ; Sun, 12 Oct 2008 19:15:53 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9D2NEmC021377 for ; Sun, 12 Oct 2008 19:23:14 -0700 Message-Id: <200810130223.m9D2NEmC021377@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS 551 final 1 Date: Sun, 12 Oct 2008 19:23:14 -0700 From: Bill Cheng Someone wrote: > I am using a SIGUSR1 for terminating the sleeping thread. It works fine for > the case of 2 beacon nodes. > > When I run 3 beacon nodes, one of the processes terminates with a > message "*User > Signal 1*". All we are doing after catching the SIGUSR1 is setting a flag > and making the sleeping thread check that flag and exit. > > Also, we are sending the sleeping thread a signal by using the following > command: "*pthread_kill(threadid , SIGUSR1)*" > > When does a program terminate with a "*User Signal 1*" message ? I think it means you have received a SIGUSR1 signal and it's not caught! I think on Solaris, if you want to catch the same signal by the same signal handler after it's caught, you should call signal() again in side the signal handler. On Linux, you don't need to do this, I think. -- Bill Cheng // bill.cheng@usc.edu On Sun, Oct 12, 2008 at 8:19 AM, Bill Cheng wrote: > Someone wrote: > > > Its mentioned in the FAQ that: > > > > *" .........Please note that nodes X and Y will create a child thread > each > > to handle the other end of these connections. At the same time, node X > will > > terminate the 2nd child thread that's sleeping for 30 seconds and node Y > > will terminate the child thread that's sleeping for 30 seconds*." > > > > My question is, can we terminate the sleeping threads with a SIGKILL or > > should we handle it with SIGTERM ? > > You can use SIGTERM, SIGINT, or any signal to wake up this > thread and have this thread checking a flag to see if it's > time to terminate. > > > Basically, can we do a "forceful" termination ? > > You will never get an "yes" from me for something like this! :-) > > The way you *should* write code is to have only one exit > point for any thread. I think this is the first thing you > need to try to get good at. After you get really good at > this, you can do it other ways. Pthread has functions that > you can use to kill a thread. But you need to be very > careful when to do it and how to clean up whatever a thread > might left behind. > -- > Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 250.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 12 08:46:19 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9CFkJI4021717 for ; Sun, 12 Oct 2008 08:46:19 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9CFrYiq014601 for ; Sun, 12 Oct 2008 08:53:34 -0700 Message-Id: <200810121553.m9CFrYiq014601@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: cs551 Ruminations on global variables Date: Sun, 12 Oct 2008 08:53:34 -0700 From: Bill Cheng Someone wrote: > I have heard, learned and practiced to avoid global variables for a > decade :-) . However, I found myself using a lot of global variables > in warm-up 2. Likewise, my partner and I are expecting more global > variables in the final project. > > Although I could pass many arguments to the thread entry function by > passing them as a pointer to a structure, I don't think it's very > convenient. > > Should I feel guilty about using many global variables? How about just one global variable? You can always build a structure to contain all your global variables and have only one instance of this structure! This way you have only one global variable without changing much! I guess my point is that you don't really have to feel too bad about having many global variables because you can always consolidate them into one. You do have to worry about locking global variables! If you have a major data structure that many threads would need access to, you need a mutex for accessing it. If it's become part of a larger data structure, you can still use mutex to lock part of the data structure. So, it doesn't really present any problem. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 249.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 12 08:40:05 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9CFe5wi021654 for ; Sun, 12 Oct 2008 08:40:05 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9CFlK1M014514 for ; Sun, 12 Oct 2008 08:47:20 -0700 Message-Id: <200810121547.m9CFlK1M014514@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551 - Final1 Date: Sun, 12 Oct 2008 08:47:20 -0700 From: Bill Cheng Someone worte: > > > Scenario: 3 non-beacon nodes [with no init_neighbor file] starting up. > > > 1 beacon-node already up and blocked on accept(). > > > > > > When the 3 non-beacon nodes send join request messages, the beacon node > > > responds to the 3 nodes. Does this beacon node also forward the join > > > request to the non-beacon nodes ? > > > > Yes. The JOIN request gets *flooded* to the whole network > > (if TTL is large enough). > > ---- A node is NOT considerd to be a part of the SERVANT network until > it completes JOIN and HELLO. In this case how can it receive any > JOIN_REQ before HELLO. I think, when we have to flood a message it is > only to those nodes that are a part of the network. Since the other > two nodes will only be having a temporary connection to beacon node it > should not receive any flooded messages until it is a part of SERVANT > network. Ah! I think I misunderstood your senario. I thought the 3 non-beacon nodes are already part of the network and you were asking about the 4th non-beacon node. I was talking about the 4th non-beacon node. Sorry! Since the whole network at this point consists of only the beacon node, the JOIN requests will not be forwarded to the JOINing non-beacon nodes. Regarding what to do if MinNeighbor is greater than 1, please see the FAQ: http://merlot.usc.edu/cs551-f08/projects/final-faq.html#no-enough-join Finally, you ask: > How does a non-beacon node make another non-beacon node its neigbor if it > doesn't send a Join request to the non-beacon nodes ? Over time. The first non-beacon node that ever joins the network can only have beacon node as its init neighbors. If you start another non-beacon node after the first non-beacon has exchanged HELLO messages with its init neighbors, then it is possible for the 2nd non-beacon node to have the first non-beacon node as one of its init neighbors. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 248.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 12 08:12:07 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9CFC7bg021371 for ; Sun, 12 Oct 2008 08:12:07 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9CFJMxZ013914 for ; Sun, 12 Oct 2008 08:19:22 -0700 Message-Id: <200810121519.m9CFJMxZ013914@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS 551 final 1 Date: Sun, 12 Oct 2008 08:19:22 -0700 From: Bill Cheng Someone wrote: > Its mentioned in the FAQ that: > > *" .........Please note that nodes X and Y will create a child thread each > to handle the other end of these connections. At the same time, node X will > terminate the 2nd child thread that's sleeping for 30 seconds and node Y > will terminate the child thread that's sleeping for 30 seconds*." > > My question is, can we terminate the sleeping threads with a SIGKILL or > should we handle it with SIGTERM ? You can use SIGTERM, SIGINT, or any signal to wake up this thread and have this thread checking a flag to see if it's time to terminate. > Basically, can we do a "forceful" termination ? You will never get an "yes" from me for something like this! :-) The way you *should* write code is to have only one exit point for any thread. I think this is the first thing you need to try to get good at. After you get really good at this, you can do it other ways. Pthread has functions that you can use to kill a thread. But you need to be very careful when to do it and how to clean up whatever a thread might left behind. -- Bill Cheng // bill.cheng@usc.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 247.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Oct 11 20:12:44 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9C3Cik0008246 for ; Sat, 11 Oct 2008 20:12:44 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9C3JqkB001394 for ; Sat, 11 Oct 2008 20:19:52 -0700 Message-Id: <200810120319.m9C3JqkB001394@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: logging time Date: Sat, 11 Oct 2008 20:19:52 -0700 From: Bill Cheng Someone wrote: > Should the