Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Dec 21 17:33:44 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iBM1Xija015328 for ; Tue, 21 Dec 2004 17:33:44 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iBM1XHgv001155 for ; Tue, 21 Dec 2004 17:33:17 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iBM1XH8N001153 for cs551@merlot; Tue, 21 Dec 2004 17:33:17 -0800 Date: Tue, 21 Dec 2004 17:33:17 -0800 From: william@bourbon.usc.edu Message-Id: <200412220133.iBM1XH8N001153@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: keeping a copy of the project specs... Hi, Once in a while, I got requests from students who asked for old project specs (ones when they took CS 551) because they are going on an interview and they forgot what the projects are about. If you plan to do the same, please save a copy of the project specs soon (before I delete them this weekend)! Thanks! Happy Holidays! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Dec 10 17:09:30 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iBB19Aja014138 for ; Fri, 10 Dec 2004 17:09:30 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iBB18Vgv001379 for ; Fri, 10 Dec 2004 17:08:51 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iBB18BaZ001056 for cs551@merlot; Fri, 10 Dec 2004 17:08:11 -0800 Date: Fri, 10 Dec 2004 17:08:11 -0800 From: william@bourbon.usc.edu Message-Id: <200412110108.iBB18BaZ001056@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: grading final exam is taking longer than I thought... Hi, Right after the final exam, several students asked me when should they expect to hear about the grades. I said that I will try to finish everything by Friday. Well, things are taking longer than I thought. I'm hoping to finish everything by this weekend. Worst case it will take me till end of Monday to assign grades. I will send out individual e-mails to let you know about your final exam score and your class letter grade. Sorry about the delay. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Dec 7 21:37:50 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iB85boja022041 for ; Tue, 7 Dec 2004 21:37:50 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iB85bwgv026455 for ; Tue, 7 Dec 2004 21:37:58 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iB85bwkg026453 for cs551@merlot.usc.edu; Tue, 7 Dec 2004 21:37:58 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iB85bvgv026447 for ; Tue, 7 Dec 2004 21:37:57 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iB85bvVm026443 for ; Tue, 7 Dec 2004 21:37:57 -0800 Message-Id: <200412080537.iB85bvVm026443@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: DEC-bit question Date: Tue, 07 Dec 2004 21:37:57 -0800 From: william@bourbon.usc.edu Someone wrote: > I'm a little confused by the technique used to detect congestion > in the DEC-bit paper. First it says that it uses the avg. queue > length and detects congestion if it is >= 1. Then, later they > discuss using hysteresis as a method for gradually reducing the > feedback, however using it does not optimize power. I cannot > find it saying explicitly what is used by the DEC-bit > implementation. Can you shed some light on this? The last paragraph right before section 4.1 on page 166 says: We find that the power is maximum when the hysteresis is nonexistent, with a threshold value of 1. If you are looking for "what is used by the DEC-bit implementation", then I don't know exactly what was implemented and it's probably not important. What's important are the ideas, principles, and lessons learned in the study. This is true for all papers. (In general, if you want to know exactly what's implemented, you just need to find a copy of the code.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Dec 7 11:02:32 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iB7J2Wja030823 for ; Tue, 7 Dec 2004 11:02:32 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iB7J2fgv014008 for ; Tue, 7 Dec 2004 11:02:41 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iB7J2eac014003 for cs551@merlot.usc.edu; Tue, 7 Dec 2004 11:02:40 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iB7J2egv014000 for ; Tue, 7 Dec 2004 11:02:40 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iB7J2evu013991 for ; Tue, 7 Dec 2004 11:02:40 -0800 Message-Id: <200412071902.iB7J2evu013991@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS 551 - Questions about fair queueing Date: Tue, 07 Dec 2004 11:02:40 -0800 From: william@bourbon.usc.edu Someone wrote: > I'll use the example on Slide 20 of lecture 15. > The scale ratio of the logical time and the real time is 1:2. > And the initial slope is 1/2 because there are 2 initial flows. > That makes Y2's arrival time map to logical time 1.5. > But if the ratio is 1:1.Slope is still 1/2. Y2's arrival time will > map to logical time 2, which is the same as the X1's logical finish time. > So how we choose the axes scale might effect the outcome. What you are calling "scale ratio" here doesn't affect anything (except visually). If you use 1 inch for 1 real time unit horizontally and use 1 inch for 1 logical time unit vertically, the only difference is that the angle of the line will be 22.5 degrees instead of 45 degrees. All the calculations should come out exactly the same. This would be true for *any* graphs. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Tuesday, December 7, 2004 9:43 am Subject: Re: CS 551 - Questions about fair queueing > Someone wrote: > > > I have a question on solving the fair queueing problems with a > > diagram. I understand the analogy of drawing a > > RealTime/LogicalTime diagram to solve the problem as in Lecture > > 15. What I don't understand is how to choose the scale of the > > axes in the beginning. Can you explain how to choose that ratio ? > > I'm not sure what you mean by choosing the scale of the axes. > > The horizontal axis is real time, so there's no question > about scale there. The vertical axis is logical time, which > ticks once per round (one bit served from each non-busy > queue). You can scale this anyway you want and the curve > should look exactly the same (the only difference being the > label you have on the vertical axis). > > On slide 18 of lecture 15, it says that the "all packets are > of size 1", it doesn't say how many bits are there in size > of 1. But it should scale no matter how many bits there are > for a size of 1. For example, if 1 means 1 million bits, > you will get the same pictures as in slides 19 through 24. > If 1 means 1 thousand bits, everything is stil the same, > except that the vertical axis will be labeled differently. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Dec 6 21:46:30 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iB75kUja000860 for ; Mon, 6 Dec 2004 21:46:30 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iB75kegv023101 for ; Mon, 6 Dec 2004 21:46:40 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iB75ketk023091 for cs551@merlot.usc.edu; Mon, 6 Dec 2004 21:46:40 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iB75kdgv023083 for ; Mon, 6 Dec 2004 21:46:39 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iB75kdYI023079 for ; Mon, 6 Dec 2004 21:46:39 -0800 Message-Id: <200412070546.iB75kdYI023079@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Questions about fair queueing Date: Mon, 06 Dec 2004 21:46:39 -0800 From: william@bourbon.usc.edu Someone wrote: > For the weighted fair queueing problem, can we bring a calculator > during the final? No. You must do everything by hand. The arithmatics will be simple. You can always leave things in fractions (but you have to add things up). For example, don't write 2.5+1/3. You should write either 2.833 or 17/6 in this case. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Dec 6 17:43:35 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iB71hZja024333 for ; Mon, 6 Dec 2004 17:43:35 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iB71hjgv024767 for ; Mon, 6 Dec 2004 17:43:45 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iB71hjh7024760 for cs551@merlot.usc.edu; Mon, 6 Dec 2004 17:43:45 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iB71hjgv024751 for ; Mon, 6 Dec 2004 17:43:45 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iB71hjxi024747 for ; Mon, 6 Dec 2004 17:43:45 -0800 Message-Id: <200412070143.iB71hjxi024747@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS 551 - Questions about fair queueing Date: Mon, 06 Dec 2004 17:43:44 -0800 From: william@bourbon.usc.edu Someone wrote: > I have a question on solving the fair queueing problems with a > diagram. I understand the analogy of drawing a > RealTime/LogicalTime diagram to solve the problem as in Lecture > 15. What I don't understand is how to choose the scale of the > axes in the beginning. Can you explain how to choose that ratio ? I'm not sure what you mean by choosing the scale of the axes. The horizontal axis is real time, so there's no question about scale there. The vertical axis is logical time, which ticks once per round (one bit served from each non-busy queue). You can scale this anyway you want and the curve should look exactly the same (the only difference being the label you have on the vertical axis). On slide 18 of lecture 15, it says that the "all packets are of size 1", it doesn't say how many bits are there in size of 1. But it should scale no matter how many bits there are for a size of 1. For example, if 1 means 1 million bits, you will get the same pictures as in slides 19 through 24. If 1 means 1 thousand bits, everything is stil the same, except that the vertical axis will be labeled differently. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Dec 6 17:21:08 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iB71L8ja023507 for ; Mon, 6 Dec 2004 17:21:08 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iB71LJgv012941 for ; Mon, 6 Dec 2004 17:21:19 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iB71LJF2012934 for cs551@merlot.usc.edu; Mon, 6 Dec 2004 17:21:19 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iB71LIgv012928 for ; Mon, 6 Dec 2004 17:21:18 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iB71LIZY012921 for ; Mon, 6 Dec 2004 17:21:18 -0800 Message-Id: <200412070121.iB71LIZY012921@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: TCP Throughput Date: Mon, 06 Dec 2004 17:21:18 -0800 From: william@bourbon.usc.edu Someone wrote: > There are several different equations related to TCP throughput > in the Padhye98a and Floyd99b papers. I'm curious which ones are > actually used for policing and which are important to know. I'm not sure "which ones are actually used for policing" since TCP friendliness is not enforced on the Internet. Which ones are important to know? Well, I cannot answer this question because it really depends on what you care about in real life and what you do. One can argue that none of the questions are important since it's the technique that was used to derive these equestions should be important. But if you are asking about the exam, I guess it's clear which ones are on the lecture slides! :-) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Dec 6 17:16:30 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iB71GUja023331 for ; Mon, 6 Dec 2004 17:16:30 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iB71Gegv010465 for ; Mon, 6 Dec 2004 17:16:40 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iB71GewS010459 for cs551@merlot.usc.edu; Mon, 6 Dec 2004 17:16:40 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iB71Gegv010454 for ; Mon, 6 Dec 2004 17:16:40 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iB71GehX010447 for ; Mon, 6 Dec 2004 17:16:40 -0800 Message-Id: <200412070116.iB71GehX010447@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Questions about fair queueing Date: Mon, 06 Dec 2004 17:16:39 -0800 From: william@bourbon.usc.edu Someone wrote: > I have a few questions about fair queueing: > > 1) On lecture 15, slides 22-24, your fair queueing calculation > example appears to be incorrect. If I understand properly, if > the arrival time of Ax3 = 1.833, then the Fx3 = 2.833, but you > have it as Fx3 = 3 on all three slides. Furthermore, you did not > show the arriaval of X3 in slides 22 and 23. Please let me know > if my assumptions are correct. If not, please explain why the > presented calculations are correct. Fx3=3 because max(Fx1,Ax3)=max(2,1.833)=2. The little crosshair thing with a circle around it does not denote arrival. It denotes a slope change. There was an arrival at real time 3 because of the naming convention (X3). > 2) On lecture 16, slide 3 and in the Demers paper, it states that > in WFQ, you need to count the Y twice when the Y queue is not > empty. I do not understand what it means to count it twice, or > why to do this. Can you please explain. Counting twice is about how to figure out the slope. If queues X and Y are not empty and queue Z is empty, you need to go at a slope of 1/3. The reason is that in a round, you will serve 1 bit from X and 2 bits from Y. Therefore, the slope is 1/3 and you need to "shrink the packet size by half". (If queues X and Z are not empty and queue Y is empty, you need to go at a slope of 1/2.) > Also, if the priority > for queue Y is 3 instead of 2, would you count the Y three times > for every single count of flows X and Z? Yes. If the weight for queue Y is 3, you need to shrink the packet size in Y to 1/3 its actual size and count it 3 times when you calculate the slope. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Dec 6 17:06:54 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iB716sja022948 for ; Mon, 6 Dec 2004 17:06:54 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iB7175gv005383 for ; Mon, 6 Dec 2004 17:07:05 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iB7175tX005375 for cs551@merlot.usc.edu; Mon, 6 Dec 2004 17:07:05 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iB7174gv005372 for ; Mon, 6 Dec 2004 17:07:04 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iB7174KK005368 for ; Mon, 6 Dec 2004 17:07:04 -0800 Message-Id: <200412070107.iB7174KK005368@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: chord query Date: Mon, 06 Dec 2004 17:07:04 -0800 From: william@bourbon.usc.edu Someone wrote: > From the Stoica01a.pdf, page 6, figure 5-b. The caption says, > Finger tables and key locations after node 3 leaves. However, the > node 3 is shown by a green circle and the successor columns for > all finger tables continue to show node 0,3 and 6, and node 1 no > longer exists. Is there a typo in the caption, 'node 3' in place > of 'node 1' or I need to read the paper again? I think it's a typo. > Also if my above assumption is correct, then for the finger table > entry at node 0, shouldn't the first row last column have > successor as '3' and not '0'? Reasoning: In the interval [1,2) > the nearest node is # 3. I think you are correct. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Dec 6 14:08:27 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iB6M8Rja016227 for ; Mon, 6 Dec 2004 14:08:27 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iB6M8cgv012688 for ; Mon, 6 Dec 2004 14:08:38 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iB6M8cZx012686 for cs551@merlot; Mon, 6 Dec 2004 14:08:38 -0800 Date: Mon, 6 Dec 2004 14:08:38 -0800 From: william@bourbon.usc.edu Message-Id: <200412062208.iB6M8cZx012686@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: final exam policy... Hi, I want to mention that during the final exam, I will not allow anyone to leave the room (to go to the bathroom, to get a drink of water, or anything else). If you have a medical condition and *must* go to the bathroom often, please bring a doctor's note. Otherwise, please make sure you won't need to leave the room in the middle of the exam. Thanks for your consideration and sorry about the inconvenience! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Dec 4 21:54:39 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iB55sdja012774 for ; Sat, 4 Dec 2004 21:54:39 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iB55ssgv025897 for ; Sat, 4 Dec 2004 21:54:54 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iB55ssQ9025895 for cs551@merlot.usc.edu; Sat, 4 Dec 2004 21:54:54 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iB55ssgv025889 for ; Sat, 4 Dec 2004 21:54:54 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iB55ssn0025882 for ; Sat, 4 Dec 2004 21:54:54 -0800 Message-Id: <200412050554.iB55ssn0025882@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: keys/search in freenet Date: Sat, 04 Dec 2004 21:54:54 -0800 From: william@bourbon.usc.edu Someone wrote: > From the freenet paper: SSK (signed subspace key) is used as a > container for describing a file. The SSK is stored as "You would > then calculate the file's SSK by hashing the public half of the > subspace key and the descriptive string independently before > concatenating them and hashing again." (I don't see why the SSK is related the rest of your message.) > When a search is performed, the node tries to send a query to the > nearest possible key-match amongst its neighbors. My question is: > On what basis does a node find a nearest key match for a given > search query? If its solely on the basis of SHA1 value of the > keywords, then it cannot be alphabetical comparison as the SHA1 > for "hello world" is "f1d815770d5be4b5c404151403209f69ed81c1b6" > and "hello worlds" is "240055d4ac849de0e11bb34e7ac7de039e816f0a". > ie. even though the keywords for above 2 queries differ only by > "one" letter, their SHA1 value's are completely different. The SHA1 values in Freenet is the "content hash" of the data (just like SHA1 of a file in our final project, and *not* like the SHA1 half of a bit-vector). So, when you said "keywords", it doesn't really apply to Freenet. If you have 2 files, one file's content is "hello world" and another file's content is "hello worlds", these 2 files are far away from each *in the key space*. There is no concept if "file similiarity" in Freenet. Although there is the concept of "closeness of keys". If 2 keys are close, it says nothing about the content of the corresponding 2 files. Most likely, the content of the corresponding 2 files are completely different. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Dec 4 21:48:18 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iB55mIja012529 for ; Sat, 4 Dec 2004 21:48:18 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iB55mYgv019854 for ; Sat, 4 Dec 2004 21:48:34 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iB55mYF8019849 for cs551@merlot.usc.edu; Sat, 4 Dec 2004 21:48:34 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iB55mYgv019846 for ; Sat, 4 Dec 2004 21:48:34 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iB55mYDP019842 for ; Sat, 4 Dec 2004 21:48:34 -0800 Message-Id: <200412050548.iB55mYDP019842@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: triple-dup-ack Date: Sat, 04 Dec 2004 21:48:34 -0800 From: william@bourbon.usc.edu Someone wrote: > Lecture 17, Slide #18, we have congestion avoidance on Y-axis. > Since we ignore "slow-start", shouldn't the number of segment > sent for Y2 = 1/2(W1), ie. when TDP1 occurs, shouldn't the > initial Congestion Window Size for Y2 1/2 of W1? Yes, the initial cwnd during TDP2 is W1/2. But I don't understand why you said "the number of segment sent for Y2 = W1/2" since Y2 is the area under the curve. > I am trying to draw an analogy between the above slide and Fig. > 1(page 3) mentioned in Padhye-98a paper and the window size in > that figure is similar to my reasoning above. Kindly let me know. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Dec 3 10:49:02 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iB3In2ja030047 for ; Fri, 3 Dec 2004 10:49:02 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iB3InLgv032101 for ; Fri, 3 Dec 2004 10:49:21 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iB3InLsC032099 for cs551@merlot.usc.edu; Fri, 3 Dec 2004 10:49:21 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iB3InKgv032096 for ; Fri, 3 Dec 2004 10:49:20 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iB3InK9X032092 for ; Fri, 3 Dec 2004 10:49:20 -0800 Message-Id: <200412031849.iB3InK9X032092@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: weighted fair queuing question Date: Fri, 03 Dec 2004 10:49:20 -0800 From: william@bourbon.usc.edu Someone wrote: > Does WFQ have a limit on the number of queues it can serve per > source? There is no limit, in theory. But of course there is a practical limit since a router can only have so much memory buffer. > If there is no limit, then a malicious user can have > multiple sources, and delay legitimate users from using their > fair share. > Eg: Machine 1 (legitimate) - 1 source > Machine 2 (illegitimate) - 10 sources. > So machine 2 gets served 10 times (10 bits as compared to 1 bit) > more than machine 1. Am I missing something out here? It may be hard to control. This malicious user must figure out how to construct multiple flows such that they will all pass through the same link. Even if this use just use different port numbers to create many flows, if the router uses one queue per source host/dest host pair, this attack will not be effective. Also, denial of service is usually not a major concern for queue management. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Dec 1 12:30:14 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iB1KUEja023541 for ; Wed, 1 Dec 2004 12:30:14 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iB1KUcgv009856 for ; Wed, 1 Dec 2004 12:30:38 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iB1KUcSK009854 for cs551@merlot; Wed, 1 Dec 2004 12:30:38 -0800 Date: Wed, 1 Dec 2004 12:30:38 -0800 From: william@bourbon.usc.edu Message-Id: <200412012030.iB1KUcSK009854@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: question regarding the [Deering88b] reference Hi, During the review for final exam today, someone asked about [Deering88b] and said that it does not seem to be related to DVMRP and MOSPF. He was correct. The labeling on the lecture slides was incorrect. The [Deering88b] label should go with multicast and not with DVMRP and MOSPF. DVMRP and MOSPF was described in [Deering96a]. This is now fixed on the class web page. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Dec 1 07:57:21 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iB1FvLja013292 for ; Wed, 1 Dec 2004 07:57:21 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iB1Fvjgv005652 for ; Wed, 1 Dec 2004 07:57:45 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iB1Fvj8i005650 for cs551@merlot.usc.edu; Wed, 1 Dec 2004 07:57:45 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iB1Fvjgv005647 for ; Wed, 1 Dec 2004 07:57:45 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iB1FvjSd005643 for ; Wed, 1 Dec 2004 07:57:45 -0800 Message-Id: <200412011557.iB1FvjSd005643@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: est cases for grading of final project part (2) ... Date: Wed, 01 Dec 2004 07:57:45 -0800 From: william@bourbon.usc.edu Someone wrote: > In test case r7: > > " > in 6th window, > type: > store usctommy.gif 2 category="picture gif" > in 5th window, type: > "status files 1 04.out", look at "04.out", > response should come from only nodes *04 and *07, > node *07 should have no files and node *04 should > have a copy of "usctommy.gif" > in 5th window, type: > "status files 3 04.out", look at "04.out", > response should come from all nodes, > nodes *00, *01, *04, *09 should have a copy of > "usctommy.gif", nodes *07 and *08 should not have > this file > " > > I couldnot understand why node *07 does not get the file in this case? When > issued STORE command at n09 (6th window) with TTL=2, it should reach n01, > n00, n04, n07. So, n07 should store the file, shouldnot it? You are correct. I thought node *07 was 3 hops away from node *09. Thanks for catching yet another mistake. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Dec 1 07:46:42 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iB1Fkgja012906 for ; Wed, 1 Dec 2004 07:46:42 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iB1Fl6gv028236 for ; Wed, 1 Dec 2004 07:47:06 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iB1Fl6j2028234 for cs551@merlot.usc.edu; Wed, 1 Dec 2004 07:47:06 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iB1Fl6gv028225 for ; Wed, 1 Dec 2004 07:47:06 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iB1Fl6GZ028221 for ; Wed, 1 Dec 2004 07:47:06 -0800 Message-Id: <200412011547.iB1Fl6GZ028221@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: est cases for grading of final project part (2) ... Date: Wed, 01 Dec 2004 07:47:06 -0800 From: william@bourbon.usc.edu Someone wrote: > In test case r7: > > " > in 1st window, > type: > delete FileName=blondie1.mp3 > SHA1=8ae005585be9c44ef1910d25dd6f8da58c432ab5 Nonce=(user the correct nonce > from above) > this command should delete all files on all nodes, > type "status files 5 05.out", look at "05.out", > make sure that all files are deleted > " > > Shouldnot it be "5th window (node n08)", since n08 is the originator of the > STORE command for that file and it is noted that the delete command should > delete all the files (so certificate verification is successful)? Yet another typo. Fixed. Thanks for catching this! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Nov 30 21:51:28 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iB15pRja022727 for ; Tue, 30 Nov 2004 21:51:27 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iB15prgv016222 for ; Tue, 30 Nov 2004 21:51:53 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iB15pr53016220 for cs551@merlot.usc.edu; Tue, 30 Nov 2004 21:51:53 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iB15prgv016217 for ; Tue, 30 Nov 2004 21:51:53 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iB15prQH016213 for ; Tue, 30 Nov 2004 21:51:53 -0800 Message-Id: <200412010551.iB15prQH016213@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: est cases for grading of final project part (2) ... Date: Tue, 30 Nov 2004 21:51:53 -0800 From: william@bourbon.usc.edu Someone wrote: > In test case "b3" it says: > > search keywords="blondie mp3" > should get no response, type c to terminate > > I could not understand why it should not get a response? "blondie" and "mp3" > are among the keywords for that file? Oops! I meant to use part of the the file name. So it should be: search keywords="blondie1 mp3" It's fixed on the web page now. Thanks for catching this. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Nov 30 21:47:47 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iB15llja022541 for ; Tue, 30 Nov 2004 21:47:47 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iB15mDgv012732 for ; Tue, 30 Nov 2004 21:48:13 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iB15mDfP012730 for cs551@merlot.usc.edu; Tue, 30 Nov 2004 21:48:13 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iB15mDgv012727 for ; Tue, 30 Nov 2004 21:48:13 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iB15mDfe012723 for ; Tue, 30 Nov 2004 21:48:13 -0800 Message-Id: <200412010548.iB15mDfe012723@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: est cases for grading of final project part (2) ... Date: Tue, 30 Nov 2004 21:48:13 -0800 From: william@bourbon.usc.edu Someone wrote: > Regarding test case c2, after the line "type "shutdown" in the 1st window" > among the nodes listed that should initiate a CHECK_REQ there is also a > beacon node "n01". It might be a typo, since beacon nodes do not initiate > any CHECK_REQ in case of a failure of a neighbor, right? You are absolutely right! I've just changed it from: nodes *01, *04, and *08 should do CHECKs, ... to: [BC: Fixed 11/30/2004] nodes *04 and *08 should do CHECKs, ... Thanks for catching it! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Nov 30 21:39:16 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iB15dGja022177 for ; Tue, 30 Nov 2004 21:39:16 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iB15dfgv004563 for ; Tue, 30 Nov 2004 21:39:41 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iB15dfjO004561 for cs551@merlot.usc.edu; Tue, 30 Nov 2004 21:39:41 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iB15dfgv004558 for ; Tue, 30 Nov 2004 21:39:41 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iB15df4x004554 for ; Tue, 30 Nov 2004 21:39:41 -0800 Message-Id: <200412010539.iB15df4x004554@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: est cases for grading of final project part (2) ... Date: Tue, 30 Nov 2004 21:39:41 -0800 From: william@bourbon.usc.edu Someone wrote: > The network topologies used in test cases assume we are using ports 180XX, > and because distance computation (in the case of JOIN) is depended on > node_id's of the nodes, I am not able to get the same topologies while > trying out with ports we are assigned. What would you recommend? When a node sees that it has a init_neighbor_list file, it must *not* do a join and must start participating in the network. Therefore, you should be able to manually create init_neighbor_list files in the home directories of your nodes and create a topology you want (given that you will start the nodes in a certain order). -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Wednesday, November 24, 2004 2:50 PM Subject: est cases for grading of final project part (2) ... > i, > > I've posted the test cases that the grader will be using > to grade final project part (2): > > http://merlot.usc.edu/cs551-f04/projects/testcases/part2.html > > lease note that these test data files are using fixed > ports. Therefore, if two students are doing the tests > at the same time, there may be conflicts. Please manually > modify the n??.ini files after they are copied into your > project directory and change them to use your ports. > > At some point, the grader may ask you to give him a demo if > he is having trouble getting your code to work with these > test cases. Please make sure that you have tried these test > cases out by then so you can get as much (partial) credit as > you can. If, by the time of the demo appointment, you haven't > tried these out, you will *not* get another chance to do the > demo! So, please be prepared. > > If you see any problem with these test cases, please send > e-mail to both the grader and myself. Thanks! > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Nov 29 16:30:37 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAU0Ubja021877 for ; Mon, 29 Nov 2004 16:30:37 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAU0Xsgv026890 for ; Mon, 29 Nov 2004 16:33:54 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAU0XsJG026888 for cs551@merlot.usc.edu; Mon, 29 Nov 2004 16:33:54 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAU0Xsgv026885 for ; Mon, 29 Nov 2004 16:33:54 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAU0Xs1F026881 for ; Mon, 29 Nov 2004 16:33:54 -0800 Message-Id: <200411300033.iAU0Xs1F026881@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: demo timeslots for the final project... Date: Mon, 29 Nov 2004 16:33:54 -0800 From: william@bourbon.usc.edu Someone wrote: > Should we mail the TA or grader? Oops! I mean the grader, Sanjay Garg . Sorry! Please also remember that the grading test cases are at: http://merlot.usc.edu/cs551-f04/projects/testcases/part2.html -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Tuesday, November 30, 2004 5:59 AM Subject: demo timeslots for the final project... > Hi, > > The TA is requesting that you make demo with him. The demo > will be 30 minutes long. Please send him your top *4* time > slot choices from the following time frame and e-mail it to > him as soon as possible. The TA is available during the > following time: > > For on-campus students > Tuesday (11/30) 5pm - 9pm > Wednesday (12/1) 5pm - 9pm > Thursday (12/2) 5pm - 9pm > > For DEN students > Friday (12/3) 5pm - 9pm > Saturday (12/4) 5pm - 9pm > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 29 16:26:26 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAU0QQja021735 for ; Mon, 29 Nov 2004 16:26:26 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAU0Tggv022868 for ; Mon, 29 Nov 2004 16:29:42 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAU0Tg1l022866 for cs551@merlot; Mon, 29 Nov 2004 16:29:42 -0800 Date: Mon, 29 Nov 2004 16:29:42 -0800 From: william@bourbon.usc.edu Message-Id: <200411300029.iAU0Tg1l022866@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: demo timeslots for the final project... Hi, The TA is requesting that you make demo with him. The demo will be 30 minutes long. Please send him your top *4* time slot choices from the following time frame and e-mail it to him as soon as possible. The TA is available during the following time: For on-campus students Tuesday (11/30) 5pm - 9pm Wednesday (12/1) 5pm - 9pm Thursday (12/2) 5pm - 9pm For DEN students Friday (12/3) 5pm - 9pm Saturday (12/4) 5pm - 9pm -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Nov 28 22:07:08 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAT678ja021568 for ; Sun, 28 Nov 2004 22:07:08 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAT6ARgv028814 for ; Sun, 28 Nov 2004 22:10:27 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAT6ARJs028812 for cs551@merlot.usc.edu; Sun, 28 Nov 2004 22:10:27 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAT6ARgv028803 for ; Sun, 28 Nov 2004 22:10:27 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAT6AR2E028799 for ; Sun, 28 Nov 2004 22:10:27 -0800 Message-Id: <200411290610.iAT6AR2E028799@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Hw3-2.tcl Date: Sun, 28 Nov 2004 22:10:27 -0800 From: william@bourbon.usc.edu Someone wrote: > I fixed the error. > > I was trying to locate the files referenced on this page. > http://www.isi.edu/nsnam/ns/tutorial/nsscript5.html > > tcl/mobility/scene files ... The only files that's in the ~csci551 account are ~csci551/ns and ~csci551/nam! If you are looking for other files, please download from the nsnam website. -- Bill Cheng // bill.cheng@usc.edu   >>-----Original Message----- >>From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] >>Sent: Sunday, November 28, 2004 8:57 PM >>To: cs551@bourbon.usc.edu >>Subject: Re: Hw3-2.tcl >> >>Someone wrote: >> >> > I am not sure but I think in line 65 >> > exec ~csci551/nam hw3-3.nam & >> > This is intended and not the existing >> > exec ~csci551/nam out.nam & >> >>I guess it should be obvious whether it is a typo or not. >> >> > Also is there anyway that I can look up existing NS scripts in the >> > csci551/ install of NS. I got an error related to the wireless >> > configuration and an example script in the ns install was recommended >>by >> > the ns compiler. >> >>I'm not sure what error you are getting. It's usually >>better if you can send me a transcript. But I think >>we are running out of time and I may not see your next >>message. >>-- >>Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Nov 28 21:56:59 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAT5uxja021243 for ; Sun, 28 Nov 2004 21:56:59 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAT60Igv019103 for ; Sun, 28 Nov 2004 22:00:18 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAT60Ihl019101 for cs551@merlot.usc.edu; Sun, 28 Nov 2004 22:00:18 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAT60Igv019098 for ; Sun, 28 Nov 2004 22:00:18 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAT60Idn019094 for ; Sun, 28 Nov 2004 22:00:18 -0800 Message-Id: <200411290600.iAT60Idn019094@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: nam not working Date: Sun, 28 Nov 2004 22:00:18 -0800 From: william@bourbon.usc.edu Someone wrote: > On the hw3-1 I was able to generate a tcl script and produce the > ns and nam trace files, but when I run it through nam, it does > not show any nodes. Looks like nam is working. I do get a window when I run ~csci551/nam > Is there supposed to be a connectivity > statement in the tcl script besides a "connect $tcp $sink" to > make the nodes show up? Sorry that I cannot help... That's something for you to find out. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Nov 28 20:53:21 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAT4rLja019392 for ; Sun, 28 Nov 2004 20:53:21 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAT4uegv023209 for ; Sun, 28 Nov 2004 20:56:40 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAT4ueQY023204 for cs551@merlot.usc.edu; Sun, 28 Nov 2004 20:56:40 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAT4uegv023198 for ; Sun, 28 Nov 2004 20:56:40 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAT4uet1023194 for ; Sun, 28 Nov 2004 20:56:40 -0800 Message-Id: <200411290456.iAT4uet1023194@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Hw3-2.tcl Date: Sun, 28 Nov 2004 20:56:40 -0800 From: william@bourbon.usc.edu Someone wrote: > I am not sure but I think in line 65 > exec ~csci551/nam hw3-3.nam & > This is intended and not the existing > exec ~csci551/nam out.nam & I guess it should be obvious whether it is a typo or not. > Also is there anyway that I can look up existing NS scripts in the > csci551/ install of NS. I got an error related to the wireless > configuration and an example script in the ns install was recommended by > the ns compiler. I'm not sure what error you are getting. It's usually better if you can send me a transcript. But I think we are running out of time and I may not see your next message. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Nov 28 09:58:33 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iASHwXja000553 for ; Sun, 28 Nov 2004 09:58:33 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iASI1rgv030676 for ; Sun, 28 Nov 2004 10:01:53 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iASI1rrr030674 for cs551@merlot.usc.edu; Sun, 28 Nov 2004 10:01:53 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iASI1rgv030665 for ; Sun, 28 Nov 2004 10:01:53 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iASI1rYJ030661 for ; Sun, 28 Nov 2004 10:01:53 -0800 Message-Id: <200411281801.iASI1rYJ030661@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: hw3-2 nam file query Date: Sun, 28 Nov 2004 10:01:53 -0800 From: william@bourbon.usc.edu Someone wrote: > The hw3-2 nam script has the initial line as: > > $ns trace-all [open hw3-3.tr w] > $ns namtrace-all [open hw3-3.nam w] > > I am confused with the naming scheme. I know it doesn't matter > but shouldn't the above lines read as hw3-2.tr and hw3-2.nam? You are correct. Please change them (it's also okay not to change them). -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 24 14:46:59 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAOMkxja018447 for ; Wed, 24 Nov 2004 14:46:59 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAOMoTgv020312 for ; Wed, 24 Nov 2004 14:50:29 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAOMoTNP020310 for cs551@merlot; Wed, 24 Nov 2004 14:50:29 -0800 Date: Wed, 24 Nov 2004 14:50:29 -0800 From: william@bourbon.usc.edu Message-Id: <200411242250.iAOMoTNP020310@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: est cases for grading of final project part (2) ... i, I've posted the test cases that the grader will be using to grade final project part (2): http://merlot.usc.edu/cs551-f04/projects/testcases/part2.html lease note that these test data files are using fixed ports. Therefore, if two students are doing the tests at the same time, there may be conflicts. Please manually modify the n??.ini files after they are copied into your project directory and change them to use your ports. At some point, the grader may ask you to give him a demo if he is having trouble getting your code to work with these test cases. Please make sure that you have tried these test cases out by then so you can get as much (partial) credit as you can. If, by the time of the demo appointment, you haven't tried these out, you will *not* get another chance to do the demo! So, please be prepared. If you see any problem with these test cases, please send e-mail to both the grader and myself. Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Nov 23 22:58:25 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAO6wPja022201 for ; Tue, 23 Nov 2004 22:58:25 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAO71ugv015524 for ; Tue, 23 Nov 2004 23:01:56 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAO71utb015522 for cs551@merlot; Tue, 23 Nov 2004 23:01:56 -0800 Date: Tue, 23 Nov 2004 23:01:56 -0800 From: william@bourbon.usc.edu Message-Id: <200411240701.iAO71utb015522@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: submission deadline is getting close... Hi, Many of you have not even submitted *anything*. Please try to submit something soon just in case you cannot get things to work exactly the way you want near the deadline or the machine load gets too high. (If nunki crashed, please let me know.) When it gets close to the deadline, you may make mistakes and miss the deadline. The penalty for missing the deadline is *very severe* and non-negotiable. Please submit on-time! Please remember, I have to be fair to all. This means applying *one standard* to all students. (Therefore, load being high on nunki cannot be accepted as an execuse for late submissions.) Also, most likely I will not answer any more e-mail questions tonight. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Nov 23 22:01:21 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAO61Lja020476 for ; Tue, 23 Nov 2004 22:01:21 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAO64qgv017787 for ; Tue, 23 Nov 2004 22:04:52 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAO64paZ017780 for cs551@merlot.usc.edu; Tue, 23 Nov 2004 22:04:51 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAO64ogv017774 for ; Tue, 23 Nov 2004 22:04:50 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAO64oPd017767 for ; Tue, 23 Nov 2004 22:04:50 -0800 Message-Id: <200411240604.iAO64oPd017767@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Nunki is awefully slow Date: Tue, 23 Nov 2004 22:04:50 -0800 From: william@bourbon.usc.edu Someone wrote: > we are not able to test our programs before the submission > nunki is taking abt 2 mins to even compile!!. Running "uptime" on nunki gives: 10:04pm up 31 day(s), 7:07, 83 users, load average: 16.96, 16.95, 16.86 So, the average load is kind of high. But, nunki is running fine. Slowness is expected at times. If you do "top", you will see that a lot of processes called "viewdraw" is eating up a lot of the CPU time. I have no idea what these are. Also, 2-3 "sv_node" processes are also eating up some CPU time. I hope none of you are doing busy-waits! Anyway, this is what happens when it gets close to deadlines. That's why I've mentioned so many times that you should do your project early! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Nov 23 09:29:59 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iANHTxja031177 for ; Tue, 23 Nov 2004 09:29:59 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iANHXVgv001750 for ; Tue, 23 Nov 2004 09:33:31 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iANHXUcp001741 for cs551@merlot.usc.edu; Tue, 23 Nov 2004 09:33:30 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iANHXUgv001738 for ; Tue, 23 Nov 2004 09:33:30 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iANHXUSS001734 for ; Tue, 23 Nov 2004 09:33:30 -0800 Message-Id: <200411231733.iANHXUSS001734@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: about flooding STORE Date: Tue, 23 Nov 2004 09:33:29 -0800 From: william@bourbon.usc.edu Someone wrote: > A STORE message may travel through the network, because each intermediate > node are supposed to at least forward it to its negihbors up to max-ttl, so > chances are a node may get the same message twice, so when this occurs > should the node reject transferring the remaining portion of the STORE msg > as soon as it interprets the header and observes that the msg is a > duplicate, or continue dumping the file in a temporary place no matter what? For the kind of flooding we are doing, a node should see the same message (no matter what type of message it is) x time, if it has x neighbers, right? If you see a message with a message ID that's in your cache, you should drop the message and don't even look at the content. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Nov 23 06:04:40 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iANE4eja025390 for ; Tue, 23 Nov 2004 06:04:40 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iANE8Dgv023786 for ; Tue, 23 Nov 2004 06:08:13 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iANE8DPv023782 for cs551@merlot.usc.edu; Tue, 23 Nov 2004 06:08:13 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iANE8Dgv023775 for ; Tue, 23 Nov 2004 06:08:13 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iANE8DBs023771 for ; Tue, 23 Nov 2004 06:08:13 -0800 Message-Id: <200411231408.iANE8DBs023771@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Compiling Date: Tue, 23 Nov 2004 06:08:13 -0800 From: william@bourbon.usc.edu Someone wrote: > On project 1 you said we needed to include > /usr/usc/openssl/default/include > in the makefile and link to > /usr/usc/openssl/default/lib -lcrypto > in order to use the MD5 functions. > > But I noticed that for this project that a set of MD5 functions are also > defined in > /usr/lsd/openssl/0.9.7c/include > and my code runs fine using these MD5 functions. > Is this OK or should we > link to the same library as in project > 1 for the MD5 functions and only use 0.9.7c/ for the SHA functions. For part (2), you must use 0.9.7c for all openssl files, functions and programs. Please follow the spec and not use the default one. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Nov 22 12:22:56 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAMKMuja026413 for ; Mon, 22 Nov 2004 12:22:56 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAMKQVgv018755 for ; Mon, 22 Nov 2004 12:26:31 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAMKQVUi018753 for cs551@merlot.usc.edu; Mon, 22 Nov 2004 12:26:31 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAMKQVgv018750 for ; Mon, 22 Nov 2004 12:26:31 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAMKQVSa018746 for ; Mon, 22 Nov 2004 12:26:31 -0800 Message-Id: <200411222026.iAMKQVSa018746@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: 551 - about GET_REQUEST Date: Mon, 22 Nov 2004 12:26:30 -0800 From: william@bourbon.usc.edu Someone wrote: > Basically it is that the Search Function only searches every > other node other than the node that generated the search message. When you initiate a search, you must search your own node. I've discussed this before. -- Bill Cheng // bill.cheng@usc.edu >>-----Original Message----- >>From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] >>Sent: Monday, November 22, 2004 10:21 AM >>To: cs551@bourbon.usc.edu >>Subject: Re: 551 - about GET_REQUEST >> >>Someone wrote: >> >> > I was rereading some of these messages, this one confuses me a little. >>I >> > just wanted to know if I do have a FILE then if I search the network >>it >> > wont show up that I have the file. Or will it? I don’t think it >>should. >> > Please advise >> >>I'm not sure exactly what you are asking... Between the time >>you receive a search response and the time you send out a get, >>it's possible that another node has done a delete. If I'm not >>answering the right question, please let me know. >>-- >>Bill Cheng // bill.cheng@usc.edu >> >> >> >> >>-----Original Message----- >> >>From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] >> >>Sent: Friday, November 19, 2004 7:46 AM >> >>To: cs551@bourbon.usc.edu >> >>Subject: Re: 551 - about GET_REQUEST >> >> >> >>Someone wrote: >> >> >> >> > This may be a superfluous question, but just wanted to be sure. In >> the >> >>case >> >> > of GET, should we still flood the GET_REQ even if the chosen File >> is >> >>being >> >> > served at the local node? >> >> >> >>Yes. >> >> >> >> > For uniformity we could, however it is unnecessary... >> >> >> >>Most likely. But you really don't know for sure if there >> >>is another file out there with the same file ID (unless >> >>you have recorded the fact the the search response you got >> >>was from this node). >> >> >> >> > Also, even if the file is located at some remote peer, we >> >> > could send GET_REQ only in the direction of the path (only for the >> >>first hop >> >> > case) we received the SEARCH_RESP corresponding to that file, >> instead >> >>of >> >> > broadcasting it to all our immediate neighbors. >> >> >> >>GET request must be flooded to the whole network, according >> >>to the spec. >> >>-- >> >>Bill Cheng // bill.cheng@usc.edu >> Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Nov 22 10:17:11 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAMIHBja022770 for ; Mon, 22 Nov 2004 10:17:11 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAMIKkgv005034 for ; Mon, 22 Nov 2004 10:20:46 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAMIKk0n005032 for cs551@merlot.usc.edu; Mon, 22 Nov 2004 10:20:46 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAMIKjgv005029 for ; Mon, 22 Nov 2004 10:20:45 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAMIKj8B005019 for ; Mon, 22 Nov 2004 10:20:45 -0800 Message-Id: <200411221820.iAMIKj8B005019@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: 551 - about GET_REQUEST Date: Mon, 22 Nov 2004 10:20:45 -0800 From: william@bourbon.usc.edu Someone wrote: > I was rereading some of these messages, this one confuses me a little. I > just wanted to know if I do have a FILE then if I search the network it > wont show up that I have the file. Or will it? I don’t think it should. > Please advise I'm not sure exactly what you are asking... Between the time you receive a search response and the time you send out a get, it's possible that another node has done a delete. If I'm not answering the right question, please let me know. -- Bill Cheng // bill.cheng@usc.edu >>-----Original Message----- >>From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] >>Sent: Friday, November 19, 2004 7:46 AM >>To: cs551@bourbon.usc.edu >>Subject: Re: 551 - about GET_REQUEST >> >>Someone wrote: >> >> > This may be a superfluous question, but just wanted to be sure. In the >>case >> > of GET, should we still flood the GET_REQ even if the chosen File is >>being >> > served at the local node? >> >>Yes. >> >> > For uniformity we could, however it is unnecessary... >> >>Most likely. But you really don't know for sure if there >>is another file out there with the same file ID (unless >>you have recorded the fact the the search response you got >>was from this node). >> >> > Also, even if the file is located at some remote peer, we >> > could send GET_REQ only in the direction of the path (only for the >>first hop >> > case) we received the SEARCH_RESP corresponding to that file, instead >>of >> > broadcasting it to all our immediate neighbors. >> >>GET request must be flooded to the whole network, according >>to the spec. >>-- >>Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Nov 22 10:11:28 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAMIBSja022592 for ; Mon, 22 Nov 2004 10:11:28 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAMIF3gv002879 for ; Mon, 22 Nov 2004 10:15:03 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAMIF38s002877 for cs551@merlot.usc.edu; Mon, 22 Nov 2004 10:15:03 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAMIF2gv002874 for ; Mon, 22 Nov 2004 10:15:02 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAMIF2TI002870 for ; Mon, 22 Nov 2004 10:15:02 -0800 Message-Id: <200411221815.iAMIF2TI002870@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: FileIDRe: FileId Date: Mon, 22 Nov 2004 10:15:02 -0800 From: william@bourbon.usc.edu Someone wrote: > Is that okay? When you store a file each node that caches that > file willl have the same metadata, with the same nonce. My > understanding is that the nonce distinguishes between two store > commands of the same file (same SHA1 hash). So if you do a > "status files" command, all nodes will transmit the metadata for > all files, even cached files that have the same fileId. Same > with a get command, according to what you are saying. > It is not specified (I think), but when a node caches a file in a store > or get command, should it create its own UOID and place it in the > Nonce field of the metadata record? That way each copy, > permanent and stored has a different nonce and prevents status > and get commands from sending multple packets of the same > information. > Does this make sense? A nonce is part of a file's metadata which gets created when a node initiates a STORE. This metadata should never change. A STORE may deposit a file on many nodes via probabilistic flooding. For the sake of argument, let's say that this is the only file in your network. When you do a search, you will get many hits for this file. But, when you do a GET, only one node should respond. So, nonce must not equal to file ID. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Monday, November 22, 2004 8:02 am Subject: Re: FileID > Someone wrote: > > > I know you've mentioned this before, but I want to make sure that > > it is sufficient to use the Nonce of each file as the FileID in a > > status files response message. > > If you have 100 nodes having the same file and you do a GET, > you will end up with all 100 nodes sending the same file to > your node. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Nov 22 08:04:34 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAMG4Yja018991 for ; Mon, 22 Nov 2004 08:04:34 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAMG89gv021452 for ; Mon, 22 Nov 2004 08:08:09 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAMG89fw021444 for cs551@merlot.usc.edu; Mon, 22 Nov 2004 08:08:09 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAMG89gv021441 for ; Mon, 22 Nov 2004 08:08:09 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAMG893D021437 for ; Mon, 22 Nov 2004 08:08:09 -0800 Message-Id: <200411221608.iAMG893D021437@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Nunki is not executing any executables Date: Mon, 22 Nov 2004 08:08:08 -0800 From: william@bourbon.usc.edu Someone wrote: > Nunki is not executing any executable.... > I compiled a simple test program to print a character and it is not doing so Can you execute "ls" or "openssl"? May be this is temporary. May be the swap space is exhausted because too many people running large jobs. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Nov 22 08:02:50 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAMG2oja018927 for ; Mon, 22 Nov 2004 08:02:50 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAMG6Pgv020791 for ; Mon, 22 Nov 2004 08:06:25 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAMG6PqX020789 for cs551@merlot.usc.edu; Mon, 22 Nov 2004 08:06:25 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAMG6Pgv020786 for ; Mon, 22 Nov 2004 08:06:25 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAMG6PPP020782 for ; Mon, 22 Nov 2004 08:06:25 -0800 Message-Id: <200411221606.iAMG6PPP020782@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Illegal Instruction Date: Mon, 22 Nov 2004 08:06:25 -0800 From: william@bourbon.usc.edu Someone wrote: > Suddenly nunki has started giving the following error > > I'm giving a command sv_node ../Servant/16240/start-16240.ini > and it says illegal instruction Regarding illegal instructions, please see: http://merlot.usc.edu/cs551-f04/projects.html#segfault Is malloc() failing and you are not checking the return code? -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Nov 22 08:01:13 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAMG1Dja018862 for ; Mon, 22 Nov 2004 08:01:13 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAMG4mgv020171 for ; Mon, 22 Nov 2004 08:04:48 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAMG4mmr020169 for cs551@merlot.usc.edu; Mon, 22 Nov 2004 08:04:48 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAMG4mgv020160 for ; Mon, 22 Nov 2004 08:04:48 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAMG4mZi020156 for ; Mon, 22 Nov 2004 08:04:48 -0800 Message-Id: <200411221604.iAMG4mZi020156@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: sha1 match for Get/Store Date: Mon, 22 Nov 2004 08:04:48 -0800 From: william@bourbon.usc.edu Someone wrote: > As per specs in FileData field in > get response message (MessageType=0xDB) and > store message (MessageType=0xCC) > > (?)+ File Data The actual file. A node receiving this message > must compute the SHA1 hash value of the file and compare it > against the stored file description. If it does not match, the > file should be discarded. > > I was just wondering, what is the purpose of comparing SHA1 of > the file with the stored file metadata. since we know its a > reliable communication. Please let me know. It's possible that a node is not forwarding properly. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Nov 22 07:59:10 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAMFxAja018767 for ; Mon, 22 Nov 2004 07:59:10 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAMG2jgv019331 for ; Mon, 22 Nov 2004 08:02:45 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAMG2jJD019329 for cs551@merlot.usc.edu; Mon, 22 Nov 2004 08:02:45 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAMG2jgv019326 for ; Mon, 22 Nov 2004 08:02:45 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAMG2jvl019322 for ; Mon, 22 Nov 2004 08:02:45 -0800 Message-Id: <200411221602.iAMG2jvl019322@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: FileID Date: Mon, 22 Nov 2004 08:02:45 -0800 From: william@bourbon.usc.edu Someone wrote: > I know you've mentioned this before, but I want to make sure that > it is sufficient to use the Nonce of each file as the FileID in a > status files response message. If you have 100 nodes having the same file and you do a GET, you will end up with all 100 nodes sending the same file to your node. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Nov 21 21:37:58 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAM5bwja000587 for ; Sun, 21 Nov 2004 21:37:58 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAM5fYgv014357 for ; Sun, 21 Nov 2004 21:41:34 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAM5fYhx014352 for cs551@merlot.usc.edu; Sun, 21 Nov 2004 21:41:34 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAM5fYgv014349 for ; Sun, 21 Nov 2004 21:41:34 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAM5fYgr014345 for ; Sun, 21 Nov 2004 21:41:34 -0800 Message-Id: <200411220541.iAM5fYgr014345@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Certifying command Date: Sun, 21 Nov 2004 21:41:34 -0800 From: william@bourbon.usc.edu Someone wrote: > That makes sense, but the real question is, is this okay?: > SIGN: > openssl smime -sign -in foo -out bar -nocerts -signer cert.pem \ > -inkey /auto/home-scf27/schifman/cs551/sv/n0/private.pem > VERIFY: > openssl smime -verify -noverify -in bar -out /dev/null -signer cert.pem \ > -certfile /auto/home-scf-27/schifman/cs551/sv/n1/files/1.pem > > if 1.pem is a copy of cert.pem on the originating node? I'm sure you can verify if this works or not yourself. Run these commands over the commandline and see if they work. If they don't work, you probably have used the wrong certificate file. You can try all combinations and see which one works for you. And please read my previous e-mail *carefully*. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Sunday, November 21, 2004 8:20 pm Subject: Re: Certifying command > Someone write: > > > For signing a file with openssl, for the "-signer cert.pem" in > > the spec, is that "cert.pem" just a name or does it actually use > > the cert.pem file? > > Yes. You should use the public key certificate of the node. > This may seem a bit redundent. But, to really understand why, > you can read up on Public Key Infrastructure (PKI). > > > The reason I ask is that in the code for my > > command I use a variant of ("%s/cert.pem", homeDir) and would > > then need to explicitly say the same thing on verification. > > You can use the above for signing. To verify digital > signature, you need the certificate of the file and not of > the node. This means that it should be something like > "#.cert" for both the -signer and -certfile arguments in the > "openssl smime -verify" command. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Nov 21 20:17:20 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAM4HJja030764 for ; Sun, 21 Nov 2004 20:17:19 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAM4Kugv002268 for ; Sun, 21 Nov 2004 20:20:56 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAM4KuY7002265 for cs551@merlot.usc.edu; Sun, 21 Nov 2004 20:20:56 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAM4Kugv002262 for ; Sun, 21 Nov 2004 20:20:56 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAM4KupG002258 for ; Sun, 21 Nov 2004 20:20:56 -0800 Message-Id: <200411220420.iAM4KupG002258@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Certifying command Date: Sun, 21 Nov 2004 20:20:56 -0800 From: william@bourbon.usc.edu Someone write: > For signing a file with openssl, for the "-signer cert.pem" in > the spec, is that "cert.pem" just a name or does it actually use > the cert.pem file? Yes. You should use the public key certificate of the node. This may seem a bit redundent. But, to really understand why, you can read up on Public Key Infrastructure (PKI). > The reason I ask is that in the code for my > command I use a variant of ("%s/cert.pem", homeDir) and would > then need to explicitly say the same thing on verification. You can use the above for signing. To verify digital signature, you need the certificate of the file and not of the node. This means that it should be something like "#.cert" for both the -signer and -certfile arguments in the "openssl smime -verify" command. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Nov 21 20:12:03 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAM4C3ja030649 for ; Sun, 21 Nov 2004 20:12:03 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAM4Fdgv029607 for ; Sun, 21 Nov 2004 20:15:39 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAM4Fd5p029605 for cs551@merlot.usc.edu; Sun, 21 Nov 2004 20:15:39 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAM4Fdgv029596 for ; Sun, 21 Nov 2004 20:15:39 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAM4Fdr9029592 for ; Sun, 21 Nov 2004 20:15:39 -0800 Message-Id: <200411220415.iAM4Fdr9029592@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: HEX DUMP Date: Sun, 21 Nov 2004 20:15:39 -0800 From: william@bourbon.usc.edu Someone wrote: > Is there a hexdump utility on nunki that we can use? Please try ~csci551b/bin/hexdump. -- Bill Cheng // bill.cheng@acm.org Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Nov 21 15:13:56 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iALNDuja022038 for ; Sun, 21 Nov 2004 15:13:56 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iALNHXgv006367 for ; Sun, 21 Nov 2004 15:17:33 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iALNHX3j006362 for cs551@merlot.usc.edu; Sun, 21 Nov 2004 15:17:33 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iALNHWgv006359 for ; Sun, 21 Nov 2004 15:17:32 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iALNHWYb006355 for ; Sun, 21 Nov 2004 15:17:32 -0800 Message-Id: <200411212317.iALNHWYb006355@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Storing Certificates Date: Sun, 21 Nov 2004 15:17:32 -0800 From: william@bourbon.usc.edu Someone wrote: > I'm a little unclear about storing certificates. I assume you are talking about a certificate of a node (and not a certificate of a file which is shipped around with STORE and GET). > When we -reset > a node, should we delete and recreate the public and private key > certificates for that node? You should delete *everything* you've generated. So, that includes the private key file and the public key certificate. > If so, any node who has cached files > from this node will not be able to remove them because there is > no longer a valid key to sign for delete messages. Right! This is not a problem because "-reset" is mainly for grading! We will be running "-reset" on all nodes. > Otherwise, do > we just manually create the PEM stuff before starting the node so > that it is not removed. Please clear this up for me. I'm not sure how you can manually create the PEM stuff. If you re-run the command, you will get a different private key file and public key certificate, even if you supply exactly the same input. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Nov 21 13:31:52 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iALLVqja019063 for ; Sun, 21 Nov 2004 13:31:52 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iALLZTgv011014 for ; Sun, 21 Nov 2004 13:35:29 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iALLZTsL011012 for cs551@merlot.usc.edu; Sun, 21 Nov 2004 13:35:29 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iALLZTgv011009 for ; Sun, 21 Nov 2004 13:35:29 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iALLZTPs011005 for ; Sun, 21 Nov 2004 13:35:29 -0800 Message-Id: <200411212135.iALLZTPs011005@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: 551fp - Nonce Date: Sun, 21 Nov 2004 13:35:29 -0800 From: william@bourbon.usc.edu Someone wrote: > Could you please restate the significance of Nonce? Is it only used in > DELETE messages, or also in storing files (Is it only the File ID we are > looking when attempting to store files and index them locally)? It is hard > to absorb all information at once, and I would be glad if you could refresh > my memory. I have used Nonce only for handling DELETE in the project... You can just do a text search with your brower for the word "nonce" in the spec and you should see everything that's related to the nonse. You should see that a nonce is part of a file metadata: http://merlot.usc.edu/cs551-f04/projects/final.html#metadata It's needed for everything that involves the metadata. That includes search response, get response, store, and status response. DELETE needs nonce, but not as part of file metadata. The purpose of nonce is to distinguish different STORE of the same file (if everything else about this file is identical). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Nov 20 21:30:26 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAL5UQja012257 for ; Sat, 20 Nov 2004 21:30:26 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAL5Y5gv012748 for ; Sat, 20 Nov 2004 21:34:05 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAL5Y58x012746 for cs551@merlot.usc.edu; Sat, 20 Nov 2004 21:34:05 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAL5Y5gv012743 for ; Sat, 20 Nov 2004 21:34:05 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAL5Y5mN012739 for ; Sat, 20 Nov 2004 21:34:05 -0800 Message-Id: <200411210534.iAL5Y5mN012739@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CacheSize & PermSize Date: Sat, 20 Nov 2004 21:34:05 -0800 From: william@bourbon.usc.edu Someone wrote: > When the spec refers to the total storage of cached or permanent files - > does this include the certificates and meta data files as well as the data > files or should we only count the data files in computing the amount of > perm/cached data? Just counting data files would be fine. But if you are counting metadata and certificates, that's fine too. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Nov 20 21:25:37 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAL5Pbja012064 for ; Sat, 20 Nov 2004 21:25:37 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAL5TGgv008121 for ; Sat, 20 Nov 2004 21:29:16 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAL5TGao008119 for cs551@merlot.usc.edu; Sat, 20 Nov 2004 21:29:16 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAL5TGgv008113 for ; Sat, 20 Nov 2004 21:29:16 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAL5TG4Z008109 for ; Sat, 20 Nov 2004 21:29:16 -0800 Message-Id: <200411210529.iAL5TG4Z008109@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS551--- error while generating certificate Date: Sat, 20 Nov 2004 21:29:15 -0800 From: william@bourbon.usc.edu Someone wrote: > I'm getting the following error while running the following command > openssl smime -sign -in -out certificate -nocerts -signer cert.pem -inkey private.pem > > Error opening signer certificate cert.pem > 15043:error:02001002:system library:fopen:No such file or directory:bss_file.c:276:fopen('cert.pem','r') > 15043:error:20074002:BIO routines:FILE_CTRL:system lib:bss_file.c:278: > unable to load certificate > > I'm running this command using the "system()" system call. Does the command work if you run it on a commandline? Looks like the error message is saying that it cannot find "cert.pem". Also, you should not be using system() to execute commands. You should use popen() because you can read the result back. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Nov 20 21:22:34 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAL5MYja012000 for ; Sat, 20 Nov 2004 21:22:34 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAL5QDgv005202 for ; Sat, 20 Nov 2004 21:26:13 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAL5QDwi005194 for cs551@merlot.usc.edu; Sat, 20 Nov 2004 21:26:13 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAL5QCgv005191 for ; Sat, 20 Nov 2004 21:26:12 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAL5QCNw005181 for ; Sat, 20 Nov 2004 21:26:12 -0800 Message-Id: <200411210526.iAL5QCNw005181@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Indexing Date: Sat, 20 Nov 2004 21:26:12 -0800 From: william@bourbon.usc.edu Someone wrote: > I'm confused how to handle indexing when the index is the same. > E.g.: My kwrd_index file stores > pairs, but if I store a new file with the same keywords, the > hashtable ignores the new entry because it already has that key. > How can this be handled. I'm not sure what kind of hashtable you are using. But you should use one that supports collisions. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Nov 19 15:14:10 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAJNEAja024775 for ; Fri, 19 Nov 2004 15:14:10 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAJNHqgv020113 for ; Fri, 19 Nov 2004 15:17:52 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAJNHqtW020111 for cs551@merlot; Fri, 19 Nov 2004 15:17:52 -0800 Date: Fri, 19 Nov 2004 15:17:52 -0800 From: william@bourbon.usc.edu Message-Id: <200411192317.iAJNHqtW020111@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: grading for final project part (2)... Hi, Please read this e-mail *carefully* because it affect everyone. I have mentioned in class that I will create and release test cases for the grading of final project part (2) similar to those for part (1): http://merlot.usc.edu/cs551-f04/projects/testcases/part1.html#grading Now I'm deciding against it. I think it's better to release them after the submission deadline and ask you to test your submitted code against them in order to prepare for your demo. But what I do want to mention is that the baseline case for grading of part (2) is the r7 test case posted for part (1): http://merlot.usc.edu/cs551-f04/projects/testcases/r7/ You should: 1) Make sure that your nodes can come up and running with the 6 startup files in ~csci551b/public/final1/r7 on nunki. Please make sure you change the port numbers in both the Port entry in the [init] section and all the entries in the [beacons] section to use your own ports. In this configuration, there are 2 beacon nodes and all non-beacon nodes have InitNeighbors=2 and MinNeighbors=2. 2) Some of you may *not* have JOIN working. I have mentioned in class that if you will lose a lot of points for part (2) if you can only have a *beacons-only* network. *This is still true!* My suggestion was that you should be able to manually create init_neighbor_list in a node's HomeDir and have a non-beacon come up thinking that it has already done a JOIN and start participating in the network. This way, you can have a more useful network. To test this, the grader must be able to manually create init_neighbor_list files. Since there is no specification of the init_neighbor_list file format, this will make the grader's job difficult. Please have a section named "init_neighbor_list file format" in your README file so that the grader can create them manually. Please do so whether you have JOIN working or not. (I've just added a paragraph in the Project Report section of the spec.) IMPORTANT: If your init_neighbor_list is a binary file and cannot be create manually (with a text editor), please send me e-mail ASAP! 3) I've mentioned in class that it's difficult to grade CHECK if your JOIN does *not* work and that you will lose most of the points for CHECK if JOIN does not work. (CHECK is worth 15 points in code and 2 points in documentation.) However, given that you can manually create init_neighbor_list (see (2) above), you can still claim that CHECK is working by doing all the CHECK and delete init_neighbor_list if a CHECK message cannot reach a beacon node. After you have deleted your init_neighbor_list file and restart, you node should fail since your JOIN does not work. At this point, you should print out a message and let the grader know that you know that your JOIN doesn't work and that's why you are shutting down your node and he can add init_neighbor_list to your HomeDir manually. If this is the case, please indicate so in your README file. You will lose 10 points to start with (instead of 17 points). 4) Just want to remind you that the output files for "status" and "get" user commands should go to the current working directory and *not* the node's HomeDir. Similarly, when you do a "store", you should look for the file in the current working directory. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Nov 19 07:42:29 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAJFgTja011863 for ; Fri, 19 Nov 2004 07:42:29 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAJFkCgv013083 for ; Fri, 19 Nov 2004 07:46:12 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAJFkCqT013081 for cs551@merlot.usc.edu; Fri, 19 Nov 2004 07:46:12 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAJFkCgv013078 for ; Fri, 19 Nov 2004 07:46:12 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAJFkCb5013074 for ; Fri, 19 Nov 2004 07:46:12 -0800 Message-Id: <200411191546.iAJFkCb5013074@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: 551 - about GET_REQUEST Date: Fri, 19 Nov 2004 07:46:12 -0800 From: william@bourbon.usc.edu Someone wrote: > This may be a superfluous question, but just wanted to be sure. In the case > of GET, should we still flood the GET_REQ even if the chosen File is being > served at the local node? Yes. > For uniformity we could, however it is unnecessary... Most likely. But you really don't know for sure if there is another file out there with the same file ID (unless you have recorded the fact the the search response you got was from this node). > Also, even if the file is located at some remote peer, we > could send GET_REQ only in the direction of the path (only for the first hop > case) we received the SEARCH_RESP corresponding to that file, instead of > broadcasting it to all our immediate neighbors. GET request must be flooded to the whole network, according to the spec. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Nov 19 07:36:54 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAJFasja011670 for ; Fri, 19 Nov 2004 07:36:54 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAJFebgv007931 for ; Fri, 19 Nov 2004 07:40:37 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAJFeb3k007929 for cs551@merlot.usc.edu; Fri, 19 Nov 2004 07:40:37 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAJFebgv007926 for ; Fri, 19 Nov 2004 07:40:37 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAJFebba007922 for ; Fri, 19 Nov 2004 07:40:37 -0800 Message-Id: <200411191540.iAJFebba007922@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS 551 - Re: Lecture 18 - slide 8 Date: Fri, 19 Nov 2004 07:40:37 -0800 From: william@bourbon.usc.edu Someone wrote: > > You then take the "query bit-vector" and performa a bit-wise > > AND with a "file bit-vector". If the result *equals* the > > "query bit-vector", then you need to do the strcmp(). > > Otherwise, there cannot be a possible match between the > > "query keywords" and the "file keywords". > > I'm a confused with all those ANDs and strcmp(). > What you are saying is that a file will match a search request > only if it has the exactly > same set of keywords (because of the strcmp). > So it seems like the AND operation is an extra step. > > Unless the situation is when the files keywords are "a b c" > and search keywords are "a b". A success search will only need > the AND operation, but then no strcmp() is neccessary. > > Please help me understand which is the desire behavior. Thanks. Let's first understand the spec, and then talk about implementation. Mixing the two is only adding to the confusion. The important thing to understand is that if the user types: search keywords="a b c" the spec says that this means: look for documents with keyword a AND keyword b AND keyword c Step one. We should all agree that this is the spec. (There was a bug on the lecture slide in question. But that has been fixed and you got a one day extension for that.) Step two is to implement this with a simplified Bloom Filter, which we are calling this the bit-vector approach for our project. Once we have reached an agreement in step one above, logically, there is only one correct implementation. (Although there can be few different way to implement this correctly, with different efficiency.) In the past few messages, we have discussed an efficient implementation. Now, let's come back to your last question. It is *possible* that if files keywords are "a b c" and if the search keywords are "x y", and you run the algorithm I mentioned previously, you may get a match (not with these values, but it is possible with some other search keywords). The reason is that we are not taking the whole 20 bytes of SHA1 and the whole 16 bytes of MD5 to construct our bit-vector (which only uses 9 bit of SHA1 and 9 bit of MD5). Therefore, once you get a match, you must do strcmp() and make sure that every word in your search keywords is a file keyword. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Nov 19 07:13:53 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAJFDrja010984 for ; Fri, 19 Nov 2004 07:13:53 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAJFHagv021267 for ; Fri, 19 Nov 2004 07:17:36 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAJFHafm021259 for cs551@merlot.usc.edu; Fri, 19 Nov 2004 07:17:36 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAJFHZgv021256 for ; Fri, 19 Nov 2004 07:17:35 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAJFHZen021249 for ; Fri, 19 Nov 2004 07:17:35 -0800 Message-Id: <200411191517.iAJFHZen021249@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: port problem Date: Fri, 19 Nov 2004 07:17:35 -0800 From: william@bourbon.usc.edu Someone wrote: > Its taking a long time to form connect to any port on nunki. > I thought there is some bug in my code and so I tried: > telnet nunki.usc.edu > usually I get a quick response saying: > Trying 128.125.5.168... > telnet: Unable to connect to remote host: Connection refused > > But at times, it kinda freezes and nothing happens. I have to > wait for a minute or so and try and then it works. > Is this because of the load on nunki? I'm not sure what's causing this. If you suspect it's the load, run "uptime" and see if the load average is large. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Nov 18 21:34:39 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAJ5Ydja026489 for ; Thu, 18 Nov 2004 21:34:39 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAJ5cNgv027028 for ; Thu, 18 Nov 2004 21:38:23 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAJ5cNY2027026 for cs551@merlot.usc.edu; Thu, 18 Nov 2004 21:38:23 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAJ5cNgv027023 for ; Thu, 18 Nov 2004 21:38:23 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAJ5cM97027019 for ; Thu, 18 Nov 2004 21:38:22 -0800 Message-Id: <200411190538.iAJ5cM97027019@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Key conflicts in BST Date: Thu, 18 Nov 2004 21:38:22 -0800 From: william@bourbon.usc.edu Someone wrote: > If a user tries to store two different files with *a same file name* or > *same keywords*, should we produce some Error messages or save it with a > modified new file name? Files in a node's local storage must be named "1.data", "2.data", etc. So, if you only store two files with the same original filename=foo.mp3, these 2 files will be named "1.data" and "2.data". Both "1.meta" and "2.meta" will contains a line that looks like: Filename=foo.mp3\r (I've discussed why it is desirable to have "1.meta" to look exactly like what goes into a message. So I won't elaborate again.) > It may be reasonable to save it anyway with modified file name, but how > about same keywords? > > For example, > > Servant> store foo.mp3 30 type=mp3 > > Servant> store bar.mp3 30 type=mp3 > > These files have exactly same keywords and they will make *same bit > vectors*! It will make a confliction at the kwrd_index BST. > > What should we do in this case? As I have mentioned in class, each node in the BST for the filename index and the SHA1 index should contain a linked list of numbers where a number corresponds to the name of a file in local storage. Filename conflicts and SHA1 conflicts are expected. That's why a linked list is used. To store the bit-vectors, you dont' use a BST. You just use a linked list, one entry per stored file. If 2 files have identical keywords, they will have identical bit-vectors. This is not a conflict. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Nov 18 20:30:23 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAJ4UNja024676 for ; Thu, 18 Nov 2004 20:30:23 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAJ4Y7gv031218 for ; Thu, 18 Nov 2004 20:34:07 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAJ4Y7Mk031216 for cs551@merlot.usc.edu; Thu, 18 Nov 2004 20:34:07 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAJ4Y7gv031213 for ; Thu, 18 Nov 2004 20:34:07 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAJ4Y7ih031209 for ; Thu, 18 Nov 2004 20:34:07 -0800 Message-Id: <200411190434.iAJ4Y7ih031209@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Lecture 18 - slide 8 Date: Thu, 18 Nov 2004 20:34:07 -0800 From: william@bourbon.usc.edu Someone wrote: > I could not understand one thing, > if we are responding search on the basis of if all keywords in query match > with the keywords in file. > why are we only looking for atleast 1 bit set in result of bit vector? This > is the case of keywords logically ORed. > > if we do so in case of logically ANDed keywords ,bit vector will hit for > most of the cases and we need to go for number of unnecessary string > comparison .Infact we should check, if all bits set in bit vector of Query > (all the 1s in query bit vector) matches with file bit vector, then only we > should go for string comparison. You are absolutely right! I don't know why I said it the way I said it. (What I said was true if there is only one search keyword. I guess that must have been the reason why I said it that way.) So, I need to modify the last paragraph in my previous e-mail as follows: You then take the "query bit-vector" and performa a bit-wise AND with a "file bit-vector". If the result *equals* the "query bit-vector", then you need to do the strcmp(). Otherwise, there cannot be a possible match between the "query keywords" and the "file keywords". Thanks for finding my "bug"! -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Thursday, November 18, 2004 7:50 PM Subject: Re: Lecture 18 - slide 8 > Someone wrote: > > > I know there was a problem with this slide, but shouldn't you fix > > it so the keywords are logically "OR'd" not "AND'd" so the > > bitVector is representative of all the keywords. If you > > logically AND all the keywords you probably will end up with all > > 0s. > > The phrase on the slide in question is: > > "search keywords are logically AND'ed" > > It means that when you enter the following search command: > > search keywords="key1 key2 key3" > > you will be looking for a document with keyword key1 AND keyword > key2 AND keyword key3. That's where the "logical AND" comes > in. > > (This is in contrast with doing a search on Google. When you > enter "key1 key2 key3" on Google, you will be looking for a > document with keyword key1 OR keyword key2 OR keyword key3.) > > To implement the AND, you take the bit-vector of key1 and > do a bit-wise OR with the bit-vector of key2. Then you > take the resulting bit-vector and do a bit-wise OR with > the bit-vector of key3! This will be your "query bit-vector". > > You then take the "query bit-vector" and performa a bit-wise > AND with a "file bit-vector". If the result has at least a > 1 on the left side and at least a 1 on the right side, then > you need to do the strcmp(). Otherwise, there cannot be a > possible match between the "query keywords" and the "file > keywords". > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Nov 18 19:46:40 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAJ3keja023401 for ; Thu, 18 Nov 2004 19:46:40 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAJ3oOgv022321 for ; Thu, 18 Nov 2004 19:50:24 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAJ3oOuq022319 for cs551@merlot.usc.edu; Thu, 18 Nov 2004 19:50:24 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAJ3oOgv022316 for ; Thu, 18 Nov 2004 19:50:24 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAJ3oOso022312 for ; Thu, 18 Nov 2004 19:50:24 -0800 Message-Id: <200411190350.iAJ3oOso022312@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Lecture 18 - slide 8 Date: Thu, 18 Nov 2004 19:50:24 -0800 From: william@bourbon.usc.edu Someone wrote: > I know there was a problem with this slide, but shouldn't you fix > it so the keywords are logically "OR'd" not "AND'd" so the > bitVector is representative of all the keywords. If you > logically AND all the keywords you probably will end up with all > 0s. The phrase on the slide in question is: "search keywords are logically AND'ed" It means that when you enter the following search command: search keywords="key1 key2 key3" you will be looking for a document with keyword key1 AND keyword key2 AND keyword key3. That's where the "logical AND" comes in. (This is in contrast with doing a search on Google. When you enter "key1 key2 key3" on Google, you will be looking for a document with keyword key1 OR keyword key2 OR keyword key3.) To implement the AND, you take the bit-vector of key1 and do a bit-wise OR with the bit-vector of key2. Then you take the resulting bit-vector and do a bit-wise OR with the bit-vector of key3! This will be your "query bit-vector". You then take the "query bit-vector" and performa a bit-wise AND with a "file bit-vector". If the result has at least a 1 on the left side and at least a 1 on the right side, then you need to do the strcmp(). Otherwise, there cannot be a possible match between the "query keywords" and the "file keywords". -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Nov 18 19:35:52 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAJ3Zqja023054 for ; Thu, 18 Nov 2004 19:35:52 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAJ3dagv012163 for ; Thu, 18 Nov 2004 19:39:36 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAJ3da9F012161 for cs551@merlot.usc.edu; Thu, 18 Nov 2004 19:39:36 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAJ3dagv012158 for ; Thu, 18 Nov 2004 19:39:36 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAJ3da0P012148 for ; Thu, 18 Nov 2004 19:39:36 -0800 Message-Id: <200411190339.iAJ3da0P012148@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: gdb error: "Program received signal ?, Unknown signal." Date: Thu, 18 Nov 2004 19:39:36 -0800 From: william@bourbon.usc.edu Someone wrote: > This is a follow-up to my previous mail. I recently identified that the > reason I was not able to make GDB start was the OpenSSL library. When I > exclude "-lcrypto" from the library list, GDB 6.0 works just fine, otherwise > it fails with the "Bus Error" without even loading my program fully (the GDB > itself quits with the error). I really am need of the latest GDB as I am > having hard times debugging my code, because earlier versions of GDB (4.16, > 4.18) hangs after receiving "Unknown Signal ?" whenever my program calls > pthread_cancel() - which is crucial point in the execution path of my > design. I have searched through the net and communicated in newsgroups at no > avail. Here is my gcc command: > > gcc -pthreads -o sv_node -g -I/usr/lsd/openssl/0.9.7c/include -D_REENTRANT \ > -L/usr/lsd/openssl/0.9.7c/lib -lpthread -lposix4 -lsocket -lnsl > -lm -lcrypto > > Am I doing anything wrong here? I really have no idea! If you are having trouble with gdb-6.0, you should use the default one (gdb-4.16) *like everyone else*. You can complain to ISD, but I don't think they will be able to help you much. As I have mentioned before, if gdb (4.16) cannot give you a good breakpoint with multi-threaded code, you need to find a way to debug your code without this "feature". -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Sunday, November 14, 2004 12:32 PM Subject: Re: gdb error: "Program received signal ?, Unknown signal." > Someone wrote: > > > Thank you, I have just tried the new gdb version, however even if I > comment > > out *all* the code from my main() method, the gdb fails to execute the > code, > > it quits to the shell with "Bus Error" - it does not execute at all! > All I > > get: > > > > (gdb) run > > Starting program: /.../sv > > Bus error > > nunki.usc.edu(714): > > > > Is this a bug with gdb? I also wrote a "Hello World" application. Only > then > > gdb executes > > the code without bailing out! Is there a problem with libraries I am > > linking? > > I guess if you don't do anything unusual, there should be no problem. > > > I have also tried with gdb 4.18, it runs the code unlike 6.0, however I > > receive the same > > signalling error as before... Also, since DDD (I am also using it) is > based > > on GDB, it > > does not help at all. > > As far as I know, gdb 4.18 may have problems with multi-threaded > code. I was told that ddd works with multi-threaded code. I've > also mentioned that it is possible that you have corrupted the > memory of the debugger and that may be why the debugger is dying. > > All I can see is, "Keey trying." > -- > Bill Cheng // bill.cheng@usc.edu > > > > > ----- Original Message ----- > > From: > > To: > > Sent: Sunday, November 14, 2004 9:02 AM > > Subject: Re: gdb error: "Program received signal ?, Unknown signal." > > > > > > > Someone wrote: > > > > > > > I am having the following error in gdb, and when I "continue" the > gdb > > > hangs, > > > > preventing me to debug my code... I have searched through the net, > > > however > > > > found that this was because of earlier versions of gdb lacking > > > > multithreading support. Is there any way to fix this, or upgrade > the > > > gdb? > > > > The gdb is not able to "handle" signals that is unknown to it, so > it > > > just > > > > hangs, and I couldnot find any way to explicitly ignore the signal > (by > > > > "handle x noprint"), because it does not have any numeric value to > > > > reference! > > > > > > > > The error is: > > > > "Program received signal ?, Unknown signal." in _poll() - that is > deep > > > in > > > > the stack of the system call select(), nothing to do directly with > my > > > own > > > > code. > > > > > > > > I would appreciate if you could give any workaround, if any. > > > > > > Please see my message with timestamp "Wed 20 Oct 22:24". On nunki, > > > ddd is at: > > > > > > /usr/usc/ddd/default/bin/ddd > > > > > > A newer gdb is at: > > > > > > /usr/usc/gnu/gdb/6.0/bin/gdb > > > > > > I don't know how well either of them work, so I don't know > > > if either of them would help you find your bug. (Please note > > > that it is possible that you have corrupted the memory of the > > > debugger.) > > > -- > > > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Nov 18 14:08:56 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAIM8uja013788 for ; Thu, 18 Nov 2004 14:08:56 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAIMCegv023853 for ; Thu, 18 Nov 2004 14:12:40 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAIMCeu4023851 for cs551@merlot.usc.edu; Thu, 18 Nov 2004 14:12:40 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAIMCegv023848 for ; Thu, 18 Nov 2004 14:12:40 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAIMCe0G023844 for ; Thu, 18 Nov 2004 14:12:40 -0800 Message-Id: <200411182212.iAIMCe0G023844@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Probabalistic Flooding of Store Date: Thu, 18 Nov 2004 14:12:40 -0800 From: william@bourbon.usc.edu Someone wrote: > I understand that if a node receives a store request it is supposed to flip > a coin with probablity of success NeighborStorProb to decide whether or not > to send the store to its neighbors. But how about the node that is > initiating the store. Does is also probabalitically flood the store or does > it send it to all its neighbors? The node that initiates the STORE should do the same thing. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Nov 18 11:59:52 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAIJxqja010087 for ; Thu, 18 Nov 2004 11:59:52 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAIK3bgv009194 for ; Thu, 18 Nov 2004 12:03:37 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAIK3bit009192 for cs551@merlot.usc.edu; Thu, 18 Nov 2004 12:03:37 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAIK3bgv009189 for ; Thu, 18 Nov 2004 12:03:37 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAIK3bro009185 for ; Thu, 18 Nov 2004 12:03:37 -0800 Message-Id: <200411182003.iAIK3bro009185@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: files in current working directory Date: Thu, 18 Nov 2004 12:03:37 -0800 From: william@bourbon.usc.edu Someone wrote: > Two Questions ... > > Question 1: > > I could not understand why do I need to call getcwd() at all. > > lets say sv_node is in /usr/bin , and .ini file is in > /home/scf-22/csci551b/tmp/final1 > > CASE1) user can run > /usr/bin/sv_node /home/scf-22/csci551b/tmp/final1/n00.ini > > CASE 2) > Or if pwd is /home/scf-22/csci551b/tmp/final1/ > /usr/bin/sv_node n00.ini > > CASE3) > > Or if pwd /home/scf-22/csci551b/tmp > > /usr/bin/sv_node final/n00.ini And case 4: pwd is /home/scf-22/csci551b/tmp and you run: sv_node /home/scf-22/csci551b/tmp/final1/n00.ini > in all three cases i will do fopen(filename ... Because sv_node is > anyway running in cwd. I assume by "filename", you mean "n00.ini". Then you are correct that if you just do fopen(filename, ...), it will work. When you need to create a file for output, you can also just do fopen(output_filename, ...), *if* you have *not* changed your working directory. If you plan to change your working directory, you should remember where you were. (In your example, since you cannot write to /home/scf-22/csci551b/tmp, you should let your user know when you cannot create a file there.) > Question 2: > ----------------- > > while sending to network or in the metadata, "Filename=" is absolute > path(with directory ) or just the filename ? > e.g. Filename = /home/scf-22/csci551b/tmp/blondie.mp3 > or Filename = blondie.mp3 Filename is just the *name* of the file. You should not have any path information in it. (If by mistake you have the path in it, I think it should also work.) -- Bill Cheng // bill.cheng@usc.edu > > ----- Original Message ----- > > From: william@bourbon.usc.edu > > Date: Tuesday, November 9, 2004 11:23 pm > > Subject: Re: files in current working directory > > > > > Someone wrote: > > > > > > > From the spec: > > > > Otherwise, foo is relative to the user's current working > > > > directory. > > > > > > > > Is this the directory from which "sv_node" runs or is it the home > > > > directory specified in the .ini file? > > > > > > It's the current working directory. Just call getcwd() or getwd() > > > to get the current working directory. > > > > > > (Imagine that your sv_node is installed in something like /usr/bin > > > and anyone can run it.) > > > -- > > > Bill Cheng // bill.cheng@usc.edu > > > Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Nov 18 11:51:43 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAIJphja009870 for ; Thu, 18 Nov 2004 11:51:43 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAIJtSgv006143 for ; Thu, 18 Nov 2004 11:55:28 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAIJtSDE006141 for cs551@merlot.usc.edu; Thu, 18 Nov 2004 11:55:28 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAIJtRgv006138 for ; Thu, 18 Nov 2004 11:55:27 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAIJtRZM006134 for ; Thu, 18 Nov 2004 11:55:27 -0800 Message-Id: <200411181955.iAIJtRZM006134@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: TCP as QoS Date: Thu, 18 Nov 2004 11:55:27 -0800 From: william@bourbon.usc.edu Someone wrote: > This question may be a bit out of date. In Lecture 12-Slide 12: > Does TCP provide Quality of Service Guarantees - N > But if one has a MPLS (MultiProtocol Label Switching) network, > then use of FEC (Forward Equivalence Clas )will allow QoS > (Quality of Service) levels to be guaranteed. > (Reference: > http://dictionary.reference.com/search?q=multiprotocol%20label%20switching) > So it implies that TCP alone cannot provide QoS, but with > advanced protocols (like MPLS) built on top of TCP, we can have > QoS? I'm not too familiar with MPLS... I'm not sure why you would run TCP over MPLS if you want QoS Guarantees. If you have a network that provide Integrated Service with guaranteed service, I'm also not sure why you would run TCP over it. Usually, when people talk about TCP, they mean TCP over IP. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Nov 17 23:04:26 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAI74Qja019918 for ; Wed, 17 Nov 2004 23:04:26 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAI78Cgv023126 for ; Wed, 17 Nov 2004 23:08:12 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAI78CnQ023122 for cs551@merlot.usc.edu; Wed, 17 Nov 2004 23:08:12 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAI78Cgv023118 for ; Wed, 17 Nov 2004 23:08:12 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAI78C9v023114 for ; Wed, 17 Nov 2004 23:08:12 -0800 Message-Id: <200411180708.iAI78C9v023114@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: search keywords Date: Wed, 17 Nov 2004 23:08:12 -0800 From: william@bourbon.usc.edu Someone wrote: > Yes, I did read the slides.... but I got confused because: > From the Slide: keywords are logically OR'ed > From the Project Description: > To search for a file with keywords key1, key2, and key3, the user > should enter: > search keywords="key1 key2 key3" > > The *and* word is in bold and confused me. > Anyways, now I understand that it should be logically OR'ed. Hmm... You are correct that this is confusing. The spec is correct! The slide is wrong! I've just updated it. Since this may have affected things somewhat, I'm extending the deadline by one day! Thanks for catching this bug! And in your previous e-mail, you are correct that the search should fail. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Thursday, November 18, 2004 11:05 am Subject: Re: search keywords > Someone wrote: > > > From the spec; > > To search for a file with keywords key1, key2, and key3, the user should > > enter: > > search keywords="key1 key2 key3" > > > > If a file is stored with the keywords "Bryan Adams" > > and the user enters the following: > > search keywords "Bryan Adams Songs" > > > > The result for the above search would be negative - ie. no match > > found, as all keywords entered by the user are not present. > > Am I correct, wrong, terribly mistaken? > > Please see slide 8 of lecture 18. > -- > Bill Cheng // bill.cheng@usc.edu > > Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Nov 17 22:49:50 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAI6noja019340 for ; Wed, 17 Nov 2004 22:49:50 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAI6ragv009370 for ; Wed, 17 Nov 2004 22:53:36 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAI6raMT009365 for cs551@merlot.usc.edu; Wed, 17 Nov 2004 22:53:36 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAI6ragv009362 for ; Wed, 17 Nov 2004 22:53:36 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAI6ran0009352 for ; Wed, 17 Nov 2004 22:53:36 -0800 Message-Id: <200411180653.iAI6ran0009352@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: search keywords Date: Wed, 17 Nov 2004 22:53:36 -0800 From: william@bourbon.usc.edu Someone wrote: > In Store command all the words are keyword as you said in class. > e.g. > > store abc.mp3 30 categories="audio mp3" artist="Blondie" title="Heart of > Glass" > > KEYWORDS->>>categories audio mp3 artist Blondie title Heart of Glass Correct! > How about Search command > > search keywords="categories="audio mp3" artist="Blondie" title="Heart of > Glass"" > > it this a valid command ? The above has ambiguous syntax because of the way you use double-quotes. You can either flat it as error. Or you can look for the 2nd double-quote to end the list of keywords. In this case, the above is the same as: search keywords="categories=" If you replace '=' by a space character, you will be only searching for "categories". > if it is then what should be the keywords ?? .. > 1) same as above ? > OR > 2) key1 = categories="audio mp3" > key2 = artist="Blondie" > key3 = title="Heart of Glass" If you enter something that doesn't make sense, you don't have to parse some sense out of it! Please remember that we don't have a GUI, so we have to follow some standard syntactic rules when you enter something on a input line. One standard way of putting a double-quote character between a pair of outer double-quotes is to "escape" the inner double-quote character. You should define your escape sequence if you want this to be a "language". But this may be an overkill. Therefore, I would just do the simple thing and find the next double-quote and end the search keywords (and basically disallowing double-quote characters between the outer double-quotes). Don't make this too complicated. Just be robust and display good error messages. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Wednesday, November 17, 2004 9:35 PM Subject: Re: search keywords > Someone wrote: > > > From the spec; > > To search for a file with keywords key1, key2, and key3, the user should > > enter: > > search keywords="key1 key2 key3" > > > > If a file is stored with the keywords "Bryan Adams" > > and the user enters the following: > > search keywords "Bryan Adams Songs" > > > > The result for the above search would be negative - ie. no match > > found, as all keywords entered by the user are not present. > > Am I correct, wrong, terribly mistaken? > > Please see slide 8 of lecture 18. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Nov 17 21:33:42 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAI5Xgja017171 for ; Wed, 17 Nov 2004 21:33:42 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAI5bSgv001147 for ; Wed, 17 Nov 2004 21:37:28 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAI5bSDL001139 for cs551@merlot.usc.edu; Wed, 17 Nov 2004 21:37:28 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAI5bSgv001136 for ; Wed, 17 Nov 2004 21:37:28 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAI5bSNi001132 for ; Wed, 17 Nov 2004 21:37:28 -0800 Message-Id: <200411180537.iAI5bSNi001132@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: search response locally Date: Wed, 17 Nov 2004 21:37:28 -0800 From: william@bourbon.usc.edu Someone wrote: > I want to know, whether search response should display results from local > node's file system too? > Right now I am flooding request to other nodes and getting response from > other nodes only. I am not searching on local node. Is it fine? Of course it's not fine! If a node is storing 100,000 files, how can the node's user know what's in its storage? You must also search the node you are interacting with. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Nov 17 21:31:50 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAI5Voja017107 for ; Wed, 17 Nov 2004 21:31:50 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAI5Zbgv031810 for ; Wed, 17 Nov 2004 21:35:37 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAI5ZbAD031799 for cs551@merlot.usc.edu; Wed, 17 Nov 2004 21:35:37 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAI5Zagv031796 for ; Wed, 17 Nov 2004 21:35:37 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAI5Zapg031792 for ; Wed, 17 Nov 2004 21:35:36 -0800 Message-Id: <200411180535.iAI5Zapg031792@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: search keywords Date: Wed, 17 Nov 2004 21:35:36 -0800 From: william@bourbon.usc.edu Someone wrote: > From the spec; > To search for a file with keywords key1, key2, and key3, the user should > enter: > search keywords="key1 key2 key3" > > If a file is stored with the keywords "Bryan Adams" > and the user enters the following: > search keywords "Bryan Adams Songs" > > The result for the above search would be negative - ie. no match > found, as all keywords entered by the user are not present. > Am I correct, wrong, terribly mistaken? Please see slide 8 of lecture 18. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Nov 17 16:46:11 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAI0kBja009014 for ; Wed, 17 Nov 2004 16:46:11 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAI0nwgv015706 for ; Wed, 17 Nov 2004 16:49:58 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAI0nwC0015704 for cs551@merlot.usc.edu; Wed, 17 Nov 2004 16:49:58 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAI0nwgv015698 for ; Wed, 17 Nov 2004 16:49:58 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAI0nwvF015691 for ; Wed, 17 Nov 2004 16:49:58 -0800 Message-Id: <200411180049.iAI0nwvF015691@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Certificates Date: Wed, 17 Nov 2004 16:49:58 -0800 From: william@bourbon.usc.edu Someone wrote: > I'm a little confused. > Is it appropriate when a 'store' command is issued to have > every node that caches the file to also cache a file.pem as > the public key certificate? Yes. That's what I have suggested. > Example: > 1) node1>store foo > 2) node1 creates and copies > homeDir/files/1.data > homeDir/files/1.meta I would also copy the public key certificate as "1.pem". Again, simplicity and uniformity. > 3)node1 probabalistically floods store message > 4)node2 receives store message and stores > homeDir/files/3.data (just happened to be on 3 for file count) > homeDir/files/3.meta > homeDir/files/3.pem > > And then the signed spec is only created when node1 calls a > 'delete foo' command. Yes. (I guess if you want to pre-create these files and store them, that would be fine too.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Nov 17 16:42:31 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAI0gVja008899 for ; Wed, 17 Nov 2004 16:42:31 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAI0kIgv014340 for ; Wed, 17 Nov 2004 16:46:18 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAI0kIvN014338 for cs551@merlot.usc.edu; Wed, 17 Nov 2004 16:46:18 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAI0kHgv014335 for ; Wed, 17 Nov 2004 16:46:17 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAI0kHeJ014331 for ; Wed, 17 Nov 2004 16:46:17 -0800 Message-Id: <200411180046.iAI0kHeJ014331@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: search response Date: Wed, 17 Nov 2004 16:46:17 -0800 From: william@bourbon.usc.edu Someone wrote: > I was confused by what was said in calss and the lack of it > in the spec. We are allowed to store such info in a file or > are we limited to the specified files. The specified files are required. You can add anything else you want into your mini-filesystem. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Wednesday, November 17, 2004 4:18 pm Subject: Re: search response > Someone wrote: > > > I still am a little confused here. > > > > A network is running. there are 2 beacons and 4 nodes otherwise. > > One node dies, because it has a very small auto shut down time(or > > any other reason). When that node is started again. The Linked > > lists for its connections are made again(JOIN), then the file > > requests that were made in the previous run of that node, do > > those exist for this node. SO the node gets a new store request > > it just overwrites the existing meta files,data files and the > > index files etc. > > > > On a restart I start my file no =1 and there fore all store > > requests will be with names as 1.* so on. Is this correct. > > No. I've mentioned this in class, you must store the > largested number you've used in a file somewhere in your > HomeDir. (I probably misunderstood what you asked previously.) > When a node restarts, it must read this value from a file. > The only time you can reuse the numbers is when you have > issued a "-reset". > -- > Bill Cheng // bill.cheng@usc.edu > > > > > ----- Original Message ----- > From: william@bourbon.usc.edu > Date: Wednesday, November 17, 2004 3:25 pm > Subject: Re: search response > > > Someone wrote: > > > > > I still have few questions in case of search response. > > > > > > AS per your response, > > > "When you create 1.data, you can call GetUOID() and > > > > >> > create 1.fileid. This fileID should be global unique > > > > >> > (with high probability)." > > > > > > 1)For the restarting nodes, Do I delete all the files like > > 1.fileID > 2.fileID and create a new .fileId file for all > the > > existing files.?? > > > Or I can keep fileIDs in memory but still I do need to > > generate all the > > > fileIDs when a node restarts depending upon how many files > are > > existing in > > > that node. Am I right? > > > > If you use #.fileid, they don't need to be recreated every time > > you restart a node because (you can fill in the answer here). > > As I've mentioned in a previous message, you don't even need > > these files and just keep the file IDs in memory. > > > > Actually, you can take this one step further. You can generate > > file IDs for files that you are including in your search response! > > You can keep the file ID to file name (1.data) mapping in a > > linked-list. So, even if you are storing 100,000 files, this > > linked-list may be very short! > > > > > 2) search result should stop printing on control_c. It > means, > > each result > > > is printed just after you received the response. Its not > like > > a node waits > > > for some time and then all the results are printed. > > > > You should print as soon as you get a response. > > > > > 3)In get request FileID in entered and node sends this > request to > > > particular node which sends this FileID, So on receiving > get > > req, node > > > need to search for the index of file based on asked > fileId. > > Linear search > > > is Ok or should I search this too via binary tree?? > > > > Linear search is okay. If you do what I mentioned above, you > > can see that it's not a problem! > > -- > > Bill Cheng // bill.cheng@usc.edu > > > > > > > > > > ----- Original Message ----- > > From: > > To: > > Sent: Wednesday, November 17, 2004 9:58 AM > > Subject: Re: search response > > > > > > > Someone wrote: > > > > > > > So every node has its own uoid for the same file across > > several > > nodes... > > > > > > Yes. If there is 100 copies of a file, when you do a SEARCH, > > > you will get 100 hits. The idea here is that when you do a > > > GET, you will only get 1 response. > > > > > > > Everything else is the same. Also about restarting > nodes. > > When a > > > > node restarts it has to start storing files from the > last > > file no+1? > > > > > > No. If you give the node instance ID, then GetUOID() will > return > > a different value every time you call it. Look at > the code and > > > convince yourself that it works like this. > > > -- > > > Bill Cheng // bill.cheng@usc.edu > > > > > > > > > > > > >>-----Original Message----- > > > >>From: william@bourbon.usc.edu [william@bourbon.usc.edu] > > > >>Sent: Tuesday, November 16, 2004 11:08 PM > > > >>To: cs551@bourbon.usc.edu > > > >>Subject: Re: search response > > > >> > > > >>Someone wrote: > > > >> > > > >> > I'm confused about this 1.fileid. Why is this needed? > > > >> > > > >>It's *not* needed (that's why I said "can"). > > > >> > > > >>Come to think of it, a fileID can even exist only in > memory. > > >>-- > > > >>Bill Cheng // bill.cheng@usc.edu > > > > > > >> > > > >> > > > >> > > > >> > > > >> ----- Original Message ----- > > > >> From: william@bourbon.usc.edu > > > >> Date: Tuesday, November 16, 2004 9:18 pm > > > >> Subject: Re: search response > > > >> > > > >> > Someone wrote: > > > >> > > > > >> > > In the search response, fields 51-70 correspond > to > > a UOID > > > >> > > that identifies a file. Is this Nonce? > > > >> > > > > >> > No. When you create 1.data, you can call GetUOID() and > > > >> > create 1.fileid. This fileID should be global unique > > > >> > (with high probability). > > > >> > > > > >> > So, if you have a unique file (identified by its > filename, > > >> > SHA1, and nonce) and it is stored on > multiple nodes. All > > > >> > these files will have the same filename, SHA1, and > nonce. > > >> > But each of them will have a different fileID. > > > >> > -- > > > >> > Bill Cheng // bill.cheng@usc.edu > > > >> Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Nov 17 16:14:59 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAI0Exja008007 for ; Wed, 17 Nov 2004 16:14:59 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAI0Ikgv004241 for ; Wed, 17 Nov 2004 16:18:46 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAI0Ij0d004239 for cs551@merlot.usc.edu; Wed, 17 Nov 2004 16:18:46 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAI0Ijgv004236 for ; Wed, 17 Nov 2004 16:18:45 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAI0Ij3f004232 for ; Wed, 17 Nov 2004 16:18:45 -0800 Message-Id: <200411180018.iAI0Ij3f004232@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: search response Date: Wed, 17 Nov 2004 16:18:45 -0800 From: william@bourbon.usc.edu Someone wrote: > I still am a little confused here. > > A network is running. there are 2 beacons and 4 nodes otherwise. > One node dies, because it has a very small auto shut down time(or > any other reason). When that node is started again. The Linked > lists for its connections are made again(JOIN), then the file > requests that were made in the previous run of that node, do > those exist for this node. SO the node gets a new store request > it just overwrites the existing meta files,data files and the > index files etc. > > On a restart I start my file no =1 and there fore all store > requests will be with names as 1.* so on. Is this correct. No. I've mentioned this in class, you must store the largested number you've used in a file somewhere in your HomeDir. (I probably misunderstood what you asked previously.) When a node restarts, it must read this value from a file. The only time you can reuse the numbers is when you have issued a "-reset". -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Wednesday, November 17, 2004 3:25 pm Subject: Re: search response > Someone wrote: > > > I still have few questions in case of search response. > > > > AS per your response, > > "When you create 1.data, you can call GetUOID() and > > > >> > create 1.fileid. This fileID should be global unique > > > >> > (with high probability)." > > > > 1)For the restarting nodes, Do I delete all the files like > 1.fileID > 2.fileID and create a new .fileId file for all the > existing files.?? > > Or I can keep fileIDs in memory but still I do need to > generate all the > > fileIDs when a node restarts depending upon how many files are > existing in > > that node. Am I right? > > If you use #.fileid, they don't need to be recreated every time > you restart a node because (you can fill in the answer here). > As I've mentioned in a previous message, you don't even need > these files and just keep the file IDs in memory. > > Actually, you can take this one step further. You can generate > file IDs for files that you are including in your search response! > You can keep the file ID to file name (1.data) mapping in a > linked-list. So, even if you are storing 100,000 files, this > linked-list may be very short! > > > 2) search result should stop printing on control_c. It means, > each result > > is printed just after you received the response. Its not like > a node waits > > for some time and then all the results are printed. > > You should print as soon as you get a response. > > > 3)In get request FileID in entered and node sends this request to > > particular node which sends this FileID, So on receiving get > req, node > > need to search for the index of file based on asked fileId. > Linear search > > is Ok or should I search this too via binary tree?? > > Linear search is okay. If you do what I mentioned above, you > can see that it's not a problem! > -- > Bill Cheng // bill.cheng@usc.edu > > > > > ----- Original Message ----- > From: > To: > Sent: Wednesday, November 17, 2004 9:58 AM > Subject: Re: search response > > > > Someone wrote: > > > > > So every node has its own uoid for the same file across > several > > nodes... > > > > Yes. If there is 100 copies of a file, when you do a SEARCH, > > you will get 100 hits. The idea here is that when you do a > > GET, you will only get 1 response. > > > > > Everything else is the same. Also about restarting nodes. > When a > > > node restarts it has to start storing files from the last > file no+1? > > > > No. If you give the node instance ID, then GetUOID() will return > > a different value every time you call it. Look at the code and > > convince yourself that it works like this. > > -- > > Bill Cheng // bill.cheng@usc.edu > > > > > > > > >>-----Original Message----- > > >>From: william@bourbon.usc.edu [william@bourbon.usc.edu] > > >>Sent: Tuesday, November 16, 2004 11:08 PM > > >>To: cs551@bourbon.usc.edu > > >>Subject: Re: search response > > >> > > >>Someone wrote: > > >> > > >> > I'm confused about this 1.fileid. Why is this needed? > > >> > > >>It's *not* needed (that's why I said "can"). > > >> > > >>Come to think of it, a fileID can even exist only in memory. > > >>-- > > >>Bill Cheng // bill.cheng@usc.edu > > > > >> > > >> > > >> > > >> > > >> ----- Original Message ----- > > >> From: william@bourbon.usc.edu > > >> Date: Tuesday, November 16, 2004 9:18 pm > > >> Subject: Re: search response > > >> > > >> > Someone wrote: > > >> > > > >> > > In the search response, fields 51-70 correspond to > a UOID > > >> > > that identifies a file. Is this Nonce? > > >> > > > >> > No. When you create 1.data, you can call GetUOID() and > > >> > create 1.fileid. This fileID should be global unique > > >> > (with high probability). > > >> > > > >> > So, if you have a unique file (identified by its filename, > > >> > SHA1, and nonce) and it is stored on multiple nodes. All > > >> > these files will have the same filename, SHA1, and nonce. > > >> > But each of them will have a different fileID. > > >> > -- > > >> > Bill Cheng // bill.cheng@usc.edu > > >> Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Nov 17 15:21:26 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAHNLQja006458 for ; Wed, 17 Nov 2004 15:21:26 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAHNPEgv016954 for ; Wed, 17 Nov 2004 15:25:14 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAHNPEre016952 for cs551@merlot.usc.edu; Wed, 17 Nov 2004 15:25:14 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAHNPDgv016949 for ; Wed, 17 Nov 2004 15:25:13 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAHNPDNw016945 for ; Wed, 17 Nov 2004 15:25:13 -0800 Message-Id: <200411172325.iAHNPDNw016945@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: search response Date: Wed, 17 Nov 2004 15:25:13 -0800 From: william@bourbon.usc.edu Someone wrote: > I still have few questions in case of search response. > > AS per your response, > "When you create 1.data, you can call GetUOID() and > > >> > create 1.fileid. This fileID should be global unique > > >> > (with high probability)." > > 1)For the restarting nodes, Do I delete all the files like 1.fileID > 2.fileID and create a new .fileId file for all the existing files.?? > Or I can keep fileIDs in memory but still I do need to generate all the > fileIDs when a node restarts depending upon how many files are existing in > that node. Am I right? If you use #.fileid, they don't need to be recreated every time you restart a node because (you can fill in the answer here). As I've mentioned in a previous message, you don't even need these files and just keep the file IDs in memory. Actually, you can take this one step further. You can generate file IDs for files that you are including in your search response! You can keep the file ID to file name (1.data) mapping in a linked-list. So, even if you are storing 100,000 files, this linked-list may be very short! > 2) search result should stop printing on control_c. It means, each result > is printed just after you received the response. Its not like a node waits > for some time and then all the results are printed. You should print as soon as you get a response. > 3)In get request FileID in entered and node sends this request to > particular node which sends this FileID, So on receiving get req, node > need to search for the index of file based on asked fileId. Linear search > is Ok or should I search this too via binary tree?? Linear search is okay. If you do what I mentioned above, you can see that it's not a problem! -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Wednesday, November 17, 2004 9:58 AM Subject: Re: search response > Someone wrote: > > > So every node has its own uoid for the same file across several > > nodes... > > Yes. If there is 100 copies of a file, when you do a SEARCH, > you will get 100 hits. The idea here is that when you do a > GET, you will only get 1 response. > > > Everything else is the same. Also about restarting nodes. When a > > node restarts it has to start storing files from the last file no+1? > > No. If you give the node instance ID, then GetUOID() will return > a different value every time you call it. Look at the code and > convince yourself that it works like this. > -- > Bill Cheng // bill.cheng@usc.edu > > > > >>-----Original Message----- > >>From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] > >>Sent: Tuesday, November 16, 2004 11:08 PM > >>To: cs551@bourbon.usc.edu > >>Subject: Re: search response > >> > >>Someone wrote: > >> > >> > I'm confused about this 1.fileid. Why is this needed? > >> > >>It's *not* needed (that's why I said "can"). > >> > >>Come to think of it, a fileID can even exist only in memory. > >>-- > >>Bill Cheng // bill.cheng@usc.edu > > >> > >> > >> > >> > >> ----- Original Message ----- > >> From: william@bourbon.usc.edu > >> Date: Tuesday, November 16, 2004 9:18 pm > >> Subject: Re: search response > >> > >> > Someone wrote: > >> > > >> > > In the search response, fields 51-70 correspond to a UOID > >> > > that identifies a file. Is this Nonce? > >> > > >> > No. When you create 1.data, you can call GetUOID() and > >> > create 1.fileid. This fileID should be global unique > >> > (with high probability). > >> > > >> > So, if you have a unique file (identified by its filename, > >> > SHA1, and nonce) and it is stored on multiple nodes. All > >> > these files will have the same filename, SHA1, and nonce. > >> > But each of them will have a different fileID. > >> > -- > >> > Bill Cheng // bill.cheng@usc.edu > >> Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 17 12:33:30 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAHKXUja000895 for ; Wed, 17 Nov 2004 12:33:30 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAHKbIgv019936 for ; Wed, 17 Nov 2004 12:37:18 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAHKbIca019934 for cs551@merlot; Wed, 17 Nov 2004 12:37:18 -0800 Date: Wed, 17 Nov 2004 12:37:18 -0800 From: william@bourbon.usc.edu Message-Id: <200411172037.iAHKbIca019934@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: question about creating private key and certificate... Hi, Someone asked me right after class about what to do with all the openssl printout when you run the "openssl req" command. I said that it was okay to have it displayed on the terminal since this is done when a node starts and not every time. So, you don't *have to* hide all these openssl messages. But you should print something like "creating private key and public key certificate..." right before you invoke the "openssl req" command. It's always good to inform your user what your program is doing, if you think your user is going to wonder about it. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Nov 17 10:10:02 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAHIA2ja030261 for ; Wed, 17 Nov 2004 10:10:02 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAHIDngv032376 for ; Wed, 17 Nov 2004 10:13:49 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAHIDnLF032374 for cs551@merlot.usc.edu; Wed, 17 Nov 2004 10:13:49 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAHIDngv032368 for ; Wed, 17 Nov 2004 10:13:49 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAHIDn8J032361 for ; Wed, 17 Nov 2004 10:13:49 -0800 Message-Id: <200411171813.iAHIDn8J032361@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: delete and status files Date: Wed, 17 Nov 2004 10:13:49 -0800 From: william@bourbon.usc.edu Someone wrote: > When a node sends out a delete msg, it removes its own copy too right? Sure! It removes its own copy within its HomeDir. > I forgot what we should do with a "status files" message? can't find it in > the spec. If you look the message format for status response messages, you will see that each file has 2 fields, namely, FileID and Metadata. So, just do something reasonable to display this information so that the grader can see what you are getting. For example, if a node has 2 files, you can print the following to stdout: nunki.usc.edu:12345 [1] 1238ab812837... [metadata] FileName=... ... [2] af8271639485... [metadata] FileName=... -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Nov 17 10:03:19 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAHI3Jja030085 for ; Wed, 17 Nov 2004 10:03:19 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAHI77gv029762 for ; Wed, 17 Nov 2004 10:07:07 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAHI77NH029757 for cs551@merlot.usc.edu; Wed, 17 Nov 2004 10:07:07 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAHI76gv029754 for ; Wed, 17 Nov 2004 10:07:06 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAHI765W029750 for ; Wed, 17 Nov 2004 10:07:06 -0800 Message-Id: <200411171807.iAHI765W029750@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Get message Date: Wed, 17 Nov 2004 10:07:06 -0800 From: william@bourbon.usc.edu Someone wrote: > I'd just realized there is also another thing that is not > mentioned in the spec about the GET. When I received the get > response, besides creating a cached entry for it, should I create > a file in the working directory using the filename as indicated > in the metadata? Of course! I thought that's implied. When you do a GET with google or napster, you do get a copy of the file that you can view or playback. > Generally, storage inside the file system > directory is meaningless to end user, the get command should be > doing something about extracting a real file such that user could > use it. After you've created a file (such as 1.data), just copy it to your current directory. This should be straightforward. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Tuesday, November 16, 2004 9:22 pm Subject: Re: Writing out indexes > Someone wrote: > > > From your response to the email: > > > Just STORE and DELETE. On GET, you don't need to do it. > > > > I think the index files need to be updated when a node > receives a GET > > response. There are 2 cases: when a node is forwarding the the > GET > > response it might cache the file and when the node that > initiates the > > GET request. In both cases the file retrieved is store so the > index files > > need to be updated as well. > > (I'm assuming that the node initiating the GET request also > puts a copy > > in the cache in addition to passing the file to the user.) > > You are correct, I forgot about this. GET can add files > to a node. > > GET is relative infrequent compare to SEARCH. This kind > of P2P network needs to be optimized for SEARCH. > -- > Bill Cheng // bill.cheng@usc.edu > > > > ----- Original Message ----- > From: william@bourbon.usc.edu > Date: Tuesday, November 16, 2004 1:04 pm > Subject: Re: Writing out indexes > > > Someone wrote: > > > > > This is probably a silly question at this point, but I need to > > > ask it: > > > Can we keep our index structures in memory as long as the node > > > process is running or do we have to update the indices and > write > > them out to disk for every store, get, or remove > operation? > > > Just STORE and DELETE. On GET, you don't need to do it. > > > > > It seems to be much easier just to implement each index as a > > > HashTable and deserialize them at node startup and > serialize them > > > back only when a node shuts down. This follows the O(n) rule. > > > > But what if you have a crash between startup and shutdown? > > Your index file will not match what's stored on the node. > > > > As far as coding goes, it should be no problem to write > > out the index when you finish a STORE or a DELETE. Yes, > > it's kind of inefficient. But since STORE and DELETE are > > infrequent, this is fine (for this project). > > -- > > Bill Cheng // bill.cheng@usc.edu > > Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Nov 17 09:55:09 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAHHt9ja029905 for ; Wed, 17 Nov 2004 09:55:09 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAHHwugv026755 for ; Wed, 17 Nov 2004 09:58:56 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAHHwuZQ026753 for cs551@merlot.usc.edu; Wed, 17 Nov 2004 09:58:56 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAHHwugv026750 for ; Wed, 17 Nov 2004 09:58:56 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAHHwuU6026746 for ; Wed, 17 Nov 2004 09:58:56 -0800 Message-Id: <200411171758.iAHHwuU6026746@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: search response Date: Wed, 17 Nov 2004 09:58:56 -0800 From: william@bourbon.usc.edu Someone wrote: > So every node has its own uoid for the same file across several > nodes... Yes. If there is 100 copies of a file, when you do a SEARCH, you will get 100 hits. The idea here is that when you do a GET, you will only get 1 response. > Everything else is the same. Also about restarting nodes. When a > node restarts it has to start storing files from the last file no+1? No. If you give the node instance ID, then GetUOID() will return a different value every time you call it. Look at the code and convince yourself that it works like this. -- Bill Cheng // bill.cheng@usc.edu >>-----Original Message----- >>From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] >>Sent: Tuesday, November 16, 2004 11:08 PM >>To: cs551@bourbon.usc.edu >>Subject: Re: search response >> >>Someone wrote: >> >> > I'm confused about this 1.fileid. Why is this needed? >> >>It's *not* needed (that's why I said "can"). >> >>Come to think of it, a fileID can even exist only in memory. >>-- >>Bill Cheng // bill.cheng@usc.edu >> >> >> >> >> ----- Original Message ----- >> From: william@bourbon.usc.edu >> Date: Tuesday, November 16, 2004 9:18 pm >> Subject: Re: search response >> >> > Someone wrote: >> > >> > > In the search response, fields 51-70 correspond to a UOID >> > > that identifies a file. Is this Nonce? >> > >> > No. When you create 1.data, you can call GetUOID() and >> > create 1.fileid. This fileID should be global unique >> > (with high probability). >> > >> > So, if you have a unique file (identified by its filename, >> > SHA1, and nonce) and it is stored on multiple nodes. All >> > these files will have the same filename, SHA1, and nonce. >> > But each of them will have a different fileID. >> > -- >> > Bill Cheng // bill.cheng@usc.edu >> Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Nov 16 23:24:14 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAH7OEja016898 for ; Tue, 16 Nov 2004 23:24:14 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAH7S2gv027273 for ; Tue, 16 Nov 2004 23:28:02 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAH7S2n5027271 for cs551@merlot.usc.edu; Tue, 16 Nov 2004 23:28:02 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAH7S2gv027268 for ; Tue, 16 Nov 2004 23:28:02 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAH7S2BI027264 for ; Tue, 16 Nov 2004 23:28:02 -0800 Message-Id: <200411170728.iAH7S2BI027264@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Metadata format Date: Tue, 16 Nov 2004 23:28:02 -0800 From: william@bourbon.usc.edu Someone wrote: > So when I write out the metadata to disk. I explicitly need: > fprintf(fp, "[metadata]\r\n"); //example, need both \r and \n???? > same as writing across the network??? and then the receiver will > parse the files using \r\n as delimiters initially? You need to convince yourself that your code is doing the right thing. You should examine memory and verify what you are sending out meets the spec. (Exactly what you write into your .meta file is not as important.) -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Tuesday, November 16, 2004 11:17 pm Subject: Re: Metadata format > Someone wrote: > > > I'm confused about the metadata formatting. In the spec it > > describes this INI-like format for the metadata. Is this what has > > to be stored in a .meta file, what is sent across the network, or > > both? > > To send across the network. It is *convenient* (not a > requirement) to have the .meta file to be exactly the same as > what goes into a message. > > > Can I use my own format to send across the network? > > No! You must follow the spec. > > > You need to send more information across the network, because the > > filename and keywords field are both variable, so it is not > > possible to parse a STORE message provided only the metadata > > length. You need to also provide the filename length at least. > > So when a node receives a message, if the file is "blondie1.mp3", > > then a metadata length and filelength(12) is sent across to make > > sure the receiving node knows that keyword length = metadata > > length - fixed field lengths - 12. > > All you need is the total size of the metadata. If you write > the metadata out to a temporary file, this file *will* contain > exactly 7 ASCII lines! The first line is "[metadata]\r", the > second line is "FileName=blondie1.mp3\r", etc. I left out the > "\n" since it's the end-of-line character on nunki. So, you > can even use functions like fgets() to parse this file. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Nov 16 23:13:19 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAH7DJja016654 for ; Tue, 16 Nov 2004 23:13:19 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAH7H8gv016970 for ; Tue, 16 Nov 2004 23:17:08 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAH7H8rK016968 for cs551@merlot.usc.edu; Tue, 16 Nov 2004 23:17:08 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAH7H8gv016959 for ; Tue, 16 Nov 2004 23:17:08 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAH7H8fw016955 for ; Tue, 16 Nov 2004 23:17:08 -0800 Message-Id: <200411170717.iAH7H8fw016955@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Metadata format Date: Tue, 16 Nov 2004 23:17:08 -0800 From: william@bourbon.usc.edu Someone wrote: > I'm confused about the metadata formatting. In the spec it > describes this INI-like format for the metadata. Is this what has > to be stored in a .meta file, what is sent across the network, or > both? To send across the network. It is *convenient* (not a requirement) to have the .meta file to be exactly the same as what goes into a message. > Can I use my own format to send across the network? No! You must follow the spec. > You need to send more information across the network, because the > filename and keywords field are both variable, so it is not > possible to parse a STORE message provided only the metadata > length. You need to also provide the filename length at least. > So when a node receives a message, if the file is "blondie1.mp3", > then a metadata length and filelength(12) is sent across to make > sure the receiving node knows that keyword length = metadata > length - fixed field lengths - 12. All you need is the total size of the metadata. If you write the metadata out to a temporary file, this file *will* contain exactly 7 ASCII lines! The first line is "[metadata]\r", the second line is "FileName=blondie1.mp3\r", etc. I left out the "\n" since it's the end-of-line character on nunki. So, you can even use functions like fgets() to parse this file. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Nov 16 23:04:14 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAH74Eja016478 for ; Tue, 16 Nov 2004 23:04:14 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAH783gv008314 for ; Tue, 16 Nov 2004 23:08:03 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAH783KZ008312 for cs551@merlot.usc.edu; Tue, 16 Nov 2004 23:08:03 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAH783gv008309 for ; Tue, 16 Nov 2004 23:08:03 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAH783pX008305 for ; Tue, 16 Nov 2004 23:08:03 -0800 Message-Id: <200411170708.iAH783pX008305@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: search response Date: Tue, 16 Nov 2004 23:08:03 -0800 From: william@bourbon.usc.edu Someone wrote: > I'm confused about this 1.fileid. Why is this needed? It's *not* needed (that's why I said "can"). Come to think of it, a fileID can even exist only in memory. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Tuesday, November 16, 2004 9:18 pm Subject: Re: search response > Someone wrote: > > > In the search response, fields 51-70 correspond to a UOID > > that identifies a file. Is this Nonce? > > No. When you create 1.data, you can call GetUOID() and > create 1.fileid. This fileID should be global unique > (with high probability). > > So, if you have a unique file (identified by its filename, > SHA1, and nonce) and it is stored on multiple nodes. All > these files will have the same filename, SHA1, and nonce. > But each of them will have a different fileID. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Nov 16 21:28:29 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAH5STja014442 for ; Tue, 16 Nov 2004 21:28:29 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAH5WIgv014258 for ; Tue, 16 Nov 2004 21:32:18 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAH5WINc014256 for cs551@merlot.usc.edu; Tue, 16 Nov 2004 21:32:18 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAH5WHgv014247 for ; Tue, 16 Nov 2004 21:32:17 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAH5WHdl014243 for ; Tue, 16 Nov 2004 21:32:17 -0800 Message-Id: <200411170532.iAH5WHdl014243@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Keywords Date: Tue, 16 Nov 2004 21:32:17 -0800 From: william@bourbon.usc.edu Someone wrote: > I know you've mentioned this before, but I need to verify: > when I produce the bit vector from the keywords and store the > keywords as metadata, does each separate word become a keyword? > So "Heart of glass" is actualy 3 keywords: "Heart", "of", "glass" > and should be stored as such and used separately to turn on bit > vector bits? Should be considered as 3 keywords (and turn possibly 6 bits on in the bit vector). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Nov 16 21:26:57 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAH5Qvja014395 for ; Tue, 16 Nov 2004 21:26:57 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAH5Ukgv012763 for ; Tue, 16 Nov 2004 21:30:46 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAH5Uki2012761 for cs551@merlot.usc.edu; Tue, 16 Nov 2004 21:30:46 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAH5Ujgv012752 for ; Tue, 16 Nov 2004 21:30:45 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAH5Ujjo012748 for ; Tue, 16 Nov 2004 21:30:45 -0800 Message-Id: <200411170530.iAH5Ujjo012748@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Permanent Storage Date: Tue, 16 Nov 2004 21:30:45 -0800 From: william@bourbon.usc.edu Someone wrote: > I am just having a little bit of confusion on when a file should be > permanent and when it should be cached only. > > The spec says that when a node gets a "store" or "get response" it should > decide whether or not to cache it in both cases. So in both these cases I > assume caching. But it also says that the node generating the store ignores > the StoreProb value. I assume that this means this node permanently stores > this file. This seems to make sense since the nodes that generate the > "gets" also must permanently store the files (e.g only nodes that initiate > file action permanently store it). Is this correct? Please see my message with timestamp "Sat 13 Nov 21:45". -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Nov 16 21:21:11 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAH5LBja014280 for ; Tue, 16 Nov 2004 21:21:11 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAH5P0gv007278 for ; Tue, 16 Nov 2004 21:25:00 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAH5P0Mb007273 for cs551@merlot.usc.edu; Tue, 16 Nov 2004 21:25:00 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAH5P0gv007270 for ; Tue, 16 Nov 2004 21:25:00 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAH5P0VG007266 for ; Tue, 16 Nov 2004 21:25:00 -0800 Message-Id: <200411170525.iAH5P0VG007266@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: search sha1has Date: Tue, 16 Nov 2004 21:25:00 -0800 From: william@bourbon.usc.edu Someone wrote: > From the spec: > > There should be no blank characters around the equal sign. > To search for a file with an exact SHA1 hash of bar, the > user should enter: > > search sha1hash=bar > > Do we enter the SHA1 value of file 'bar' in the above query. > ie. say SHA1 (bar) = 6b6c5636c484d47599d20191c3023b8a29b2fe11 > (just an example) > on the servant> prompt, the user enters: > > servant> search sha1hash=6b6c5636c484d47599d20191c3023b8a29b2fe11 You should have 40 characters after the equal sign as in your last example. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Nov 16 21:18:18 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAH5IIja014206 for ; Tue, 16 Nov 2004 21:18:18 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAH5M7gv004554 for ; Tue, 16 Nov 2004 21:22:07 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAH5M7NR004552 for cs551@merlot.usc.edu; Tue, 16 Nov 2004 21:22:07 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAH5M7gv004549 for ; Tue, 16 Nov 2004 21:22:07 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAH5M7TS004545 for ; Tue, 16 Nov 2004 21:22:07 -0800 Message-Id: <200411170522.iAH5M7TS004545@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Writing out indexes Date: Tue, 16 Nov 2004 21:22:07 -0800 From: william@bourbon.usc.edu Someone wrote: > From your response to the email: > > Just STORE and DELETE. On GET, you don't need to do it. > > I think the index files need to be updated when a node receives a GET > response. There are 2 cases: when a node is forwarding the the GET > response it might cache the file and when the node that initiates the > GET request. In both cases the file retrieved is store so the index files > need to be updated as well. > (I'm assuming that the node initiating the GET request also puts a copy > in the cache in addition to passing the file to the user.) You are correct, I forgot about this. GET can add files to a node. GET is relative infrequent compare to SEARCH. This kind of P2P network needs to be optimized for SEARCH. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Tuesday, November 16, 2004 1:04 pm Subject: Re: Writing out indexes > Someone wrote: > > > This is probably a silly question at this point, but I need to > > ask it: > > Can we keep our index structures in memory as long as the node > > process is running or do we have to update the indices and write > > them out to disk for every store, get, or remove operation? > > Just STORE and DELETE. On GET, you don't need to do it. > > > It seems to be much easier just to implement each index as a > > HashTable and deserialize them at node startup and serialize them > > back only when a node shuts down. This follows the O(n) rule. > > But what if you have a crash between startup and shutdown? > Your index file will not match what's stored on the node. > > As far as coding goes, it should be no problem to write > out the index when you finish a STORE or a DELETE. Yes, > it's kind of inefficient. But since STORE and DELETE are > infrequent, this is fine (for this project). > -- > Bill Cheng // bill.cheng@usc.edu > > Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Nov 16 21:14:30 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAH5ETja014125 for ; Tue, 16 Nov 2004 21:14:29 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAH5IIgv000860 for ; Tue, 16 Nov 2004 21:18:18 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAH5IIHI000858 for cs551@merlot.usc.edu; Tue, 16 Nov 2004 21:18:18 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAH5IIgv000855 for ; Tue, 16 Nov 2004 21:18:18 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAH5IIEZ000845 for ; Tue, 16 Nov 2004 21:18:18 -0800 Message-Id: <200411170518.iAH5IIEZ000845@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: search response Date: Tue, 16 Nov 2004 21:18:18 -0800 From: william@bourbon.usc.edu Someone wrote: > In the search response, fields 51-70 correspond to a UOID > that identifies a file. Is this Nonce? No. When you create 1.data, you can call GetUOID() and create 1.fileid. This fileID should be global unique (with high probability). So, if you have a unique file (identified by its filename, SHA1, and nonce) and it is stored on multiple nodes. All these files will have the same filename, SHA1, and nonce. But each of them will have a different fileID. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Nov 15 22:42:02 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAG6g2ja017851 for ; Mon, 15 Nov 2004 22:42:02 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAG6jsgv031396 for ; Mon, 15 Nov 2004 22:45:54 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAG6jsab031394 for cs551@merlot.usc.edu; Mon, 15 Nov 2004 22:45:54 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAG6jsgv031391 for ; Mon, 15 Nov 2004 22:45:54 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAG6jsFZ031387 for ; Mon, 15 Nov 2004 22:45:54 -0800 Message-Id: <200411160645.iAG6jsFZ031387@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: cert.pem Date: Mon, 15 Nov 2004 22:45:54 -0800 From: william@bourbon.usc.edu Someone wrote: > the content of the private key varies everytime but the size of > private key is constant, but the file size for the public key > seems to vary based on the parameters that I pass on the fucntion > for eg like someone@usc.edu instead of yourname@... As I have mentioned in class, the public key certificate is not just the public key. It also contains other information, such as the information you supplied. (The private key file is just the encoded private key.) -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Monday, November 15, 2004 10:32 pm Subject: Re: cert.pem > Someone wrote: > > > just wanted to find out, while generating keys, the private key > > in my case is always constant at 887 and the public key seems to > > vary if I change in the command at places like > > YOURnam..@younam.com to something like raghu@usc.edu, am I going > > wrong somewhere? > > You should get a different private key file every time you > run that command. Did you compare the *content* of your > private key files? I just copy and paste from the spec > and get a different private key file every time. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Nov 15 22:28:11 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAG6SBja017194 for ; Mon, 15 Nov 2004 22:28:11 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAG6W2gv018244 for ; Mon, 15 Nov 2004 22:32:02 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAG6W2Gs018242 for cs551@merlot.usc.edu; Mon, 15 Nov 2004 22:32:02 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAG6W2gv018239 for ; Mon, 15 Nov 2004 22:32:02 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAG6W2pB018233 for ; Mon, 15 Nov 2004 22:32:02 -0800 Message-Id: <200411160632.iAG6W2pB018233@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: cert.pem Date: Mon, 15 Nov 2004 22:32:02 -0800 From: william@bourbon.usc.edu Someone wrote: > just wanted to find out, while generating keys, the private key > in my case is always constant at 887 and the public key seems to > vary if I change in the command at places like > YOURnam..@younam.com to something like raghu@usc.edu, am I going > wrong somewhere? You should get a different private key file every time you run that command. Did you compare the *content* of your private key files? I just copy and paste from the spec and get a different private key file every time. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Nov 15 22:22:44 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAG6Mija017077 for ; Mon, 15 Nov 2004 22:22:44 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAG6QZgv013019 for ; Mon, 15 Nov 2004 22:26:35 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAG6QZqm013017 for cs551@merlot.usc.edu; Mon, 15 Nov 2004 22:26:35 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAG6QZgv013014 for ; Mon, 15 Nov 2004 22:26:35 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAG6QZ4e013010 for ; Mon, 15 Nov 2004 22:26:35 -0800 Message-Id: <200411160626.iAG6QZ4e013010@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: .meta file Date: Mon, 15 Nov 2004 22:26:35 -0800 From: william@bourbon.usc.edu Someone wrote: > While writing .meta files, and later on sending them through network, > should we omit '\0' NULL characters? Should it be NULL free? When you send the metadata information through the network, there should be no '\0' characters. Therefore, I would not store them in a .meta file either. I've mentioned this probably a few times... Think *simplicity*! When you create a .meta file, you will be just writing out the bytes from a message into a file. You know how many bytes are in the metadata because there is a field in the message telling you that. Just do a fwrite() and you are done! (And in this case, there would be no '\0' to write.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Nov 15 21:00:20 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAG50Kja014766 for ; Mon, 15 Nov 2004 21:00:20 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAG54Cgv031740 for ; Mon, 15 Nov 2004 21:04:12 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAG54CdG031735 for cs551@merlot.usc.edu; Mon, 15 Nov 2004 21:04:12 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAG54Cgv031732 for ; Mon, 15 Nov 2004 21:04:12 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAG54Ctn031728 for ; Mon, 15 Nov 2004 21:04:12 -0800 Message-Id: <200411160504.iAG54Ctn031728@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Writing out indexes Date: Mon, 15 Nov 2004 21:04:12 -0800 From: william@bourbon.usc.edu Someone wrote: > This is probably a silly question at this point, but I need to > ask it: > Can we keep our index structures in memory as long as the node > process is running or do we have to update the indices and write > them out to disk for every store, get, or remove operation? Just STORE and DELETE. On GET, you don't need to do it. > It seems to be much easier just to implement each index as a > HashTable and deserialize them at node startup and serialize them > back only when a node shuts down. This follows the O(n) rule. But what if you have a crash between startup and shutdown? Your index file will not match what's stored on the node. As far as coding goes, it should be no problem to write out the index when you finish a STORE or a DELETE. Yes, it's kind of inefficient. But since STORE and DELETE are infrequent, this is fine (for this project). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Nov 15 12:32:28 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAFKWSja004679 for ; Mon, 15 Nov 2004 12:32:28 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAFKaKgv011478 for ; Mon, 15 Nov 2004 12:36:20 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAFKaKJS011473 for cs551@merlot.usc.edu; Mon, 15 Nov 2004 12:36:20 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAFKaKgv011470 for ; Mon, 15 Nov 2004 12:36:20 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAFKaKpA011466 for ; Mon, 15 Nov 2004 12:36:20 -0800 Message-Id: <200411152036.iAFKaKpA011466@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: 551fp2 - certificates Date: Mon, 15 Nov 2004 12:36:20 -0800 From: william@bourbon.usc.edu Someone wrote: > I couldnot quite understand how we are supposed to manipulate certificates > and have couple of questions. I spent a few minutes at the beginning of the lecture today to talk about this. > Could we assume that the private key exists in > the directory, or should we generate everything from within the program? When you do "-reset", the private key file should be deleted. When you program starts, if the private key file does not exist, it should run the corresponding openssl command to create a private key file and a public key certificate file. > When generating a digitally signed File Spec for the DELETE command, are we > going to first store the File Spec entries in a text file, then run the > openssl command on it, then read the contents along with the digital > signature completely without omitting any lines (seperators, header > information, etc.)? Exactly! > And, should the "certificate" field include the > seperator lines? (e.g. "----BEGIN CERTIFICATE----"). Yes. Please do not modify anything in the certificate. Otherwise, the other side cannot verify digital signatures. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Nov 14 12:28:14 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAEKSEja007148 for ; Sun, 14 Nov 2004 12:28:14 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAEKW9gv028173 for ; Sun, 14 Nov 2004 12:32:09 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAEKW9NG028171 for cs551@merlot.usc.edu; Sun, 14 Nov 2004 12:32:09 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAEKW9gv028168 for ; Sun, 14 Nov 2004 12:32:09 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAEKW9H8028164 for ; Sun, 14 Nov 2004 12:32:09 -0800 Message-Id: <200411142032.iAEKW9H8028164@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: gdb error: "Program received signal ?, Unknown signal." Date: Sun, 14 Nov 2004 12:32:09 -0800 From: william@bourbon.usc.edu Someone wrote: > Thank you, I have just tried the new gdb version, however even if I comment > out *all* the code from my main() method, the gdb fails to execute the code, > it quits to the shell with "Bus Error" - it does not execute at all! All I > get: > > (gdb) run > Starting program: /.../sv > Bus error > nunki.usc.edu(714): > > Is this a bug with gdb? I also wrote a "Hello World" application. Only then > gdb executes > the code without bailing out! Is there a problem with libraries I am > linking? I guess if you don't do anything unusual, there should be no problem. > I have also tried with gdb 4.18, it runs the code unlike 6.0, however I > receive the same > signalling error as before... Also, since DDD (I am also using it) is based > on GDB, it > does not help at all. As far as I know, gdb 4.18 may have problems with multi-threaded code. I was told that ddd works with multi-threaded code. I've also mentioned that it is possible that you have corrupted the memory of the debugger and that may be why the debugger is dying. All I can see is, "Keey trying." -- Bill Cheng // bill.cheng@usc.edu > ----- Original Message ----- > From: > To: > Sent: Sunday, November 14, 2004 9:02 AM > Subject: Re: gdb error: "Program received signal ?, Unknown signal." > > > > Someone wrote: > > > > > I am having the following error in gdb, and when I "continue" the gdb > > hangs, > > > preventing me to debug my code... I have searched through the net, > > however > > > found that this was because of earlier versions of gdb lacking > > > multithreading support. Is there any way to fix this, or upgrade the > > gdb? > > > The gdb is not able to "handle" signals that is unknown to it, so it > > just > > > hangs, and I couldnot find any way to explicitly ignore the signal (by > > > "handle x noprint"), because it does not have any numeric value to > > > reference! > > > > > > The error is: > > > "Program received signal ?, Unknown signal." in _poll() - that is deep > > in > > > the stack of the system call select(), nothing to do directly with my > > own > > > code. > > > > > > I would appreciate if you could give any workaround, if any. > > > > Please see my message with timestamp "Wed 20 Oct 22:24". On nunki, > > ddd is at: > > > > /usr/usc/ddd/default/bin/ddd > > > > A newer gdb is at: > > > > /usr/usc/gnu/gdb/6.0/bin/gdb > > > > I don't know how well either of them work, so I don't know > > if either of them would help you find your bug. (Please note > > that it is possible that you have corrupted the memory of the > > debugger.) > > -- > > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Nov 14 08:58:22 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAEGwLja002940 for ; Sun, 14 Nov 2004 08:58:22 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAEH2Hgv015171 for ; Sun, 14 Nov 2004 09:02:17 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAEH2H1v015169 for cs551@merlot.usc.edu; Sun, 14 Nov 2004 09:02:17 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAEH2Ggv015166 for ; Sun, 14 Nov 2004 09:02:16 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAEH2GEk015156 for ; Sun, 14 Nov 2004 09:02:16 -0800 Message-Id: <200411141702.iAEH2GEk015156@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: gdb error: "Program received signal ?, Unknown signal." Date: Sun, 14 Nov 2004 09:02:16 -0800 From: william@bourbon.usc.edu Someone wrote: > I am having the following error in gdb, and when I "continue" the gdb hangs, > preventing me to debug my code... I have searched through the net, however > found that this was because of earlier versions of gdb lacking > multithreading support. Is there any way to fix this, or upgrade the gdb? > The gdb is not able to "handle" signals that is unknown to it, so it just > hangs, and I couldnot find any way to explicitly ignore the signal (by > "handle x noprint"), because it does not have any numeric value to > reference! > > The error is: > "Program received signal ?, Unknown signal." in _poll() - that is deep in > the stack of the system call select(), nothing to do directly with my own > code. > > I would appreciate if you could give any workaround, if any. Please see my message with timestamp "Wed 20 Oct 22:24". On nunki, ddd is at: /usr/usc/ddd/default/bin/ddd A newer gdb is at: /usr/usc/gnu/gdb/6.0/bin/gdb I don't know how well either of them work, so I don't know if either of them would help you find your bug. (Please note that it is possible that you have corrupted the memory of the debugger.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Nov 13 22:30:06 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAE6U6ja011700 for ; Sat, 13 Nov 2004 22:30:06 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAE6Y2gv012776 for ; Sat, 13 Nov 2004 22:34:02 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAE6Y2NI012772 for cs551@merlot.usc.edu; Sat, 13 Nov 2004 22:34:02 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAE6Y2gv012765 for ; Sat, 13 Nov 2004 22:34:02 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAE6Y2es012761 for ; Sat, 13 Nov 2004 22:34:02 -0800 Message-Id: <200411140634.iAE6Y2es012761@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Rejoining the network binding Date: Sat, 13 Nov 2004 22:34:02 -0800 From: william@bourbon.usc.edu Someone wrote: > I got this same error a while back. The way I fixed it was by just closing > the listening socket explicitly calling close(). Just canceling the thread > does not close the socket. Ah ha! Just as I suspected! :-) -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Saturday, November 13, 2004 9:59 PM Subject: Re: Rejoining the network binding > Someone wrote: > > > I was hoping you could give me a suggestion on this. When my > > check() function is issued and the node rejoins the network, one > > of the first things that happens is a new socket is established > > in a thread for listening for incoming connections. Whenever the > > rejoin occurs, I get a "bind error: invalid argment". I have the > > SO_REUSEADDR socket option enabled and the connection should be > > closed. Any ideas? > > (I'm assuming that you are closing all your sockets normally > when you restart the node.) When you said "whenever the > rejoin occurs", do you mean this for a beacon node or for the > node that has just failed the check? > > I guess I have no idea why you are getting this error. May > be you should ask this in the discussion board and see if > someone else has seen the same thing. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Nov 13 22:11:31 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAE6BVja011284 for ; Sat, 13 Nov 2004 22:11:31 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAE6FSgv027221 for ; Sat, 13 Nov 2004 22:15:28 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAE6FS2K027219 for cs551@merlot.usc.edu; Sat, 13 Nov 2004 22:15:28 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAE6FSgv027213 for ; Sat, 13 Nov 2004 22:15:28 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAE6FSd9027206 for ; Sat, 13 Nov 2004 22:15:28 -0800 Message-Id: <200411140615.iAE6FSd9027206@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Rejoining the network binding Date: Sat, 13 Nov 2004 22:15:28 -0800 From: william@bourbon.usc.edu Someone wrote: > I'm referring to the non-beacon node that times out on a check > request. The cleanup of the server does a pthread_cancel on the > thread managing the listening socket. Then when the node > rejoins, I get that bind error - invalid argument. When I call > pthread_cancel, the thread is terminated as should be all open > sockets, automatically. So I should not have a problem rejoining > unless the pthread_cancel does not cause the socket to close, or > the bind error is due to a TIME_WAIT condition. However, the > TIME_WAIT up to MSL seconds should not matter if the SO_REUSEADDR > socket option is set. Am I correct in my assumptions. If so, > what else could be the issue? I'm not sure if all opened sockets are closed nicely. It may work just fine, but I wouldn't know for sure. I don't know what can cause this. As usual, I would write a small test program and see if this is the problem. Other than that, I don't have any better ideas. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Saturday, November 13, 2004 9:59 pm Subject: Re: Rejoining the network binding > Someone wrote: > > > I was hoping you could give me a suggestion on this. When my > > check() function is issued and the node rejoins the network, one > > of the first things that happens is a new socket is established > > in a thread for listening for incoming connections. Whenever the > > rejoin occurs, I get a "bind error: invalid argment". I have the > > SO_REUSEADDR socket option enabled and the connection should be > > closed. Any ideas? > > (I'm assuming that you are closing all your sockets normally > when you restart the node.) When you said "whenever the > rejoin occurs", do you mean this for a beacon node or for the > node that has just failed the check? > > I guess I have no idea why you are getting this error. May > be you should ask this in the discussion board and see if > someone else has seen the same thing. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Nov 13 22:07:09 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAE679ja011176 for ; Sat, 13 Nov 2004 22:07:09 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAE6B6gv023064 for ; Sat, 13 Nov 2004 22:11:06 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAE6B6PF023059 for cs551@merlot.usc.edu; Sat, 13 Nov 2004 22:11:06 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAE6B6gv023056 for ; Sat, 13 Nov 2004 22:11:06 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAE6B6R4023052 for ; Sat, 13 Nov 2004 22:11:06 -0800 Message-Id: <200411140611.iAE6B6R4023052@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS551 - Re: cache and perm storage Date: Sat, 13 Nov 2004 22:11:06 -0800 From: william@bourbon.usc.edu Someone wrote: > Would it be appropriate to add a cached flag to the metadata for > each file so we can minimize the overhead for managing cached > files separately from permanent files. These files are local to a node, you can put anything you want in it. > I realize that would > slightly modify the spec, but it seems like a resonable option. > Also, this doesn't mean that the cached flag would necessarily > need to be sent across the network with the rest of the metadata. > It would be determined locally, however, it could be stored and > managed along with the rest of the metadata making implementation > much more manageable. Isn't full functionality more important > than following the spec in this case? It is important to follow the spec. I don't think what you suggested violates the spec! One thing you need to be careful is that when you put metadata in a search response, a get response, a store request, or a status response message, you must *not* add additional information in the metadata! You must send *only* what's specified in: http://merlot.usc.edu/cs551-f04/projects/final.html#metadata This is why I suggested to use a separate file for the cache bit. If you only store what you can send in #.meta, then it's really easy to put metatdata in the above message types. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Saturday, November 13, 2004 9:45 pm Subject: Re: CS551 - Re: cache and perm storage > Someone wrote: > > > I'm quite confused after thinking about what you said in this > message. > > I originally thought that the cached files are cleaned when a > node shuts > > down. > > In a way, this is similar to how Netscape (and IE) works. > Netscape stores cached files in ~/.netscape/cache (or > something like that). When you kill Netscape and restart it > at a later time, all the cache files are still in > ~/.netscape/cache. There is a cache size you can set for > Netscape and LRU are used to reaplce cached files when there > are too many files to cache. > > The difference here is that for Netscape, there is no concept > of "permanent" files. > > > If the cached files can survive node restarts and should only > be purged > > by LRU when there's a cache size is reached, then I don't see > the > > difference between cached files and permanent files. > > If you store a file into the network, if everything is cached, > then eventually this file may no longer exist. This is the > case for Freenet, but not for the class project. We want to > make sure that once a file is stored into the network, you can > always find at least one copy of the file. > > We further use the Napster idea that if you (a node) retrieve > a file, you must serve that file. So, if you initiate a GET, > you must make what you got permanent. > > > They both can survive node restarts. They both have a size > limit on when > > to use LRT. > > Permanent files are *not* subject to LRU! There is a size > limit for permanent files (PermSize), if adding a file into > the permanent storage will exceed PermSize, you should refuse > to add this file! > -- > Bill Cheng // bill.cheng@usc.edu > > > > > ----- Original Message ----- > From: william@bourbon.usc.edu > Date: Thursday, November 11, 2004 0:01 am > Subject: Re: cache and perm storage > > > Someone wrote: > > > > > From the spec, it said when a node forwards a get response, > > > assuming the prob outcome I need to cache it, does that > mean I > > > need to store that data into my file system where the perm > > > storage resides? From the spec, there's no explicit > > > control/specification to differentiate a permanent storage > or a > > > cached storage, so does that mean I have to make the > bookkeeping > > myself? If so, how long do I retain the caches > before I purge > > > them? > > > > You need a bit somewhere to flag whether a file in your mini > > filesystem is temporary (cached) or permanent. A cached file > > is subject to LRU replacement while a permanent file is not. > > > > You can create files "1.cached", "2.cached", etc. and put > > either a 1 or a 0 in these files to indicate if the file is > > cached or permanent. > > > > For the LRU, you can create a linked list in memory to do > > LRU. But you should not serialize this structure to disk > > every time it is accessed. You can write it out to a file > > (may be calling it "lru_index") when you are writing out > > another file. > > > > > Another thing is the SSL, I know I need to make a private > key via > > > the shell as I'd done that before setting an SSL server. > However, > > for certificate verifying signed files, I wonder if > there is any > > > openSSL API that I could used directly instead of going to > exec a > > > command line, it would cumbersome to do that everytime > trying to > > > verify a file. > > > > Please see: > > > > http://merlot.usc.edu/cs551-f04/projects/final.html#cert > > http://merlot.usc.edu/cs551-f04/projects/final.html#popen > > > > By the way, I don't know why you say "SSL". We are not doing > > SSL (Secure Socket Layer). > > -- > > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Nov 13 21:55:22 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAE5tMja010926 for ; Sat, 13 Nov 2004 21:55:22 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAE5xIgv011776 for ; Sat, 13 Nov 2004 21:59:18 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAE5xItn011774 for cs551@merlot.usc.edu; Sat, 13 Nov 2004 21:59:18 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAE5xIgv011771 for ; Sat, 13 Nov 2004 21:59:18 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAE5xIvt011764 for ; Sat, 13 Nov 2004 21:59:18 -0800 Message-Id: <200411140559.iAE5xIvt011764@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Rejoining the network binding Date: Sat, 13 Nov 2004 21:59:18 -0800 From: william@bourbon.usc.edu Someone wrote: > I was hoping you could give me a suggestion on this. When my > check() function is issued and the node rejoins the network, one > of the first things that happens is a new socket is established > in a thread for listening for incoming connections. Whenever the > rejoin occurs, I get a "bind error: invalid argment". I have the > SO_REUSEADDR socket option enabled and the connection should be > closed. Any ideas? (I'm assuming that you are closing all your sockets normally when you restart the node.) When you said "whenever the rejoin occurs", do you mean this for a beacon node or for the node that has just failed the check? I guess I have no idea why you are getting this error. May be you should ask this in the discussion board and see if someone else has seen the same thing. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Nov 13 21:51:35 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAE5pZja010845 for ; Sat, 13 Nov 2004 21:51:35 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAE5tWgv008211 for ; Sat, 13 Nov 2004 21:55:32 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAE5tWFb008203 for cs551@merlot.usc.edu; Sat, 13 Nov 2004 21:55:32 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAE5tWgv008200 for ; Sat, 13 Nov 2004 21:55:32 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAE5tWrq008196 for ; Sat, 13 Nov 2004 21:55:32 -0800 Message-Id: <200411140555.iAE5tWrq008196@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: cache and perm storage Date: Sat, 13 Nov 2004 21:55:31 -0800 From: william@bourbon.usc.edu Someone wrote: | > > Another thing is the SSL, I know I need to make a private key via | > > the shell as I'd done that before setting an SSL server. However, | > > for certificate verifying signed files, I wonder if there is any | > > openSSL API that I could used directly instead of going to exec a | > > command line, it would cumbersome to do that everytime trying to | > > verify a file. | > | > Please see: | > | > http://merlot.usc.edu/cs551-f04/projects/final.html#cert | > http://merlot.usc.edu/cs551-f04/projects/final.html#popen | > | > By the way, I don't know why you say "SSL". We are not doing | > SSL (Secure Socket Layer). | > -- | > Bill Cheng // bill.cheng@usc.edu | | I have the same question. | Should I exec as wriiten in the spec. OR should I call C functions from | openssl/*.h ? In the last section of the spec, it says: A SERVANT node must be implemented as a single process ([BC: Added 11/8/2004] with the exception of popen() calls). So, you can use popen() (which is probably implemented as a wrapper around an exec() call) for these. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Nov 13 21:47:45 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAE5ljja010737 for ; Sat, 13 Nov 2004 21:47:45 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAE5pfgv004555 for ; Sat, 13 Nov 2004 21:51:41 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAE5pfZx004553 for cs551@merlot.usc.edu; Sat, 13 Nov 2004 21:51:41 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAE5pfgv004550 for ; Sat, 13 Nov 2004 21:51:41 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAE5pfA8004546 for ; Sat, 13 Nov 2004 21:51:41 -0800 Message-Id: <200411140551.iAE5pfA8004546@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Check reset Date: Sat, 13 Nov 2004 21:51:41 -0800 From: william@bourbon.usc.edu Someone wrote: > When implementing check, I assume it is okay to shutdown the > server process and restart it again using exec() or something > along those lines. Since a node should be a single process, you shouldn't be doing things like fork() and exec(). I've mentioned several times in class that the "restart" is "as if" you start over in main(). > In any case, when a check fails, should there > be an automatic reset() to remove the init_neighbors_list so a > full rediscovery is issued? Should the files remain in this case > unlike using the -reset flag on the sv_node cmd line? If CHECK failed, a node should simply delete its init_neighbor_list file and restart (and rejoin). This is *not* the same as -reset where you delete *all* files. When CHECK failed, you do not touch the cached files, the permanent files, the index files, etc. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Nov 13 21:41:45 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAE5fjja010622 for ; Sat, 13 Nov 2004 21:41:45 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAE5jfgv031180 for ; Sat, 13 Nov 2004 21:45:41 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAE5jfOJ031178 for cs551@merlot.usc.edu; Sat, 13 Nov 2004 21:45:41 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAE5jfgv031169 for ; Sat, 13 Nov 2004 21:45:41 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAE5jfFS031165 for ; Sat, 13 Nov 2004 21:45:41 -0800 Message-Id: <200411140545.iAE5jfFS031165@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS551 - Re: cache and perm storage Date: Sat, 13 Nov 2004 21:45:41 -0800 From: william@bourbon.usc.edu Someone wrote: > I'm quite confused after thinking about what you said in this message. > I originally thought that the cached files are cleaned when a node shuts > down. In a way, this is similar to how Netscape (and IE) works. Netscape stores cached files in ~/.netscape/cache (or something like that). When you kill Netscape and restart it at a later time, all the cache files are still in ~/.netscape/cache. There is a cache size you can set for Netscape and LRU are used to reaplce cached files when there are too many files to cache. The difference here is that for Netscape, there is no concept of "permanent" files. > If the cached files can survive node restarts and should only be purged > by LRU when there's a cache size is reached, then I don't see the > difference between cached files and permanent files. If you store a file into the network, if everything is cached, then eventually this file may no longer exist. This is the case for Freenet, but not for the class project. We want to make sure that once a file is stored into the network, you can always find at least one copy of the file. We further use the Napster idea that if you (a node) retrieve a file, you must serve that file. So, if you initiate a GET, you must make what you got permanent. > They both can survive node restarts. They both have a size limit on when > to use LRT. Permanent files are *not* subject to LRU! There is a size limit for permanent files (PermSize), if adding a file into the permanent storage will exceed PermSize, you should refuse to add this file! -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Thursday, November 11, 2004 0:01 am Subject: Re: cache and perm storage > Someone wrote: > > > From the spec, it said when a node forwards a get response, > > assuming the prob outcome I need to cache it, does that mean I > > need to store that data into my file system where the perm > > storage resides? From the spec, there's no explicit > > control/specification to differentiate a permanent storage or a > > cached storage, so does that mean I have to make the bookkeeping > > myself? If so, how long do I retain the caches before I purge > > them? > > You need a bit somewhere to flag whether a file in your mini > filesystem is temporary (cached) or permanent. A cached file > is subject to LRU replacement while a permanent file is not. > > You can create files "1.cached", "2.cached", etc. and put > either a 1 or a 0 in these files to indicate if the file is > cached or permanent. > > For the LRU, you can create a linked list in memory to do > LRU. But you should not serialize this structure to disk > every time it is accessed. You can write it out to a file > (may be calling it "lru_index") when you are writing out > another file. > > > Another thing is the SSL, I know I need to make a private key via > > the shell as I'd done that before setting an SSL server. However, > > for certificate verifying signed files, I wonder if there is any > > openSSL API that I could used directly instead of going to exec a > > command line, it would cumbersome to do that everytime trying to > > verify a file. > > Please see: > > http://merlot.usc.edu/cs551-f04/projects/final.html#cert > http://merlot.usc.edu/cs551-f04/projects/final.html#popen > > By the way, I don't know why you say "SSL". We are not doing > SSL (Secure Socket Layer). > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Nov 12 13:40:42 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iACLegja003951 for ; Fri, 12 Nov 2004 13:40:42 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iACLiggv026099 for ; Fri, 12 Nov 2004 13:44:42 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iACLigSe026097 for cs551@merlot.usc.edu; Fri, 12 Nov 2004 13:44:42 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iACLiggv026094 for ; Fri, 12 Nov 2004 13:44:42 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iACLig8B026090 for ; Fri, 12 Nov 2004 13:44:42 -0800 Message-Id: <200411122144.iACLig8B026090@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: bit-vector query Date: Fri, 12 Nov 2004 13:44:42 -0800 From: william@bourbon.usc.edu Someone wrote: > I have a query regarding bit-vector. > Node 1: > For keyword "foo" MD5 value = 351 > Bit vector to be set = 87*4 + 3, 87 zero hex digits after '8' > > For another keyword "startrek", we get MD5 value = 350 > Bit vector to be set = 87*4 + 2, 87 zero hex digits after '4' If you run: echo -n "foo" | openssl md5 You should get "acbd18db4cc2f85cedef654fccc4a4d8". The right-most 9 bits is 0x0d8 (or 216 in decimal). I'm not sure how you get 351. (One slide 10 of lecture, you get 351 if the keyword is "categories".) If you run: echo -n "startrek" | openssl md5 You should get "29f491121c63af2a883378c50e1f8d9f". The right-most 9 bits is 0x19f (or 415 in decimal). I'm not sure how you get 350. Anyway, let's assume you get the right stuff and one keyword gets you 351 and another keyword gets you 350. Now, you have to *OR* the bit-vector that corresponds to 351 and the bit-vector that corresponds to 350 and store that. So, you will get 'C' followed by 87 zeroes. > Node 2: sends a search query with keyword "foo" > Bit vector for "foo" = 87 zero hex digits after 8 > > Node 1 receives this message and does a bit wise & with its bit-vector. > ie. 1000 & 0100 = 0000 > Even though node 1 has the keyword "foo" it wont give a possible match. > > What am I missing out here? You should do the AND with the stored bit-vector which is now 'C' followed by 87 zeroes. Then you should have: 1000 & 1100 = 1000 This means that there is a possible match between the search keyword and the stored keyword*s*. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Nov 11 21:44:02 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAC5i2ja016919 for ; Thu, 11 Nov 2004 21:44:02 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAC5m3gv011236 for ; Thu, 11 Nov 2004 21:48:03 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAC5m3TF011234 for cs551@merlot.usc.edu; Thu, 11 Nov 2004 21:48:03 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAC5m3gv011226 for ; Thu, 11 Nov 2004 21:48:03 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAC5m3mn011221 for ; Thu, 11 Nov 2004 21:48:03 -0800 Message-Id: <200411120548.iAC5m3mn011221@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS 551 - Efficient data structure Date: Thu, 11 Nov 2004 21:48:02 -0800 From: william@bourbon.usc.edu Someone wrote: > I have a question on the efficient data structures. > 1. > I was just going over the spec over again and I noticed that > in the section about "Index Files" it says we > "must use" binary search trees. But there seems to be inconsistency > because in lecture you said we can use Hash if we want. > So I'm wondering what to do as I'm doing everything with Hash now. In class, I have mentioned several times that the data structures must be *at least* as fast as BST. A BST with N nodes has a search time of log(N) and an insertion time of log(N). If you serialize a BST correctly, you can deserialize it in order N time. If your Hash Tables are at least as fast as the above, they would be fine. (I probably should change the spec to say the same, but I am not going to modify the spec now, unless I get more inquiries.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Nov 11 14:37:15 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iABMbFja008394 for ; Thu, 11 Nov 2004 14:37:15 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iABMfHgv006458 for ; Thu, 11 Nov 2004 14:41:17 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iABMfHm9006456 for cs551@merlot.usc.edu; Thu, 11 Nov 2004 14:41:17 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iABMfGgv006453 for ; Thu, 11 Nov 2004 14:41:16 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iABMfGBn006449 for ; Thu, 11 Nov 2004 14:41:16 -0800 Message-Id: <200411112241.iABMfGBn006449@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: nonce Date: Thu, 11 Nov 2004 14:41:16 -0800 From: william@bourbon.usc.edu Someone wrote: > Is it ok to generate nonce using openssl function rand_bytes() > associated with the *filename* only?? I'm not sure what you have in mind and what you meant by "associated with the filename only". But isn't it easier to just call GetUOID() with the right? (You should think about why a nonce is used and why calling GetUOID() is sufficient.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Nov 10 21:48:40 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAB5meja019678 for ; Wed, 10 Nov 2004 21:48:40 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAB5qigv004035 for ; Wed, 10 Nov 2004 21:52:44 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAB5qiEp004033 for cs551@merlot.usc.edu; Wed, 10 Nov 2004 21:52:44 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAB5qigv004030 for ; Wed, 10 Nov 2004 21:52:44 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAB5qiDQ004026 for ; Wed, 10 Nov 2004 21:52:44 -0800 Message-Id: <200411110552.iAB5qiDQ004026@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Proj 1 Grade Question Date: Wed, 10 Nov 2004 21:52:44 -0800 From: william@bourbon.usc.edu Someone wrote: > Will you be sending out an e-mail with our updated project 1 grades or > should we request that information from the project grader? I will send individual e-mails to everyone letting you know your final project part (1) grade soon after I get the scores from the grader. As of now, I have not received the scores. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Nov 10 21:46:21 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAB5kLja019631 for ; Wed, 10 Nov 2004 21:46:21 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAB5oPgv001761 for ; Wed, 10 Nov 2004 21:50:25 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAB5oPXQ001759 for cs551@merlot.usc.edu; Wed, 10 Nov 2004 21:50:25 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAB5oPgv001753 for ; Wed, 10 Nov 2004 21:50:25 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAB5oPn3001746 for ; Wed, 10 Nov 2004 21:50:25 -0800 Message-Id: <200411110550.iAB5oPn3001746@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: SHA1 error Date: Wed, 10 Nov 2004 21:50:25 -0800 From: william@bourbon.usc.edu Someone wrote: > Similar to MD5, I am trying to generate the SHA1 in for the file using: > void SHA1_Init(SHA_CTX *c); > void SHA1_Update(SHA_CTX *c, const void *data, unsigned long len); > void SHA1_Final(unsigned char *md, SHA_CTX *c); > > Compiler gives the following error: > error: new declaration `void SHA1_Init(SHA_CTX*)' > /usr/lsd/openssl/0.9.7c/include/openssl/sha.h:111: error: ambiguates old > declaration `int SHA1_Init(SHA_CTX*)' > error: new declaration `void SHA1_Update(SHA_CTX*, const void*, > long unsigned int)' > /usr/lsd/openssl/0.9.7c/include/openssl/sha.h:112: error: ambiguates old > declaration `int SHA1_Update(SHA_CTX*, const void*, long unsigned int)' > > Am I doing something wrong? Stuck since past 2 hours. Please send me transcript of your compilation. I have no idea what you use to compile your code! I compile with: gcc -g -Wall -I/usr/lsd/openssl/0.9.7c/include -c foo.c and it works. "foo.c" is the following dummy code: #include int main(int argc, char *argv[]) { unsigned char sha1_buf[SHA_DIGEST_LENGTH], buf[200]; SHA_CTX sha_ctx; SHA1_Init(&sha_ctx); SHA1_Update(&sha_ctx, buf, sizeof(buf)); SHA1_Final(sha1_buf, &sha_ctx); return(0); } -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 10 16:27:11 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAB0RBja013111 for ; Wed, 10 Nov 2004 16:27:11 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAB0VGgv021515 for ; Wed, 10 Nov 2004 16:31:16 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAB0VGCJ021513 for cs551@merlot; Wed, 10 Nov 2004 16:31:16 -0800 Date: Wed, 10 Nov 2004 16:31:16 -0800 From: william@bourbon.usc.edu Message-Id: <200411110031.iAB0VGCJ021513@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: solution to HW2 problem 3 posted Please see: http://merlot.usc.edu/cs551-f04/homeworks/sol-wfq.html If you see any problem, please let me know. Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Nov 10 15:35:13 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAANZDja011416 for ; Wed, 10 Nov 2004 15:35:13 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAANdHgv002097 for ; Wed, 10 Nov 2004 15:39:17 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAANdHKc002095 for cs551@merlot.usc.edu; Wed, 10 Nov 2004 15:39:17 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAANdHgv002092 for ; Wed, 10 Nov 2004 15:39:17 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAANdHjC002087 for ; Wed, 10 Nov 2004 15:39:17 -0800 Message-Id: <200411102339.iAANdHjC002087@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: SHA1 of a file Date: Wed, 10 Nov 2004 15:39:17 -0800 From: william@bourbon.usc.edu Someone wrote: > To get SHA1 of a file, can we use the system call: openssl sha1 > or we need to use one of the libraries (ie. similar to > what we did for MD5 in warmup-1)? Since you already know how to do it from warmup #1, please just use library calls (and not execute "openssl"). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Nov 10 07:57:08 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAAFv8ja001973 for ; Wed, 10 Nov 2004 07:57:08 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAAG1Dgv028488 for ; Wed, 10 Nov 2004 08:01:13 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAAG1DcZ028486 for cs551@merlot.usc.edu; Wed, 10 Nov 2004 08:01:13 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAAG1Dgv028477 for ; Wed, 10 Nov 2004 08:01:13 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAAG1DAL028473 for ; Wed, 10 Nov 2004 08:01:13 -0800 Message-Id: <200411101601.iAAG1DAL028473@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: cache and perm storage Date: Wed, 10 Nov 2004 08:01:13 -0800 From: william@bourbon.usc.edu Someone wrote: > From the spec, it said when a node forwards a get response, > assuming the prob outcome I need to cache it, does that mean I > need to store that data into my file system where the perm > storage resides? From the spec, there's no explicit > control/specification to differentiate a permanent storage or a > cached storage, so does that mean I have to make the bookkeeping > myself? If so, how long do I retain the caches before I purge > them? You need a bit somewhere to flag whether a file in your mini filesystem is temporary (cached) or permanent. A cached file is subject to LRU replacement while a permanent file is not. You can create files "1.cached", "2.cached", etc. and put either a 1 or a 0 in these files to indicate if the file is cached or permanent. For the LRU, you can create a linked list in memory to do LRU. But you should not serialize this structure to disk every time it is accessed. You can write it out to a file (may be calling it "lru_index") when you are writing out another file. > Another thing is the SSL, I know I need to make a private key via > the shell as I'd done that before setting an SSL server. However, > for certificate verifying signed files, I wonder if there is any > openSSL API that I could used directly instead of going to exec a > command line, it would cumbersome to do that everytime trying to > verify a file. Please see: http://merlot.usc.edu/cs551-f04/projects/final.html#cert http://merlot.usc.edu/cs551-f04/projects/final.html#popen By the way, I don't know why you say "SSL". We are not doing SSL (Secure Socket Layer). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Nov 9 23:19:08 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAA7J8ja023612 for ; Tue, 9 Nov 2004 23:19:08 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAA7NEgv025059 for ; Tue, 9 Nov 2004 23:23:14 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAA7NELr025057 for cs551@merlot.usc.edu; Tue, 9 Nov 2004 23:23:14 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAA7NEgv025054 for ; Tue, 9 Nov 2004 23:23:14 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAA7NE15025050 for ; Tue, 9 Nov 2004 23:23:14 -0800 Message-Id: <200411100723.iAA7NE15025050@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: files in current working directory Date: Tue, 09 Nov 2004 23:23:14 -0800 From: william@bourbon.usc.edu Someone wrote: > From the spec: > Otherwise, foo is relative to the user's current working > directory. > > Is this the directory from which "sv_node" runs or is it the home > directory specified in the .ini file? It's the current working directory. Just call getcwd() or getwd() to get the current working directory. (Imagine that your sv_node is installed in something like /usr/bin and anyone can run it.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Nov 9 22:35:25 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iAA6ZPja022725 for ; Tue, 9 Nov 2004 22:35:25 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAA6dWgv015996 for ; Tue, 9 Nov 2004 22:39:32 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iAA6dWWb015994 for cs551@merlot.usc.edu; Tue, 9 Nov 2004 22:39:32 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iAA6dWgv015985 for ; Tue, 9 Nov 2004 22:39:32 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iAA6dWkb015981 for ; Tue, 9 Nov 2004 22:39:32 -0800 Message-Id: <200411100639.iAA6dWkb015981@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: check message Date: Tue, 09 Nov 2004 22:39:32 -0800 From: william@bourbon.usc.edu Someone wrote: > suppose a reg node sends a check message and before it gets a > resp if the beacon breaks how long should the reg node wait > before it restarts, I dont find anything like a check resp > timeout or something like that in the spec? > Or should I wait based on the message timeout?? Please see my message with timestamp "Fri 05 Nov 08:12". -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 8 23:07:14 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iA977Eja025843 for ; Mon, 8 Nov 2004 23:07:14 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA97BNgv024454 for ; Mon, 8 Nov 2004 23:11:23 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iA97BNuA024449 for cs551@merlot; Mon, 8 Nov 2004 23:11:23 -0800 Date: Mon, 8 Nov 2004 23:11:23 -0800 From: william@bourbon.usc.edu Message-Id: <200411090711.iA97BNuA024449@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: requirements added (explicitly) for the final project... Hi, I've mentioned in class and in e-mails to the whole class about not using large memory buffers. I just noticed that I cannot find this specified in the spec. So, I'm making it explicit by adding the following in the Miscellaneous section of the project spec: [BC: Added 11/8/2004] The maximum size of a memory buffer is limited to 8,192 bytes. I also made a modification to the note about doing everything in a single process and using the current working directory for "status" commands. Please search for the "BC:" string in the spec to see all these updates. These udpates to the spec are basically of the "clarafication" types. So, none of them really changed anything. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Nov 8 20:55:40 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iA94teja022894 for ; Mon, 8 Nov 2004 20:55:40 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA94xngv029832 for ; Mon, 8 Nov 2004 20:59:49 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iA94xnaY029830 for cs551@merlot.usc.edu; Mon, 8 Nov 2004 20:59:49 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA94xngv029827 for ; Mon, 8 Nov 2004 20:59:49 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iA94xnIB029823 for ; Mon, 8 Nov 2004 20:59:49 -0800 Message-Id: <200411090459.iA94xnIB029823@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: SHA1 in store message Date: Mon, 08 Nov 2004 20:59:49 -0800 From: william@bourbon.usc.edu Someone wrote: > When a node receives a store message, it should first compute the SHA1 > hash of the file (FileData), compare it with the SHA1 hash value in the > Metadata, drop the packet if its not the same? This is done before a node > decides wether to store/forward the store message right? Either way is fine. Please document your choice. > To compute a SHA1 hash value of a file, do we copy the entire content of > the file to the memory buffer (in SHA1()) even if its a large file? You will lose *a lot of points* if you allocate *large* memory buffers. You should use the code similiar to what you did in warmup project #1. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Nov 8 17:21:20 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iA91LKja018560 for ; Mon, 8 Nov 2004 17:21:20 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA91PUgv023168 for ; Mon, 8 Nov 2004 17:25:30 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iA91PU0w023163 for cs551@merlot.usc.edu; Mon, 8 Nov 2004 17:25:30 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA91PTgv023157 for ; Mon, 8 Nov 2004 17:25:29 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iA91PTB8023153 for ; Mon, 8 Nov 2004 17:25:29 -0800 Message-Id: <200411090125.iA91PTB8023153@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: openssl absolute path Date: Mon, 08 Nov 2004 17:25:29 -0800 From: william@bourbon.usc.edu Someone wrote: > I am trying to create a private key file and public key certificate. > The command in the spec: > /bin/echo "US\nCA\nLA\nUSC\nServant-`date +%d%b%Y`-rootca `hostname`\naphadke@usc.edu\n\n\n" | openssl req -new -nodes -newkey rsa:1024 -x509 -keyout private.pem -out cert.pem > > gave an error (openssl was not found in the path). > I replaced it with absolute path for openssl: > > /bin/echo "US\nCA\nLA\nUSC\nServant-`date +%d%b%Y`-rootca `hostname`\naphadke@usc.edu\n\n\n" | /usr/lsd/openssl/0.9.7c/bin/openssl req -new -nodes -newkey rsa:1024 -x509 -keyout private.pem -out cert.pem > > and it works fine..... so should I go ahead and add path for openssl in my .cshrc file? You can use "/usr/lsd/openssl/0.9.7c/bin/openssl" or just leave it at "openssl" and add "/usr/lsd/openssl/0.9.7c/bin" to your path. The grader will have "/usr/lsd/openssl/0.9.7c/bin" in his path. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Nov 8 10:41:05 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iA8If5ja009677 for ; Mon, 8 Nov 2004 10:41:05 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA8IjFgv006403 for ; Mon, 8 Nov 2004 10:45:15 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iA8IjFjQ006401 for cs551@merlot.usc.edu; Mon, 8 Nov 2004 10:45:15 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA8IjFgv006398 for ; Mon, 8 Nov 2004 10:45:15 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iA8IjF4r006394 for ; Mon, 8 Nov 2004 10:45:15 -0800 Message-Id: <200411081845.iA8IjF4r006394@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: store and 1.data Date: Mon, 08 Nov 2004 10:45:15 -0800 From: william@bourbon.usc.edu Someone wrote: > From the specs: > > To store file foo into the SERVANT, the user should enter: > > store foo [tag1="value1" tag2="value2" ...] > > Does it mean that I need to copy the file 'foo' to my mini > filesystem directory structure and name it as 1.data (or 2.data > and so on....) Yes. And you should find "foo" in your current working directory (and not the HomeDir of your node). For part (2), you will get points deducted if you look for "foo" in your HomeDir. Of course, if we have a graphical user interface, this would be like uploading a JPEG file where you would click a "Browse" button and the GUI will let you choose a file (starting from your working directory). Given that we won't have a GUI, we'll just use the working directory, if you don't specify a full path. > If thats the case, then wont we have two copies > of the same file or I am missing something out here? Sure, but you can simply delete the file in the working directory and that shouldn't affect the other copy. Imagine you upload your JPEG file to a peer-to-peer system and not knowing that one of the nodes of the peer-to-peer system is also on your machine (probably started by a different user). Then it is clearly possible that you have 2 copies of your JPEG file. In general, you should make your code more *general*. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Nov 7 22:34:21 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iA86YLja026702 for ; Sun, 7 Nov 2004 22:34:21 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA86cVgv021565 for ; Sun, 7 Nov 2004 22:38:31 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iA86cVU1021563 for cs551@merlot.usc.edu; Sun, 7 Nov 2004 22:38:31 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA86cVgv021560 for ; Sun, 7 Nov 2004 22:38:31 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iA86cVi2021550 for ; Sun, 7 Nov 2004 22:38:31 -0800 Message-Id: <200411080638.iA86cVi2021550@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Status Timeout Date: Sun, 07 Nov 2004 22:38:31 -0800 From: william@bourbon.usc.edu Someone wrote: > I can't seem to find anything in the spec about how long to > wait for status response messages. Can you please tell me. Please see my message with timestamp "Fri 05 Nov 08:12". Same rationale applies. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Nov 7 20:35:56 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iA84Zuja024288 for ; Sun, 7 Nov 2004 20:35:56 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA84e7gv006254 for ; Sun, 7 Nov 2004 20:40:07 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iA84e7qo006252 for cs551@merlot.usc.edu; Sun, 7 Nov 2004 20:40:07 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA84e7gv006244 for ; Sun, 7 Nov 2004 20:40:07 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iA84e74M006239 for ; Sun, 7 Nov 2004 20:40:07 -0800 Message-Id: <200411080440.iA84e74M006239@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: hw2-2 Date: Sun, 07 Nov 2004 20:40:07 -0800 From: william@bourbon.usc.edu Someone wrote: > When I do call XGraph.. it gives me "cant find command .."error, but the > trace file I want is generated. I used /usr/usc/X/bin/xgraph and opened > the > Trace file, exported it to ps and submitted it with my homework. Is this > acceptable? Why can't you call /usr/usc/X/bin/xgraph in your script code? -- Bill Cheng // bill.cheng@usc.edu   >>-----Original Message----- >>From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] >>Sent: Sunday, November 07, 2004 12:32 PM >>To: cs551@bourbon.usc.edu >>Subject: Re: hw2-2 >> >>Someone wrote: >> >> > HW2-2 says that we need to plot an XGraph and write out >> > observations based on the output of the plot. >> > So in our hw2-2 tcl script, do we need to show the XGraph, if >> > yes, then what filename should we use for storing the x,y >> > co-ordinates for the graph? >> >>In your hw2-2.tcl script, you should call xgraph at the >>end (just like you use to call nam in hw1). >> >>You can name the output file anything you want and use the >>same filename when you call xgraph. If you are using >>"nam.out" in hw1, you can call this "xgraph.out". Just >>make sure you don't use a name that will wipe out your >>submission. >>-- >>Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Nov 7 12:28:06 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iA7KS5ja014607 for ; Sun, 7 Nov 2004 12:28:05 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA7KWIgv018307 for ; Sun, 7 Nov 2004 12:32:18 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iA7KWIeR018305 for cs551@merlot.usc.edu; Sun, 7 Nov 2004 12:32:18 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA7KWIgv018296 for ; Sun, 7 Nov 2004 12:32:18 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iA7KWIMZ018292 for ; Sun, 7 Nov 2004 12:32:18 -0800 Message-Id: <200411072032.iA7KWIMZ018292@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: hw2-2 Date: Sun, 07 Nov 2004 12:32:18 -0800 From: william@bourbon.usc.edu Someone wrote: > HW2-2 says that we need to plot an XGraph and write out > observations based on the output of the plot. > So in our hw2-2 tcl script, do we need to show the XGraph, if > yes, then what filename should we use for storing the x,y > co-ordinates for the graph? In your hw2-2.tcl script, you should call xgraph at the end (just like you use to call nam in hw1). You can name the output file anything you want and use the same filename when you call xgraph. If you are using "nam.out" in hw1, you can call this "xgraph.out". Just make sure you don't use a name that will wipe out your submission. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Nov 7 00:34:52 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iA78Ypja021736 for ; Sun, 7 Nov 2004 00:34:52 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA78d5gv020422 for ; Sun, 7 Nov 2004 00:39:05 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iA78d5Rv020420 for cs551@merlot.usc.edu; Sun, 7 Nov 2004 00:39:05 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA78d5gv020411 for ; Sun, 7 Nov 2004 00:39:05 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iA78d5FS020407 for ; Sun, 7 Nov 2004 00:39:05 -0800 Message-Id: <200411070839.iA78d5FS020407@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: hw2 Date: Sun, 07 Nov 2004 00:39:05 -0800 From: william@bourbon.usc.edu Someone wrote: > For problem 1 - landmark hierarchy management, should we consider a static > network or a dynamic network (in which node joins/leaves, network failures > could occur and we should adapt to situation) in designing our algorithm? Please only consider statis network. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Nov 6 21:25:55 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iA75Ptja017949 for ; Sat, 6 Nov 2004 21:25:55 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA75U9gv003078 for ; Sat, 6 Nov 2004 21:30:09 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iA75U9ZC003076 for cs551@merlot.usc.edu; Sat, 6 Nov 2004 21:30:09 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA75U9gv003073 for ; Sat, 6 Nov 2004 21:30:09 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iA75U9CF003069 for ; Sat, 6 Nov 2004 21:30:09 -0800 Message-Id: <200411070530.iA75U9CF003069@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Check Message Date: Sat, 06 Nov 2004 21:30:09 -0800 From: william@bourbon.usc.edu Someone wrote: > If a beacon node loses connection with one of its neighbors, must it send > check messages as well? No. > It seems like beacons shouldn't have to send checks > since they are fully connected and don't do join. Exactly. CHECK is only for non-beacon nodes to initiate. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Nov 6 21:24:15 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iA75OFja017939 for ; Sat, 6 Nov 2004 21:24:15 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA75STgv001417 for ; Sat, 6 Nov 2004 21:28:29 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iA75STho001415 for cs551@merlot.usc.edu; Sat, 6 Nov 2004 21:28:29 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA75SSgv001412 for ; Sat, 6 Nov 2004 21:28:29 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iA75SSSI001402 for ; Sat, 6 Nov 2004 21:28:28 -0800 Message-Id: <200411070528.iA75SSSI001402@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: shutdown and restart on network partition Date: Sat, 06 Nov 2004 21:28:28 -0800 From: william@bourbon.usc.edu Someone wrote: > From the spec: > For a network partition: > "This node must therefore rejoin the network (gracefully shutting > itself down and then starting itself again as if it has never > been part of the network)" > > Is the process of shutting down and starting itself again done by > the main program itself? The shutdown and restart are "conceptual". You don't really have to shutdown the node and restart it by running sv_node from a shell. You just need to clean everything up and go to a place in your code as if you are starting from main(). (If you are restarting from main(), you should not have any child thread running.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Nov 5 19:20:01 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iA63K1ja018861 for ; Fri, 5 Nov 2004 19:20:01 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA63OIgv009941 for ; Fri, 5 Nov 2004 19:24:18 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iA63OIri009939 for cs551@merlot.usc.edu; Fri, 5 Nov 2004 19:24:18 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA63OIgv009930 for ; Fri, 5 Nov 2004 19:24:18 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iA63OHGP009914 for ; Fri, 5 Nov 2004 19:24:18 -0800 Message-Id: <200411060324.iA63OHGP009914@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Finger Tables in CHORD Date: Fri, 05 Nov 2004 19:24:17 -0800 From: william@bourbon.usc.edu Someone wrote: > Regarding your discussion of CHORD on wednesday, I do not > understand how the data is in between nodes. I'm not sure exactly what you mean... Let's say you have 2 nodes K1 and K2. They are adjacent because successor(K1)=K2. All data with keys K, such that K1 < K <= K2, have successor(K)=K2 by definition. So, all these data are stored on node K2. > Is every node a > finger entry, or are there assumed more nodes between finger > entries and they just help speed up the forwarding process?? It is important to understand that the successor() function returns the key that corresponds to an actual node while the argument you supply to the successor() call does *not* have to correspond to an actual node. Every entry in a finger table points to a return value of a call to the successor() function. Therefore, every entry in a finger table points to a key that corresponds to an actual node. In a large network, if i is large, there are usually many many nodes between 2 nodes that are pointed to by ith and (i+1)th finger table entries. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Nov 5 08:08:35 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iA5G8Zja005335 for ; Fri, 5 Nov 2004 08:08:35 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA5GCrgv006271 for ; Fri, 5 Nov 2004 08:12:53 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iA5GCrYi006263 for cs551@merlot.usc.edu; Fri, 5 Nov 2004 08:12:53 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA5GCqgv006260 for ; Fri, 5 Nov 2004 08:12:52 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iA5GCq0i006256 for ; Fri, 5 Nov 2004 08:12:52 -0800 Message-Id: <200411051612.iA5GCq0i006256@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: time out for check Date: Fri, 05 Nov 2004 08:12:52 -0800 From: william@bourbon.usc.edu Someone wrote: > How long a node should wait for the check response from > beacon node before deciding to rejoin ? Given that all the nodes in the network are not going to forward responses after MsgLifetime, it should be a function of MsgLifetime. Please set it to something reasonable. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Nov 4 12:05:36 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iA4K5aja013262 for ; Thu, 4 Nov 2004 12:05:36 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA4K9vgv010784 for ; Thu, 4 Nov 2004 12:09:57 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iA4K9vvG010782 for cs551@merlot.usc.edu; Thu, 4 Nov 2004 12:09:57 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA4K9ugv010779 for ; Thu, 4 Nov 2004 12:09:56 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iA4K9uXS010775 for ; Thu, 4 Nov 2004 12:09:56 -0800 Message-Id: <200411042009.iA4K9uXS010775@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: tests for project part1 Date: Thu, 04 Nov 2004 12:09:56 -0800 From: william@bourbon.usc.edu Someone wrote: > specs says--> > > "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. " > > But I interpreted from this is , If beacon node try connecting another > beacon node, if got connected .....send "hello" message. Other beacon node > receives "hello" and see it is already in my neighbor list as I know my > neighbors hostname and port number already. So I should not send "hello" > back. So only one hello message will be in log for one in send for other in > receive. > Since hello message is advertising of hostname and port number. > > I do send hello message back if hello received from any other node which is > not in my neighbor list like any new node. This is not the correct interpretation. I have explained this during lectures and in the e-mail to the whole class. In addition to the message with timestamp "Mon 11 Oct 17:08", another is "Tue 19 Oct 15:59". There are more. Please see: http://merlot.usc.edu/cs551-f04/msgs/bill/all.txt and do a search on the word "exchange". The idea is that 2 nodes (of any type) must *exchange* hello messages when they first connect (if they are participating in the network). -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Thursday, November 04, 2004 11:39 AM Subject: Re: tests for project part1 > Someone wrote: > > > I see in test cases when beacon nodes exchange "HLLO" and it is required > > in log to be two hello messages. > > A node, beacon or not, must log *all* messages. > > > As per specs, beacon node should put all other beacons in its neighbor list > > and A node sends "hello" response back only to those nodes which are not in > > neighbor list. > > I don't know why you are saying this. This is not what the > spec says. Could you quote exactly from the spec? > > > So in case of beacon since all other beacons are in neighbor list so I did > > not send hello response back. But any other node is responded back with > > "hello" if its not in neighbor list. So, only one hello message is seen in > > my log if beacon nodes are exchanging hello and two messages if any other > > node not in neighbor list exchange hello with any node. > > > > I hope this is acceptable. > > This is not correct. We have discussed this further in my > message with timestamp "Mon 11 Oct 17:08". > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Nov 4 11:35:35 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iA4JZZja012651 for ; Thu, 4 Nov 2004 11:35:35 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA4Jdtgv026254 for ; Thu, 4 Nov 2004 11:39:55 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iA4JdtBa026246 for cs551@merlot.usc.edu; Thu, 4 Nov 2004 11:39:55 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA4Jdtgv026243 for ; Thu, 4 Nov 2004 11:39:55 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iA4Jdtcn026239 for ; Thu, 4 Nov 2004 11:39:55 -0800 Message-Id: <200411041939.iA4Jdtcn026239@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: tests for project part1 Date: Thu, 04 Nov 2004 11:39:55 -0800 From: william@bourbon.usc.edu Someone wrote: > I see in test cases when beacon nodes exchange "HLLO" and it is required > in log to be two hello messages. A node, beacon or not, must log *all* messages. > As per specs, beacon node should put all other beacons in its neighbor list > and A node sends "hello" response back only to those nodes which are not in > neighbor list. I don't know why you are saying this. This is not what the spec says. Could you quote exactly from the spec? > So in case of beacon since all other beacons are in neighbor list so I did > not send hello response back. But any other node is responded back with > "hello" if its not in neighbor list. So, only one hello message is seen in > my log if beacon nodes are exchanging hello and two messages if any other > node not in neighbor list exchange hello with any node. > > I hope this is acceptable. This is not correct. We have discussed this further in my message with timestamp "Mon 11 Oct 17:08". -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Nov 3 23:50:40 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iA47oeja030618 for ; Wed, 3 Nov 2004 23:50:40 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA47t1gv028769 for ; Wed, 3 Nov 2004 23:55:01 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iA47t1Y1028767 for cs551@merlot.usc.edu; Wed, 3 Nov 2004 23:55:01 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA47t1gv028761 for ; Wed, 3 Nov 2004 23:55:01 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iA47t1sv028754 for ; Wed, 3 Nov 2004 23:55:01 -0800 Message-Id: <200411040755.iA47t1sv028754@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: name_index observation Date: Wed, 03 Nov 2004 23:55:01 -0800 From: william@bourbon.usc.edu Someone wrote: > The spec (class notes) says that the name_index should be a BST indexed by > file name. And the file names have monotonically increasing names > (file0.dat, file1.dat, file2.dat...). If this is the case then our BST will > simply become a linked list and perform O(n) for search,insert and delete. > Is this acceptable? Or am I missing something? The format of a STORE user command is: store foo [tag1="value1" tag2="value2" ...] So, the file name is "foo". In the "blondie1.mp3" example, the file name is "blondie1.mp3". So, don't use the "internal name". Also, the internal file names should be "1.dat", "2.dat", ... and *not* "file0.dat", "file1.dat", ... -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Nov 3 16:06:09 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iA4069ja020197 for ; Wed, 3 Nov 2004 16:06:09 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA40AVgv008114 for ; Wed, 3 Nov 2004 16:10:31 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iA40AVE8008109 for cs551@merlot.usc.edu; Wed, 3 Nov 2004 16:10:31 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA40AVgv008100 for ; Wed, 3 Nov 2004 16:10:31 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iA40AVda008096 for ; Wed, 3 Nov 2004 16:10:31 -0800 Message-Id: <200411040010.iA40AVda008096@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: openssl testing Date: Wed, 03 Nov 2004 16:10:31 -0800 From: william@bourbon.usc.edu Someone wrote: > I was trying to do some general testing with the openssl commands > just from my SSH session on nunki. When I run any openssl > commands I get the response "openssl: Command not found.". > Should this work or do I have to put it into code and execute it > in a shell and then it will suddenly work ?? Please make sure you've done what's mentioned in: http://merlot.usc.edu/cs551-f04/projects/final.html#openssl If it's still not working, please let me know. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Nov 2 21:47:27 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iA35lQja030262 for ; Tue, 2 Nov 2004 21:47:27 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA35ppgv028893 for ; Tue, 2 Nov 2004 21:51:51 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iA35pp9n028891 for cs551@merlot.usc.edu; Tue, 2 Nov 2004 21:51:51 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA35pogv028888 for ; Tue, 2 Nov 2004 21:51:50 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iA35po4C028884 for ; Tue, 2 Nov 2004 21:51:50 -0800 Message-Id: <200411030551.iA35po4C028884@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Data Files naming convention Date: Tue, 02 Nov 2004 21:51:50 -0800 From: william@bourbon.usc.edu Someone wrote: > In the project spec it states that you must use numeric file name such as > 1.data 1.meta. Why is that? wouldn't it be easier if we can just use the > file name that mkstemp() provides OR sprintf() on time(0) as the file > name. What is the purpose behind the spec? Think of 1, 2, 3, ... as inode numbers in UNIX. This is the basic rationale behind it. It's numbers you manage. Also, it's easy and efficient to implement. I think using mkstemp() would also work. But you will end up with filenames that are totally random. Probably not as easy to *grade*. Using time(0) would not work because you may have 2 files created around the same time. Then you have to use some kind of a sequence number anyway. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Nov 2 21:36:39 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iA35adja030051 for ; Tue, 2 Nov 2004 21:36:39 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA35f3gv018602 for ; Tue, 2 Nov 2004 21:41:04 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iA35f3mU018600 for cs551@merlot.usc.edu; Tue, 2 Nov 2004 21:41:03 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA35f3gv018597 for ; Tue, 2 Nov 2004 21:41:03 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iA35f3q6018587 for ; Tue, 2 Nov 2004 21:41:03 -0800 Message-Id: <200411030541.iA35f3q6018587@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Index Files implementations - BST Date: Tue, 02 Nov 2004 21:41:03 -0800 From: william@bourbon.usc.edu Someone wrote: > I'm confused on how to get O(n) on the > serialization/deserialization process without implementing our > own Btrees. May be you have to implement your own BST if nothing out there let you do what you need. (I'm not sure why you say Btree. B-tree is used in databases and it's not the same as a BST.) > A Btree insert is typically of the form insert(root, > item) and has a complexity of O(log n) even when balanced so > populating the tree will be O(n log n). How can you improve > this? Maybe its a stupid question I should know from undergrad > data structures class, but still. You need to store the *structure* of the BST when you serialize. When you deserialize, you do *not* start with an empty BST and *insert* nodes into this BST. If you store the structure of the BST, you can build the BST in O(n) time. If you are planning to use hash tables instead of BST, assuming that the hash table has an insertion time of O(1), then you don't need to store the structure of your hash table. You can just store the values. When you read the values back, you can insert them back into the hash table and you will achieve O(n). One thing you might want to consider, if doing the BST serialization and deserialization is going to take too much time, is to do what you can with O(n log n). If you have time later, change your code to do O(n). If I have to choose, I would say functionality first and efficiency second. This is simply because when it comes to grading, if there is no functionality (or there is only broken functionality), it's hard to get to the efficiency part. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Tuesday, November 2, 2004 3:44 pm Subject: Re: Index Files implementations - BST > Someone wrote: > > > For the index structures, instead of writing our own BST, I > was wondering > > if we can use something that's already been provided in the STL. > > Yes! Please cite the source in your README file and in your code. > Preferablely, keep these files separate from the files you write. > > > As far as > > I know BST is the underlying implementation for the STL map, > multimap, > set, and multiset. > > I've heard from someone in class complaining about these. So, > I'm not sure if these would work. I'm also not familiar with > STL. (Personally, I don't use templates unless I'm required > to do so. But that's just me. You won't lose points for using > templates.) Remember that you have to serialize the BST into > a file and deserialize it from a file. I don't know if the STL > stuff proves you with these functionalities. > > > Also, when a node chooses to store a file, it updates its BST > structure. > Say in the case when we have a system crash > sometimes afterwards and > > before we shutdown the system (serialize the BSTs), we'll > loose the > > indexes of the files we just stored. Any suggestion to this? > > You should write out the BST structure into the corresponding > index file everything time you insert or delete a node from > the BST! (For this project, you don't need to worry about the > case where the system crashs in the middle of writing out the > file.) Insert (store) and delete are relatively rare in > systems like this. You need to make sure search and retrieve > are fast. The speed on store and delete is not as important. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Nov 2 16:15:49 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iA30Fnja022838 for ; Tue, 2 Nov 2004 16:15:49 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA30KDgv005888 for ; Tue, 2 Nov 2004 16:20:13 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iA30KDEx005880 for ; Tue, 2 Nov 2004 16:20:13 -0800 Message-Id: <200411030020.iA30KDEx005880@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: test cases for grading of final project part (1)... Date: Tue, 02 Nov 2004 16:20:13 -0800 From: william@bourbon.usc.edu Hi, Please note that these test data files are using fixed ports. Therefore, if two students are doing the tests at the same time, there may be conflicts. One thing you can do is to manually modify the n??.ini files after they are copied into your project directory and change them to use your ports. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Mon, 01 Nov 2004 21:49:21 -0800 From: william@bourbon.usc.edu To: cs551@merlot.usc.edu Subject: Re: test cases for grading of final project part (1)... Someone wrote: > In "b1" case following command fails... > cp ~/grading/guidelines/final1/b1/n??.ini . > /home/scf-27/gmittal/grading/guidelines/final1/b1/: No such file or > directory > Am I doing something wrong? > or How should I access n00.ini ....? Oops! That directory does not exist. I need to fix *all* these files. Please wait about 30 minutes before accessing them again (and please make sure you do a *reload*). Sorry! -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Monday, November 01, 2004 4:41 PM Subject: test cases for grading of final project part (1)... > Hi, > > I've posted the test cases that the grader will be using > to grade final project part (1): > > http://merlot.usc.edu/cs551-f04/projects/testcases/part1.html#grading > > At some point, the grader may ask you to give him a demo if > he is having trouble getting your code to work with these > test cases. Please make sure that you have tried these test > cases out by then so you can get as much (partial) credit as > you can. If, by the time of the demo appointment, you haven't > tried these out, you will not get another chance to do the > demo. So, please be prepared. > > If you see any problem with these test cases, please send > e-mail to both the grader and myself. Thanks! > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Nov 2 15:40:21 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iA2NeLja022147 for ; Tue, 2 Nov 2004 15:40:21 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA2Nikgv004802 for ; Tue, 2 Nov 2004 15:44:46 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iA2NikTF004799 for cs551@merlot.usc.edu; Tue, 2 Nov 2004 15:44:46 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA2Nijgv004791 for ; Tue, 2 Nov 2004 15:44:45 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iA2NijHw004787 for ; Tue, 2 Nov 2004 15:44:45 -0800 Message-Id: <200411022344.iA2NijHw004787@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Index Files implementations - BST Date: Tue, 02 Nov 2004 15:44:45 -0800 From: william@bourbon.usc.edu Someone wrote: > For the index structures, instead of writing our own BST, I was wondering > if we can use something that's already been provided in the STL. Yes! Please cite the source in your README file and in your code. Preferablely, keep these files separate from the files you write. > As far as > I know BST is the underlying implementation for the STL map, multimap, > set, and multiset. I've heard from someone in class complaining about these. So, I'm not sure if these would work. I'm also not familiar with STL. (Personally, I don't use templates unless I'm required to do so. But that's just me. You won't lose points for using templates.) Remember that you have to serialize the BST into a file and deserialize it from a file. I don't know if the STL stuff proves you with these functionalities. > Also, when a node chooses to store a file, it updates its BST structure. > Say in the case when we have a system crash sometimes afterwards and > before we shutdown the system (serialize the BSTs), we'll loose the > indexes of the files we just stored. Any suggestion to this? You should write out the BST structure into the corresponding index file everything time you insert or delete a node from the BST! (For this project, you don't need to worry about the case where the system crashs in the middle of writing out the file.) Insert (store) and delete are relatively rare in systems like this. You need to make sure search and retrieve are fast. The speed on store and delete is not as important. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 1 21:44:55 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iA25itja031973 for ; Mon, 1 Nov 2004 21:44:55 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA25nLgv006680 for ; Mon, 1 Nov 2004 21:49:21 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iA25nLEA006676 for ; Mon, 1 Nov 2004 21:49:21 -0800 Message-Id: <200411020549.iA25nLEA006676@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: test cases for grading of final project part (1)... Date: Mon, 01 Nov 2004 21:49:21 -0800 From: william@bourbon.usc.edu Someone wrote: > In "b1" case following command fails... > cp ~/grading/guidelines/final1/b1/n??.ini . > /home/scf-27/gmittal/grading/guidelines/final1/b1/: No such file or > directory > Am I doing something wrong? > or How should I access n00.ini ....? Oops! That directory does not exist. I need to fix *all* these files. Please wait about 30 minutes before accessing them again (and please make sure you do a *reload*). Sorry! -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Monday, November 01, 2004 4:41 PM Subject: test cases for grading of final project part (1)... > Hi, > > I've posted the test cases that the grader will be using > to grade final project part (1): > > http://merlot.usc.edu/cs551-f04/projects/testcases/part1.html#grading > > At some point, the grader may ask you to give him a demo if > he is having trouble getting your code to work with these > test cases. Please make sure that you have tried these test > cases out by then so you can get as much (partial) credit as > you can. If, by the time of the demo appointment, you haven't > tried these out, you will not get another chance to do the > demo. So, please be prepared. > > If you see any problem with these test cases, please send > e-mail to both the grader and myself. Thanks! > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 1 16:36:43 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iA20ahja025823 for ; Mon, 1 Nov 2004 16:36:43 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA20fAgv012746 for ; Mon, 1 Nov 2004 16:41:10 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iA20fAlp012744 for cs551@merlot; Mon, 1 Nov 2004 16:41:10 -0800 Date: Mon, 1 Nov 2004 16:41:10 -0800 From: william@bourbon.usc.edu Message-Id: <200411020041.iA20fAlp012744@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: test cases for grading of final project part (1)... Hi, I've posted the test cases that the grader will be using to grade final project part (1): http://merlot.usc.edu/cs551-f04/projects/testcases/part1.html#grading At some point, the grader may ask you to give him a demo if he is having trouble getting your code to work with these test cases. Please make sure that you have tried these test cases out by then so you can get as much (partial) credit as you can. If, by the time of the demo appointment, you haven't tried these out, you will not get another chance to do the demo. So, please be prepared. If you see any problem with these test cases, please send e-mail to both the grader and myself. Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 1 13:12:20 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iA1LCKja021091 for ; Mon, 1 Nov 2004 13:12:20 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA1LGlgv002619 for ; Mon, 1 Nov 2004 13:16:47 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iA1LGlVJ002617 for cs551@merlot; Mon, 1 Nov 2004 13:16:47 -0800 Date: Mon, 1 Nov 2004 13:16:47 -0800 From: william@bourbon.usc.edu Message-Id: <200411012116.iA1LGlVJ002617@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: office hours this week... Hi, I've mentioned that I will be holding full office hours this week because of the midterm exam. Well, so far no one has come to discuss about the exam! So, I'm cutting my office hour short today. For Wednesday, I'll go back to the original schedule that I will be there for the first 15 minutes, if no one is there waiting for me at the end of the 15 minutes, I'll leave. If you want to discuss about your exam, please make an appointment (even if it's for a timeslot during the office hour). Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Oct 31 22:27:29 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iA16RTja002989 for ; Sun, 31 Oct 2004 22:27:29 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA16Vwgv010243 for ; Sun, 31 Oct 2004 22:31:58 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iA16Vw1t010235 for cs551@merlot.usc.edu; Sun, 31 Oct 2004 22:31:58 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA16Vvgv010232 for ; Sun, 31 Oct 2004 22:31:57 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iA16Vvr4010230 for cs551; Sun, 31 Oct 2004 22:31:57 -0800 Date: Sun, 31 Oct 2004 22:31:57 -0800 From: william@bourbon.usc.edu Message-Id: <200411010631.iA16Vvr4010230@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: cannot get join to work for part (2)... Hi, Someone suggested that it's possible to have more than a beacon-only network even if he/she cannot get JOIN (and CHECK) to work for part (2). The idea is to manually create init_neighbor_list files! I didn't think about the possibility of having a manually created "init_neighbor_list" file before! I think that's a good way to go if you are having trouble with JOIN (and CHECK). So, if you don't want to work on CHECK and would like to have "init_neighbor_list" manually created for you, you will lose 17 points to start with (15 from code and 2 from documentation). Please make sure you say this up front in your README file to save the grader some time. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Oct 31 22:22:30 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iA16MUja002908 for ; Sun, 31 Oct 2004 22:22:30 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA16Qxgv005484 for ; Sun, 31 Oct 2004 22:26:59 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iA16QxDZ005479 for cs551@merlot.usc.edu; Sun, 31 Oct 2004 22:26:59 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA16Qxgv005476 for ; Sun, 31 Oct 2004 22:26:59 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iA16QxJW005471 for ; Sun, 31 Oct 2004 22:26:59 -0800 Message-Id: <200411010626.iA16QxJW005471@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Proj 1 Grading Date: Sun, 31 Oct 2004 22:26:59 -0800 From: william@bourbon.usc.edu Someone wrote: > I know it is too late to make any changes to our project 1 > submission, but say for instance I found the line of code that > was making my nodes crash intermittantly (an extra delete line). > Would it make a difference to the grading if I detailed my > finding and submitted it to the grader? Perhaps would the grader > only take the fixed amount off for a seg fault instead of > considering a whole portion of the program as failing if I showed > him this. Or is it too late? Please let the grader know now to make grading easier. Since it costs 3 points per line modification within 48 hours after the submission deadline (the first 3 modifications being free), you can expect that it will cost *at least* 5 points per line of modification now. The grader will decide exactly how many points to take off on a case-by-case basis. But it would definitely be better if you let him know early. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Oct 31 19:09:09 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iA1399ja031408 for ; Sun, 31 Oct 2004 19:09:09 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA13Dcgv016241 for ; Sun, 31 Oct 2004 19:13:38 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iA13DcwU016239 for cs551@merlot.usc.edu; Sun, 31 Oct 2004 19:13:38 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iA13Dcgv016236 for ; Sun, 31 Oct 2004 19:13:38 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id iA13Dc6Y016226 for ; Sun, 31 Oct 2004 19:13:38 -0800 Message-Id: <200411010313.iA13Dc6Y016226@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: final project part II unfinished parts Date: Sun, 31 Oct 2004 19:13:37 -0800 From: william@bourbon.usc.edu Someone wrote: > If we did not finish some parts of part (I) in time for the > due date, such as the status message, will it be graded (or > required) for part (II)? "status neighbor" is needed to look at the connectivity of your network! If it doesn't work, it would be very difficult to see what your network look like. Also, how can you debug and make sure you that you have the right connectivity and that are doing the right thing? Therefore, it's very important that you get it to work. If you have trouble getting it to work right, please come see me during my office hour. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 26 21:35:47 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9R4Zlja003584 for ; Tue, 26 Oct 2004 21:35:47 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9R4eSgv008844 for ; Tue, 26 Oct 2004 21:40:28 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9R4eSBK008842 for cs551@merlot; Tue, 26 Oct 2004 21:40:28 -0700 Date: Tue, 26 Oct 2004 21:40:28 -0700 From: william@bourbon.usc.edu Message-Id: <200410270440.i9R4eSBK008842@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: if you haven't submited anything, submit something soon! Hi, I noticed that only 20 students have submitted something. If you have not made a submission, I suggest that you do some cleanup now, create a submission file, and submit *something* soon. (Even if this code crashes, as long as it compiles, it's better than nothing.) When it gets close to the deadline, you will find that time really flies. If you miss the deadline, the penalty is *too severe*! So, please don't miss the deadline. I cannot make any exception if you miss the deadline. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Oct 26 19:55:55 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9R2ttja001426 for ; Tue, 26 Oct 2004 19:55:55 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9R30agv011219 for ; Tue, 26 Oct 2004 20:00:36 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9R30ang011217 for cs551@merlot.usc.edu; Tue, 26 Oct 2004 20:00:36 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9R30agv011214 for ; Tue, 26 Oct 2004 20:00:36 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9R30alR011210 for ; Tue, 26 Oct 2004 20:00:36 -0700 Message-Id: <200410270300.i9R30alR011210@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: readme file Date: Tue, 26 Oct 2004 20:00:36 -0700 From: william@bourbon.usc.edu Someone wrote: > Is it possible to extend the deadline by one hour at least to compensate for > the loss during yester night? I believe it will be invaluable. Sorry, but no. The deadline stands. The whole point is to work on this *early*! It's not meant to be worked on at the last minutes/hours. > Also, can we submit a more detailed README file later on to be able to > explain the design more comprehensively for aiding grading? You *cannot* submit a more detailed README file. All modifications (Makefile, code or documentation) is subject to the rules specified in: http://merlot.usc.edu/cs551-f04/projects.html#mods So, one line of modification (Makefile, code or documentation) is 128 characters max! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Oct 26 17:42:28 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9R0gSja031180 for ; Tue, 26 Oct 2004 17:42:28 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9R0lBgv014134 for ; Tue, 26 Oct 2004 17:47:11 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9R0lA3W014126 for cs551@merlot.usc.edu; Tue, 26 Oct 2004 17:47:10 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9R0lAgv014123 for ; Tue, 26 Oct 2004 17:47:10 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9R0lAa4014119 for ; Tue, 26 Oct 2004 17:47:10 -0700 Message-Id: <200410270047.i9R0lAa4014119@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Home dir Date: Tue, 26 Oct 2004 17:47:10 -0700 From: william@bourbon.usc.edu Someone wrote: > AS home directory needs to be created if not created already. > but 'mkdir' command takes only > /home/servant > not like > home/servat/16704 > should I just run mkdir on homeDir path from ini file? I mean It will be > like /home/servant or any other way to create like directory/subdirectory?? I'm not sure why "home/servat/16704" doesn't work, assuming that "./home/servat" already exists. If "./home/servat" does not exist, you can create it. So, if you do it recursively, you should be able to create it. It should be very easy to write. You should create the home directory if it does not exist. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Oct 26 14:44:06 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9QLi6ja027558 for ; Tue, 26 Oct 2004 14:44:06 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9QLmmgv007210 for ; Tue, 26 Oct 2004 14:48:48 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9QLmm2T007208 for cs551@merlot.usc.edu; Tue, 26 Oct 2004 14:48:48 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9QLmmgv007205 for ; Tue, 26 Oct 2004 14:48:48 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9QLmmjH007201 for ; Tue, 26 Oct 2004 14:48:48 -0700 Message-Id: <200410262148.i9QLmmjH007201@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: include ini file? Date: Tue, 26 Oct 2004 14:48:48 -0700 From: william@bourbon.usc.edu Someone wrote: > Is it okay if we submit our own .ini files with our project? If you know that your code work with a particular setup, you can include them. But make sure you document how you use them! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Oct 26 07:49:50 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9QEnoja019166 for ; Tue, 26 Oct 2004 07:49:50 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9QEsXgv006364 for ; Tue, 26 Oct 2004 07:54:33 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9QEsXAi006362 for cs551@merlot.usc.edu; Tue, 26 Oct 2004 07:54:33 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9QEsXgv006356 for ; Tue, 26 Oct 2004 07:54:33 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9QEsWFa006349 for ; Tue, 26 Oct 2004 07:54:33 -0700 Message-Id: <200410261454.i9QEsWFa006349@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Servers are down again Date: Tue, 26 Oct 2004 07:54:32 -0700 From: william@bourbon.usc.edu Someone wrote: > It's 12:30am Tuesday morning, and the server has gone down > again. I've been told that the scf-fs filesystem is down. > > I'll keep trying to reconnect, but I thought you should know > what's going on. Apparently, this is a "scheduled" downtime. Please see my message with timestamp "Mon 25 Oct 17:22". -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Oct 25 21:35:47 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9Q4Zlja006424 for ; Mon, 25 Oct 2004 21:35:47 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9Q4eVgv011995 for ; Mon, 25 Oct 2004 21:40:31 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9Q4eVX5011990 for cs551@merlot.usc.edu; Mon, 25 Oct 2004 21:40:31 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9Q4eVgv011987 for ; Mon, 25 Oct 2004 21:40:31 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9Q4eVIA011983 for ; Mon, 25 Oct 2004 21:40:31 -0700 Message-Id: <200410260440.i9Q4eVIA011983@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Autoshutdown Date: Mon, 25 Oct 2004 21:40:31 -0700 From: william@bourbon.usc.edu Someone wrote: > I am facing a problem,when either a beacon or non beacon shuts > down either manually(cntrl c) or due to autoshutdown, the other > nodes think that the node that is down think that the node is > still active and try forwarding it to it and hence cause > segmentation fault becuase they are trying to write to a socket > that is non existant, can the nodes send some sort of message to > the nodes that it is connected to so that the other nodes can > remove the entries from the routing table etc. No. You need to stick to the spec. I don't know how you can write to a socket that is "non-existant". If it doesn't exist, how can you write to it?! May be I'm not understanding what "non-existant" mean. Once a socket is closed, you shouldn't write to it. If you can close a socket and write to it simulatneously, you probably need a mutex!!! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Oct 25 21:32:50 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9Q4Woja006377 for ; Mon, 25 Oct 2004 21:32:50 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9Q4bYgv009200 for ; Mon, 25 Oct 2004 21:37:34 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9Q4bYDj009198 for cs551@merlot.usc.edu; Mon, 25 Oct 2004 21:37:34 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9Q4bYgv009195 for ; Mon, 25 Oct 2004 21:37:34 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9Q4bYbE009191 for ; Mon, 25 Oct 2004 21:37:34 -0700 Message-Id: <200410260437.i9Q4bYbE009191@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Test Cases Date: Mon, 25 Oct 2004 21:37:34 -0700 From: william@bourbon.usc.edu Someone wrote: > what are the kind of test cases we are supposed to implement > or what test cases will be used to test? There are some test cases given in the spec (near the bottom of the spec). But you should be able to come up with your own. Remember, this is a graduate level class after all. Don't tell me you don't know how to test your own program! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Oct 25 21:31:00 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9Q4V0ja006330 for ; Mon, 25 Oct 2004 21:31:00 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9Q4Zigv007467 for ; Mon, 25 Oct 2004 21:35:44 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9Q4Zi0h007465 for cs551@merlot.usc.edu; Mon, 25 Oct 2004 21:35:44 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9Q4Zigv007462 for ; Mon, 25 Oct 2004 21:35:44 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9Q4ZijG007458 for ; Mon, 25 Oct 2004 21:35:44 -0700 Message-Id: <200410260435.i9Q4ZijG007458@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: nam not working Date: Mon, 25 Oct 2004 21:35:44 -0700 From: william@bourbon.usc.edu Someone wrote: > nam is not working because ~csci551 is not readable. > > See .. > nunki.usc.edu(66): ls ~csci551 > /home/scf-22/csci551 unreadable If you do "ls -ldg ~csci551", you'll get: drwx--x--x 25 csci551 csci-551 2560 Oct 24 21:14 /home/scf-22/csci551/ This should explain why you get the "unreadable" error (becuase you are suppose to get that). Isn't it clear from HW1 spec that you are suppose to do: ~csci551/nam > I am not much aware of nam format, I can not test as its not working. Now that you know the right way, you don't have this problem any more. > if anyone could help me how to write in a file in nam format. > If I see the example given in specs, I dont understand the first line. > V -t * -v 1.0a5 ???? what is this? > n -t * -s 3 -c red -i black > n -t * -s 4 -c red -i black > l -t * -s 3 -d 4 -c blue > > I understand is.....As i know destination and source of each link from > status response. > line 2nd and 3rd for each node. > line 4th for link in between them. > What about first one. > are these the only lines to write or anything else like any other flag. I don't know exactly what the first line is for. If it works, just keep it. Please don't send me questions about nam any more. Post it in the discussion board or try figuring it out for yourself. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Oct 25 17:23:43 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9Q0Nhja001122 for ; Mon, 25 Oct 2004 17:23:43 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9Q0SSgv003603 for ; Mon, 25 Oct 2004 17:28:28 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9Q0SSKf003601 for cs551@merlot.usc.edu; Mon, 25 Oct 2004 17:28:28 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9Q0SSgv003598 for ; Mon, 25 Oct 2004 17:28:28 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9Q0SSaO003594 for ; Mon, 25 Oct 2004 17:28:28 -0700 Message-Id: <200410260028.i9Q0SSaO003594@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS551 - Part 1 Grading question Date: Mon, 25 Oct 2004 17:28:28 -0700 From: william@bourbon.usc.edu Someone wrote: > I read your reponse and you said "a lot less points". This is > where I'm not sure. > For Part 1, not implementing join doesn't effect the other 3 > messages. > I understand it'll cause more for not having join in Part 2 where > things depend > on it, but for Part 1 join is quite independent. > Does that still mean join weighs more points then the other 3 > messages in Part 1 grading ? I'm having trouble seeing this "grading by message" approach. I don't know, at this point, exactly how many points will be taken off if you do a beacon-only network, even if it works perfectly. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Tuesday, October 26, 2004 7:32 am Subject: Re: CS551 - Part 1 Grading question > Someone wrote: > > > I just have a question on the grading policy for Part 1. > > Is every message weighted equally ? > > The reason I'm asking is I have 3 messages working properly > except "join". > > Please see my message with timestamp "Fri 22 Oct 15:09" > regarding beacon-only networks. > > > However, as you might know, many of us is under heavy load. So > if all 4 > > messages are weighted equally, then I think I'll leave "join" > for part 2 > > which I think is acceptable lost for me to study for other exams. > > This is why I asked all of you to start your project *early*, > too many times. Time management is not as easy as it appeared > when you have too many balls to juggle. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Oct 25 17:17:35 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9Q0HZja000979 for ; Mon, 25 Oct 2004 17:17:35 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9Q0MKgv001282 for ; Mon, 25 Oct 2004 17:22:20 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9Q0MKg8001280 for cs551@merlot.usc.edu; Mon, 25 Oct 2004 17:22:20 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9Q0MKgv001277 for ; Mon, 25 Oct 2004 17:22:20 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9Q0MK8I001273 for ; Mon, 25 Oct 2004 17:22:20 -0700 Message-Id: <200410260022.i9Q0MK8I001273@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: strange broadcast msg from nobody Date: Mon, 25 Oct 2004 17:22:20 -0700 From: william@bourbon.usc.edu Someone wrote: > I received this message while doing my project: > bash-2.05b$ Broadcast Message from nobody (???) on nunki.usc.edu > Mon Oct 25 17:17:37... > SCF-FS down in 7 hours 13 minutes at 0:30 for 1 hour for hardware > fix. > > Is this a prank or it is really going to be down for an hour? My guess is that this is a real system message. Sounds like a good time for a midnight snack. A "planned" downtime is something you can probably figure into your schedule! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Oct 25 17:15:36 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9Q0Faja000932 for ; Mon, 25 Oct 2004 17:15:36 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9Q0KKgv000507 for ; Mon, 25 Oct 2004 17:20:20 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9Q0KKDU000505 for cs551@merlot.usc.edu; Mon, 25 Oct 2004 17:20:20 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9Q0KKgv000496 for ; Mon, 25 Oct 2004 17:20:20 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9Q0KKHw000492 for ; Mon, 25 Oct 2004 17:20:20 -0700 Message-Id: <200410260020.i9Q0KKHw000492@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: fclose(stdin) question Date: Mon, 25 Oct 2004 17:20:20 -0700 From: william@bourbon.usc.edu Someone wrote: > Problem solved, using (cin >> c) iostream to get the character > such that pthread_cancel should cancel the console stream > nicely. Thanks. Good to know! -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Monday, October 25, 2004 3:21 pm Subject: Re: fclose(stdin) question > Hmm... Interesting. (I would assume that gets() just > calls read(). Well, may be not. Select() saves the day > again! > -- > Bill Cheng // bill.cheng@usc.edu > > > > -----Original Message----- > Date: Tue, 26 Oct 2004 06:05:36 +0800 > To: william@bourbon.usc.edu > Subject: Re: fclose(stdin) question > > Hi, > > I had a similar problem. I think it depends on what kind of > function you are > calling to read from stdin. > I was using gets and it would hang my program. I'm pretty sure I > ended the t > hread properly. > Anyway, using select() should solve the problem. > > > > > ----- Original Message ----- > From: william@bourbon.usc.edu > Date: Tuesday, October 26, 2004 5:25 am > Subject: Re: fclose(stdin) question > > > Someone wrote: > > > > > I just have a quick question and only that single problem left. > > > When I autoshutdown the nodes, however my servant> console is > > > still active, how do I really close that nicely without sending > > > itself a termination signal and exit hardly. I try > fclose(stdin) > > but it sill doesn't work, and I search through > the net, people > > > are doing this that way, but it seems that is doesn't work on > > > nunki, is there any thing I missed? I'd try on my windows > system, > > it works perfectly. > > > > I don't think you need to fclose(stdin). What is the problem > > if you don't close stdin? > > > > Is the problem that you have a thread that is blocked trying > > to read from stdin? It shouldn't be a problem if you just > > cancel this thread since read() is a cancellation point. > > -- > > Bill Cheng // bill.cheng@usc.edu > > Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Oct 25 16:27:17 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9PNRHja032416 for ; Mon, 25 Oct 2004 16:27:17 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9PNW1gv015178 for ; Mon, 25 Oct 2004 16:32:01 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9PNW1JR015176 for cs551@merlot.usc.edu; Mon, 25 Oct 2004 16:32:01 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9PNW1gv015173 for ; Mon, 25 Oct 2004 16:32:01 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9PNW1uI015169 for ; Mon, 25 Oct 2004 16:32:01 -0700 Message-Id: <200410252332.i9PNW1uI015169@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS551 - Part 1 Grading question Date: Mon, 25 Oct 2004 16:32:01 -0700 From: william@bourbon.usc.edu Someone wrote: > I just have a question on the grading policy for Part 1. > Is every message weighted equally ? > The reason I'm asking is I have 3 messages working properly except "join". Please see my message with timestamp "Fri 22 Oct 15:09" regarding beacon-only networks. > However, as you might know, many of us is under heavy load. So if all 4 > messages are weighted equally, then I think I'll leave "join" for part 2 > which I think is acceptable lost for me to study for other exams. This is why I asked all of you to start your project *early*, too many times. Time management is not as easy as it appeared when you have too many balls to juggle. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Oct 25 16:22:41 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9PNMfja032335 for ; Mon, 25 Oct 2004 16:22:41 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9PNRQgv013465 for ; Mon, 25 Oct 2004 16:27:26 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9PNRQ9u013463 for cs551@merlot.usc.edu; Mon, 25 Oct 2004 16:27:26 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9PNRQgv013460 for ; Mon, 25 Oct 2004 16:27:26 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9PNRQow013453 for ; Mon, 25 Oct 2004 16:27:26 -0700 Message-Id: <200410252327.i9PNRQow013453@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Neighbors Status Output Date: Mon, 25 Oct 2004 16:27:25 -0700 From: william@bourbon.usc.edu Someone wrote: > I have a question abt nam format, if i read on internet, I see many > flags. > If you could please tell me ,for the followings....... > > Response from nunki:149 connected to nunki:150 > Response from nunki:150 connected to nunki:149 > > l -t * -s nunki:149 -d nunki:150 > l -t * -s nunki:150 -d nunki:149 > > this is sufficient. > -t indicates time, do I write current time when I get response. I really > hardly knows abt nam format. I don't know exactly what works either. Just fire up nam and see if it will take your input (create the input file by hand). -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Sunday, October 24, 2004 10:14 PM Subject: Re: Neighbors Status Output > Someone wrote: > > > Say we get status responses from several nodes like the following: > > > > Response from nunki:149 connected to nunki:150 > > Response from nunki:150 connected to nunki:149 > > > > Should the output file have 2 links or just 1 (i.e 1 link indicated duplex) > > > > l -t * -s nunki:149 -d nunki:150 > > > > or > > l -t * -s nunki:149 -d nunki:150 > > l -t * -s nunki:150 -d nunki:149 > > You should output as soon as you get a response. Therefore, > you should output 2 links. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Oct 25 15:16:26 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9PMGQja030749 for ; Mon, 25 Oct 2004 15:16:26 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9PML9gv021382 for ; Mon, 25 Oct 2004 15:21:09 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9PML9U6021380 for cs551@merlot.usc.edu; Mon, 25 Oct 2004 15:21:09 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9PML9gv021377 for ; Mon, 25 Oct 2004 15:21:09 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9PML9Ym021373 for ; Mon, 25 Oct 2004 15:21:09 -0700 Message-Id: <200410252221.i9PML9Ym021373@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: fclose(stdin) question Date: Mon, 25 Oct 2004 15:21:09 -0700 From: william@bourbon.usc.edu Hmm... Interesting. (I would assume that gets() just calls read(). Well, may be not. Select() saves the day again! -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Tue, 26 Oct 2004 06:05:36 +0800 To: william@bourbon.usc.edu Subject: Re: fclose(stdin) question Hi, I had a similar problem. I think it depends on what kind of function you are calling to read from stdin. I was using gets and it would hang my program. I'm pretty sure I ended the t hread properly. Anyway, using select() should solve the problem. ----- Original Message ----- From: william@bourbon.usc.edu Date: Tuesday, October 26, 2004 5:25 am Subject: Re: fclose(stdin) question > Someone wrote: > > > I just have a quick question and only that single problem left. > > When I autoshutdown the nodes, however my servant> console is > > still active, how do I really close that nicely without sending > > itself a termination signal and exit hardly. I try fclose(stdin) > > but it sill doesn't work, and I search through the net, people > > are doing this that way, but it seems that is doesn't work on > > nunki, is there any thing I missed? I'd try on my windows system, > > it works perfectly. > > I don't think you need to fclose(stdin). What is the problem > if you don't close stdin? > > Is the problem that you have a thread that is blocked trying > to read from stdin? It shouldn't be a problem if you just > cancel this thread since read() is a cancellation point. > -- > Bill Cheng // bill.cheng@usc.edu > > Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Oct 25 14:20:38 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9PLKcja029621 for ; Mon, 25 Oct 2004 14:20:38 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9PLPNgv001011 for ; Mon, 25 Oct 2004 14:25:23 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9PLPNYO001003 for cs551@merlot.usc.edu; Mon, 25 Oct 2004 14:25:23 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9PLPNgv001000 for ; Mon, 25 Oct 2004 14:25:23 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9PLPNPb000996 for ; Mon, 25 Oct 2004 14:25:23 -0700 Message-Id: <200410252125.i9PLPNPb000996@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: fclose(stdin) question Date: Mon, 25 Oct 2004 14:25:23 -0700 From: william@bourbon.usc.edu Someone wrote: > I just have a quick question and only that single problem left. > When I autoshutdown the nodes, however my servant> console is > still active, how do I really close that nicely without sending > itself a termination signal and exit hardly. I try fclose(stdin) > but it sill doesn't work, and I search through the net, people > are doing this that way, but it seems that is doesn't work on > nunki, is there any thing I missed? I'd try on my windows system, > it works perfectly. I don't think you need to fclose(stdin). What is the problem if you don't close stdin? Is the problem that you have a thread that is blocked trying to read from stdin? It shouldn't be a problem if you just cancel this thread since read() is a cancellation point. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Oct 25 14:12:57 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9PLCvja029444 for ; Mon, 25 Oct 2004 14:12:57 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9PLHggv030559 for ; Mon, 25 Oct 2004 14:17:42 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9PLHg2n030557 for cs551@merlot.usc.edu; Mon, 25 Oct 2004 14:17:42 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9PLHggv030554 for ; Mon, 25 Oct 2004 14:17:42 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9PLHg2m030544 for ; Mon, 25 Oct 2004 14:17:42 -0700 Message-Id: <200410252117.i9PLHg2m030544@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Part 1 extension Date: Mon, 25 Oct 2004 14:17:42 -0700 From: william@bourbon.usc.edu Someone wrote: > Any chance of extending the deadline for Part 1? I could not > login on Sat till very late in the evening . I know you have > extended the deadline by 24 hours but we get far less time to > work on a Tue compared to Sat since its a weekday. There was a few hours of outage last Saturday. I think everything was normal around 4pm. Looks like the first long after nunki's reboot at 4pm was someone from our class! So, there was plenty of (free) time left on Saturday. Anyway, I will not extend the deadline any more unless nunki becomes unavailable again for an extended period of time. Sorry. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Oct 25 13:15:49 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9PKFnja028273 for ; Mon, 25 Oct 2004 13:15:49 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9PKKYgv009688 for ; Mon, 25 Oct 2004 13:20:34 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9PKKYVv009680 for cs551@merlot.usc.edu; Mon, 25 Oct 2004 13:20:34 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9PKKYgv009677 for ; Mon, 25 Oct 2004 13:20:34 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9PKKYkB009673 for ; Mon, 25 Oct 2004 13:20:34 -0700 Message-Id: <200410252020.i9PKKYkB009673@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Question on Packing MsgType into Header Date: Mon, 25 Oct 2004 13:20:34 -0700 From: william@bourbon.usc.edu Someone wrote: > Couple question on the general format of the packet header: > > 1. The MsgType field is a 1 byte numeric field. So to enter in > 0xFA into the 1 byte field, is one way to do this correctly to: > sprintf(Header.MsgType, "%x",0xFA) with Header.Msgtype being a > char[1]? No! As I have mentioned previously, if you want to use any of the printf() functions, you need to know exactly what you are doing. What do you get when you call: printf("%x", 0xfa); You get "fa", in ASCII! What about this: char buf[30], zz[1]; buf[0] = 0xfa; zz[0] = 0xfa; You get 0xfa in buf[0] and zz[0]. > 2. For any 1 byte char (really numberic) fields like the MsgType > field, I assume I do not need to convert to network byte order > since this is being transmitted a char? Right. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Oct 25 10:43:40 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9PHheja025213 for ; Mon, 25 Oct 2004 10:43:40 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9PHmPgv018360 for ; Mon, 25 Oct 2004 10:48:25 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9PHmPw2018358 for cs551@merlot.usc.edu; Mon, 25 Oct 2004 10:48:25 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9PHmPgv018355 for ; Mon, 25 Oct 2004 10:48:25 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9PHmPE8018351 for ; Mon, 25 Oct 2004 10:48:25 -0700 Message-Id: <200410251748.i9PHmPE8018351@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: HELLO again Date: Mon, 25 Oct 2004 10:48:25 -0700 From: william@bourbon.usc.edu Someone wrote: > I have a basic question regarding HELLO; I have searched thru messages (hope > I didnt miss an obvious answer), but couldnot be sure. > If a node is to join the network, it will contact a beacon node to send a > JOIN. Should this new non-beacon node and bacon node exchange HELLO messages > first? No. If a node is not "participating in the network", it doesn't send HELLO. > Or should new non-beacon node only send a JOIN message? In the former > case, it is highly probable that the beacon-node would pair with every node, > which is undesirable. It should just send a JOIN and wait for timeout. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Oct 24 22:10:13 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9P5ACja009698 for ; Sun, 24 Oct 2004 22:10:12 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9P5Exgv007935 for ; Sun, 24 Oct 2004 22:14:59 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9P5ExDN007930 for cs551@merlot.usc.edu; Sun, 24 Oct 2004 22:14:59 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9P5Exgv007924 for ; Sun, 24 Oct 2004 22:14:59 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9P5ExCV007920 for ; Sun, 24 Oct 2004 22:14:59 -0700 Message-Id: <200410250514.i9P5ExCV007920@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Neighbors Status Output Date: Sun, 24 Oct 2004 22:14:59 -0700 From: william@bourbon.usc.edu Someone wrote: > Say we get status responses from several nodes like the following: > > Response from nunki:149 connected to nunki:150 > Response from nunki:150 connected to nunki:149 > > Should the output file have 2 links or just 1 (i.e 1 link indicated duplex) > > l -t * -s nunki:149 -d nunki:150 > > or > l -t * -s nunki:149 -d nunki:150 > l -t * -s nunki:150 -d nunki:149 You should output as soon as you get a response. Therefore, you should output 2 links. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Oct 24 22:08:52 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9P58qja009623 for ; Sun, 24 Oct 2004 22:08:52 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9P5D8gv006156 for ; Sun, 24 Oct 2004 22:13:28 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9P5CwAH005988 for cs551@merlot.usc.edu; Sun, 24 Oct 2004 22:12:58 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9P5Cmgv005819 for ; Sun, 24 Oct 2004 22:12:58 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9P5CcvA005654 for ; Sun, 24 Oct 2004 22:12:48 -0700 Message-Id: <200410250512.i9P5CcvA005654@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: HELLO again Date: Sun, 24 Oct 2004 22:12:38 -0700 From: william@bourbon.usc.edu Someone wrote: > Is it okay if after a node is connected with a neighbor and they > exchange HELLO messages that it sees another HELLO? Do I need to > handle this? If so, can I just ignore it or reply with HELLO > again but don't change message connection. Usually, a spurious message of any kind is an indication that something has gone wrong. Since this is not specified, you can do whatever you want. You might want to document it. Remember what the late Jon Postel has said: Be liberal in what you accept, and conservative in what you send. When you send, you should follow the spec since the spec usually says what the correct behavior is. When you receive, you may need to do more than what's in the spec! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Oct 24 09:07:25 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9OG7Pja026528 for ; Sun, 24 Oct 2004 09:07:25 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9OGCDgv017567 for ; Sun, 24 Oct 2004 09:12:13 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9OGCCrk017552 for cs551@merlot.usc.edu; Sun, 24 Oct 2004 09:12:12 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9OGCCgv017543 for ; Sun, 24 Oct 2004 09:12:12 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9OGCCn4017539 for ; Sun, 24 Oct 2004 09:12:12 -0700 Message-Id: <200410241612.i9OGCCn4017539@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: check, keepalive messages and responses Date: Sun, 24 Oct 2004 09:12:12 -0700 From: william@bourbon.usc.edu Someone wrote: > Just a few questions, do we need to implement check > message/response in part1 of the project, I'd done that already > but just want to know and comment it out if neccessary for ease > dubugging? You should comment it out or disable it if you want to make sure that it does not interfere with grading! > Also, regarding the status message, do I use the join_timeout > parameter to wait for all the status response > on the network? No. Since MsgLifetime is the time it takes for all the nodes in the network to stop forwarding responses, you can wait a little bit longer than MsgLifetime (how about 25% more). > Another thing is the keepalive messages, for beacon to beacon > connection mesh, do I need to timeout the connection if there's > no activity between two baecons, or I keep on send keepalive > forever just for the baecon mesh? Since disconnecting beacon will > easily result in network partition. That's it. Thanks. You should just keep sending keepalive messages forever. Please note that although the spec says: If there is no traffic from a node to one of its neighbors, the node must send a keepalive message so that its neighbor knows that it is still operating properly. >From a sender's point of view, if you simply send a keepalive message more often than KeepAliveTimeout, regardless if you have sent anything in a connection, it *doesn't violate* the spec. (Of course, you can also just do exactly what the spec says.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Oct 23 16:39:12 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9NNcqja028015 for ; Sat, 23 Oct 2004 16:39:12 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9NNgpgv010897 for ; Sat, 23 Oct 2004 16:43:11 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9NNgfWu010735 for cs551@merlot.usc.edu; Sat, 23 Oct 2004 16:42:41 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9NNgVgv010567 for ; Sat, 23 Oct 2004 16:42:41 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9NNgL4b010413 for ; Sat, 23 Oct 2004 16:42:31 -0700 Message-Id: <200410232342.i9NNgL4b010413@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: content of .log file Date: Sat, 23 Oct 2004 16:42:21 -0700 From: william@bourbon.usc.edu Someone wrote: > About the content of the .log file, should we save the > illegal messages, like those (except JOIN) prior to the first > hello message? (although we asuume there are no malicious node) You can do it if you want. You can put additional information into the log file if you want. For example, you can log these messages and add another line to indicate that you got it before the first HELLO. May be you can start a comment line (such as this one) with a '#' character or a '//' string. Since this is not part of the spec, you can do anything reasonable. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Oct 23 10:15:35 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9NHFKja020406 for ; Sat, 23 Oct 2004 10:15:35 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9NHJogv031976 for ; Sat, 23 Oct 2004 10:20:00 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9NHJUuM031659 for cs551@merlot; Sat, 23 Oct 2004 10:19:30 -0700 Date: Sat, 23 Oct 2004 10:19:30 -0700 From: william@bourbon.usc.edu Message-Id: <200410231719.i9NHJUuM031659@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: final project part (1) extended by 24 hours Due to the problem on nunki, I'm extending the deadline by 24 hours. I'll update the web page later when I get a chance. Gotta run! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Oct 23 09:50:20 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9NGo5ja019864 for ; Sat, 23 Oct 2004 09:50:20 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9NGsGgv009092 for ; Sat, 23 Oct 2004 09:54:31 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9NGs675008939 for cs551@merlot.usc.edu; Sat, 23 Oct 2004 09:54:06 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9NGs1gv008859 for ; Sat, 23 Oct 2004 09:54:06 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9NGruOi008783 for ; Sat, 23 Oct 2004 09:54:01 -0700 Message-Id: <200410231654.i9NGruOi008783@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: nunki problem logging in Date: Sat, 23 Oct 2004 09:53:56 -0700 From: william@bourbon.usc.edu Someone wrote: > I have been trying to login to nunki.usc.edu since past hour and > all I get is: Last login: Sat Oct 23 08:44:46 2004 from > vpn-052-169.usc > There is no prompt and nothing happens after that. Can you please > check and let us know? Umm... Faculty does not have priority at ISD! So, please go ahead and check with ISD yourself. Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Oct 23 09:46:52 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9NGkgja019817 for ; Sat, 23 Oct 2004 09:46:52 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9NGp8gv006257 for ; Sat, 23 Oct 2004 09:51:13 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9NGp32X006174 for cs551@merlot.usc.edu; Sat, 23 Oct 2004 09:51:03 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9NGowgv006099 for ; Sat, 23 Oct 2004 09:51:03 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9NGorKZ006023 for ; Sat, 23 Oct 2004 09:50:58 -0700 Message-Id: <200410231650.i9NGorKZ006023@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Login on NUNKI Hanging Date: Sat, 23 Oct 2004 09:50:53 -0700 From: william@bourbon.usc.edu Someone wrote: > Some process is messing up my account. When ever I try to ssh > into nunki or aludra it hangs. Do I need to call ISD or is there > another way to fix this? > Written at 9:46AM Saturday I'm having the same problem. May be the load is too high or some NFS problems. Hopefully it will be normal soon. Let me know if this problem persists for more than 2 hours. Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Oct 23 09:42:38 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9NGgNja019736 for ; Sat, 23 Oct 2004 09:42:38 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9NGkhgv002171 for ; Sat, 23 Oct 2004 09:46:53 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9NGkcux002093 for cs551@merlot.usc.edu; Sat, 23 Oct 2004 09:46:38 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9NGkSgv001926 for ; Sat, 23 Oct 2004 09:46:38 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9NGkNH3001850 for ; Sat, 23 Oct 2004 09:46:28 -0700 Message-Id: <200410231646.i9NGkNH3001850@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: connect blocking Date: Sat, 23 Oct 2004 09:46:23 -0700 From: william@bourbon.usc.edu Someone wrote: > Sometimes connect() blocks for some time, even I am using reuse addr > option. > I debug it a lot, could not catch error. If connect blocks for some time, > it affects 3rd 4th communication between nodes . > If you could please give any clues?? I'm not sure what could be causing this. But, are you sure you are closing the sockets before your node exits? If you simply let a thread dies and not closing existing connections, who knows exactly what would happen! I'm not sure what you meant by affecting "3rd 4th communication". Once you have established a connection, you should only close it if you get a keepalive timeout or if you are shutting down your node. You don't need to "connect" for every message you send. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Oct 22 22:02:45 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9N52jja005391 for ; Fri, 22 Oct 2004 22:02:45 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9N57bgv022741 for ; Fri, 22 Oct 2004 22:07:37 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9N57bG0022736 for cs551@merlot.usc.edu; Fri, 22 Oct 2004 22:07:37 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9N57bgv022730 for ; Fri, 22 Oct 2004 22:07:37 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9N57b0v022726 for ; Fri, 22 Oct 2004 22:07:37 -0700 Message-Id: <200410230507.i9N57b0v022726@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Project 1 Date: Fri, 22 Oct 2004 22:07:37 -0700 From: william@bourbon.usc.edu Someone wrote: > Once I have seen a section on one of your pages proposing a way to > tabularize global parameters for the program, a code snippet was given. I > cannot remember exactly what it was and where it was, but I remember it was > useful. Strangely, maybe because of stress, I searched but cannot locate the > page now, could you please direct me to the page I have mentioned? If you go to the lectures page and look at the Tentative Slides: final project part (1) I think you are referring to page 18 of that set of slides. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Oct 22 21:13:40 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9N4Deja004388 for ; Fri, 22 Oct 2004 21:13:40 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9N4IWgv008505 for ; Fri, 22 Oct 2004 21:18:32 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9N4IWCn008503 for cs551@merlot.usc.edu; Fri, 22 Oct 2004 21:18:32 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9N4IWgv008500 for ; Fri, 22 Oct 2004 21:18:32 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9N4IWOo008496 for ; Fri, 22 Oct 2004 21:18:32 -0700 Message-Id: <200410230418.i9N4IWOo008496@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: minNeighbors Date: Fri, 22 Oct 2004 21:18:32 -0700 From: william@bourbon.usc.edu Someone wrote: > During the startup process for a sv_node, if I connect to all the > neighbors in my init_neighbors_list, but some of the connections > are dropped because those neighbors are already connected via the > neighbor's init_neighbor_list do I still count that in my > minNeighbors count? Are you talking about the case that A connects to B and B connects to A simulatneously and A realize that it should drop the connection from A to B but keep the connection from B to A (due to the tie breaking rule)? If this is the case, you still count B as A's neighbor. > In other terms, can minNeighbors be > evaluated against the total number of connected neighbors or can > the neighbors only be from that node's init_neighbor_list?? I don't see the difference! In my example, even though A drops the connection from A to B, B is still in A's init_neighbor_list. So, in either way, the neighbor B counts as a successfully connected neighbor. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Oct 22 15:04:08 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9MM48ja029509 for ; Fri, 22 Oct 2004 15:04:08 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9MM90gv025423 for ; Fri, 22 Oct 2004 15:09:00 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9MM9015025420 for cs551@merlot.usc.edu; Fri, 22 Oct 2004 15:09:00 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9MM90gv025415 for ; Fri, 22 Oct 2004 15:09:00 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9MM906l025411 for ; Fri, 22 Oct 2004 15:09:00 -0700 Message-Id: <200410222209.i9MM906l025411@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: asking the final part1 extension Date: Fri, 22 Oct 2004 15:09:00 -0700 From: william@bourbon.usc.edu Someone wrote: > I take 3 classes this semester. It's very hard for me to keep > track of each class. > I think I am doing my best, but I mayn't complete the final > project1 within the due. > > Your mail discourages me from doing this project. > if I don't complete project1, I can't even start project2. > if I submit after the due, I get 0 point. > > are there any ways to deliever this difficult situation? During the first class, I mentioned that this class is a heavy class in terms of assignments. Looks like you didn't really take my warnings seriously. You don't need to *complete* part (1) in order to get partial credit. You can turn in something that's working so get partial credit. If you turnn in something that's totally not working, you will get very little credit. Make sure you turn something working in *on time*! There is no point missing the deadline. In the past, some students decided not to do join and have a beacon-only network. This cuts down some work. This also get them a lot less points. But they did it because they didn't have a choice. With a beacon-only network, you can still do some of part (2). For example, you will not be able to do CHECK, but you can still do some of everything else. Some of the probablistic flooding is kind of useless if the network is a full mesh, so you will lose some points there. If you decided to do a beacon-only network, please say it up front in your README file so we can save some trouble grading it. Thanks! -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Friday, October 22, 2004 11:22 AM Subject: Re: asking the final part1 extension > Someone wrote: > > > Could you extend the final part1? Sorry for asking this. > > I've been working hard on it , but many parts take time for > > debugging(I'm stuck on joining part^^). > > Please make generous decision for its extension. > > I'm sorry, but I will not extend the deadline. I've > warned everyone about this many times. The only reason > I might consider extending the deadline is if nunki is > down for an *extended* period of time during this weekend. > Otherwise, I'm sticking with the original deadline. > > Please also note that part (2) depends on part (1) and > I will not give "solution" to part (1). So, you need to > get part (1) working or you will get into big trouble > with part (2). It's all about starting early and not > slacking off! > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Oct 22 13:06:50 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9MK6oja027131 for ; Fri, 22 Oct 2004 13:06:50 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9MKBggv008036 for ; Fri, 22 Oct 2004 13:11:42 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9MKBgmk008028 for cs551@merlot.usc.edu; Fri, 22 Oct 2004 13:11:42 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9MKBggv008025 for ; Fri, 22 Oct 2004 13:11:42 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9MKBg6f008021 for ; Fri, 22 Oct 2004 13:11:42 -0700 Message-Id: <200410222011.i9MKBg6f008021@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: asking the final part1 extension Date: Fri, 22 Oct 2004 13:11:42 -0700 From: william@bourbon.usc.edu Someone wrote: > With all due respect, I did start early and did not slack off. > However, this is a complex project and we would really appreciate > if you could extend the deadline by a day. I read some of the > Spring 04 posts where somebody requested for an extended deadline > (submit project after spring break) and you took a poll for that. > Can we have something similar, except, this time it will be by a > single day? The extension for Spring 04 was a big mistake and I'm sorry that I cannot repeat that mistake again. Also, what I will do in this semester is independent of whatever I did in previous semesters. So, if you were counting on the fact that I gave an extension last semester and expecting an extension this semester, it is unfortunate that you have made a mistake. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Friday, October 22, 2004 11:22 am Subject: Re: asking the final part1 extension > Someone wrote: > > > Could you extend the final part1? Sorry for asking this. > > I've been working hard on it , but many parts take time for > > debugging(I'm stuck on joining part^^). > > Please make generous decision for its extension. > > I'm sorry, but I will not extend the deadline. I've > warned everyone about this many times. The only reason > I might consider extending the deadline is if nunki is > down for an *extended* period of time during this weekend. > Otherwise, I'm sticking with the original deadline. > > Please also note that part (2) depends on part (1) and > I will not give "solution" to part (1). So, you need to > get part (1) working or you will get into big trouble > with part (2). It's all about starting early and not > slacking off! > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Oct 22 12:36:33 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9MJaXja026491 for ; Fri, 22 Oct 2004 12:36:33 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9MJfQgv015085 for ; Fri, 22 Oct 2004 12:41:26 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9MJfQ3O015083 for cs551@merlot.usc.edu; Fri, 22 Oct 2004 12:41:26 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9MJfPgv015080 for ; Fri, 22 Oct 2004 12:41:25 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9MJfPUv015064 for ; Fri, 22 Oct 2004 12:41:25 -0700 Message-Id: <200410221941.i9MJfPUv015064@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: about sending keepalive message Date: Fri, 22 Oct 2004 12:41:25 -0700 From: william@bourbon.usc.edu Someone wrote: > In the spec., it says "If there is no traffic from a node to one > of its neighbors, the node must send a keepalive message so that > its neighbor knows that it is still operating properly. " > Since there is no way to know the KeepAliveTimeout of neighbors, > how often should a node send this message if there is no message > to send for a period of time? You can assume that every node's KeepAliveTimeout value is the same. I would send a keepalive at half that interval (or more often if you like). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Oct 22 12:34:58 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9MJYwja026444 for ; Fri, 22 Oct 2004 12:34:58 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9MJdogv013679 for ; Fri, 22 Oct 2004 12:39:50 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9MJdoPo013677 for cs551@merlot.usc.edu; Fri, 22 Oct 2004 12:39:50 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9MJdogv013674 for ; Fri, 22 Oct 2004 12:39:50 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9MJdoAt013670 for ; Fri, 22 Oct 2004 12:39:50 -0700 Message-Id: <200410221939.i9MJdoAt013670@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Beacon InitNeighbors Date: Fri, 22 Oct 2004 12:39:50 -0700 From: william@bourbon.usc.edu Someone wrote: > Does a beacon node need an initNeighbors list for all non-beacon > nodes that are its neighbors? I don't think so, because those > neighbors are the ones with the beacon in their initNeighbors > list. I just want to make sure. The init_neighbor_list file is *only* created when a node finishes a join. A beacon node does not do a join, so it does not have a init_neighbor_list. And again, if A is in B's init_neighbor_list, it doesn't mean that B is in A's init_neighbor_list. For a large network, it's very unlikely that B will be in A's init_neighbor_list. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Oct 22 11:17:28 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9MIHSja024843 for ; Fri, 22 Oct 2004 11:17:28 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9MIMLgv010752 for ; Fri, 22 Oct 2004 11:22:21 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9MIML7G010744 for cs551@merlot.usc.edu; Fri, 22 Oct 2004 11:22:21 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9MIMLgv010741 for ; Fri, 22 Oct 2004 11:22:21 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9MIMLEE010737 for ; Fri, 22 Oct 2004 11:22:21 -0700 Message-Id: <200410221822.i9MIMLEE010737@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: asking the final part1 extension Date: Fri, 22 Oct 2004 11:22:21 -0700 From: william@bourbon.usc.edu Someone wrote: > Could you extend the final part1? Sorry for asking this. > I've been working hard on it , but many parts take time for > debugging(I'm stuck on joining part^^). > Please make generous decision for its extension. I'm sorry, but I will not extend the deadline. I've warned everyone about this many times. The only reason I might consider extending the deadline is if nunki is down for an *extended* period of time during this weekend. Otherwise, I'm sticking with the original deadline. Please also note that part (2) depends on part (1) and I will not give "solution" to part (1). So, you need to get part (1) working or you will get into big trouble with part (2). It's all about starting early and not slacking off! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Oct 22 08:01:59 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9MF1xja020953 for ; Fri, 22 Oct 2004 08:01:59 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9MF6qgv028984 for ; Fri, 22 Oct 2004 08:06:52 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9MF6qeL028982 for cs551@merlot.usc.edu; Fri, 22 Oct 2004 08:06:52 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9MF6pgv028973 for ; Fri, 22 Oct 2004 08:06:51 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9MF6pRt028965 for ; Fri, 22 Oct 2004 08:06:51 -0700 Message-Id: <200410221506.i9MF6pRt028965@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: too many join responses Date: Fri, 22 Oct 2004 08:06:51 -0700 From: william@bourbon.usc.edu Someone wrote: > Do you mean that, whenever a node tries to join the network, it should wait > whole JoinTimeout period even though there are only several nodes or not? Exactly! > I understand why a node needs to hear JNRSs from every node in the network. > Otherwise newly joining nodes would be connected only at the beacon nodes or > near to beacon nodes. It won't be a fair condition. Correct! > But the default value of JoinTimeout is 15 seconds! Isn't it a little bit > long time for a node to wait for ALL JNRSs whenever it joins to the network? > > I'm still wondering if I understood the spec in right way. How about: JoinTimeout=2 Remember, 15 is just the *default* if you don't specify anything. A default value can be overridden. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] Sent: Thursday, October 21, 2004 10:10 PM To: cs551@bourbon.usc.edu Subject: Re: too many join responses Someone wrote: > I have a question about the joining process. > > Because JNRQ is flooded to whole network, it is quite possible to get TOO > many JNRSs! > > In this case, how long should it wait to get those ENDLESS JNRSs? And how > can it decide if there will be more JNRS or not? > > I think it should stop getting JNRSs at some reasonable point and sort those > with their distance and choose its initial neighbors. > > But it is still a bit tricky to decide some reasonable point to do that. > > For simplicity, can I get JNRS only the number of InitNeighbors? > > Or did I miss some points in spec? Sounds like you missed or misunderstood "JoinTimeout". The answer to your question is indeed in the spec. However, the question you asked is a fair question. If there are really hundreds of thousands of nodes, there will be too many join responses! Flooding is really not scalable for a real network. Well, this is an assignment after all and it's not meant to scale well. But, the question is, why does the spec basically says that you need join responses from every node in the network? What is it trying to achieve? And what is the down side of setting the TTL for a join request to a small number? -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Oct 21 22:07:52 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9M57qja008679 for ; Thu, 21 Oct 2004 22:07:52 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9M5Ckgv017148 for ; Thu, 21 Oct 2004 22:12:46 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9M5CkGu017146 for cs551@merlot.usc.edu; Thu, 21 Oct 2004 22:12:46 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9M5Ckgv017143 for ; Thu, 21 Oct 2004 22:12:46 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9M5CkrC017139 for ; Thu, 21 Oct 2004 22:12:46 -0700 Message-Id: <200410220512.i9M5CkrC017139@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Connect hanging Date: Thu, 21 Oct 2004 22:12:46 -0700 From: william@bourbon.usc.edu Someone wrote: > When I iterate through my beacon list trying to "connect()" to > inactive ports, the connect() system call hangs until it times > out after a few minutes. Shouldn't the connection be immediately > refused and connect return??? Yes. > If not, is this expected, or is it > appropriate to use TCP options or something to shorten the > connect() timeout time. Are you calling setsockopt() with SO_REUSEADDR, as suggested in the spec of warmup project #1? I really cannot think of any other reason why your connect() does not return right away. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Oct 21 22:04:43 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9M54hja008632 for ; Thu, 21 Oct 2004 22:04:43 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9M59bgv014125 for ; Thu, 21 Oct 2004 22:09:37 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9M59bDf014123 for cs551@merlot.usc.edu; Thu, 21 Oct 2004 22:09:37 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9M59bgv014120 for ; Thu, 21 Oct 2004 22:09:37 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9M59b68014116 for ; Thu, 21 Oct 2004 22:09:37 -0700 Message-Id: <200410220509.i9M59b68014116@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: too many join responses Date: Thu, 21 Oct 2004 22:09:37 -0700 From: william@bourbon.usc.edu Someone wrote: > I have a question about the joining process. > > Because JNRQ is flooded to whole network, it is quite possible to get TOO > many JNRSs! > > In this case, how long should it wait to get those ENDLESS JNRSs? And how > can it decide if there will be more JNRS or not? > > I think it should stop getting JNRSs at some reasonable point and sort those > with their distance and choose its initial neighbors. > > But it is still a bit tricky to decide some reasonable point to do that. > > For simplicity, can I get JNRS only the number of InitNeighbors? > > Or did I miss some points in spec? Sounds like you missed or misunderstood "JoinTimeout". The answer to your question is indeed in the spec. However, the question you asked is a fair question. If there are really hundreds of thousands of nodes, there will be too many join responses! Flooding is really not scalable for a real network. Well, this is an assignment after all and it's not meant to scale well. But, the question is, why does the spec basically says that you need join responses from every node in the network? What is it trying to achieve? And what is the down side of setting the TTL for a join request to a small number? -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Oct 21 14:54:11 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9LLsBja032400 for ; Thu, 21 Oct 2004 14:54:11 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9LLx6gv002452 for ; Thu, 21 Oct 2004 14:59:06 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9LLx6Ok002450 for cs551@merlot.usc.edu; Thu, 21 Oct 2004 14:59:06 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9LLx5gv002447 for ; Thu, 21 Oct 2004 14:59:05 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9LLx59X002443 for ; Thu, 21 Oct 2004 14:59:05 -0700 Message-Id: <200410212159.i9LLx59X002443@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Hello not replied Date: Thu, 21 Oct 2004 14:59:05 -0700 From: william@bourbon.usc.edu Someone wrote: > How long should the node wait untill HELLO is received? > JoinTimeout or KeepAliveTimeout? In my previous message, I was talking about the node who is receiving a join request, and *not* the node who is joining. -- Bill Cheng // bill.cheng@acm.org ----- Original Message ----- From: william@bourbon.usc.edu Date: Thursday, October 21, 2004 11:46 am Subject: Re: Hello not replied > Someone wrote: > > > What happens if a connection is made from node A to node B, node > > A sends node B HELLO and node B does not respond with a HELLO, > > but continues to send it messages and keepalives if connected? > > There is no HELLO response timeout in the spec. > > Node A must wait for the HELLO. It should *not* process > anything until the HELLO is received. Since it should > not process anything, it should never see a keep-alive > and therefore will timeout and close the connection. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Oct 21 11:41:28 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9LIfSja027705 for ; Thu, 21 Oct 2004 11:41:28 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9LIkNgv005312 for ; Thu, 21 Oct 2004 11:46:23 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9LIkNlv005307 for cs551@merlot.usc.edu; Thu, 21 Oct 2004 11:46:23 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9LIkNgv005304 for ; Thu, 21 Oct 2004 11:46:23 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9LIkNkO005300 for ; Thu, 21 Oct 2004 11:46:23 -0700 Message-Id: <200410211846.i9LIkNkO005300@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Hello not replied Date: Thu, 21 Oct 2004 11:46:23 -0700 From: william@bourbon.usc.edu Someone wrote: > What happens if a connection is made from node A to node B, node > A sends node B HELLO and node B does not respond with a HELLO, > but continues to send it messages and keepalives if connected? > There is no HELLO response timeout in the spec. Node A must wait for the HELLO. It should *not* process anything until the HELLO is received. Since it should not process anything, it should never see a keep-alive and therefore will timeout and close the connection. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Oct 21 11:39:44 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9LIdija027631 for ; Thu, 21 Oct 2004 11:39:44 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9LIidgv003744 for ; Thu, 21 Oct 2004 11:44:39 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9LIidlU003742 for cs551@merlot.usc.edu; Thu, 21 Oct 2004 11:44:39 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9LIidgv003734 for ; Thu, 21 Oct 2004 11:44:39 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9LIidtp003729 for ; Thu, 21 Oct 2004 11:44:39 -0700 Message-Id: <200410211844.i9LIidtp003729@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Join socket keepalive Date: Thu, 21 Oct 2004 11:44:39 -0700 From: william@bourbon.usc.edu Someone wrote: > This is the last thing (I think) I don't understand totally. > > Scenario: > 1) Node A sends JOIN to Node B > 2) Node B sends JOIN Response and forwards JOIN to other nodes > 3) Although Node B has already sent its response to node A, it > must keep the socket connection to Node A open in order to > forward JOIN Responses from its neighbors back to Node A. > 4) After Node A's JOIN Timeout expires, it closes the TCP > connection close(sockfd), however this is only a "half close" > 5) How does Node B know how long to keep open its half of the > connection for routing? Clearly, it should close as soon as node > A closes the other half of the message, but there is no message > for this, is there? > > Am I understanding correctly? How is this issue addressed? When node A closes the socket, node B need to know. Since node A is not sending anything else (because this is a temporary connection), you can have node B do a read()/recv(). When ndoe A closes the socket, read()/recv() should return with an error code. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Oct 20 22:22:03 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9L5M2ja011297 for ; Wed, 20 Oct 2004 22:22:02 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9L5Qxgv003397 for ; Wed, 20 Oct 2004 22:26:59 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9L5QxdW003391 for cs551@merlot.usc.edu; Wed, 20 Oct 2004 22:26:59 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9L5Qxgv003388 for ; Wed, 20 Oct 2004 22:26:59 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9L5QxlH003384 for ; Wed, 20 Oct 2004 22:26:59 -0700 Message-Id: <200410210526.i9L5QxlH003384@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: size field of message header Date: Wed, 20 Oct 2004 22:26:59 -0700 From: william@bourbon.usc.edu Someone wrote: > From the specs: > The field should account for the message header. > Is this the common message header (27 bytes) or the size of > the entire message that is being sent? The field should be the size of the entire message. So, for a keep-alive message, this should be 27. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Oct 20 22:20:00 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9L5K0ja011203 for ; Wed, 20 Oct 2004 22:20:00 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9L5Ovgv001420 for ; Wed, 20 Oct 2004 22:24:57 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9L5OvMg001412 for cs551@merlot.usc.edu; Wed, 20 Oct 2004 22:24:57 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9L5Ougv001409 for ; Wed, 20 Oct 2004 22:24:56 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9L5OuPj001405 for ; Wed, 20 Oct 2004 22:24:56 -0700 Message-Id: <200410210524.i9L5OuPj001405@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: problems with gdb/xterm/man Date: Wed, 20 Oct 2004 22:24:56 -0700 From: william@bourbon.usc.edu Someone wrote: > I have having problems with gdb. I get the following message > when I try to execute my prog. The prog does not stop at the > breakpoint. > > "Breakpoint 1 at 0x139fc: file sv_node.cpp, line 326. > (gdb) run a.ini > Starting program: /home/scf-04/lalwani/csci551/final/sv_node a.ini > > Program exited normally. > warning: Unable to find dynamic linker breakpoint function. > warning: GDB will be unable to debug shared library initializers > warning: and track explicitly loaded dynamic code. > You can't do that without a process to debug > (gdb) " I've mentioned in class that "gdb" may have problem with breakpoints in a child thread. So, you need to figure out a way to get around it for debugging. Someone in class suggested that "ddd" is better than "gdb" because you can set breakpoints in a child thread. I've never tried "ddd", so I cannot verify if that's the case. You should give it a try. > I am also not able to look at any man page. The man command > fails. I am also able to open xterms , they immediately > close after starting up. > > Are others also having similar problems or I am the only one. > Every thing was working fine till yesterday. I think you are the only one. Your .cshrc/.login or your .bashrc may have bugs in it. You should either copy one from the system or copy from another student or ask ISD for help. > Are any changes being done on nunki again ? I noticed that > the netscape version has changed. Since gcc/g++ and openssl has changed since the beginning of the semester, it's possible that something else has changes. But recently, I haven't heard anyone else having problems. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Oct 20 22:09:03 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9L593ja010979 for ; Wed, 20 Oct 2004 22:09:03 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9L5Dxgv023426 for ; Wed, 20 Oct 2004 22:13:59 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9L5DxZE023424 for cs551@merlot.usc.edu; Wed, 20 Oct 2004 22:13:59 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9L5Dxgv023419 for ; Wed, 20 Oct 2004 22:13:59 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9L5DxIc023411 for ; Wed, 20 Oct 2004 22:13:59 -0700 Message-Id: <200410210513.i9L5DxIc023411@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: More Questions on Hello message tie-break point Date: Wed, 20 Oct 2004 22:13:59 -0700 From: william@bourbon.usc.edu Someone wrote: > Correct me if I'm wrong, there's two scenarios where a node sends a > "hello". First, when a node just got started up, it sends "hello" > to all its neighbors, THEN it starts listening to the connections. If > that's true, how can you have Node A and B sending "hello" to each other > at the same time when none of them are listening? > Second, Node A is already up and running, and it gets a "hello" from Node > B. Node A decides to make Node B its neighbor so it sends a "hello" back > with the existing connection. > Am I missing something? In your first case, since you are suppose to be doing multithreading, you can be listening and sending hellos at the same time. Your 2nd case can certainly occur. -- Bill Cheng // bill.cheng@usc.edu On Tue, 19 Oct 2004 william@bourbon.usc.edu wrote: > Someone wrote: > > > In regards to message from: Fri 15 Oct 13:49 > > > > Are you saying that the only point to tie break nodes is after > > the exchange of hello messages? I want to verify that nothing > > needs to be done sooner (e.g. with beacons connecting to each > > other). For example: > > > > 1) Node A connects to Node B and Node B connects to Node A at > > same time > > 2) Node A sends HELLO to Node B > > 3) Node B sends HELLO to Node A > > 4) Both Node A and Node B in their listening threads check > > through neighbor list for duplicate neighbor nodeIds > > 5) If duplicate found, both do the strcmp(NA, NB) tie-break > > process and will come to the same conclusion. To break the > > connection. Each will be a half-close, resulting in a full > > TCP termination. > > So far so good. > > > 6) In this scenario, this will also work if any node that is > > already a neighbor tries to connect to an existing TCP > > neighbor when a connection already exists. IS THIS OKAY? > > Because if node A does a half close, goes down, and then > > comes back up, the new connection will be refused if this > > process happens before node B's keepalive timer for node A > > expires. > > I'm not sure the exact scenario you are referring to. If A > has an active connection to B and B knows it, why would B > want to make a connection to A? Shouldn't B know that it > can just use the connection from A? > > > Does this seem like it covers everything for this scenario? > > I'm not missing any other scenario in which to do a tie-break?? > > It sounds right, but I cannot say if this covers everything > just like I cannot look at a description of an algorithm and > tell you that it does not cause deadlock or starvation. You > need to convince yourself that it's correct. > > (You don't have to do this, but you can certainly write some > code and put it inside a "#ifdef DEBUG" block and check if > you violate the condition in question.) Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Oct 20 14:45:16 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9KLjGja002137 for ; Wed, 20 Oct 2004 14:45:16 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9KLoEgv028213 for ; Wed, 20 Oct 2004 14:50:14 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9KLoEj9028205 for cs551@merlot.usc.edu; Wed, 20 Oct 2004 14:50:14 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9KLoDgv028202 for ; Wed, 20 Oct 2004 14:50:13 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9KLoD9r028198 for ; Wed, 20 Oct 2004 14:50:13 -0700 Message-Id: <200410202150.i9KLoD9r028198@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: distance for join response Date: Wed, 20 Oct 2004 14:50:13 -0700 From: william@bourbon.usc.edu Someone wrote: > Thanks! I was thinking like we don't have to show others nodes from where > the message originated. > so , host name and ports should be the requesting host not of the > forwarding host. Forwarding nodes (routers) should not alter any part of a message (well, except for TTL). This is true for networking in general. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Wednesday, October 20, 2004 2:27 PM Subject: Re: distance for join response > Someone wrote: > > > perhaps I am not understanding the specs fully. > > > > 'A' is a regular node ands send JNRQ to beacon node 'B' > > and 'B' flood it to its neighbors 'C' and 'D'. > > in JNRS--->distance field > > 'B' will calculate its distance to 'A' and fill it. > > 1) what about 'C' and 'D' ?? They don't know that message originated from > > 'A' .Will these calculate distance from 'B' (Cto B and D to B)and route back > > to 'B'. then 'B' will forward it to 'A' > > 2)Also what I feel is this JNRQ will only be flooded to beacon nodes only as > > beacon node has other beacon as its neighbors no other regular nodes. > > Oops! I misunderstood your previous question totally. > > C and D can calculate distances to A because node A's node ID > can be constructed from the Hostname and Host Port fields of > the join request message. Please see the code under "Distance > Computation" in: > > http://merlot.usc.edu/cs551-f04/projects/final.html#basic > > Regard (2) above, the idea is to have non-beacon nodes as > your neighbors. Think about the case where the network > has been up and running for a long time. There can be only > 4 beacon nodes and 20,000 regular nodes. If a new node tries > to join, chances are, all its initial neighbors will be regular > nodes. > -- > Bill Cheng // bill.cheng@usc.edu > > > > ----- Original Message ----- > From: > To: > Sent: Wednesday, October 20, 2004 10:43 AM > Subject: Re: distance for join response > > > > Someone wrote: > > > > > when a regular node send join request, beacon node flood it to its neighbors > > > and send back join response to the originating node with the distance from > > > it. > > > Any other regular node(say NB) when get this join request flooded by the > > > beacon node, it forwards this request to its neighbors,and also send the > > > join response only to the node from where it get this flooded request which > > > is routed back by that node., Now "how this node (NB) will calculate its > > > distance from the originating node to fill in distance field since it does > > > not know the originating node?" > > > > NB doesn't have to do anything like that! If the node that originated > > the joint request decided to make put NB in it's init_neighbor_list, > > it will contact NB and say hello. Then NB can do the calculation at > > that time. > > -- > > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Oct 20 14:23:00 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9KLN0ja001690 for ; Wed, 20 Oct 2004 14:23:00 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9KLRvgv007578 for ; Wed, 20 Oct 2004 14:27:57 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9KLRvYR007576 for cs551@merlot.usc.edu; Wed, 20 Oct 2004 14:27:57 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9KLRvgv007567 for ; Wed, 20 Oct 2004 14:27:57 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9KLRvNK007563 for ; Wed, 20 Oct 2004 14:27:57 -0700 Message-Id: <200410202127.i9KLRvNK007563@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: distance for join response Date: Wed, 20 Oct 2004 14:27:57 -0700 From: william@bourbon.usc.edu Someone wrote: > perhaps I am not understanding the specs fully. > > 'A' is a regular node ands send JNRQ to beacon node 'B' > and 'B' flood it to its neighbors 'C' and 'D'. > in JNRS--->distance field > 'B' will calculate its distance to 'A' and fill it. > 1) what about 'C' and 'D' ?? They don't know that message originated from > 'A' .Will these calculate distance from 'B' (Cto B and D to B)and route back > to 'B'. then 'B' will forward it to 'A' > 2)Also what I feel is this JNRQ will only be flooded to beacon nodes only as > beacon node has other beacon as its neighbors no other regular nodes. Oops! I misunderstood your previous question totally. C and D can calculate distances to A because node A's node ID can be constructed from the Hostname and Host Port fields of the join request message. Please see the code under "Distance Computation" in: http://merlot.usc.edu/cs551-f04/projects/final.html#basic Regard (2) above, the idea is to have non-beacon nodes as your neighbors. Think about the case where the network has been up and running for a long time. There can be only 4 beacon nodes and 20,000 regular nodes. If a new node tries to join, chances are, all its initial neighbors will be regular nodes. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Wednesday, October 20, 2004 10:43 AM Subject: Re: distance for join response > Someone wrote: > > > when a regular node send join request, beacon node flood it to its neighbors > > and send back join response to the originating node with the distance from > > it. > > Any other regular node(say NB) when get this join request flooded by the > > beacon node, it forwards this request to its neighbors,and also send the > > join response only to the node from where it get this flooded request which > > is routed back by that node., Now "how this node (NB) will calculate its > > distance from the originating node to fill in distance field since it does > > not know the originating node?" > > NB doesn't have to do anything like that! If the node that originated > the joint request decided to make put NB in it's init_neighbor_list, > it will contact NB and say hello. Then NB can do the calculation at > that time. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Oct 20 10:38:13 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9KHcDja029365 for ; Wed, 20 Oct 2004 10:38:13 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9KHhBgv023063 for ; Wed, 20 Oct 2004 10:43:11 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9KHhBIL023061 for cs551@merlot.usc.edu; Wed, 20 Oct 2004 10:43:11 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9KHhAgv023058 for ; Wed, 20 Oct 2004 10:43:10 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9KHhAPb023054 for ; Wed, 20 Oct 2004 10:43:10 -0700 Message-Id: <200410201743.i9KHhAPb023054@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: distance for join response Date: Wed, 20 Oct 2004 10:43:10 -0700 From: william@bourbon.usc.edu Someone wrote: > when a regular node send join request, beacon node flood it to its neighbors > and send back join response to the originating node with the distance from > it. > Any other regular node(say NB) when get this join request flooded by the > beacon node, it forwards this request to its neighbors,and also send the > join response only to the node from where it get this flooded request which > is routed back by that node., Now "how this node (NB) will calculate its > distance from the originating node to fill in distance field since it does > not know the originating node?" NB doesn't have to do anything like that! If the node that originated the joint request decided to make put NB in it's init_neighbor_list, it will contact NB and say hello. Then NB can do the calculation at that time. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 19 21:32:58 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9K4Wwja012906 for ; Tue, 19 Oct 2004 21:32:58 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9K4bvgv028471 for ; Tue, 19 Oct 2004 21:37:57 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9K4bvbl028469 for cs551@merlot; Tue, 19 Oct 2004 21:37:57 -0700 Date: Tue, 19 Oct 2004 21:37:57 -0700 From: william@bourbon.usc.edu Message-Id: <200410200437.i9K4bvbl028469@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: final project part (1) due date getting close... Hi, If you stil have questions regarding the operation of the P2P network for the final project part (1), please bring them to class tomorrow (Wed). I'll ask if there is any questions about the project at the beginning of class. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Oct 19 19:32:18 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9K2WIja010518 for ; Tue, 19 Oct 2004 19:32:18 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9K2bHgv011101 for ; Tue, 19 Oct 2004 19:37:17 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9K2bHv7011099 for cs551@merlot.usc.edu; Tue, 19 Oct 2004 19:37:17 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9K2bHgv011096 for ; Tue, 19 Oct 2004 19:37:17 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9K2bHpV011092 for ; Tue, 19 Oct 2004 19:37:17 -0700 Message-Id: <200410200237.i9K2bHpV011092@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: TTL in beacon Date: Tue, 19 Oct 2004 19:37:17 -0700 From: william@bourbon.usc.edu Someone wrote: > in case of a reg node what if it fails to connect to any of the > beacon nodes (in case none are up) should the reg node keep > trying infinitely until any one of them are up or just try > connecting to any one of the beacon nodes and then shut down. Please see my message with timestamp "Tue 19 Oct 15:38". -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Tuesday, October 19, 2004 4:02 pm Subject: Re: TTL in beacon > Someone wrote: > > > what I meant was the beacon nodes or reg nodes whatever just keep > > decrementing the ttl of whatever the reg node which tries to join > > say eg reg node1 wants to join a servant n/w with interconnected > > beacons 2,3,4,5. now 2 floods the n/w with whatever ttl val that > > 1 sends in its join req(which it gets from its config file). so > > in that case when beacon nodes need not use join to connect among > > themselves or to other reg nodes at all why do they have ttl in > > their config file. > > If the user enters "status neighbor 2 foo" at a beacon node, > this beacon node needs to flood a status request message > with a TTL of 2. > -- > Bill Cheng // bill.cheng@usc.edu > > > > ----- Original Message ----- > From: william@bourbon.usc.edu > Date: Tuesday, October 19, 2004 7:43 am > Subject: Re: TTL in beacon > > > Someone wrote: > > > > > if a node is a beacon what is the purpose of ttl in the beacon > > > config file it has to anyhow use the ttl as passed on by the > > > regular node when it tries to join. > > > > I'm not sure what you mean. > > > > Please note that a beacon node is the same as a regular node, > > except for joins (please see the last paragraph in the > > SERVANT Node Start-up sectin of the spec). If this doesn't > > answer your question, please describe your concern in more > > details. > > -- > > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Oct 19 15:57:53 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9JMvrja006212 for ; Tue, 19 Oct 2004 15:57:53 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9JN2rgv002900 for ; Tue, 19 Oct 2004 16:02:53 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9JN2r2D002898 for cs551@merlot.usc.edu; Tue, 19 Oct 2004 16:02:53 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9JN2rgv002895 for ; Tue, 19 Oct 2004 16:02:53 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9JN2rNs002890 for ; Tue, 19 Oct 2004 16:02:53 -0700 Message-Id: <200410192302.i9JN2rNs002890@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: TTL in beacon Date: Tue, 19 Oct 2004 16:02:53 -0700 From: william@bourbon.usc.edu Someone wrote: > what I meant was the beacon nodes or reg nodes whatever just keep > decrementing the ttl of whatever the reg node which tries to join > say eg reg node1 wants to join a servant n/w with interconnected > beacons 2,3,4,5. now 2 floods the n/w with whatever ttl val that > 1 sends in its join req(which it gets from its config file). so > in that case when beacon nodes need not use join to connect among > themselves or to other reg nodes at all why do they have ttl in > their config file. If the user enters "status neighbor 2 foo" at a beacon node, this beacon node needs to flood a status request message with a TTL of 2. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Tuesday, October 19, 2004 7:43 am Subject: Re: TTL in beacon > Someone wrote: > > > if a node is a beacon what is the purpose of ttl in the beacon > > config file it has to anyhow use the ttl as passed on by the > > regular node when it tries to join. > > I'm not sure what you mean. > > Please note that a beacon node is the same as a regular node, > except for joins (please see the last paragraph in the > SERVANT Node Start-up sectin of the spec). If this doesn't > answer your question, please describe your concern in more > details. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Oct 19 15:54:12 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9JMsCja006165 for ; Tue, 19 Oct 2004 15:54:12 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9JMxBgv031787 for ; Tue, 19 Oct 2004 15:59:11 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9JMxBg5031782 for cs551@merlot.usc.edu; Tue, 19 Oct 2004 15:59:11 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9JMxBgv031776 for ; Tue, 19 Oct 2004 15:59:11 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9JMxBcT031772 for ; Tue, 19 Oct 2004 15:59:11 -0700 Message-Id: <200410192259.i9JMxBcT031772@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Retry for beacon nodes Date: Tue, 19 Oct 2004 15:59:11 -0700 From: william@bourbon.usc.edu Someone wrote: > Beacon node does not have to send "hello" to other beacons as its neighbors > just try connecting other beacons and participate in the network. No. Between *any* 2 nodes, they must exchange "hello" messages first. This is how they find out about the node ID of its neighbor (I'm using "neighbor" generically here). I think I've mentioned this in class. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Tuesday, October 19, 2004 3:38 PM Subject: Re: Retry for beacon nodes > Someone wrote: > > > while I have to join the network, I try to connect beacon node, if first > > beacon node is down, should I go to 2nd immediately or I should wait > > for the retry period. > > If you are joining the network, that means you are *not* a beacon > node. If you are just a regular node, you don't care about the > Retry value in the [beacons] section. You just go immediately > to the next one. > > > Incase none of the beacon is up, I should exit or wait for the > > autoshutdown > > and go on trying to connect beacon until able to find running beacon. > > If no beacon node is up, you should shutdown. Of course, you > should always tell the user why you are shutting down. > -- > Bill Cheng // bill.cheng@usc.edu > > > > ----- Original Message ----- > From: > To: > Sent: Tuesday, October 19, 2004 11:33 AM > Subject: Re: Retry for beacon nodes > > > > Someone wrote: > > > > > I don't understand what you mean about the "Retry" value in the > > > [beacons] section of the INI file. > > > > > > Do we try to connect to all beacons in a row. Then if we could > > > not connect to any, wiat the "Retry" time, and try to reconnect > > > to any not still connected to. And keep doing this in a loop > > > until node termination? > > > > This is for beacon nodes only. Remember that beacon nodes > > must be connected in a full mesh. If you have 3 beacon > > nodes running now, they should be connected in a full mesh. > > 2 days later, you have 6 beacon nodes running, even if none > > of the original 3 nodes has been rebooted, all 6 beacon nodes > > should now be connected in a full mesh. "Retry" will make sure > > that this will be the case. > > > > So, when a beacon node comes up, if it finds that 3 of the > > other beacon nodes are not up, it should try to see if they > > are up every "retry" interval. > > > > > Also, the 30 second default for Retry? I assume that needs to be > > > hard coded into the INI_Parsing if the value is null? > > > > All default values should be "hard-coded". I guess that's one > > way to think of what "default" means. > > -- > > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Oct 19 15:43:59 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9JMhxja005914 for ; Tue, 19 Oct 2004 15:43:59 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9JMmxgv022093 for ; Tue, 19 Oct 2004 15:48:59 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9JMmxh2022091 for cs551@merlot.usc.edu; Tue, 19 Oct 2004 15:48:59 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9JMmxgv022087 for ; Tue, 19 Oct 2004 15:48:59 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9JMmxdh022081 for ; Tue, 19 Oct 2004 15:48:59 -0700 Message-Id: <200410192248.i9JMmxdh022081@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Discovering your host name/IP Date: Tue, 19 Oct 2004 15:48:59 -0700 From: william@bourbon.usc.edu Someone wrote: > When a servant node starts up, it must know its IP to find its > FQDN or its domain name. This is necessary to create a nodeID > node Instance Id and determine whether the node is a server. > THere is no provision in the spec for specifying a domain name in > the startup INI file or at the command line. API calls like > gethostbyname(), etc. must be provided a domain name. > > Can we just hard-code nunki.usc.edu as the domain name for all > sv_nodes or do you have another solution? Please do not hardcode it because we may be running one of your nodes on aludra. You can call gethostname() (and may be followed by gethostbyname() if it doesn't return exactly what you want). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Oct 19 15:33:22 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9JMXMja005648 for ; Tue, 19 Oct 2004 15:33:22 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9JMcMgv012137 for ; Tue, 19 Oct 2004 15:38:22 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9JMcMR6012135 for cs551@merlot.usc.edu; Tue, 19 Oct 2004 15:38:22 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9JMcMgv012129 for ; Tue, 19 Oct 2004 15:38:22 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9JMcMxw012122 for ; Tue, 19 Oct 2004 15:38:22 -0700 Message-Id: <200410192238.i9JMcMxw012122@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Retry for beacon nodes Date: Tue, 19 Oct 2004 15:38:22 -0700 From: william@bourbon.usc.edu Someone wrote: > while I have to join the network, I try to connect beacon node, if first > beacon node is down, should I go to 2nd immediately or I should wait for > the retry period. If you are joining the network, that means you are *not* a beacon node. If you are just a regular node, you don't care about the Retry value in the [beacons] section. You just go immediately to the next one. > Incase none of the beacon is up, I should exit or wait for the autoshutdown > and go on trying to connect beacon until able to find running beacon. If no beacon node is up, you should shutdown. Of course, you should always tell the user why you are shutting down. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Tuesday, October 19, 2004 11:33 AM Subject: Re: Retry for beacon nodes > Someone wrote: > > > I don't understand what you mean about the "Retry" value in the > > [beacons] section of the INI file. > > > > Do we try to connect to all beacons in a row. Then if we could > > not connect to any, wiat the "Retry" time, and try to reconnect > > to any not still connected to. And keep doing this in a loop > > until node termination? > > This is for beacon nodes only. Remember that beacon nodes > must be connected in a full mesh. If you have 3 beacon > nodes running now, they should be connected in a full mesh. > 2 days later, you have 6 beacon nodes running, even if none > of the original 3 nodes has been rebooted, all 6 beacon nodes > should now be connected in a full mesh. "Retry" will make sure > that this will be the case. > > So, when a beacon node comes up, if it finds that 3 of the > other beacon nodes are not up, it should try to see if they > are up every "retry" interval. > > > Also, the 30 second default for Retry? I assume that needs to be > > hard coded into the INI_Parsing if the value is null? > > All default values should be "hard-coded". I guess that's one > way to think of what "default" means. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Oct 19 11:28:50 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9JISoja000718 for ; Tue, 19 Oct 2004 11:28:50 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9JIXogv018933 for ; Tue, 19 Oct 2004 11:33:51 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9JIXoCc018931 for cs551@merlot.usc.edu; Tue, 19 Oct 2004 11:33:50 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9JIXogv018928 for ; Tue, 19 Oct 2004 11:33:50 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9JIXoG0018924 for ; Tue, 19 Oct 2004 11:33:50 -0700 Message-Id: <200410191833.i9JIXoG0018924@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Retry for beacon nodes Date: Tue, 19 Oct 2004 11:33:50 -0700 From: william@bourbon.usc.edu Someone wrote: > I don't understand what you mean about the "Retry" value in the > [beacons] section of the INI file. > > Do we try to connect to all beacons in a row. Then if we could > not connect to any, wiat the "Retry" time, and try to reconnect > to any not still connected to. And keep doing this in a loop > until node termination? This is for beacon nodes only. Remember that beacon nodes must be connected in a full mesh. If you have 3 beacon nodes running now, they should be connected in a full mesh. 2 days later, you have 6 beacon nodes running, even if none of the original 3 nodes has been rebooted, all 6 beacon nodes should now be connected in a full mesh. "Retry" will make sure that this will be the case. So, when a beacon node comes up, if it finds that 3 of the other beacon nodes are not up, it should try to see if they are up every "retry" interval. > Also, the 30 second default for Retry? I assume that needs to be > hard coded into the INI_Parsing if the value is null? All default values should be "hard-coded". I guess that's one way to think of what "default" means. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Oct 19 11:21:33 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9JILXja000567 for ; Tue, 19 Oct 2004 11:21:33 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9JIQYgv016229 for ; Tue, 19 Oct 2004 11:26:34 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9JIQYAt016227 for cs551@merlot.usc.edu; Tue, 19 Oct 2004 11:26:34 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9JIQXgv016224 for ; Tue, 19 Oct 2004 11:26:33 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9JIQXXr016220 for ; Tue, 19 Oct 2004 11:26:33 -0700 Message-Id: <200410191826.i9JIQXXr016220@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Hello message tie-break point Date: Tue, 19 Oct 2004 11:26:33 -0700 From: william@bourbon.usc.edu Someone wrote: > In regards to message from: Fri 15 Oct 13:49 > > Are you saying that the only point to tie break nodes is after > the exchange of hello messages? I want to verify that nothing > needs to be done sooner (e.g. with beacons connecting to each > other). For example: > > 1) Node A connects to Node B and Node B connects to Node A at > same time > 2) Node A sends HELLO to Node B > 3) Node B sends HELLO to Node A > 4) Both Node A and Node B in their listening threads check > through neighbor list for duplicate neighbor nodeIds > 5) If duplicate found, both do the strcmp(NA, NB) tie-break > process and will come to the same conclusion. To break the > connection. Each will be a half-close, resulting in a full > TCP termination. So far so good. > 6) In this scenario, this will also work if any node that is > already a neighbor tries to connect to an existing TCP > neighbor when a connection already exists. IS THIS OKAY? > Because if node A does a half close, goes down, and then > comes back up, the new connection will be refused if this > process happens before node B's keepalive timer for node A > expires. I'm not sure the exact scenario you are referring to. If A has an active connection to B and B knows it, why would B want to make a connection to A? Shouldn't B know that it can just use the connection from A? > Does this seem like it covers everything for this scenario? > I'm not missing any other scenario in which to do a tie-break?? It sounds right, but I cannot say if this covers everything just like I cannot look at a description of an algorithm and tell you that it does not cause deadlock or starvation. You need to convince yourself that it's correct. (You don't have to do this, but you can certainly write some code and put it inside a "#ifdef DEBUG" block and check if you violate the condition in question.) Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Oct 19 07:38:33 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9JEcXja028550 for ; Tue, 19 Oct 2004 07:38:33 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9JEhYgv004430 for ; Tue, 19 Oct 2004 07:43:34 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9JEhYMV004428 for cs551@merlot.usc.edu; Tue, 19 Oct 2004 07:43:34 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9JEhXgv004419 for ; Tue, 19 Oct 2004 07:43:33 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9JEhXuL004415 for ; Tue, 19 Oct 2004 07:43:33 -0700 Message-Id: <200410191443.i9JEhXuL004415@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: TTL in beacon Date: Tue, 19 Oct 2004 07:43:33 -0700 From: william@bourbon.usc.edu Someone wrote: > if a node is a beacon what is the purpose of ttl in the beacon > config file it has to anyhow use the ttl as passed on by the > regular node when it tries to join. I'm not sure what you mean. Please note that a beacon node is the same as a regular node, except for joins (please see the last paragraph in the SERVANT Node Start-up sectin of the spec). If this doesn't answer your question, please describe your concern in more details. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Oct 17 22:23:58 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9I5Nwja016627 for ; Sun, 17 Oct 2004 22:23:58 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9I5T2gv015568 for ; Sun, 17 Oct 2004 22:29:02 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9I5T2vf015566 for cs551@merlot.usc.edu; Sun, 17 Oct 2004 22:29:02 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9I5T2gv015561 for ; Sun, 17 Oct 2004 22:29:02 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9I5T1YP015553 for ; Sun, 17 Oct 2004 22:29:02 -0700 Message-Id: <200410180529.i9I5T1YP015553@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: all threads communicating with single socket Date: Sun, 17 Oct 2004 22:29:01 -0700 From: william@bourbon.usc.edu Someone wrote: > As select() could not be used in different threads for the same range of > sockets, it means sv_node is handling one request at a time. Why does it have to mean that? There is more than one type of "parallelism". > I am confused, how multi requests will be handled with select?? My answer in the previous e-mail was to answer a "specific question". I think you must use a single thread for the select() call, if that's what you want to do. Then you can dispatch the "jobs" to other threads ("pipelined parallelism"). Or, you can use one thread per socket (this would be another type of "parallelism"). As I have mentioned several times in class, there are many ways to do this project. Make sure you have a clean design and think through your design to make sure that everything would work. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Saturday, October 09, 2004 9:20 PM Subject: Re: all threads communicating with single socket > Someone wrote: > > > Is it possible for different threads to communicate using > > the same socket. > > I'm not sure what you mean exactly. > > Are you asking if it's okay for multiple threads to do > select() on the same socket? I don't think that works > very well (or at all)! > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Oct 16 21:46:36 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9H4kaja008062 for ; Sat, 16 Oct 2004 21:46:36 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9H4phgv031012 for ; Sat, 16 Oct 2004 21:51:43 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9H4phNF031010 for cs551@merlot.usc.edu; Sat, 16 Oct 2004 21:51:43 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9H4pggv031001 for ; Sat, 16 Oct 2004 21:51:42 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9H4pgr6030997 for ; Sat, 16 Oct 2004 21:51:42 -0700 Message-Id: <200410170451.i9H4pgr6030997@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Illegal Instruction in Servant Date: Sat, 16 Oct 2004 21:51:42 -0700 From: william@bourbon.usc.edu Someone wrote: > I'm trying to debug my program and keep getting an "Illegal > Instruction" error and then the process exits. I've done a bunch > of debugging but its really difficult with multiple threads. Do > you know what could be causing this? I thought this error only > occurred with improper libraries (is that the problem for sure?). > Any suggestions? I've spent several hours stuck. Illegal instruction is just like segmentation fault and bus error. So, there is no magic in debugging problems like this. Please see: http://merlot.usc.edu/cs551-f04/projects.html#segfault -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Oct 15 13:44:25 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9FKiPja001677 for ; Fri, 15 Oct 2004 13:44:25 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9FKnZgv024448 for ; Fri, 15 Oct 2004 13:49:35 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9FKnZg4024446 for cs551@merlot.usc.edu; Fri, 15 Oct 2004 13:49:35 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9FKnZgv024443 for ; Fri, 15 Oct 2004 13:49:35 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9FKnZLr024438 for ; Fri, 15 Oct 2004 13:49:35 -0700 Message-Id: <200410152049.i9FKnZLr024438@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: tie-break nodeIDs Date: Fri, 15 Oct 2004 13:49:35 -0700 From: william@bourbon.usc.edu Someone wrote: > If two node A and B call connect() for one another at the same time then how > will one come to know that A and B nodes are connecting simultaneously for > each other? In this case, both A and B should realize (you should figure out how) that this is happening. One of them (and only one of them) should voluntarily close the connection it initiated because both A and B use the same algorithm to determine which connection should die. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Thursday, October 14, 2004 12:58 AM Subject: Re: tie-break nodeIDs > Someone wrote: > > > Spec says: > > ---------------------------------- > > you must use the same socket for the connection from A to B and from B to A. > > It is possible that A and B initiates a connection to each other > > simultaneously. You need to make sure that only one bi-directional > > connection is setup. In order to break ties, you must compare the node IDs > > of nodes A and B. Let NA and NB be the node IDs of nodes A and B. > > ------------------------------------- > > > > How would I know remote nodeID before Accept() to tie-break nodeIDs ?? > > It's in the hello message! That's why the first message in any > connection is a hello. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Oct 15 13:40:15 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9FKeFja001596 for ; Fri, 15 Oct 2004 13:40:15 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9FKjPgv021514 for ; Fri, 15 Oct 2004 13:45:25 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9FKjPJb021512 for cs551@merlot.usc.edu; Fri, 15 Oct 2004 13:45:25 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9FKjPgv021509 for ; Fri, 15 Oct 2004 13:45:25 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9FKjP32021505 for ; Fri, 15 Oct 2004 13:45:25 -0700 Message-Id: <200410152045.i9FKjP32021505@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: node instance id Date: Fri, 15 Oct 2004 13:45:24 -0700 From: william@bourbon.usc.edu Someone wrote: > From the spec: > "Node Instance Id: Every time a node is restarted, it is associated with a > node instance ID, which is simply the concatenation of its node ID and the > time the node got started" > > Node Instance ID is needed by the GetUOID function. We need GetUOID in the > join message. When sending a join message, the node is started for the first > time (and not restarted). Should we get the "node instance id" even for the > join message or it should only be "node id"? > > :) Please think about how to make message ID unique. The answer should be clear. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Oct 14 11:51:01 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9EIp1ja002538 for ; Thu, 14 Oct 2004 11:51:01 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9EIuEgv020754 for ; Thu, 14 Oct 2004 11:56:14 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9EIuE8g020752 for cs551@merlot.usc.edu; Thu, 14 Oct 2004 11:56:14 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9EIuDgv020749 for ; Thu, 14 Oct 2004 11:56:13 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9EIuDdO020745 for ; Thu, 14 Oct 2004 11:56:13 -0700 Message-Id: <200410141856.i9EIuDdO020745@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: KEEPALIVE logging msgType Date: Thu, 14 Oct 2004 11:56:13 -0700 From: william@bourbon.usc.edu Someone wrote: > Nope, but thanks. Hmm... That's weird. The 5th line of the table in the logging section of the spec says: KPAV keepalive (none) (KPAV is right between HLLO and CKRQ). And I'm looking at: http://merlot.usc.edu/cs551-f04/projects/final.html#logging If anyone is seeing something different, please let me know! -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Thursday, October 14, 2004 11:34 am Subject: Re: KEEPALIVE logging msgType > Someone wrote: > > > In the spec, you forgot to specify the msgType string for > > logging for the Keepalive message. Please let us know your > > preferred 4-character string. > > Hmm... Isn't it there already (KPAV)? > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Oct 14 11:29:14 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9EITEja002020 for ; Thu, 14 Oct 2004 11:29:14 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9EIYRgv012578 for ; Thu, 14 Oct 2004 11:34:27 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9EIYRLN012576 for cs551@merlot.usc.edu; Thu, 14 Oct 2004 11:34:27 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9EIYRgv012573 for ; Thu, 14 Oct 2004 11:34:27 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9EIYRU9012569 for ; Thu, 14 Oct 2004 11:34:27 -0700 Message-Id: <200410141834.i9EIYRU9012569@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: KEEPALIVE logging msgType Date: Thu, 14 Oct 2004 11:34:27 -0700 From: william@bourbon.usc.edu Someone wrote: > In the spec, you forgot to specify the msgType string for > logging for the Keepalive message. Please let us know your > preferred 4-character string. Hmm... Isn't it there already (KPAV)? -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Oct 14 00:52:49 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9E7qnja020857 for ; Thu, 14 Oct 2004 00:52:49 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9E7w3gv019457 for ; Thu, 14 Oct 2004 00:58:03 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9E7w30x019455 for cs551@merlot.usc.edu; Thu, 14 Oct 2004 00:58:03 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9E7w3gv019447 for ; Thu, 14 Oct 2004 00:58:03 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9E7w20B019442 for ; Thu, 14 Oct 2004 00:58:02 -0700 Message-Id: <200410140758.i9E7w20B019442@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: tie-break nodeIDs Date: Thu, 14 Oct 2004 00:58:02 -0700 From: william@bourbon.usc.edu Someone wrote: > Spec says: > ---------------------------------- > you must use the same socket for the connection from A to B and from B to A. > It is possible that A and B initiates a connection to each other > simultaneously. You need to make sure that only one bi-directional > connection is setup. In order to break ties, you must compare the node IDs > of nodes A and B. Let NA and NB be the node IDs of nodes A and B. > ------------------------------------- > > How would I know remote nodeID before Accept() to tie-break nodeIDs ?? It's in the hello message! That's why the first message in any connection is a hello. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Oct 13 10:40:18 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9DHeIja003679 for ; Wed, 13 Oct 2004 10:40:18 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9DHjXgv028005 for ; Wed, 13 Oct 2004 10:45:33 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9DHjXZc028003 for cs551@merlot.usc.edu; Wed, 13 Oct 2004 10:45:33 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9DHjXgv028000 for ; Wed, 13 Oct 2004 10:45:33 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9DHjXfG027993 for ; Wed, 13 Oct 2004 10:45:33 -0700 Message-Id: <200410131745.i9DHjXfG027993@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: SHA1 library Date: Wed, 13 Oct 2004 10:45:33 -0700 From: william@bourbon.usc.edu Someone wrote: > That alone did not work. I added -lcrypto to LDFLAGS and it > did the trick. :) I'm glad you have figured that out. You could have also just read the spec! :-) -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Wednesday, October 13, 2004 8:48 am Subject: Re: SHA1 library > Someone wrote: > > > For MD5, I was using /usr/usc/openssl/default/lib > > However the path no longer exists, > > According to the current spec [Last updated Wed Sep 22 2004], > you should use: > > -I/usr/lsd/openssl/0.9.7c/include > > in your Makefile. Please follow the spec. > > > and when I try to use the GetUOID > > function from the website, I get > > sv_node.c:55: error: `SHA1' undeclared (first use this function) > > > > Is the openssl/sha1.h library path missing or I need to debug my > > code a bit more? > > According to: > > http://www.openssl.org/docs/crypto/sha.html > > you should use and not . > > Also, if GetUOID() in the spec doesn't work or suit your > needs, please change it. It's not meant to be used as is > (but if you want to keep it the way it is, that's fine). > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Oct 13 08:43:41 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9DFhfja001271 for ; Wed, 13 Oct 2004 08:43:41 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9DFmugv023718 for ; Wed, 13 Oct 2004 08:48:56 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9DFmuSa023716 for cs551@merlot.usc.edu; Wed, 13 Oct 2004 08:48:56 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9DFmugv023713 for ; Wed, 13 Oct 2004 08:48:56 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9DFmuiq023709 for ; Wed, 13 Oct 2004 08:48:56 -0700 Message-Id: <200410131548.i9DFmuiq023709@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: SHA1 library Date: Wed, 13 Oct 2004 08:48:56 -0700 From: william@bourbon.usc.edu Someone wrote: > For MD5, I was using /usr/usc/openssl/default/lib > However the path no longer exists, According to the current spec [Last updated Wed Sep 22 2004], you should use: -I/usr/lsd/openssl/0.9.7c/include in your Makefile. Please follow the spec. > and when I try to use the GetUOID > function from the website, I get > sv_node.c:55: error: `SHA1' undeclared (first use this function) > > Is the openssl/sha1.h library path missing or I need to debug my > code a bit more? According to: http://www.openssl.org/docs/crypto/sha.html you should use and not . Also, if GetUOID() in the spec doesn't work or suit your needs, please change it. It's not meant to be used as is (but if you want to keep it the way it is, that's fine). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Oct 12 23:20:15 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9D6KFja021882 for ; Tue, 12 Oct 2004 23:20:15 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9D6PVgv008656 for ; Tue, 12 Oct 2004 23:25:31 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9D6PVSe008649 for cs551@merlot.usc.edu; Tue, 12 Oct 2004 23:25:31 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9D6PVgv008645 for ; Tue, 12 Oct 2004 23:25:31 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9D6PVjJ008641 for ; Tue, 12 Oct 2004 23:25:31 -0700 Message-Id: <200410130625.i9D6PVjJ008641@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Project Part 1 Questions Date: Tue, 12 Oct 2004 23:25:31 -0700 From: william@bourbon.usc.edu Someone wrote: > if a beacon node does'nt have any other beacon node as its > neightbor(but other nodes have it as its neighbor),then if a reg > node sends a join req to this beacon node then what is it > supposed to do? I'm not sure what you mean. If A is B's neighbor, then B is A's neighbor. (We are not talking about init_neighbor_list here.) So, a beacon node must have all other beacon nodes as its neighbors. If you are talking about the case where there is only one active beacon node, I don't see why it should do anything differently. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Oct 12 23:14:34 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9D6EYja021737 for ; Tue, 12 Oct 2004 23:14:34 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9D6Jpgv003125 for ; Tue, 12 Oct 2004 23:19:51 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9D6Jpai003123 for cs551@merlot.usc.edu; Tue, 12 Oct 2004 23:19:51 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9D6Jpgv003114 for ; Tue, 12 Oct 2004 23:19:51 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9D6JpbN003110 for ; Tue, 12 Oct 2004 23:19:51 -0700 Message-Id: <200410130619.i9D6JpbN003110@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Project Part 1 Questions Date: Tue, 12 Oct 2004 23:19:51 -0700 From: william@bourbon.usc.edu Someone wrote: > I was wondering in the case of join message request when the reg > node establishes a temp connection with a beacon node later when > the reg node decides to join nodes apart from the beacon node > with which it formed a temp conn, which node should initiate > breaking the connection? should'nt it be the reg node to do so > first? After JoinTimeout has expired, the node who is doing to join should disconnect. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Oct 11 20:28:21 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9C3SLja021644 for ; Mon, 11 Oct 2004 20:28:21 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9C3Xfgv032576 for ; Mon, 11 Oct 2004 20:33:41 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9C3Xf1E032574 for cs551@merlot.usc.edu; Mon, 11 Oct 2004 20:33:41 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9C3Xegv032565 for ; Mon, 11 Oct 2004 20:33:40 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9C3Xe0T032561 for ; Mon, 11 Oct 2004 20:33:40 -0700 Message-Id: <200410120333.i9C3Xe0T032561@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Neighbor connection resolution Date: Mon, 11 Oct 2004 20:33:40 -0700 From: william@bourbon.usc.edu Someone wrote: > When comparing node IDs to see which connection to keep > between 2 simultaneous connections between neighbors, do we > compare using the neighbors' node IDs or node instance IDs > (including the startup timestamp)? Node ID! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Oct 11 17:03:18 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9C03Ija017552 for ; Mon, 11 Oct 2004 17:03:18 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9C08cgv018255 for ; Mon, 11 Oct 2004 17:08:38 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9C08cL7018253 for cs551@merlot.usc.edu; Mon, 11 Oct 2004 17:08:38 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9C08cgv018250 for ; Mon, 11 Oct 2004 17:08:38 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9C08c9k018246 for ; Mon, 11 Oct 2004 17:08:38 -0700 Message-Id: <200410120008.i9C08c9k018246@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS551 - Project - Beacon startup question Date: Mon, 11 Oct 2004 17:08:38 -0700 From: william@bourbon.usc.edu Someone wrote: > I have a couple of questions concerning beacon node's startup process. > 1. When a beacon node is connecting to another beacon node, > does it need to send "hello" message ? Yes! > Spec says no "join" message, so I'm assuming "hello" is not > needed as well. (But the nodes do keep track of who's > connected to who.) The spec also says that when a node comes up, it should say hello to its neighbors. A beacon node is also a *node*. > 2. When a beacon is not yet avialable or down, how many times > do I have to retry the connection ? Once after the timeout > ? Or any number of times that we choose ? If you are a regular node participating in the network, you don't care if the node you are trying to connect to is a beacon node or not. Therefore, you try it once and if it fails, you don't retry. If you are a beacon node, you try *forever* to connect to all other beacon nodes. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Oct 10 21:22:46 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9B4Mkja024961 for ; Sun, 10 Oct 2004 21:22:46 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9B4S8gv028323 for ; Sun, 10 Oct 2004 21:28:08 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9B4S8QN028321 for cs551@merlot.usc.edu; Sun, 10 Oct 2004 21:28:08 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9B4S8gv028312 for ; Sun, 10 Oct 2004 21:28:08 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9B4S7gF028302 for ; Sun, 10 Oct 2004 21:28:08 -0700 Message-Id: <200410110428.i9B4S7gF028302@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Project Part 1 Questions Date: Sun, 10 Oct 2004 21:28:07 -0700 From: william@bourbon.usc.edu Someone wrote: > After reading through the spec twice I still have a few > questions: > > 1. Do I have to keep a thread listening for incoming connections > even after I have successfully joined then network? That is, if > node A has 2 neighbors in its init-neighbor-list file and connect > to both of them, another, different, node B on the network could > have node A in its init-neighbor-list and try to connect to node > A. Is this true, or is the neighbor relationship completely > reflexive. That is if node A has nodes B & C in its > init-neighbor-list, no other nodes besides B & C could have A as > a neighbor??? Please note that the following 2 things are different: 1) A is in the init_neighbor_list of B 2) A is B's neighbor For (1), it's possible that B is *not* in the init_neighbor_list of A. For (2), B must also be A's neighbor (except for transients or error conditions). (1) determines who needs to say hello to whom. (2) just means that A and B has an active connection to each other. In case (1), assuming that B is not in the init_neighbor_list of A, when A comes up, it will say hello to B. Then B will say hello back because that what B must be according to the protocol. After A and B exchange hello messages, A and B are neighbors. > Also, if lets say node B is down and A cannot > connect to it, does A have to leave a passive socket open > listening for a future connection from node B? A has to listen for *any* node who wishes to connect to it and say hello to it! When node X joins the network, A has sent a join response to it. A had no idea if A will win the lottery and get written into X's init_neighbor_list file. Also, in this example, it's unlikly that X will be in A's init_neighbor_list file. > 2. How often does a node have to send keepalive messages to its > neighbors? Is 1/2 the max keepalive timeout an appropriate > heuristic if this is a discretionary implementation? Anything reasonable would be fine. Please document it in your README file. > Also is it appropriate to just select() for the keepalive timeout > on the same thread used for RX between a node and its neighbor. > All messages received would be either indicate the node is up or > be a keepalive. If the RX'd message is malformed, it still would > indicate the connection is active. This seems like an easier > implementation than having a separate thread listen for > keepalives on each neighbor connection. Is this okay or am I > misunderstanding the spec? You must to send explicit keepalive messages with the specified format. Remember, the idea is to interopreate between your node and nodes implement by others. > 3. When a node sends a "join" to a beacon node, how long is the > join timeout? That is, how long do you wait for "join responses" > before closing the join connection and creating an > init-neighbors-list? Umm... how about JoinTimeout? -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Oct 9 21:20:16 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9A4KGja017610 for ; Sat, 9 Oct 2004 21:20:16 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9A4Pegv024336 for ; Sat, 9 Oct 2004 21:25:40 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9A4PeV4024334 for cs551@merlot.usc.edu; Sat, 9 Oct 2004 21:25:40 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9A4Pegv024326 for ; Sat, 9 Oct 2004 21:25:40 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9A4Pe9h024321 for ; Sat, 9 Oct 2004 21:25:40 -0700 Message-Id: <200410100425.i9A4Pe9h024321@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: init_neighbor_list Date: Sat, 09 Oct 2004 21:25:40 -0700 From: william@bourbon.usc.edu Someone wrote: > I noticed you did not give much detail as to the fomat of the > init_neighbor_list file. Does this mean we can format it however we want. Yes! > (i.e - I was thinking about having a section header called "[beacons]" just > so I can be lazy and reuse my code that retrieves the beacons from the > ".ini" file. The init_neighbor_list file is only read by the local node (you never send it across the network), therefore, a node can do whatever it wants. (And this goes for many things in this project.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Oct 9 21:15:35 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i9A4FZja017468 for ; Sat, 9 Oct 2004 21:15:35 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9A4Kxgv019864 for ; Sat, 9 Oct 2004 21:20:59 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9A4Kxuh019862 for cs551@merlot.usc.edu; Sat, 9 Oct 2004 21:20:59 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9A4Kxgv019859 for ; Sat, 9 Oct 2004 21:20:59 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9A4KxbH019852 for ; Sat, 9 Oct 2004 21:20:59 -0700 Message-Id: <200410100420.i9A4KxbH019852@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: all threads communicating with single socket Date: Sat, 09 Oct 2004 21:20:59 -0700 From: william@bourbon.usc.edu Someone wrote: > Is it possible for different threads to communicate using > the same socket. I'm not sure what you mean exactly. Are you asking if it's okay for multiple threads to do select() on the same socket? I don't think that works very well (or at all)! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Oct 9 09:52:01 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i99Gq1ja003894 for ; Sat, 9 Oct 2004 09:52:01 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i99GvRgv029727 for ; Sat, 9 Oct 2004 09:57:27 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i99GvRIV029725 for cs551@merlot.usc.edu; Sat, 9 Oct 2004 09:57:27 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i99GvQgv029717 for ; Sat, 9 Oct 2004 09:57:26 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i99GvQH2029712 for ; Sat, 9 Oct 2004 09:57:26 -0700 Message-Id: <200410091657.i99GvQH2029712@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Not Able to Connect to Nunki.usc.edu Date: Sat, 09 Oct 2004 09:57:26 -0700 From: william@bourbon.usc.edu Someone wrote: > not able to connect to nunki.usc.edu. it keeps giving the > following message "Account expired". Did speak to the User > Room Student Operators from on-campus computer labs about the > problem, and that they said the network is down. It's not unusual that the servers are down! Good time to take a break and read some papers and get ready for the midterm! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Oct 9 09:50:43 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i99Gohja003847 for ; Sat, 9 Oct 2004 09:50:43 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i99Gu9gv028551 for ; Sat, 9 Oct 2004 09:56:09 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i99Gu9Il028549 for cs551@merlot.usc.edu; Sat, 9 Oct 2004 09:56:09 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i99Gu8gv028546 for ; Sat, 9 Oct 2004 09:56:08 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i99Gu8GT028539 for ; Sat, 9 Oct 2004 09:56:08 -0700 Message-Id: <200410091656.i99Gu8GT028539@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: None of The Servers Working Date: Sat, 09 Oct 2004 09:56:08 -0700 From: william@bourbon.usc.edu Someone wrote: > None of the servers seem to be running for about 4 hours. Are the file servers working? If they are, you can work from any of the UNIX workstations in the labs. The servers to go down once in a while. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 8 21:45:34 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i994jYja021196 for ; Fri, 8 Oct 2004 21:45:34 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i994p1gv022721 for ; Fri, 8 Oct 2004 21:51:01 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i994p1s8022719 for cs551@merlot; Fri, 8 Oct 2004 21:51:01 -0700 Date: Fri, 8 Oct 2004 21:51:01 -0700 From: william@bourbon.usc.edu Message-Id: <200410090451.i994p1s8022719@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: grader office hours next week for warmup project #2 Hi, Sanjay will hold office hours on Monday, 10/11 from 5pm to 7pm in the WPH basement lab for on campus students. He will be available from 7:30pm to 9:30 pm for DEN students. DEN students, please e-mail Sanjay to reserve a phone slot. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Oct 8 08:02:11 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i98F2Bja004515 for ; Fri, 8 Oct 2004 08:02:11 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i98F7egv015093 for ; Fri, 8 Oct 2004 08:07:40 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i98F7epG015091 for cs551@merlot.usc.edu; Fri, 8 Oct 2004 08:07:40 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i98F7dgv015085 for ; Fri, 8 Oct 2004 08:07:40 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i98F7d24015080 for ; Fri, 8 Oct 2004 08:07:39 -0700 Message-Id: <200410081507.i98F7d24015080@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Maintain home directory Date: Fri, 08 Oct 2004 08:07:39 -0700 From: william@bourbon.usc.edu Someone wrote: > Can we assume the home directory has been created when a node starts up? > Or if we have to erase/create the directory? for example when -reset is > specified do we have to remove the directory ( rmdir -rf ) "as if it has > never been started before" and create the directory again? Generally, you should *not* remove directory or subdirectories. So, if -reset is used, you should just delete all the regular *files* that you have created. And do *not* execute "rm *"! You should know exactly what files are created by you. So, if the home directory does not exist, you should create it. And you do not have to remember whether you have created the directory or not. It's possible that the grader will create the home directory, put the startup.ini file in it and execute node by specifying the full path to your sv_node. This needs to work. (And this is another reason why you should not execute "rm *". -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Oct 7 23:22:50 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i986Moja025917 for ; Thu, 7 Oct 2004 23:22:50 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i986SJgv009016 for ; Thu, 7 Oct 2004 23:28:19 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i986SJT7009014 for cs551@merlot.usc.edu; Thu, 7 Oct 2004 23:28:19 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i986SJgv009010 for ; Thu, 7 Oct 2004 23:28:19 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i986SJ49009004 for ; Thu, 7 Oct 2004 23:28:19 -0700 Message-Id: <200410080628.i986SJ49009004@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: gcc or g++ Date: Thu, 07 Oct 2004 23:28:19 -0700 From: william@bourbon.usc.edu Someone wrote: > Are we allow to use g++ (c++) for the final project? I ask because I'm > trying to use some of the libraries in std. You can use anything that's installed in the system directories on nunki. For g++, please use the one in /usr/usc/gnu/gcc/default/bin. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Oct 7 20:54:45 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i983sjja022959 for ; Thu, 7 Oct 2004 20:54:45 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9840Fgv029575 for ; Thu, 7 Oct 2004 21:00:15 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9840Fhe029573 for cs551@merlot.usc.edu; Thu, 7 Oct 2004 21:00:15 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9840Fgv029570 for ; Thu, 7 Oct 2004 21:00:15 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9840Fru029566 for ; Thu, 7 Oct 2004 21:00:15 -0700 Message-Id: <200410080400.i9840Fru029566@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: join and hello message Date: Thu, 07 Oct 2004 21:00:15 -0700 From: william@bourbon.usc.edu Someone wrote: > Its clear now. Atleast one non-beacon node startup.ini file should have: > Total number of initNeighbours <= Total number of beacons > else, the network will never be formed. Yes. You need to put reasonable values in the startup configure files. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Thursday, October 7, 2004 8:00 am Subject: Re: join and hello message > Someone wrote: > > > When a non-beacon has sent a join message and is waiting for the > > replies, can it also reply to the join messages from other nodes? > > No. If a node is not "participating in the network", it > should not participating in any of the networking activities. > > > I think it should, else the network will never be formed. > > I don't know why you would say that! Slides 7 through 14 of > lecture 10 has sucn an example. Could you point out what's > wrong with that example? > > > On same lines, if a non-beacon node is undergoing the original > > join/discovery process and it receives a 'hello' message, should > > it respond back with a 'hello' message? Again, my thinking is > > inclined towards 'yes'. > > No, for the same reason above. > > Also, if A has sent hello to B but B has not send hello to > A, A should ignore anything that comes from the B->A channel. > The first thing B must send to A is a hello message. > Everything else should be ignored by A until that is done. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Oct 7 08:03:01 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i97F31ja007474 for ; Thu, 7 Oct 2004 08:03:01 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i97F8Wgv026013 for ; Thu, 7 Oct 2004 08:08:32 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i97F8Wgh026011 for cs551@merlot.usc.edu; Thu, 7 Oct 2004 08:08:32 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i97F8Wgv026008 for ; Thu, 7 Oct 2004 08:08:32 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i97F8WAF026004 for ; Thu, 7 Oct 2004 08:08:32 -0700 Message-Id: <200410071508.i97F8WAF026004@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: no beacon node Date: Thu, 07 Oct 2004 08:08:32 -0700 From: william@bourbon.usc.edu Someone wrote: > When a non-beacon node starts and none of the beacon nodes are active, > should it retry after some time (retry value is from the .ini file) or it > should print a message and shut itself down? > The message archive (http://merlot.usc.edu/cs551-f03/msgs/bill/103) says, it > should shut itself down. > > Just confirming. For a non-beacon who is trying to "join the network" and cannot talk to any beacon node, it should just shut itself down. Of course, it should print a nice message for the user. Keeping the user informed is important. By the way, you are welcome to look at messages from previous semesters, but there has been changes to the spec. So, please do so at your own risk! Also, please don't keep sending me messages about "this is my understanding, is that right?" or "just confirming"! If you do that for everything about this project and more students start doing the same thing, I will be dead! This is an *assignment* afterall. Of course, clarification questions are fair. Well, most real questions are probably fine. So, ask me a question! For example, in the above case, say "the spec says this and that, I don't think it make sense and here are my reasons". -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Oct 7 07:54:32 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i97EsWja007294 for ; Thu, 7 Oct 2004 07:54:32 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i97F03gv018004 for ; Thu, 7 Oct 2004 08:00:03 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i97F03qE018002 for cs551@merlot.usc.edu; Thu, 7 Oct 2004 08:00:03 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i97F02gv017999 for ; Thu, 7 Oct 2004 08:00:02 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i97F02af017995 for ; Thu, 7 Oct 2004 08:00:02 -0700 Message-Id: <200410071500.i97F02af017995@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: join and hello message Date: Thu, 07 Oct 2004 08:00:02 -0700 From: william@bourbon.usc.edu Someone wrote: > When a non-beacon has sent a join message and is waiting for the > replies, can it also reply to the join messages from other nodes? No. If a node is not "participating in the network", it should not participating in any of the networking activities. > I think it should, else the network will never be formed. I don't know why you would say that! Slides 7 through 14 of lecture 10 has sucn an example. Could you point out what's wrong with that example? > On same lines, if a non-beacon node is undergoing the original > join/discovery process and it receives a 'hello' message, should > it respond back with a 'hello' message? Again, my thinking is > inclined towards 'yes'. No, for the same reason above. Also, if A has sent hello to B but B has not send hello to A, A should ignore anything that comes from the B->A channel. The first thing B must send to A is a hello message. Everything else should be ignored by A until that is done. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Oct 5 21:21:58 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i964Lwja028205 for ; Tue, 5 Oct 2004 21:21:58 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i964RXgv002138 for ; Tue, 5 Oct 2004 21:27:33 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i964RXMP002136 for cs551@merlot.usc.edu; Tue, 5 Oct 2004 21:27:33 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i964RXgv002133 for ; Tue, 5 Oct 2004 21:27:33 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i964RXGG002129 for ; Tue, 5 Oct 2004 21:27:33 -0700 Message-Id: <200410060427.i964RXGG002129@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: beacon + join msg query Date: Tue, 05 Oct 2004 21:27:33 -0700 From: william@bourbon.usc.edu Someone wrote: > From your previous email: > "It then goes down the list in the [beacons] section of its startup > file and find *one* becaon node that's up and running." > Shouldn't the non-beacon node go down the beacon list, send a 'join' > message to each beacon, wait for the reply from the beacons that > are 'up', calculate the minimum distance, select the smallest > distance beacon and then send the 'join' request to build the > init-neighbour file? Why would it be necessary for a non-beacon node to send a join message to more than one beacon? > Am I correct or I need to read the spec one more time? If you cannot answer my question above, you probably need to read the spec one more time. You can probably skip the details and try to get a good understanding of how this p2p network works in general. Then you may see that some of the design decisions that went into the spec aren't as random as they first appera! :-) -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Wednesday, October 06, 2004 2:13 AM Subject: Re: beacon + join msg query > Someone wrote: > > > startup.ini > > -- > > [init] > > InitNeighbours=2 > > MinNeighbors=2 > > > > [beacons] > > Retry=13 > > nunki.usc.edu:50001= > > nunki.usc.edu:50002= > > nunki.usc.edu:50003= > > -- > > Only 2 beacon nodes are up and running > > > > A non-beacon node comes up and sends a join message. > > From the spec: If the check message cannot reach any beacon > > node, part of the network must have been disconnected from > > the core of the network. > > Umm... "check" is for part (2). You don't need it for part (1) > to work correctly. > > > Since only 2 beacons are up, will the node (non-beacon) join > > the network or it will need to resend the join message after > > timeout? > > When a non-beacon node comes up and it does not have an > "init_neighbor_list" file in its HomeDir, it knows that it > should "joing the network". It then goes down the list in > the [beacons] section of its startup file and find *one* > becaon node that's up and running. It sends a join request > message to this beacon node and wait for responses... (you > know the rest). > > There is no "check" messages involved. "Check" is needed in > part (2) when an active node detects that a connection to a > neighbor is gone (either through timeout or its peer closing > the connection). For part (1), if such a case is detected, > this node does not need to send check messages or any other > messages. Even if the number of neighbors is now less than > MinNeighbors, it doesn't have to worry about it. This is > because MinNeighbors is only checked when a node is starting > up. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Oct 5 21:15:45 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i964Fjja028063 for ; Tue, 5 Oct 2004 21:15:45 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i964LJgv028651 for ; Tue, 5 Oct 2004 21:21:19 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i964LJ0M028649 for cs551@merlot.usc.edu; Tue, 5 Oct 2004 21:21:19 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i964LJgv028640 for ; Tue, 5 Oct 2004 21:21:19 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i964LJOZ028630 for ; Tue, 5 Oct 2004 21:21:19 -0700 Message-Id: <200410060421.i964LJOZ028630@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: MID TERM Query Date: Tue, 05 Oct 2004 21:21:19 -0700 From: william@bourbon.usc.edu Someone wrote: > I want to confirm.... for mid term we are supposed to learn all slides > of lectures and papers discussed in class , not the papers in the list of > supplementary heading . Yes. And, as I've mentioned in class, most of the questions will come from the lectures. But any questions from the required papers are fair game. > Also I want to know what could be the style of paper? Will it be like > more theoretical or programing questions from the projects and assignments > may be asked? I assume you mean the style of "questions" (and not "paper"). There will be some short questions (10 words or less), some medium questions (30 words or less), and may be 1 long question. I expect you to *understand* the lectures and the papers well enough to give the *best* answers to these questions. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Oct 5 13:38:21 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i95KcLja018974 for ; Tue, 5 Oct 2004 13:38:21 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i95Khtgv032358 for ; Tue, 5 Oct 2004 13:43:55 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i95KhtvF032356 for cs551@merlot.usc.edu; Tue, 5 Oct 2004 13:43:55 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i95Khtgv032353 for ; Tue, 5 Oct 2004 13:43:55 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i95KhtIY032349 for ; Tue, 5 Oct 2004 13:43:55 -0700 Message-Id: <200410052043.i95KhtIY032349@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: beacon + join msg query Date: Tue, 05 Oct 2004 13:43:55 -0700 From: william@bourbon.usc.edu Someone wrote: > startup.ini > -- > [init] > InitNeighbours=2 > MinNeighbors=2 > > [beacons] > Retry=13 > nunki.usc.edu:50001= > nunki.usc.edu:50002= > nunki.usc.edu:50003= > -- > Only 2 beacon nodes are up and running > > A non-beacon node comes up and sends a join message. > From the spec: If the check message cannot reach any beacon > node, part of the network must have been disconnected from > the core of the network. Umm... "check" is for part (2). You don't need it for part (1) to work correctly. > Since only 2 beacons are up, will the node (non-beacon) join > the network or it will need to resend the join message after > timeout? When a non-beacon node comes up and it does not have an "init_neighbor_list" file in its HomeDir, it knows that it should "joing the network". It then goes down the list in the [beacons] section of its startup file and find *one* becaon node that's up and running. It sends a join request message to this beacon node and wait for responses... (you know the rest). There is no "check" messages involved. "Check" is needed in part (2) when an active node detects that a connection to a neighbor is gone (either through timeout or its peer closing the connection). For part (1), if such a case is detected, this node does not need to send check messages or any other messages. Even if the number of neighbors is now less than MinNeighbors, it doesn't have to worry about it. This is because MinNeighbors is only checked when a node is starting up. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Oct 5 13:29:46 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i95KTkja018764 for ; Tue, 5 Oct 2004 13:29:46 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i95KZLgv029248 for ; Tue, 5 Oct 2004 13:35:21 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i95KZLWc029246 for cs551@merlot.usc.edu; Tue, 5 Oct 2004 13:35:21 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i95KZIgv029234 for ; Tue, 5 Oct 2004 13:35:18 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i95KZHqi029230 for ; Tue, 5 Oct 2004 13:35:18 -0700 Message-Id: <200410052035.i95KZHqi029230@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Memory Management Question Date: Tue, 05 Oct 2004 13:35:17 -0700 From: william@bourbon.usc.edu Someone wrote: > Thank you for the clarification on free(). I'm pretty sure I now know it > well enough to complete this project. > I was also looking for some more detail into memory management on the web > like you suggested. I found a lot of basic information on malloc , free, > new, delete ... on the internet. Most of it was just basic C/C++ syntax > stuff or definitions. Not much about the internal workings of C/C++ dynamic > memory allocation/management. Do you know of any good references on this > topic? You can probably find them in standard OS or data structures textbooks. For example, I have Andrew Tanenbaum's Operating Systems - Design and Implementation book. Chapter 4 is devoted to memory management and section 4.2.3 is on memory management with linked lists. You need to think about how you would implement malloc() and free(). What kind of bookkeepping information do you need so that free() can return a block to the free list. Then it's clear that you cannot free a pointer that's not returned by malloc(). It should also be clear why freeing the same block twice is going to be big trouble. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Monday, October 04, 2004 10:05 PM Subject: Re: Memory Management Question > Someone wrote: > > > I have at question regarding memory management in C. I tried looking in the > > man pages but I couldn't find the answer. > > > > Suppose you allocate 5 bytes of memory like so: char* x = (char*)malloc(5); > > Then at some point in your program you increment x: x= x + 2; > > Then at some later point you want to free all of the allocated memory: > > free(x) > > > > Does "free" still know to free 5 bytes and know where the location of the > > 1st byte on the heap is? Or does free now mistakenly only free 3 bytes > > because x was incremented by 2 thereby incorrectly leaving 2 extra bytes on > > the heap. > > free() will do *neither* of the above! > > When you call free(x), x *must be* a pointer previously returned > by malloc() (or equivalent). If not, you have *corrupted memory*! > Sounds serious, huh? Well, it is. free(x) simply means to return > x, previously returned by malloc(), back to the "free list". > > You should read up on memory management and understand why this > is the case (or you can come see me). > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Oct 5 07:41:42 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i95Efgja011717 for ; Tue, 5 Oct 2004 07:41:42 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i95ElIgv002636 for ; Tue, 5 Oct 2004 07:47:18 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i95ElIhh002634 for cs551@merlot.usc.edu; Tue, 5 Oct 2004 07:47:18 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i95ElHgv002625 for ; Tue, 5 Oct 2004 07:47:17 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i95ElHUf002621 for ; Tue, 5 Oct 2004 07:47:17 -0700 Message-Id: <200410051447.i95ElHUf002621@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: A doubt about "InitNeighbors" from the final project spec Date: Tue, 05 Oct 2004 07:47:17 -0700 From: william@bourbon.usc.edu Someone wrote: > what is the difference between "InitNeighbors" and "MinNeighbors"? > > I'm actually having trouble understanding the proper meaning/use > of "InitNeighbors" from the start-up configuration file. InitNeighbors is used when a node is "joining the network" and MinNeighbors is used when a node is "participating in the network". When you join the network, you get a bunch of join response messages back, you sort them and take the top few (according to InitNeighbors) and write them to the "init_neighbor_list" file in the HomeDir of this node. (Please see slide 11 of lecture 10.) When a node is participating in the network (because it has an "init_neighbor_list" file in its HomeDir), it needs to check if there is at least MinNeighbors neighbors that it can talk to (since each node is operated independently, any or all other nodes can be down). If there is not enough neighbors to talk to, it must delete the "init_neighbor_list" file and restart. When it restarts, it will be "joining the network" (see above). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Oct 4 22:00:07 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i95507ja032009 for ; Mon, 4 Oct 2004 22:00:07 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9555igv001945 for ; Mon, 4 Oct 2004 22:05:44 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i9555ieA001943 for cs551@merlot.usc.edu; Mon, 4 Oct 2004 22:05:44 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i9555igv001937 for ; Mon, 4 Oct 2004 22:05:44 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i9555ieP001930 for ; Mon, 4 Oct 2004 22:05:44 -0700 Message-Id: <200410050505.i9555ieP001930@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Memory Management Question Date: Mon, 04 Oct 2004 22:05:44 -0700 From: william@bourbon.usc.edu Someone wrote: > I have at question regarding memory management in C. I tried looking in the > man pages but I couldn't find the answer. > > Suppose you allocate 5 bytes of memory like so: char* x = (char*)malloc(5); > Then at some point in your program you increment x: x= x + 2; > Then at some later point you want to free all of the allocated memory: > free(x) > > Does "free" still know to free 5 bytes and know where the location of the > 1st byte on the heap is? Or does free now mistakenly only free 3 bytes > because x was incremented by 2 thereby incorrectly leaving 2 extra bytes on > the heap. free() will do *neither* of the above! When you call free(x), x *must be* a pointer previously returned by malloc() (or equivalent). If not, you have *corrupted memory*! Sounds serious, huh? Well, it is. free(x) simply means to return x, previously returned by malloc(), back to the "free list". You should read up on memory management and understand why this is the case (or you can come see me). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Oct 4 13:48:31 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i94KmVja021939 for ; Mon, 4 Oct 2004 13:48:31 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i94Ks9gv029966 for ; Mon, 4 Oct 2004 13:54:09 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i94Ks9lu029964 for cs551@merlot.usc.edu; Mon, 4 Oct 2004 13:54:09 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i94Ks8gv029961 for ; Mon, 4 Oct 2004 13:54:08 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i94Ks8om029957 for ; Mon, 4 Oct 2004 13:54:08 -0700 Message-Id: <200410042054.i94Ks8om029957@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: nam not working Date: Mon, 04 Oct 2004 13:54:08 -0700 From: william@bourbon.usc.edu Someone wrote: > ns nam stops workingsince yesterday. It was working fine. ns command runs > but no output no nam window apears. Iam doing using VNC. It used to work > and I didnt do anything that could cause it not to work. > Can you try if works for you. I just tried nam on nunki and it worked for me, but I'm not running VPN (just ssh). I'm not sure what VNC is. The ns/nam in ~csci551 on nunki has been working and has not been touched since last Tuesday. Your ns command runs but no output? Is this also the case with the Hello World program from the lecture slides? May be your input is bad. Also, please copy HW related problems to the TA. He can fix the installation if it's an installation problem. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Oct 3 21:21:57 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i944Lvja001205 for ; Sun, 3 Oct 2004 21:21:57 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i944Rbgv007186 for ; Sun, 3 Oct 2004 21:27:37 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i944RbsG007184 for cs551@merlot.usc.edu; Sun, 3 Oct 2004 21:27:37 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i944Rbgv007179 for ; Sun, 3 Oct 2004 21:27:37 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i944RbIv007172 for ; Sun, 3 Oct 2004 21:27:37 -0700 Message-Id: <200410040427.i944RbIv007172@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: potentially scary typo Date: Sun, 03 Oct 2004 21:27:37 -0700 From: william@bourbon.usc.edu Someone wrote: > Homework 1, > due > 11:45PM, Friday, Oct 4, 2004 (extended). Electronic submissions > only. > > From the homework page : ) THanks for catching it. It's fixed now. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Sep 30 21:11:19 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i914BJja030505 for ; Thu, 30 Sep 2004 21:11:19 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i914H6gv002758 for ; Thu, 30 Sep 2004 21:17:06 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i914H6GJ002756 for cs551@merlot.usc.edu; Thu, 30 Sep 2004 21:17:06 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i914H6gv002753 for ; Thu, 30 Sep 2004 21:17:06 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i914H5q4002749 for ; Thu, 30 Sep 2004 21:17:06 -0700 Message-Id: <200410010417.i914H5q4002749@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Mbps, mbps and MBPS Date: Thu, 30 Sep 2004 21:17:05 -0700 From: william@bourbon.usc.edu Someone wrote: > Is there a difference between MBPS, mbps and Mbps. > MBPS == Mega Bytes Per Second > mbps == mega bits per second > Mbps == dont know. > The terms are interchangeable or they are different as mentioned above? It's unusual to see "mbps". I would use Mbps for Mega Bits Per Second. MBPS does mean Mega Bytes Per Second. The uppercase B is for Bytes and the lowercase b is for Bits. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Sep 29 22:11:27 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8U5BRja002274 for ; Wed, 29 Sep 2004 22:11:27 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8U5HGgv003354 for ; Wed, 29 Sep 2004 22:17:16 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8U5HGjK003352 for cs551@merlot.usc.edu; Wed, 29 Sep 2004 22:17:16 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8U5HGgv003343 for ; Wed, 29 Sep 2004 22:17:16 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8U5HG4q003339 for ; Wed, 29 Sep 2004 22:17:16 -0700 Message-Id: <200409300517.i8U5HG4q003339@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Basic Message Type - 9 Date: Wed, 29 Sep 2004 22:17:16 -0700 From: william@bourbon.usc.edu Someone wrote: > For delete message type: > "Only the original owner of the file (the one who stored the file > in the SERVANT originally) is allowed to delete it. " > node 1 = has the original file > node 6 = downloads the file > node 6 is not the original owner, what happens when a delete > message is sent? Since node 6 is not the original owner of the > file, it keeps the file stored in its home directory? Others > delete it from their cache and only the real owner (node 1) > deletes it from its home directory. > Am I correct? This is a part (2) question! Are you sure you want to worry about it now? To answer your question, when the file in question was created, a certificate containing the public key of node 1 was also created and copied to all nodes that store the file. The corresponding private key is a secret that only node 1 knows. A delete message must be digitally signed by the owner of the private key. Therefore, only node 1 can create the right digital signature. It's not possible for node 6 to create a proper delete message for the file in question because it cannot forge node 1's digital signature. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Sep 28 21:17:21 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8T4HLja000677 for ; Tue, 28 Sep 2004 21:17:21 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8T4NDgv018011 for ; Tue, 28 Sep 2004 21:23:13 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8T4NDrq018006 for cs551@merlot.usc.edu; Tue, 28 Sep 2004 21:23:13 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8T4NCgv018003 for ; Tue, 28 Sep 2004 21:23:12 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8T4NCuK017999 for ; Tue, 28 Sep 2004 21:23:12 -0700 Message-Id: <200409290423.i8T4NCuK017999@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: HW1 Due Date Date: Tue, 28 Sep 2004 21:23:12 -0700 From: william@bourbon.usc.edu Someone wrote: > is the due date for hw1 the same or has it been extended? I've just added the following to the News section of the class web page: 9/28/2004: Due to the gcc/g++ changes on nunki, the deadline for submitting HW1 has been extended to 11:45PM on 10/4/2004. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Sep 28 16:32:46 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8SNWkja027365 for ; Tue, 28 Sep 2004 16:32:46 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8SNccgv017495 for ; Tue, 28 Sep 2004 16:38:38 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8SNccv4017493 for cs551@merlot; Tue, 28 Sep 2004 16:38:38 -0700 Date: Tue, 28 Sep 2004 16:38:38 -0700 From: william@bourbon.usc.edu Message-Id: <200409282338.i8SNccv4017493@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: section added regarding segmentation faults and bus errors Hi, I just added the following section to the projects page: http://merlot.usc.edu/cs551-f04/projects.html#segfault Please take a look at it when you get a chance. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Sep 28 15:55:47 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8SMtlja026356 for ; Tue, 28 Sep 2004 15:55:47 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8SN1dgv003845 for ; Tue, 28 Sep 2004 16:01:39 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8SN1dIX003843 for cs551@merlot; Tue, 28 Sep 2004 16:01:39 -0700 Date: Tue, 28 Sep 2004 16:01:39 -0700 From: william@bourbon.usc.edu Message-Id: <200409282301.i8SN1dIX003843@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Please send questions regarding HWs to the TA. Hi, The TA will be doing the grading for all the homework assignments. Please send all ns-2 related questions to him. Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Sep 28 12:14:40 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8SJEeja021763 for ; Tue, 28 Sep 2004 12:14:40 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8SJKXgv002657 for ; Tue, 28 Sep 2004 12:20:33 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8SJKXlK002655 for cs551@merlot.usc.edu; Tue, 28 Sep 2004 12:20:33 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8SJKXgv002652 for ; Tue, 28 Sep 2004 12:20:33 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8SJKXaV002643 for ; Tue, 28 Sep 2004 12:20:33 -0700 Message-Id: <200409281920.i8SJKXaV002643@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Final Project 1 Date: Tue, 28 Sep 2004 12:20:33 -0700 From: william@bourbon.usc.edu Someone wrote: > Should the beacon nodes be assumed to be always up and > connected all times? Pretend that all these nodes (beacon or not) are individually administered by individuals that you do not have any control over. You can assume that if a node is up and running, it's running code that's compliant to the spec. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Sep 28 09:36:33 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8SGaXja018524 for ; Tue, 28 Sep 2004 09:36:33 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8SGgQgv008833 for ; Tue, 28 Sep 2004 09:42:26 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8SGgQCx008831 for cs551@merlot.usc.edu; Tue, 28 Sep 2004 09:42:26 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8SGgQgv008825 for ; Tue, 28 Sep 2004 09:42:26 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8SGgQx4008817 for ; Tue, 28 Sep 2004 09:42:26 -0700 Message-Id: <200409281642.i8SGgQx4008817@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS551 HW1 - Prob. Running ns Date: Tue, 28 Sep 2004 09:42:26 -0700 From: william@bourbon.usc.edu Someone wrote: > I was trying to run the .tcl file the shell pops up saying > aludra.usc.edu(18): ~csci551/ns example.tcl > /home/scf-22/csci551/ns: Command not found. > > I tried finding the ns file using find but it seems the > directory search permission is not set. > > What should I do? It's being fixed. When it's all fixed, I'll send an e-mail to the whole class regarding the extended deadline. You should work on the final project if you don't have anything else to work on! Well, at least you should read the spec *carefully*. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Sep 28 09:22:49 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8SGMnja018242 for ; Tue, 28 Sep 2004 09:22:49 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8SGSggv028490 for ; Tue, 28 Sep 2004 09:28:42 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8SGSgd5028488 for cs551@merlot.usc.edu; Tue, 28 Sep 2004 09:28:42 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8SGSggv028479 for ; Tue, 28 Sep 2004 09:28:42 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8SGSfVO028469 for ; Tue, 28 Sep 2004 09:28:42 -0700 Message-Id: <200409281628.i8SGSfVO028469@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: ns/nam still not working? Date: Tue, 28 Sep 2004 09:28:41 -0700 From: william@bourbon.usc.edu Someone wrote: > I tried to get ns/nam working: > nunki.usc.edu(12): ~csci551/ns test.tcl > /home/scf-22/csci551/ns: Command not found > nunki.usc.edu(13): ~csci551/nam > /home/scf-22/csci551/nam: Command not found > > Am I doing something wrong or the owner of csci551 is still fixing it? It's being fixed. When it's all fixed, I'll send an e-mail to the whole class regarding the extended deadline. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Sep 27 12:35:10 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8RJZAja024675 for ; Mon, 27 Sep 2004 12:35:10 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8RJf5gv024122 for ; Mon, 27 Sep 2004 12:41:05 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8RJf5Bf024120 for cs551@merlot.usc.edu; Mon, 27 Sep 2004 12:41:05 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8RJf5gv024114 for ; Mon, 27 Sep 2004 12:41:05 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8RJf5OU024107 for ; Mon, 27 Sep 2004 12:41:05 -0700 Message-Id: <200409271941.i8RJf5OU024107@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: regarding submission of warmup 2 Date: Mon, 27 Sep 2004 12:41:05 -0700 From: william@bourbon.usc.edu Someone wrote: > I had submitted my warmup2.tar.gz file on sunday around 5 to 6 pm. > I haven't got the confirmation ticket yet. Do you mean that you did not see something like the following when you run bsubmit? ( 1) Verification Successful ( 2) The timestamped upload ticket (which has been successfully verified) for ( 3) this submission has been placed in 24.bti in the following directory: ( 4) ~/.bistro/tickets/bourbon.usc.edu_9996_999033362_2 ( 5) A copy of your submission has been placed in 24.dat in the ( 6) following directory: ( 7) ~/.bistro/tickets/bourbon.usc.edu_9996_999033362_2 ( 8) The timestamp (time at the server) is '29Aug2001-14:24:57'. ( 9) Verification Successful (10) The receipt (which has been successfully verified) for this submission (11) has been placed in bourbon.usc.edu_9996_999033362_15.bri (12) in the following directory: (13) ~/.bistro/tickets/bourbon.usc.edu_9996_999033362_2 (14) The encrypted submission has been placed in (15) bourbon.usc.edu_9996_999033362_24 in the following directory: (16) ~/.bistro/commits/bourbon.usc.edu_9996_999033362_2 Or you did not get an e-mail saying that your submission has been *collected*? If this is the case, it's because your submission is sitting on the server and I have not gone there to collect all warmup #2 submissions. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Sep 26 22:51:38 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8R5pcja007311 for ; Sun, 26 Sep 2004 22:51:38 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8R5vZgv007862 for ; Sun, 26 Sep 2004 22:57:35 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8R5vZkG007860 for cs551@merlot; Sun, 26 Sep 2004 22:57:35 -0700 Date: Sun, 26 Sep 2004 22:57:35 -0700 From: william@bourbon.usc.edu Message-Id: <200409270557.i8R5vZkG007860@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: warmup #1 office hours for DEN students... Hi, If you are a remote student, the grader is generally available on Tue, 9/28, between 7:30pm and 9:30pm, for phone a conversation. But, please *make an appointment* with him via e-mail to get a specific timeslot if you would like to talk to him during that time. Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Sep 26 22:08:11 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8R58Bja006322 for ; Sun, 26 Sep 2004 22:08:11 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8R5E8gv030793 for ; Sun, 26 Sep 2004 22:14:08 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8R5E8Ij030791 for cs551@merlot.usc.edu; Sun, 26 Sep 2004 22:14:08 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8R5E8gv030788 for ; Sun, 26 Sep 2004 22:14:08 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8R5E8Gc030784 for ; Sun, 26 Sep 2004 22:14:08 -0700 Message-Id: <200409270514.i8R5E8Gc030784@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS551 HW1 - Prob. Running ns Date: Sun, 26 Sep 2004 22:14:08 -0700 From: william@bourbon.usc.edu Someone wrote: > I am having trouble running my ns scripts. When I enter the following > command I get the error displayed below. > > aludra.usc.edu(33): ~csci551/ns hw1-1.tcl > ld.so.1: /home/scf-22/csci551/nsnam/ns-2-snapshot-20030113/ns: fatal: > libstdc++.so.2.10.0: open failed: No such file or directory > Killed > > Any idea what I might be doing wrong? Nothing you did! This is all related to ISD switching the gcc compiler in the middle of the semester. Hopefully, we can get ns/nam rebuilt soon. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Sep 26 22:06:44 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8R56ija006275 for ; Sun, 26 Sep 2004 22:06:44 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8R5Cfgv029394 for ; Sun, 26 Sep 2004 22:12:41 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8R5CfaZ029392 for cs551@merlot.usc.edu; Sun, 26 Sep 2004 22:12:41 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8R5Cfgv029383 for ; Sun, 26 Sep 2004 22:12:41 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8R5CfN3029379 for ; Sun, 26 Sep 2004 22:12:41 -0700 Message-Id: <200409270512.i8R5CfN3029379@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Hm 1: ns not working Date: Sun, 26 Sep 2004 22:12:41 -0700 From: william@bourbon.usc.edu Someone wrote: > I'm trying to get ns started and I run into this error: > > [07:16 PM@aludra ~/csci551]> ~csci551/ns test.tcl ld.so.1: > /home/scf-22/csci551/nsnam/ns-2-snapshot-20030113/ns: fatal: > libstdc++.so.2.10.0: open failed: No such file or directory > > But my lib path is: > > [07:16 PM@aludra ~/csci551]> echo $LD_LIBRARY_PATH > /usr/usc/lib:/usr/lib:/usr/lsd/openssl/default/lib: > /usr/usc/matlab/6.5/extern/lib/sol2 > > Is something wrong with my path? > Because /usr/usc/lib does indeed have libstdc++.so.2.10.0..... I found libstdc++.so.2.10.0 in /usr/usc/gnu/gcc/2.95.2/lib *and* /usr/usc/gnu/gcc/2.95.3/lib. I've tried adding them to LD_LIBRARY_PATH but still get the same error. I've asked the owner of ~csci551 to rebuild ns and nam. Hopefully, it will get rebuilt soon. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Sep 26 22:04:44 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8R54ija006228 for ; Sun, 26 Sep 2004 22:04:44 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8R5Afgv027504 for ; Sun, 26 Sep 2004 22:10:41 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8R5Afkc027502 for cs551@merlot.usc.edu; Sun, 26 Sep 2004 22:10:41 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8R5Afgv027499 for ; Sun, 26 Sep 2004 22:10:41 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8R5AfKS027495 for ; Sun, 26 Sep 2004 22:10:41 -0700 Message-Id: <200409270510.i8R5AfKS027495@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Homework #1 Date: Sun, 26 Sep 2004 22:10:41 -0700 From: william@bourbon.usc.edu Someone wrote: > Quick Question about cygwin, are you able to use NS and NAM too. Yes. It's very easy to build ns and nam on cygwin since it's the default build platform for ns/nam. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Sep 26 22:03:36 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8R53aja006181 for ; Sun, 26 Sep 2004 22:03:36 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8R59Xgv026379 for ; Sun, 26 Sep 2004 22:09:33 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8R59XNq026371 for cs551@merlot.usc.edu; Sun, 26 Sep 2004 22:09:33 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8R59Wgv026368 for ; Sun, 26 Sep 2004 22:09:32 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8R59WFh026364 for ; Sun, 26 Sep 2004 22:09:32 -0700 Message-Id: <200409270509.i8R59WFh026364@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS551: ns library question Date: Sun, 26 Sep 2004 22:09:32 -0700 From: william@bourbon.usc.edu Someone wrote: > I tried to run the example ns script from your slides and got the > following error: > > nunki.usc.edu(7): ~csci551/ns simple.tcl > ld.so.1: /home/scf-22/csci551/nsnam/ns-2-snapshot-20030113/ns: > fatal: libstdc++.so.2.10.0: open failed: No such file or directory > Killed > nunki.usc.edu(8): > > Do we need to update our library paths or run this on another > host? Hmm... I couldn't get it to work. I've asked the owner of ~csci551 to rebuilt ns and nam. Looks like we have to extend the deadline for HW1 if this cannot be fixed soon. Thanks for letting me know about this problem. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Sep 26 21:43:57 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8R4hvja005756 for ; Sun, 26 Sep 2004 21:43:57 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8R4nsgv007677 for ; Sun, 26 Sep 2004 21:49:54 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8R4nsRF007675 for cs551@merlot.usc.edu; Sun, 26 Sep 2004 21:49:54 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8R4nsgv007672 for ; Sun, 26 Sep 2004 21:49:54 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8R4nsii007668 for ; Sun, 26 Sep 2004 21:49:54 -0700 Message-Id: <200409270449.i8R4nsii007668@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Dropped Customer factored into avg sys time? Date: Sun, 26 Sep 2004 21:49:54 -0700 From: william@bourbon.usc.edu Someone wrote: > Should the dropped customers' initial processing time be factored > into the avg time in the system statistical calculation? > Technically they are in the system, but dropped from the system > at queuing time. How should I proceed? Please see my message with timestamp "Mon 20 Sep 07:48". -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Sep 26 21:42:26 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8R4gQja005746 for ; Sun, 26 Sep 2004 21:42:26 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8R4mNgv006217 for ; Sun, 26 Sep 2004 21:48:23 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8R4mNqj006212 for cs551@merlot.usc.edu; Sun, 26 Sep 2004 21:48:23 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8R4mNgv006209 for ; Sun, 26 Sep 2004 21:48:23 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8R4mNna006205 for ; Sun, 26 Sep 2004 21:48:23 -0700 Message-Id: <200409270448.i8R4mNna006205@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Grades for Warmup1 Date: Sun, 26 Sep 2004 21:48:23 -0700 From: william@bourbon.usc.edu Someone wrote: > I am curious when we will know the grades of warmup1, and Are > you going to post on the site. Last Wednesday I've mentioned in class that warmup #1 has been graded and I was delaying sending you the grades until this weekend. You will receive individual e-mails regarding your scores. The grader will hold office hours on Tue, 9/28 between 5pm and 7pm in WPH Lab (in the basement). For remote students, if you like to call the grader, please send him e-mail and schedule an appointment. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Sep 26 21:36:54 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8R4asja005591 for ; Sun, 26 Sep 2004 21:36:54 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8R4gpgv000790 for ; Sun, 26 Sep 2004 21:42:51 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8R4gpdV000788 for cs551@merlot.usc.edu; Sun, 26 Sep 2004 21:42:51 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8R4gpgv000785 for ; Sun, 26 Sep 2004 21:42:51 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8R4gp6l000781 for ; Sun, 26 Sep 2004 21:42:51 -0700 Message-Id: <200409270442.i8R4gp6l000781@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Statistical Questions Date: Sun, 26 Sep 2004 21:42:51 -0700 From: william@bourbon.usc.edu Someone wrote: > I hate to have to ask silly statistical questions, but I'm pretty > confused on this. It's been a while since I took stats. > > 1. In order to calculate the avg. queue size I need to calculate > an average based on queue size readings at regular intervals. > What is an appropriate interval time for these readings to make > them accurate without consuming too much processor time? You should not take this approach. You should think about the following. Any time Q1 changes state, you record the number of jobs at Q1 right before this instance and the duration for which Q1 has this many customers. From this information, you should be able to calculate the average. Do some simple example and convince yourself that you have the right method. > 2. Should we be measuring the standard deviation for time spent > in system using a sample variance (S^2) or an actual variance > formula (sigma^2)? Sample standard deviation is just the square root of the sample variance. Since we are doing sample means, we should use sample variance and sample standard deviation. > Furthermore the sample variance can be > computed as an estimate of sigma (S) dividing the summation by N > samples, or a sample variance (s) dividing the summation by N-1 > samples. Which is the appropriate case for this example? And why > is this so (if you don't mind explaining)? For variable X, the variance is just the average of X squared minus the square of the average of X. When calculating averages, You need to divide by N and not N-1. This is specified at the end of the "Running Your Code" section of the spec. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Sep 25 23:00:00 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8Q600ja031888 for ; Sat, 25 Sep 2004 23:00:00 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8Q65xgv004876 for ; Sat, 25 Sep 2004 23:05:59 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8Q65xoq004871 for cs551@merlot.usc.edu; Sat, 25 Sep 2004 23:05:59 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8Q65xgv004868 for ; Sat, 25 Sep 2004 23:05:59 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8Q65xx8004864 for ; Sat, 25 Sep 2004 23:05:59 -0700 Message-Id: <200409260605.i8Q65xx8004864@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: cancel / kill a thread Date: Sat, 25 Sep 2004 23:05:59 -0700 From: william@bourbon.usc.edu Someone wrote: > I read the man and found out the reason for pthread_exit. > I am trying to cancel all threads (ref. Pthreads Programming - OReilly - > Page: 132-133) > for (i=0;i<3;i++) > pthread_cancel(threads[i]); > //Wait to join threads for clean exit > for (i=0;i<3;i++) > { > status_thread = pthread_join(threads[i], NULL); > printf("Thread %d status %d\n", i, status_thread); > } > Now my server - 2 thread does not exit/join. Is it because: > I call cancel and its not created till that time. > Its waiting on a pthread_cond_wait() and needs to be signalled (in this > case, pthread_cancel should still signal it) > > Where am I going wrong? I cannot answer questions like this. You need to be a lot more specific (and you cannot show me more code than this). What you said about doesn't sound right: > I call cancel and its not created till that time. Well, don't call cancel until it's created! > Its waiting on a pthread_cond_wait() and needs to be signalled (in this > case, pthread_cancel should still signal it) pthread_cond_wait() is a cancellation point. So, you should be able to kill it with pthread_cancel(). Start with some working code (copied from somewhere) and slowly change it to your current code and find out where things go wrong. There is no magic! -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Sunday, September 26, 2004 10:48 AM Subject: Re: cancel / kill a thread > Someone wrote: > > > When I receive a Ctrl-C, I fork a new thread that does: > > > > pthread_exit(&threads[0]); //arrival thread exit > > exit_thread_status = pthread_join(threads[0],NULL); > > > > printf("Thread Status %d\n",exit_thread_status); > > for (exit_threads=1;exit_threads < 3 ;exit_threads++ ) > > { > > pthread_cancel(threads[exit_threads]); > > //server 1 and server 2 thread exit > > pthread_join(threads[exit_threads],NULL); > > } > > > > The exit_thread_status value varies from 0 to 3. What am I doing wrong here? > > Did you read the man pages for pthread_exit()? > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Sep 25 22:12:27 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8Q5CRja030830 for ; Sat, 25 Sep 2004 22:12:27 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8Q5IQgv024412 for ; Sat, 25 Sep 2004 22:18:26 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8Q5IQOV024410 for cs551@merlot.usc.edu; Sat, 25 Sep 2004 22:18:26 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8Q5IQgv024407 for ; Sat, 25 Sep 2004 22:18:26 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8Q5IQV3024403 for ; Sat, 25 Sep 2004 22:18:26 -0700 Message-Id: <200409260518.i8Q5IQV3024403@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: cancel / kill a thread Date: Sat, 25 Sep 2004 22:18:26 -0700 From: william@bourbon.usc.edu Someone wrote: > When I receive a Ctrl-C, I fork a new thread that does: > > pthread_exit(&threads[0]); //arrival thread exit > exit_thread_status = pthread_join(threads[0],NULL); > > printf("Thread Status %d\n",exit_thread_status); > for (exit_threads=1;exit_threads < 3 ;exit_threads++ ) > { > pthread_cancel(threads[exit_threads]); > //server 1 and server 2 thread exit > pthread_join(threads[exit_threads],NULL); > } > > The exit_thread_status value varies from 0 to 3. What am I doing wrong here? Did you read the man pages for pthread_exit()? -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Sep 25 16:34:41 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8PNYfja023799 for ; Sat, 25 Sep 2004 16:34:41 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8PNefgv000821 for ; Sat, 25 Sep 2004 16:40:41 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8PNef6k000819 for cs551@merlot.usc.edu; Sat, 25 Sep 2004 16:40:41 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8PNefgv000816 for ; Sat, 25 Sep 2004 16:40:41 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8PNef8N000812 for ; Sat, 25 Sep 2004 16:40:41 -0700 Message-Id: <200409252340.i8PNef8N000812@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: PTHREAD_CANCEL_DEFERRED Date: Sat, 25 Sep 2004 16:40:41 -0700 From: william@bourbon.usc.edu Someone wrote: > From your message " Fri, 24 Sep 2004 21:33:52 " > it will inform the 3 worker threads to shutdown as soon as they finish their > jobs (for arrival_thread this should be appending the last customer to the > queue successfully, and for server_thread it should be emptying the queue). > *and* also prints the statistics.... > Am I correct? You must print statistics in all cases. Please note that I did not write the paragraph what you've quoted above. When you got the kill signal, you can also just stop the arrival thread and not have it wait for the next timeout (and this would be slightly better since it is possible to wait for a very long time before the next customer arrives). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 24 21:27:50 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8P4Roja032360 for ; Fri, 24 Sep 2004 21:27:50 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8P4Xqgv006081 for ; Fri, 24 Sep 2004 21:33:52 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8P4Xq5n006079 for cs551@merlot.usc.edu; Fri, 24 Sep 2004 21:33:52 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8P4Xqgv006071 for ; Fri, 24 Sep 2004 21:33:52 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8P4Xq2k006066 for ; Fri, 24 Sep 2004 21:33:52 -0700 Message-Id: <200409250433.i8P4Xq2k006066@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: PTHREAD_CANCEL_DEFERRED Date: Fri, 24 Sep 2004 21:33:52 -0700 From: william@bourbon.usc.edu Someone wrote: > I thought we were supposed to do a graceful shutdown. When the > main process receives a Ctrl+C SIGINT, it will inform the 3 > worker threads to shutdown as soon as they finish their jobs (for > arrival_thread this should be appending the last customer to the > queue successfully, and for server_thread it should be emptying > the queue). Sounds right. > If we were to use _cancel() for signalling the > threads, then it is possible that neither of the threads will > have the opportunity to finish their jobs; if they are using > cancel_deferred, again the thread would be forced to exit as soon > as it hits a cancellation point - prematurely. To my best > knowledge, in such an occasion, we would have to consume the > queue in a cleanup_handler or do something fancier. I may be > lacking knowledge (or overlooking an incident that my approach > would fail) here; but I still think doing it with global flags is > easier and straightforward. If you think it's a problem to use pthread_cancel(), then don't use it! Like you said, I would also use global flags to do most of the graceful shutdown (this is also what I said in class). But I think there is going to be a case where you will have a server thread blocked waiting for a condition variable to be signaled and the rest of the system is done with their work. I think the right thing to do at this point is to use pthread_cancel() to kill it and not fake a condition variable signal (which I think is bad form). -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Friday, September 24, 2004 5:01 PM Subject: Re: PTHREAD_CANCEL_DEFERRED > Someone wrote: > > > Do we have to use cancellation method to exit threads? > > I guess you don't *have to*. But I'm having a hard time > seeing how else you can terminate one of the 2 servers. > One of the server, upon serving the last customer, can > decide to exit, if you keep a total count of customers. > But what about the other server thread? It's probably > sitting there waiting for a condition variable to be > signaled. Are you going to fake a signaling of the > condition? > > > I am setting a global > > flag to notify working threads to exit as soon as possible after they > finish > > their necessary duties (like consuming up the queue). What is the > advantage > > of using cancellation (I have read the topic) over the method I am > using? > > If your child thread always exits normally (and exits in a timely > fashion when your process receives a kill signal), there is no > need to ever call pthread_cancel(). In this case, you can even > set the cancellation state such that the child thread cannot be > canceled. > > The point of being familiar with the cancellation stuff is to > know it well since you may need it for the final project which > is a lot more complicated than the warmups. > -- > Bill Cheng // bill.cheng@usc.edu > > > > > ----- Original Message ----- > From: > To: > Sent: Friday, September 24, 2004 1:03 PM > Subject: Re: PTHREAD_CANCEL_DEFERRED > > > > Someone wrote: > > > > > I tried to use PTHREAD_CANCEL_DEFERRED option, but it acts like it > is > > > PTHREAD_CANCEL_ASYNCHRONOUS ! > > > > > > Here is sample code I tested. > > > > > > pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &last_state ); > > > pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &last_type ); > > > > > > for( . ;. ;. ) { > > > printf("before sleep \n"); > > > sleep( . ) // wrapper function of select() > > > printf("after sleep \n"); > > > pthread_testcancel(); > > > printf("after testcancel \n"); > > > } > > > > > > I called pthread_cancel() function when this thread was > > > sleeping at sleep() function. > > > > > > I expected that "before sleep" and "after sleep" will be printed, > > > but it was not. > > > > > > Only "before sleep" was printed and this thread was canceled. > > > > > > Can you see any problem in this code? > > > > What you see is the *desired* behavior! The reason is > > that sleep() or select() is a *cancellation point*. So, > > when you call pthread_cancel() and the thread is at a > > cancellation point, the thread exits! > > > > The pthreads book has more information about cancellation > > point. You can also do a search on the web. For example: > > > > http://www.unet.univie.ac.at/aix/aixprggd/genprogc/term_threads.htm > > -- > > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 24 21:20:45 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8P4Kjja032245 for ; Fri, 24 Sep 2004 21:20:45 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8P4Qlgv031754 for ; Fri, 24 Sep 2004 21:26:47 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8P4QlWZ031752 for cs551@merlot.usc.edu; Fri, 24 Sep 2004 21:26:47 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8P4Qlgv031746 for ; Fri, 24 Sep 2004 21:26:47 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8P4QlUZ031739 for ; Fri, 24 Sep 2004 21:26:47 -0700 Message-Id: <200409250426.i8P4QlUZ031739@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: select problems Date: Fri, 24 Sep 2004 21:26:46 -0700 From: william@bourbon.usc.edu Someone wrote: > Every time I make this call, it fails: > main: select failed - invalid argument > I have no idea why and can't find any documentation on it. The > only think I can think of is if the first argument needs to be > different. > > if (select(0, NULL, NULL, NULL, &interval_t) == -1) > { > pthread_mutex_lock(&out_mutex); > perror("main: select failed"); > pthread_mutex_unlock(&out_mutex); > } Did you check the value of errno? You should be getting an EINVAL. But the question is which argument is invalid. My guess is your interval_t contains an bad value. > ***Also, just to make sure: > I can set the tv_usec value of a struct timeval to a really large > amount without touching the tv_sec value right? I just want to > make sure this won't affect select(). If you read /usr/include/sys/time.h, tv_usec is a signed long integer (I don't know why it's signed, but it is). May be it's complaining that you are using a negative number. I would use tv_usec is >= 0 and < 1,000,000 and use tv_sec for the number of seconds. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 24 16:55:31 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8ONtVja026879 for ; Fri, 24 Sep 2004 16:55:31 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8P01Xgv012265 for ; Fri, 24 Sep 2004 17:01:33 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8P01XCR012263 for cs551@merlot.usc.edu; Fri, 24 Sep 2004 17:01:33 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8P01Xgv012260 for ; Fri, 24 Sep 2004 17:01:33 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8P01Xje012256 for ; Fri, 24 Sep 2004 17:01:33 -0700 Message-Id: <200409250001.i8P01Xje012256@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: PTHREAD_CANCEL_DEFERRED Date: Fri, 24 Sep 2004 17:01:33 -0700 From: william@bourbon.usc.edu Someone wrote: > Do we have to use cancellation method to exit threads? I guess you don't *have to*. But I'm having a hard time seeing how else you can terminate one of the 2 servers. One of the server, upon serving the last customer, can decide to exit, if you keep a total count of customers. But what about the other server thread? It's probably sitting there waiting for a condition variable to be signaled. Are you going to fake a signaling of the condition? > I am setting a global > flag to notify working threads to exit as soon as possible after they finish > their necessary duties (like consuming up the queue). What is the advantage > of using cancellation (I have read the topic) over the method I am using? If your child thread always exits normally (and exits in a timely fashion when your process receives a kill signal), there is no need to ever call pthread_cancel(). In this case, you can even set the cancellation state such that the child thread cannot be canceled. The point of being familiar with the cancellation stuff is to know it well since you may need it for the final project which is a lot more complicated than the warmups. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Friday, September 24, 2004 1:03 PM Subject: Re: PTHREAD_CANCEL_DEFERRED > Someone wrote: > > > I tried to use PTHREAD_CANCEL_DEFERRED option, but it acts like it is > > PTHREAD_CANCEL_ASYNCHRONOUS ! > > > > Here is sample code I tested. > > > > pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &last_state ); > > pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &last_type ); > > > > for( . ;. ;. ) { > > printf("before sleep \n"); > > sleep( . ) // wrapper function of select() > > printf("after sleep \n"); > > pthread_testcancel(); > > printf("after testcancel \n"); > > } > > > > I called pthread_cancel() function when this thread was > > sleeping at sleep() function. > > > > I expected that "before sleep" and "after sleep" will be printed, > > but it was not. > > > > Only "before sleep" was printed and this thread was canceled. > > > > Can you see any problem in this code? > > What you see is the *desired* behavior! The reason is > that sleep() or select() is a *cancellation point*. So, > when you call pthread_cancel() and the thread is at a > cancellation point, the thread exits! > > The pthreads book has more information about cancellation > point. You can also do a search on the web. For example: > > http://www.unet.univie.ac.at/aix/aixprggd/genprogc/term_threads.htm > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 24 16:38:25 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8ONcPja026525 for ; Fri, 24 Sep 2004 16:38:25 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8ONiSgv030336 for ; Fri, 24 Sep 2004 16:44:28 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8ONiS6r030331 for cs551@merlot.usc.edu; Fri, 24 Sep 2004 16:44:28 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8ONiSgv030328 for ; Fri, 24 Sep 2004 16:44:28 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8ONiSnd030324 for ; Fri, 24 Sep 2004 16:44:28 -0700 Message-Id: <200409242344.i8ONiSnd030324@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: average number of customers in Q1? Date: Fri, 24 Sep 2004 16:44:28 -0700 From: william@bourbon.usc.edu Someone wrote: > I never meant to say that the number of customers waiting in line > is more than 2 what I meant was "if the model is M/M/2 shouldnt > the avg no of customers at any given time be the sum of the avg > no of cust at s1 + avg no of cust at s2" ie something like > service time of s1/total s1 time + service time of s2/total s2 > time. Please read what I said again (in my message with timestamp "Fri 24 Sep 12:57") and compare it against when you are saying here. If what you are saying here is true, then it should never be possible for the number of customers in Q1 to be more than 2. Map this to the bank example (which is exactly M/M/2), you should see that it's the same situation. I don't see any mathematical reason why the average number of customers at Q1 is the same as the average number of customers at S1 plus the average number of customers at S2. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 24 12:59:10 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8OJxAja022098 for ; Fri, 24 Sep 2004 12:59:10 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8OK5Dgv020070 for ; Fri, 24 Sep 2004 13:05:13 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8OK5Dbq020068 for cs551@merlot.usc.edu; Fri, 24 Sep 2004 13:05:13 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8OK5Dgv020065 for ; Fri, 24 Sep 2004 13:05:13 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8OK5DP0020061 for ; Fri, 24 Sep 2004 13:05:13 -0700 Message-Id: <200409242005.i8OK5DP0020061@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: output sharing Date: Fri, 24 Sep 2004 13:05:13 -0700 From: william@bourbon.usc.edu Someone wrote: > This may be a silly question but I wanted to ask anyway. For > logging the statistics to stdout, since multiple threads are > logging statistics do we need to place a mutex on the stdout > stream so the print statements are not interleaved? I've > personally never seen this happen, but it doesn't mean its not > necessary. > If this is necessary, won't it drastically slow down the > processing time? You must use a mutex! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 24 12:58:30 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8OJwUja022088 for ; Fri, 24 Sep 2004 12:58:30 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8OK4Xgv019471 for ; Fri, 24 Sep 2004 13:04:33 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8OK4XZj019466 for cs551@merlot.usc.edu; Fri, 24 Sep 2004 13:04:33 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8OK4Xgv019460 for ; Fri, 24 Sep 2004 13:04:33 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8OK4XcV019456 for ; Fri, 24 Sep 2004 13:04:33 -0700 Message-Id: <200409242004.i8OK4XcV019456@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Arrival Thread and main Date: Fri, 24 Sep 2004 13:04:33 -0700 From: william@bourbon.usc.edu Someone wrote: > Is it okay that I am using the main() thread to control my > arrival process storing Customers in the queue? Then there > are 1 or 2 server threads. Or do I need a separate arrival > thread because the main thread should keep track of system- > wide statistics? It's perfectly fine. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 24 12:57:41 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8OJvfja022041 for ; Fri, 24 Sep 2004 12:57:41 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8OK3igv018756 for ; Fri, 24 Sep 2004 13:03:44 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8OK3iaf018754 for cs551@merlot.usc.edu; Fri, 24 Sep 2004 13:03:44 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8OK3igv018749 for ; Fri, 24 Sep 2004 13:03:44 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8OK3i58018744 for ; Fri, 24 Sep 2004 13:03:44 -0700 Message-Id: <200409242003.i8OK3i58018744@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: PTHREAD_CANCEL_DEFERRED Date: Fri, 24 Sep 2004 13:03:44 -0700 From: william@bourbon.usc.edu Someone wrote: > I tried to use PTHREAD_CANCEL_DEFERRED option, but it acts like it is > PTHREAD_CANCEL_ASYNCHRONOUS ! > > Here is sample code I tested. > > pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &last_state ); > pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &last_type ); > > for( . ;. ;. ) { > printf("before sleep \n"); > sleep( . ) // wrapper function of select() > printf("after sleep \n"); > pthread_testcancel(); > printf("after testcancel \n"); > } > > I called pthread_cancel() function when this thread was > sleeping at sleep() function. > > I expected that "before sleep" and "after sleep" will be printed, > but it was not. > > Only "before sleep" was printed and this thread was canceled. > > Can you see any problem in this code? What you see is the *desired* behavior! The reason is that sleep() or select() is a *cancellation point*. So, when you call pthread_cancel() and the thread is at a cancellation point, the thread exits! The pthreads book has more information about cancellation point. You can also do a search on the web. For example: http://www.unet.univie.ac.at/aix/aixprggd/genprogc/term_threads.htm -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 24 12:51:22 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8OJpMja021926 for ; Fri, 24 Sep 2004 12:51:22 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8OJvPgv013166 for ; Fri, 24 Sep 2004 12:57:25 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8OJvPNX013164 for cs551@merlot.usc.edu; Fri, 24 Sep 2004 12:57:25 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8OJvPgv013161 for ; Fri, 24 Sep 2004 12:57:25 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8OJvPvU013157 for ; Fri, 24 Sep 2004 12:57:25 -0700 Message-Id: <200409241957.i8OJvPvU013157@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: average number of customers in Q1? Date: Fri, 24 Sep 2004 12:57:25 -0700 From: william@bourbon.usc.edu Someone wrote: > I was wondering should'nt the avg no of customers (if no of > servers are 2) according to the addition theorem of > probability be the sum of those two? ie avg no of cust at s1 > + avg no of cust at s2. If this is a bank and there are only 2 tellers, are you saying that it is not possible that the average number of customers waiting in line is more than 2? When you apply the "additiona theorem of probability", you cannot apply it arbitrarily! You must apply it *correctly*. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Monday, September 20, 2004 4:16 pm Subject: Re: average number of customers in Q1? > Someone wrote: > > > I think, we must print int value of the "average number of > > customers in Q1", since number of customers is a whole number. > > No. Have you heard that the "average size of a family is 2.5 > person"? It's perfectly valid to have fractions. You should > probably review what you have learned in statistics/probability > courses. > > > but in case of "average number of customers in S1", the value > > will alwz be less than 1 as we are finding the probability > > that S1 or S2 is busy. So here we should print float value. > > Am I right?? > > You should print floating point values for all averages. > -- > Bill Cheng // bill.cheng@usc.edu > > > > ----- Original Message ----- > From: > To: > Sent: Monday, September 20, 2004 7:41 AM > Subject: Re: average number of customers in Q1? > > > Someone wrote: > > > > > Hi, for the statistics, I was wondering how do we obtain the "average > > > number of customers in Q1"? Do you expect it to be number of > > > customers per millisecond ? > > > > No. The idea is that if you walk into the bank at a random > > time, on the average, how many customers do you see waiting > > in line. > > > > > Is it goes the same with the stats for S1 and S2? > > > > If you walk into the bank at a random time, on the average, > > how many customers do you see at S1 (or S2). Since S1 > > (or S2) has a maximum capacity of 1 customer, this average > > is the same as asking the following question: If you walk > > into the bank at a random time, what is the probability > > that S1 (or S2) is busy serving a customer. > > > > (I've mentioned the following in class.) To calculate it, > > draw a timeline, divide this timeline into segments where > > each segment has the same information. Then do some simple > > algebra to calculate the averages. Then convince yourself > > that what you are doing is correct. > > -- > > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Sep 23 21:43:40 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8O4heja003381 for ; Thu, 23 Sep 2004 21:43:40 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8O4nigv013054 for ; Thu, 23 Sep 2004 21:49:44 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8O4nikc013052 for cs551@merlot.usc.edu; Thu, 23 Sep 2004 21:49:44 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8O4nigv013049 for ; Thu, 23 Sep 2004 21:49:44 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8O4niMS013045 for ; Thu, 23 Sep 2004 21:49:44 -0700 Message-Id: <200409240449.i8O4niMS013045@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Total customer maximum Date: Thu, 23 Sep 2004 21:49:44 -0700 From: william@bourbon.usc.edu Someone wrote: > I have a question ... I was trying to see how well my time > based simulation converged to the average inter-arrival time > and service time. So I figured to give a large number of > customers and let it run. After the customer #1600 the time > went negative since I'm assuming the number was as large as > it was going to get as a signed long (This was at 40 min btw). > > Should you give an arbitrary maximum number of customers for > the simulation or is this case only for people with too much > time on their hands. 1600 is a very small number. You can crank up the arrival rate and the service rate and you will be able to simulate for more arrivals. You should definitely use double-precision floating point numbers to keep statistics. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Sep 23 10:20:58 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8NHKwja022117 for ; Thu, 23 Sep 2004 10:20:58 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8NHR4gv006833 for ; Thu, 23 Sep 2004 10:27:04 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8NHR4Vu006828 for cs551@merlot.usc.edu; Thu, 23 Sep 2004 10:27:04 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8NHR3gv006825 for ; Thu, 23 Sep 2004 10:27:03 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8NHR3ni006815 for ; Thu, 23 Sep 2004 10:27:03 -0700 Message-Id: <200409231727.i8NHR3ni006815@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: service time - deterministic dist Date: Thu, 23 Sep 2004 10:27:03 -0700 From: william@bourbon.usc.edu Someone wrote: > as in the case of deterministic the inter arrival time and > service time should be constant, I observe while running several > tests the interarrival time and service time varies slightly for > eg if the service time should ideally be 359 msec it varies b/n > 350 and 359 and I suppose that this clearly has nothing to do at > the application level and purely may be due to scheduling > policies and mutexes etc. If you have convinced yourself that what you are observing is not due to your application, I say "good for you!" -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Sep 22 21:32:31 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8N4WVja006118 for ; Wed, 22 Sep 2004 21:32:31 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8N4ccgv027847 for ; Wed, 22 Sep 2004 21:38:38 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8N4ccw4027842 for cs551@merlot.usc.edu; Wed, 22 Sep 2004 21:38:38 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8N4cbgv027836 for ; Wed, 22 Sep 2004 21:38:37 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8N4cbTb027832 for ; Wed, 22 Sep 2004 21:38:37 -0700 Message-Id: <200409230438.i8N4cbTb027832@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Parameters Date: Wed, 22 Sep 2004 21:38:37 -0700 From: william@bourbon.usc.edu Someone wrote: > So a good policy would be to code it such that if you were > to provide only so many values it would still work and you > are not supposed to provide all parameters? Not a good policy, but a requirement. Optional commandline arguments are, optional! This is why there are *default values* if something are not specified. Also, the optional arguments can be in any order because that's the way UNIX works! -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Wednesday, September 22, 2004 3:22 pm Subject: Re: Parameters > Someone wrote: > > > "You are required to produce a detailed trace as the customers move > > through the system. The output of your program should look like the > > following: > > Parameters: > > lambda = 0.15 > > mu = 0.35 > > system = M/M/2 (or M/M/1 if -s is specified) > > seed = 0 > > size = 5 > > number = 20 > > distribution = exp " Quote from the spec > > > > Should we also check for if you enter parameters as > > Parameters: > > lambda = 0.15 > > system = M/M/2 (or M/M/1 if -s is specified) > > seed = 0 > > size = 5 > > distribution = exp > > mu = 0.35 > > number = 20 > > > > Basically if you reorder the parameters should nm2 still work > > correctly? > > The spec says that the commandline syntax is: > > mm2 [-lambda lambda] [-mu mu] [-s] \ > [-seed seedval] [-size sz] \ > [-n num] [-d {exp|det}] > > Things in square brackets are optional arguments *and* > they can be specified in any order! For example, if you > do "man ls", it says: > > /usr/bin/ls [-aAbcCdfFghilLmnopqrRstux1@] [file...] > > It does *not* mean that you have to handle the arguments > in the same order. So, "ls -cba" is just as valid as > "ls -abc". > > When you printout the parameters, you should print them > out in the order specified in the spec. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Sep 22 21:29:17 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8N4THja006010 for ; Wed, 22 Sep 2004 21:29:17 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8N4ZOgv024741 for ; Wed, 22 Sep 2004 21:35:24 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8N4ZOQ5024739 for cs551@merlot.usc.edu; Wed, 22 Sep 2004 21:35:24 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8N4ZNgv024730 for ; Wed, 22 Sep 2004 21:35:23 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8N4ZNPX024726 for ; Wed, 22 Sep 2004 21:35:23 -0700 Message-Id: <200409230435.i8N4ZNPX024726@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: csci551 Warmup2 Date: Wed, 22 Sep 2004 21:35:23 -0700 From: william@bourbon.usc.edu Someone wrote: > The project mentions: "Please round inter-arrival and service > times to the nearest millisecond using the round() macro above." > > while the sample output shows the inter-arrival and service time > results with resolution of 0.001ms > > If we use round on ms our results will have a resolution of 1ms . > Can you please clear this point. Please see my message with timestamp "Sat 18 Sep 22:08". -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Sep 22 15:16:08 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8MMG8ja030978 for ; Wed, 22 Sep 2004 15:16:08 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8MMMFgv015276 for ; Wed, 22 Sep 2004 15:22:15 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8MMMFH5015274 for cs551@merlot.usc.edu; Wed, 22 Sep 2004 15:22:15 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8MMMFgv015271 for ; Wed, 22 Sep 2004 15:22:15 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8MMMFK8015267 for ; Wed, 22 Sep 2004 15:22:15 -0700 Message-Id: <200409222222.i8MMMFK8015267@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Parameters Date: Wed, 22 Sep 2004 15:22:15 -0700 From: william@bourbon.usc.edu Someone wrote: > "You are required to produce a detailed trace as the customers move > through the system. The output of your program should look like the > following: > Parameters: > lambda = 0.15 > mu = 0.35 > system = M/M/2 (or M/M/1 if -s is specified) > seed = 0 > size = 5 > number = 20 > distribution = exp " Quote from the spec > > Should we also check for if you enter parameters as > Parameters: > lambda = 0.15 > system = M/M/2 (or M/M/1 if -s is specified) > seed = 0 > size = 5 > distribution = exp > mu = 0.35 > number = 20 > > Basically if you reorder the parameters should nm2 still work > correctly? The spec says that the commandline syntax is: mm2 [-lambda lambda] [-mu mu] [-s] \ [-seed seedval] [-size sz] \ [-n num] [-d {exp|det}] Things in square brackets are optional arguments *and* they can be specified in any order! For example, if you do "man ls", it says: /usr/bin/ls [-aAbcCdfFghilLmnopqrRstux1@] [file...] It does *not* mean that you have to handle the arguments in the same order. So, "ls -cba" is just as valid as "ls -abc". When you printout the parameters, you should print them out in the order specified in the spec. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Sep 21 13:15:37 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8LKFaja031134 for ; Tue, 21 Sep 2004 13:15:36 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8LKI9gv029543 for ; Tue, 21 Sep 2004 13:18:09 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8LKI922029541 for cs551@merlot.usc.edu; Tue, 21 Sep 2004 13:18:09 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8LKI9gv029538 for ; Tue, 21 Sep 2004 13:18:09 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8LKI9sI029534 for ; Tue, 21 Sep 2004 13:18:09 -0700 Message-Id: <200409212018.i8LKI9sI029534@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: too much time in Q1? Date: Tue, 21 Sep 2004 13:18:09 -0700 From: william@bourbon.usc.edu Someone wrote: > Part of my output: > 00002009.793ms: c1 leaves Q1, time in Q1 = 00000000.191ms > > To get current time (00002009.793ms in this case): > use gettimeofday(), > convert it to micro-seconds > subtract from time when simulation started and divide by 1000 to > get value in milliseconds > > From the class website: > 00000312.119ms: c1 leaves Q1, time in Q1 = 0.002ms > > The value of c1 is way too large in my case because of scheduling > policies of nunki, or I am doing unnecessary calculations to get > the value of current time? When you were running your code, was nunki's load high? If you run your code when nunki's load is low, do you get a smaller number? The bottom line is that you need to convince yourself that your code is doing the right thing! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Sep 20 16:13:44 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8KNDija004515 for ; Mon, 20 Sep 2004 16:13:44 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8KNGJgv029643 for ; Mon, 20 Sep 2004 16:16:19 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8KNGJh7029641 for cs551@merlot.usc.edu; Mon, 20 Sep 2004 16:16:19 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8KNGJgv029638 for ; Mon, 20 Sep 2004 16:16:19 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8KNGJGf029634 for ; Mon, 20 Sep 2004 16:16:19 -0700 Message-Id: <200409202316.i8KNGJGf029634@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: average number of customers in Q1? Date: Mon, 20 Sep 2004 16:16:19 -0700 From: william@bourbon.usc.edu Someone wrote: > I think, we must print int value of the "average number of > customers in Q1", since number of customers is a whole number. No. Have you heard that the "average size of a family is 2.5 person"? It's perfectly valid to have fractions. You should probably review what you have learned in statistics/probability courses. > but in case of "average number of customers in S1", the value > will alwz be less than 1 as we are finding the probability > that S1 or S2 is busy. So here we should print float value. > Am I right?? You should print floating point values for all averages. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Monday, September 20, 2004 7:41 AM Subject: Re: average number of customers in Q1? > Someone wrote: > > > Hi, for the statistics, I was wondering how do we obtain the "average > > number of customers in Q1"? Do you expect it to be number of > > customers per millisecond ? > > No. The idea is that if you walk into the bank at a random > time, on the average, how many customers do you see waiting > in line. > > > Is it goes the same with the stats for S1 and S2? > > If you walk into the bank at a random time, on the average, > how many customers do you see at S1 (or S2). Since S1 > (or S2) has a maximum capacity of 1 customer, this average > is the same as asking the following question: If you walk > into the bank at a random time, what is the probability > that S1 (or S2) is busy serving a customer. > > (I've mentioned the following in class.) To calculate it, > draw a timeline, divide this timeline into segments where > each segment has the same information. Then do some simple > algebra to calculate the averages. Then convince yourself > that what you are doing is correct. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Sep 20 07:46:07 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8KEk7ja026689 for ; Mon, 20 Sep 2004 07:46:07 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8KEmhgv019663 for ; Mon, 20 Sep 2004 07:48:43 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8KEmhRW019658 for cs551@merlot.usc.edu; Mon, 20 Sep 2004 07:48:43 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8KEmhgv019655 for ; Mon, 20 Sep 2004 07:48:43 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8KEmhBe019651 for ; Mon, 20 Sep 2004 07:48:43 -0700 Message-Id: <200409201448.i8KEmhBe019651@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Include dropped customers in "avg time spent in system" stats Date: Mon, 20 Sep 2004 07:48:43 -0700 From: william@bourbon.usc.edu Someone wrote: > To calculate the "average time spent in system," should we include the > time of the customers that were dropped from the system? Since dropped customers never come into the system, we should not count them into the statistics. (Please note that in some cases, to calculate average time spent in system, some people do include lost customers. But these are special cases where a customer that is lost is considered *serverd*! We do not have such a case here.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Sep 20 07:42:13 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8KEgCja026608 for ; Mon, 20 Sep 2004 07:42:12 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8KEimgv015971 for ; Mon, 20 Sep 2004 07:44:49 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8KEimYE015969 for cs551@merlot.usc.edu; Mon, 20 Sep 2004 07:44:48 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8KEimgv015966 for ; Mon, 20 Sep 2004 07:44:48 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8KEimDL015957 for ; Mon, 20 Sep 2004 07:44:48 -0700 Message-Id: <200409201444.i8KEimDL015957@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: average number of customers Date: Mon, 20 Sep 2004 07:44:48 -0700 From: william@bourbon.usc.edu Someone wrote: > average number of customers in Q1, > average number of customers at S1, > average number of customers at S2, > > what should we calculate for these values? > For example: > average number of customers at S1 = > 1 - (totalIdleTime_S1 / totalEmulationTime) > am I wrong? In my message with timestamp "Mon 20 Sep 07:41", I wrote: Since S1 (or S2) has a maximum capacity of 1 customer, this average is the same as asking the following question: If you walk into the bank at a random time, what is the probability that S1 (or S2) is busy serving a customer. You need to convince yourself whether what you did above is correct or not (or discuss this in the DEN Discussion Board). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Sep 20 07:38:38 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8KEccja026500 for ; Mon, 20 Sep 2004 07:38:38 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8KEfEgv012604 for ; Mon, 20 Sep 2004 07:41:14 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8KEfDi8012602 for cs551@merlot.usc.edu; Mon, 20 Sep 2004 07:41:14 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8KEfDgv012599 for ; Mon, 20 Sep 2004 07:41:13 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8KEfDTS012589 for ; Mon, 20 Sep 2004 07:41:13 -0700 Message-Id: <200409201441.i8KEfDTS012589@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: average number of customers in Q1? Date: Mon, 20 Sep 2004 07:41:13 -0700 From: william@bourbon.usc.edu Someone wrote: > Hi, for the statistics, I was wondering how do we obtain the "average > number of customers in Q1"? Do you expect it to be number of > customers per millisecond ? No. The idea is that if you walk into the bank at a random time, on the average, how many customers do you see waiting in line. > Is it goes the same with the stats for S1 and S2? If you walk into the bank at a random time, on the average, how many customers do you see at S1 (or S2). Since S1 (or S2) has a maximum capacity of 1 customer, this average is the same as asking the following question: If you walk into the bank at a random time, what is the probability that S1 (or S2) is busy serving a customer. (I've mentioned the following in class.) To calculate it, draw a timeline, divide this timeline into segments where each segment has the same information. Then do some simple algebra to calculate the averages. Then convince yourself that what you are doing is correct. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Sep 19 22:58:49 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8K5wnja015694 for ; Sun, 19 Sep 2004 22:58:49 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8K61Qgv006047 for ; Sun, 19 Sep 2004 23:01:26 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8K61Qp5006045 for cs551@merlot.usc.edu; Sun, 19 Sep 2004 23:01:26 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8K61Qgv006042 for ; Sun, 19 Sep 2004 23:01:26 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8K61Qpt006035 for ; Sun, 19 Sep 2004 23:01:26 -0700 Message-Id: <200409200601.i8K61Qpt006035@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Response time calculation Date: Sun, 19 Sep 2004 23:01:26 -0700 From: william@bourbon.usc.edu Someone wrote: > I think I confused it with ri (response time) from slides #4 and #5 of > lecture-6. Slide 4 of lecture 6 uses r_i to denote response time (also known as system time). There, response time is the time the customer spent in the system. When you walk into a bank, you start a timer, when you leave the teller station, you look at time elapsed and that's your time in the system. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Monday, September 20, 2004 10:45 AM Subject: Re: Response time calculation > Someone wrote: > > > From the specs: > > 00000312.117ms: c1 enters Q1 > > 00000312.119ms: c1 leaves Q1, time in Q1 = 0.002ms > > > > time in Q1 (0.002) == response time? > > If not, what is it? > > It's the amount of time customer c1 spent waiting > in the queue. It's not the response time. > > I'm not sure why you are asking about "response time". > I don't see the phrase "response time" anywhere in the > spec. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Sep 19 22:54:56 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8K5suja015613 for ; Sun, 19 Sep 2004 22:54:56 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8K5vWgv002216 for ; Sun, 19 Sep 2004 22:57:32 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8K5vWu0002214 for cs551@merlot.usc.edu; Sun, 19 Sep 2004 22:57:32 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8K5vWgv002210 for ; Sun, 19 Sep 2004 22:57:32 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8K5vWYc002206 for ; Sun, 19 Sep 2004 22:57:32 -0700 Message-Id: <200409200557.i8K5vWYc002206@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Real time calculations and server's bookkeeping time Date: Sun, 19 Sep 2004 22:57:32 -0700 From: william@bourbon.usc.edu Someone wrote: > 1) I am trying to print the real time values for each like arival > time, service time etc..... > I have calculated the sleep time of threads considering lock, unlock, > enQueue time etc. , but still there will alwz be difference of 1-10 ms at > random with the expected values. I think this is acceptable as system > consumes time in printing too. If you think it's reasonable, please document it in your README file. If you are not sure, you should talk to other students using the DEN Discussion Board and see what others are getting and figure out what's reasonable. > 2) As per specs server book keeping time should be Zero, it means I need > to sleep server for service time or I do need to calculate the sleep time > considering other things like unlock etc?? If the service time is 200ms, you should sleep for 200ms. I'm not sure what you are unlocking. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Sep 19 22:21:16 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8K5LGja014894 for ; Sun, 19 Sep 2004 22:21:16 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8K5Nrgv002201 for ; Sun, 19 Sep 2004 22:23:53 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8K5NrjT002199 for cs551@merlot.usc.edu; Sun, 19 Sep 2004 22:23:53 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8K5Nrgv002194 for ; Sun, 19 Sep 2004 22:23:53 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8K5Nrda002186 for ; Sun, 19 Sep 2004 22:23:53 -0700 Message-Id: <200409200523.i8K5Nrda002186@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: 551wu2 - per thread signals Date: Sun, 19 Sep 2004 22:23:52 -0700 From: william@bourbon.usc.edu Someone wrote: > In my understanding, the threads will just be sleeping for a calculated > amount of time, and we wont be dealing with per-thread signalling which is > not (I suppose) directly supported by pthreads. What I mean by per-thread > signalling is to dispatch a single SIGALRM to different threads that set the > signal. In this case I guess we should keep track of which thread has > sigwait on it. > > Just wanted to check if I am on the right track. In general, signals are used for things that happens *asynchronously*. They are also used when your threads are doing something else. In warmup #2, the threads are not doing anything else (other than sleeping). So, there is no need to send them signals. Also, I think you are correct that per-thread signal is not supported by pthreads. So, you should try to avoid it. I've mentioned this before, this is suppose to be a fairly simply project, in terms of pthreads. So, don't go crazy with the esoteric features! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Sep 19 22:12:47 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8K5Clja014718 for ; Sun, 19 Sep 2004 22:12:47 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8K5FOgv026599 for ; Sun, 19 Sep 2004 22:15:24 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8K5FO8K026597 for cs551@merlot.usc.edu; Sun, 19 Sep 2004 22:15:24 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8K5FOgv026590 for ; Sun, 19 Sep 2004 22:15:24 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8K5FNgI026584 for ; Sun, 19 Sep 2004 22:15:24 -0700 Message-Id: <200409200515.i8K5FNgI026584@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Response time calculation Date: Sun, 19 Sep 2004 22:15:23 -0700 From: william@bourbon.usc.edu Someone wrote: > From the specs: > 00000312.117ms: c1 enters Q1 > 00000312.119ms: c1 leaves Q1, time in Q1 = 0.002ms > > time in Q1 (0.002) == response time? > If not, what is it? It's the amount of time customer c1 spent waiting in the queue. It's not the response time. I'm not sure why you are asking about "response time". I don't see the phrase "response time" anywhere in the spec. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Sep 18 22:14:12 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8J5ECja006126 for ; Sat, 18 Sep 2004 22:14:12 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8J5Gpgv011545 for ; Sat, 18 Sep 2004 22:16:51 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8J5GpFw011543 for cs551@merlot.usc.edu; Sat, 18 Sep 2004 22:16:51 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8J5Gpgv011540 for ; Sat, 18 Sep 2004 22:16:51 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8J5GpB9011532 for ; Sat, 18 Sep 2004 22:16:51 -0700 Message-Id: <200409190516.i8J5GpB9011532@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Pthread_create fails with -1 Date: Sat, 18 Sep 2004 22:16:51 -0700 From: william@bourbon.usc.edu Someone wrote: > My pthread_create function is failing with return value -1. What does that > mean? Please see item (4) in my message with timestamp "Thu 09 Sep 17:05". > I had used pthreads in warmup#1 as well and did not face this > problem. Now I cannot compile warmup#1B even after changing the gcc > compiler version. openssl has also moved from /usr/usc/openssl to /usr/lsd/openssl. If there are other compile problems, please send me a transcript of your compilation. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Sep 18 22:10:36 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8J5Aaja006045 for ; Sat, 18 Sep 2004 22:10:36 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8J5DFgv008116 for ; Sat, 18 Sep 2004 22:13:15 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8J5DFcc008114 for cs551@merlot.usc.edu; Sat, 18 Sep 2004 22:13:15 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8J5DFgv008106 for ; Sat, 18 Sep 2004 22:13:15 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8J5DFfB008101 for ; Sat, 18 Sep 2004 22:13:15 -0700 Message-Id: <200409190513.i8J5DFfB008101@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Unit of time Date: Sat, 18 Sep 2004 22:13:15 -0700 From: william@bourbon.usc.edu Someone wrote: > The output given in the spec has the trace times: > > 00000000.000ms: emulation begins > 00000312.112ms: c1 arrives, inter-arrival time = 312.112ms > 00000312.117ms: c1 enters Q1 > 00000312.119ms: c1 leaves Q1, time in Q1 = 0.0002ms > > 1) Are the units in time a typo? Should these times be labeled > seconds (rather than milliseconds)? So for the example, c1 > arrives a 312.112 seconds after the simulation begins rather than > beginning 312 milliseonds after the start. I just posted the answer to this. Please see my message with timestamp "Sat 18 Sep 22:08". > 2) And again for this example, shouldn't time in Q1 for c1 > be .002 seconds? The spec says "0.0002ms" and it should be "0.002ms" since 00000312.119ms minus 00000312.117ms is 0.002ms. It's fixed in the spec now. Thanks for catching it. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Sep 18 22:06:01 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8J561ja005894 for ; Sat, 18 Sep 2004 22:06:01 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8J58fgv003722 for ; Sat, 18 Sep 2004 22:08:41 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8J58fZY003717 for cs551@merlot.usc.edu; Sat, 18 Sep 2004 22:08:41 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8J58fgv003714 for ; Sat, 18 Sep 2004 22:08:41 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8J58fDm003710 for ; Sat, 18 Sep 2004 22:08:41 -0700 Message-Id: <200409190508.i8J58fDm003710@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: inter-arrival time as integer but been displayed as float Date: Sat, 18 Sep 2004 22:08:41 -0700 From: william@bourbon.usc.edu Someone wrote: > From the specs: "The return value of ExponentialInterval() > should be an integer having a unit of milliseconds" ie. > inter-arrival time should be an integer in milliseconds. Correct. This is the inter-arrival time you are shooting for. But as I've explained in class, what you get is usually not what you shoot for. > In the sample output, > 00000312.112ms: c1 arrives, inter-arrival time = 312.112ms > Out here, the inter-arrival time is a 'float' in milliseconds. I > am confused as how this is possible? Any pointers? The actual inter-arrival time is *measured* and you should report exactly what's measured. What you measured should have microsecond resolution because that's what you get from gettimeofday(). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Sep 18 22:00:21 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8J50Lja005775 for ; Sat, 18 Sep 2004 22:00:21 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8J530gv030678 for ; Sat, 18 Sep 2004 22:03:00 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8J530MW030676 for cs551@merlot.usc.edu; Sat, 18 Sep 2004 22:03:00 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8J530gv030667 for ; Sat, 18 Sep 2004 22:03:00 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8J530xi030663 for ; Sat, 18 Sep 2004 22:03:00 -0700 Message-Id: <200409190503.i8J530xi030663@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Bsubmit error Warmup2 Date: Sat, 18 Sep 2004 22:03:00 -0700 From: william@bourbon.usc.edu Someone wrote: > I tried to submit something this weekend and got the following > error. What might be happening here. > > nunki.usc.edu(9): ~csci551b/bin/bsubmit upload -event > merlot.usc.edu_9996_1073236249_18 -file warmup2.tar.gz > > sh: /usr/usc/openssl/default/bin/openssl: cannot execute > Failed to verify the signature of the Bistro Upload Info file > '/tmp/BsubmitjVaqnO' using certificate > '/home/scf-10/user/.bistro/certs/merlot.usc.edu_9996_1073236249_18_cert.pem'. ISD has recently removed /usr/usc/openssl directories. I've just rebuilt bsubmit and reinstalled it. Please try again. If you see more problems, please let me know ASAP. Thanks and sorry about the inconvenience. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Sep 18 08:17:47 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8IFHkja021621 for ; Sat, 18 Sep 2004 08:17:46 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8IFKRgv000902 for ; Sat, 18 Sep 2004 08:20:27 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8IFKRBX000900 for cs551@merlot.usc.edu; Sat, 18 Sep 2004 08:20:27 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8IFKRgv000893 for ; Sat, 18 Sep 2004 08:20:27 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8IFKR3R000887 for ; Sat, 18 Sep 2004 08:20:27 -0700 Message-Id: <200409181520.i8IFKR3R000887@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: gettimeofday() Date: Sat, 18 Sep 2004 08:20:27 -0700 From: william@bourbon.usc.edu Someone wrote: > long a,b; > gettimeofday(&tv,NULL); > a=tv.tv_sec; > b=tv.tv_usec; > > If a returns value in seconds and b in microseconds, then how do > I calculate the time elapsed? Multiplying by 10^6 wont help as it > will be out of bounds. > I am really confused with the way in which a,b can be used to > find the time elapsed. > > Any pointers? Write a function to calculate the difference and make this function take 4 argument: from_sec, from_usec, to_sec, and to_usec. May be this function should take 6 arguments, you can put the difference in seconds and microseconds in 2 arguments. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Sep 18 08:12:13 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8IFCDja021540 for ; Sat, 18 Sep 2004 08:12:13 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8IFErgv028094 for ; Sat, 18 Sep 2004 08:14:53 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8IFErub028092 for cs551@merlot.usc.edu; Sat, 18 Sep 2004 08:14:53 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8IFErgv028089 for ; Sat, 18 Sep 2004 08:14:53 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8IFErFS028085 for ; Sat, 18 Sep 2004 08:14:53 -0700 Message-Id: <200409181514.i8IFErFS028085@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Mutex Scope Date: Sat, 18 Sep 2004 08:14:53 -0700 From: william@bourbon.usc.edu Someone wrote: > I am having 3 threads for arrivalThread,server1 and server 2 > respectively with the Q being the shared resource among the > threads,the problem is that since I am having the code of the > threads in different files if I declare the thread mutex in the > header file the scope of the mutex variable is restricted to the > file,or I have to put the mutex as an extern variable, what > should I do so that the mutex variable has a global scope and if > one thread in a file locks it others can block themselves. Let's say you have something like the following: class ProtectedQueue { ... } or if you are using C: typedef struct tagProtectedQueue { ... } ProtectedQueue; The corresponding header file is "protected_queue.h". You can have a file of global variables, say, "globals.c/cpp" with corresponding header file "globals.h". In "globals.c/cpp", you can have: #include "globals.h" ProtectedQueue my_Q; In "globals.h", you have: #ifndef GLOBAL_H #define GLOBAL_H #include "protected_queue.h" extern ProtectedQueue my_Q; #endif /* ~GLOBAL_H */ The #ifndef stuff is there so that you can include this file many times and recursively and things in it will only be declared once. You should do something like this (if you haven't already done so) for most of your header files. Anywhere you want to us "my_Q", you just have to: #include "globals.h" -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 17 22:17:54 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8I5Hsja009209 for ; Fri, 17 Sep 2004 22:17:54 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8I5Kagv015528 for ; Fri, 17 Sep 2004 22:20:36 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8I5KaRv015526 for cs551@merlot.usc.edu; Fri, 17 Sep 2004 22:20:36 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8I5KZgv015517 for ; Fri, 17 Sep 2004 22:20:35 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8I5KZvt015513 for ; Fri, 17 Sep 2004 22:20:35 -0700 Message-Id: <200409180520.i8I5KZvt015513@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: pthread_atfork Date: Fri, 17 Sep 2004 22:20:35 -0700 From: william@bourbon.usc.edu Someone wrote: > I was wondering at the functioning of the library call > pthread_atfork which says the chold handler is called just before > the call to fork returns, I mean what if the child immidiately > calls an exec replacing the image of the process before the fork > call returns, then how does the child handler gets called. For warmup #2 (and the final project), you should not be forking processes. So, I don't know why you would call pthread_atfork() (which I have never heard of before). My recommendation would be to stick to the basic stuff with pthread. Try not to use esoteric functions if you don't know exactly why they do. (I certainly don't know many of the esoteric pthread functions.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 17 07:45:17 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8HEjHja024082 for ; Fri, 17 Sep 2004 07:45:17 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8HEm0gv007567 for ; Fri, 17 Sep 2004 07:48:00 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8HEm0R0007565 for cs551@merlot.usc.edu; Fri, 17 Sep 2004 07:48:00 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8HEm0gv007556 for ; Fri, 17 Sep 2004 07:48:00 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8HEm0LQ007552 for ; Fri, 17 Sep 2004 07:48:00 -0700 Message-Id: <200409171448.i8HEm0LQ007552@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: default value for lambda/mu Date: Fri, 17 Sep 2004 07:48:00 -0700 From: william@bourbon.usc.edu Someone wrote: > I may be wrong here, but "The default value for lambda is 0.5 > (customers per second) and the default value for mu is 0.35 > (customers per second).", how can we have 0.5 or 0.35 customers > arriving per second? Doesn't an "int" seem more appropriate out > here? Like 5 customers/second or 3 customers/second > :) You can have 0.5 customers arrive per second if your interarrival time is 2 seconds (or 2000ms). I know you are trying not to learn how to read floating point numbers. Too bad! :-) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Sep 16 21:57:11 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8H4vBja010864 for ; Thu, 16 Sep 2004 21:57:11 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8H4xtgv032683 for ; Thu, 16 Sep 2004 21:59:55 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8H4xtCG032681 for cs551@merlot.usc.edu; Thu, 16 Sep 2004 21:59:55 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8H4xtgv032675 for ; Thu, 16 Sep 2004 21:59:55 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8H4xtcM032668 for ; Thu, 16 Sep 2004 21:59:55 -0700 Message-Id: <200409170459.i8H4xtcM032668@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: gcc/g++ version change on nunki Date: Thu, 16 Sep 2004 21:59:55 -0700 From: william@bourbon.usc.edu Someone wrote: > I have checked to see if the path that you have given is > there when I use echo $PATH but still it gives the error gcc > not found. Well, looks like ISD is messing us up again. If you do: ls -ld /usr/usc/gnu/gcc/default You will get: lrwxrwxrwx 1 root 9 Sep 16 19:17 /usr/usc/gnu/gcc/default -> 3-default/ But there is no "/usr/usc/gnu/gcc/3-default"! This link was created *today* at 5:17pm. I have no idea why ISD would leave this link broken. Anyway, to work with the version 3.3.2 of gcc/g++, please add the following at the end of your ~/.cshrc: source /usr/usc/gnu/gcc/3.3.2/setup.csh If you are running bash, please add the following at the end of your ~/.bashrc: source /usr/usc/gnu/gcc/3.3.2/setup.sh This way, we don't have to worry about what /usr/usc/gnu/gcc/default points to. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Thursday, September 16, 2004 7:52 pm Subject: Re: gcc/g++ version change on nunki > Someone wrote: > > > I typed gcc and it cannot find the command. Did the admin > > move the program somewhere? > > The default gcc is /usr/usc/bin/gcc (I think). If you don't > have /usr/usc/bin in your $path or $PATH, you probably changed > your login script and messed something up. If this started > to happen after you've made the change to your ~/.cshrc file > as I've suggested, you may have made a typo. Debug your > ~/.cshrc file just like you would debug your program. Find > the bug and fix it. Another way is to copy your ~/.cshrc from > another student or find out how to reset it. > -- > Bill Cheng // bill.cheng@usc.edu > > > > ----- Original Message ----- > From: william@bourbon.usc.edu > Date: Wednesday, September 15, 2004 4:50 pm > Subject: Re: gcc/g++ version change on nunki > > > Someone wrote: > > > > > I got a compile error even though I set path as you suggested in > > .cshrc. > > > what shall I do? > > > > Another thing you can try is to append the following line > > to your ~/.cshrc file: > > > > source /usr/usc/gnu/gcc/2.95.2/setup.csh > > -- > > Bill Cheng // bill.cheng@usc.edu > > > > > > ----- Original Message ----- > > From: > > To: > > Sent: Wednesday, September 15, 2004 7:48 AM > > Subject: gcc/g++ version change on nunki > > > > > > > Hi, > > > > > > Apparently, ISD changed gcc/g++ from version 2.95.2 to 3.3.2 > > > *yesterday*! Many of your warmup #1 code that compiled under > > > 2.95.2 failed to compile under 3.3.2. The grader will do the > > > following when he grades (and you can do the same to verify > > > that it would work): > > > > > > set path=(/usr/usc/gnu/gcc/2.95.2/bin $path) > > > > > > (this is the csh syntax, if you are using bash, you need > > > something slightly different). > > > > > > Version 3.3.2 of gcc/g++ is much stricter than version 2.95.2. > > > Stricter is usually better! So, if you use gcc/g++, please > > > start using the new version for your warmup #2. > > > -- > > > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Sep 16 19:50:13 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8H2oDja008371 for ; Thu, 16 Sep 2004 19:50:13 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8H2qwgv009384 for ; Thu, 16 Sep 2004 19:52:58 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8H2qwbO009382 for cs551@merlot.usc.edu; Thu, 16 Sep 2004 19:52:58 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8H2qwgv009379 for ; Thu, 16 Sep 2004 19:52:58 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8H2qwG8009375 for ; Thu, 16 Sep 2004 19:52:58 -0700 Message-Id: <200409170252.i8H2qwG8009375@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: gcc/g++ version change on nunki Date: Thu, 16 Sep 2004 19:52:58 -0700 From: william@bourbon.usc.edu Someone wrote: > I typed gcc and it cannot find the command. Did the admin > move the program somewhere? The default gcc is /usr/usc/bin/gcc (I think). If you don't have /usr/usc/bin in your $path or $PATH, you probably changed your login script and messed something up. If this started to happen after you've made the change to your ~/.cshrc file as I've suggested, you may have made a typo. Debug your ~/.cshrc file just like you would debug your program. Find the bug and fix it. Another way is to copy your ~/.cshrc from another student or find out how to reset it. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Wednesday, September 15, 2004 4:50 pm Subject: Re: gcc/g++ version change on nunki > Someone wrote: > > > I got a compile error even though I set path as you suggested in > .cshrc. > > what shall I do? > > Another thing you can try is to append the following line > to your ~/.cshrc file: > > source /usr/usc/gnu/gcc/2.95.2/setup.csh > -- > Bill Cheng // bill.cheng@usc.edu > > > ----- Original Message ----- > From: > To: > Sent: Wednesday, September 15, 2004 7:48 AM > Subject: gcc/g++ version change on nunki > > > > Hi, > > > > Apparently, ISD changed gcc/g++ from version 2.95.2 to 3.3.2 > > *yesterday*! Many of your warmup #1 code that compiled under > > 2.95.2 failed to compile under 3.3.2. The grader will do the > > following when he grades (and you can do the same to verify > > that it would work): > > > > set path=(/usr/usc/gnu/gcc/2.95.2/bin $path) > > > > (this is the csh syntax, if you are using bash, you need > > something slightly different). > > > > Version 3.3.2 of gcc/g++ is much stricter than version 2.95.2. > > Stricter is usually better! So, if you use gcc/g++, please > > start using the new version for your warmup #2. > > -- > > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Sep 15 16:53:15 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8FNrFja006991 for ; Wed, 15 Sep 2004 16:53:15 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8FNu3gv031983 for ; Wed, 15 Sep 2004 16:56:03 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8FNu3FS031979 for ; Wed, 15 Sep 2004 16:56:03 -0700 Message-Id: <200409152356.i8FNu3FS031979@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: gcc/g++ version change on nunki Date: Wed, 15 Sep 2004 16:56:03 -0700 From: william@bourbon.usc.edu By the way, for warmup #2 and the final projects, you need to get your code to compile with the latest gcc/g++ (3.3.2), if you are using gcc/g++. If you need the grader to use the 2.95.2 version, he will do it, but he will also deduct 10 points. So, make the switch now! (It may be painful at first, but it's all for the best.) -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Wed, 15 Sep 2004 07:48:31 -0700 From: william@bourbon.usc.edu To: cs551@merlot.usc.edu Subject: gcc/g++ version change on nunki Hi, Apparently, ISD changed gcc/g++ from version 2.95.2 to 3.3.2 *yesterday*! Many of your warmup #1 code that compiled under 2.95.2 failed to compile under 3.3.2. The grader will do the following when he grades (and you can do the same to verify that it would work): set path=(/usr/usc/gnu/gcc/2.95.2/bin $path) (this is the csh syntax, if you are using bash, you need something slightly different). Version 3.3.2 of gcc/g++ is much stricter than version 2.95.2. Stricter is usually better! So, if you use gcc/g++, please start using the new version for your warmup #2. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Sep 15 16:47:29 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8FNlTja006849 for ; Wed, 15 Sep 2004 16:47:29 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8FNoGgv029734 for ; Wed, 15 Sep 2004 16:50:16 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8FNoGs6029732 for cs551@merlot.usc.edu; Wed, 15 Sep 2004 16:50:16 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8FNoGgv029729 for ; Wed, 15 Sep 2004 16:50:16 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8FNoGdQ029725 for ; Wed, 15 Sep 2004 16:50:16 -0700 Message-Id: <200409152350.i8FNoGdQ029725@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: gcc/g++ version change on nunki Date: Wed, 15 Sep 2004 16:50:16 -0700 From: william@bourbon.usc.edu Someone wrote: > I got a compile error even though I set path as you suggested in .cshrc. > what shall I do? Another thing you can try is to append the following line to your ~/.cshrc file: source /usr/usc/gnu/gcc/2.95.2/setup.csh -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Wednesday, September 15, 2004 7:48 AM Subject: gcc/g++ version change on nunki > Hi, > > Apparently, ISD changed gcc/g++ from version 2.95.2 to 3.3.2 > *yesterday*! Many of your warmup #1 code that compiled under > 2.95.2 failed to compile under 3.3.2. The grader will do the > following when he grades (and you can do the same to verify > that it would work): > > set path=(/usr/usc/gnu/gcc/2.95.2/bin $path) > > (this is the csh syntax, if you are using bash, you need > something slightly different). > > Version 3.3.2 of gcc/g++ is much stricter than version 2.95.2. > Stricter is usually better! So, if you use gcc/g++, please > start using the new version for your warmup #2. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Sep 15 16:43:14 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8FNhEja006768 for ; Wed, 15 Sep 2004 16:43:14 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8FNk1gv028072 for ; Wed, 15 Sep 2004 16:46:01 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8FNk1sc028070 for cs551@merlot.usc.edu; Wed, 15 Sep 2004 16:46:01 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8FNk1gv028067 for ; Wed, 15 Sep 2004 16:46:01 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8FNk1pB028063 for ; Wed, 15 Sep 2004 16:46:01 -0700 Message-Id: <200409152346.i8FNk1pB028063@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: GGC New Version Date: Wed, 15 Sep 2004 16:46:01 -0700 From: william@bourbon.usc.edu Someone wrote: > Although I hate to say this the newer version of gcc/g++ is > pestering for everything right from namespaces to using iostream > instead of iostream.h and so on. Remember what I said about "good habits"? You should be glad that the compiler is helping you out! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Sep 15 14:09:39 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8FL9dja003525 for ; Wed, 15 Sep 2004 14:09:39 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8FLCRgv004478 for ; Wed, 15 Sep 2004 14:12:27 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8FLCRDi004476 for cs551@merlot; Wed, 15 Sep 2004 14:12:27 -0700 Date: Wed, 15 Sep 2004 14:12:27 -0700 From: william@bourbon.usc.edu Message-Id: <200409152112.i8FLCRDi004476@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: warmup project #2 deadline extended... Hi, Due to the gcc/g++ changes on nunki, the deadline for submitting warmup project #2 has been extended to 11:45PM on 9/26/2004. Please also note that I have changed the rules for additional modifications after the modification deadline. Originally, you have 3 additional days to make additional modifications at 3 points per line of modification. I've changed it to only 1 additional day. Please see: http://merlot.usc.edu/cs551-f04/projects.html#mods -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Sep 15 10:21:54 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8FHLsja031010 for ; Wed, 15 Sep 2004 10:21:54 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8FHOggv018082 for ; Wed, 15 Sep 2004 10:24:42 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8FHOgIo018080 for cs551@merlot.usc.edu; Wed, 15 Sep 2004 10:24:42 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8FHOggv018077 for ; Wed, 15 Sep 2004 10:24:42 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8FHOgcT018073 for ; Wed, 15 Sep 2004 10:24:42 -0700 Message-Id: <200409151724.i8FHOgcT018073@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Non Repeatability Date: Wed, 15 Sep 2004 10:24:42 -0700 From: william@bourbon.usc.edu Someone wrote: > With the changing of the seed value for random no generator the > results aer sure to be non repeatble how can we be sure about the > testing of our code if it running fine in all the cases? You need to convince yourself that your code is doing the right thing! Test, test, test! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Sep 15 07:45:43 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8FEjhja027873 for ; Wed, 15 Sep 2004 07:45:43 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8FEmVgv008560 for ; Wed, 15 Sep 2004 07:48:31 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8FEmVUX008558 for cs551@merlot; Wed, 15 Sep 2004 07:48:31 -0700 Date: Wed, 15 Sep 2004 07:48:31 -0700 From: william@bourbon.usc.edu Message-Id: <200409151448.i8FEmVUX008558@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: gcc/g++ version change on nunki Hi, Apparently, ISD changed gcc/g++ from version 2.95.2 to 3.3.2 *yesterday*! Many of your warmup #1 code that compiled under 2.95.2 failed to compile under 3.3.2. The grader will do the following when he grades (and you can do the same to verify that it would work): set path=(/usr/usc/gnu/gcc/2.95.2/bin $path) (this is the csh syntax, if you are using bash, you need something slightly different). Version 3.3.2 of gcc/g++ is much stricter than version 2.95.2. Stricter is usually better! So, if you use gcc/g++, please start using the new version for your warmup #2. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Sep 14 21:41:00 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8F4exja015354 for ; Tue, 14 Sep 2004 21:40:59 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8F4hngv018124 for ; Tue, 14 Sep 2004 21:43:49 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8F4hnU1018122 for cs551@merlot.usc.edu; Tue, 14 Sep 2004 21:43:49 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8F4hngv018119 for ; Tue, 14 Sep 2004 21:43:49 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8F4hnxC018109 for ; Tue, 14 Sep 2004 21:43:49 -0700 Message-Id: <200409150443.i8F4hnxC018109@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: csci551: Run time of mm2 Date: Tue, 14 Sep 2004 21:43:49 -0700 From: william@bourbon.usc.edu Someone wrote: > what is the time duration is sec for which the simulation should run ? You should run till all customers have arrived and departed from the system. Please make sure you also handle things like c properly. I just noticed that I forgot to mention this in the spec, I've just added the following paragraph: [BC: Paragraph added 9/14/2004] If the user presses c on the keyboard on send a SIGINT or SIGTERM to your simulation process, you must stop the arrival process, let your system finish serving all the customers in the usual way, and output statistics in the usual way. You should be able to reuse some of your code for handling of c from warmup #1. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Sep 14 21:27:43 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8F4Rhja014995 for ; Tue, 14 Sep 2004 21:27:43 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8F4UXgv005559 for ; Tue, 14 Sep 2004 21:30:33 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8F4UXP1005557 for cs551@merlot.usc.edu; Tue, 14 Sep 2004 21:30:33 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8F4UWgv005549 for ; Tue, 14 Sep 2004 21:30:32 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8F4UWDp005544 for ; Tue, 14 Sep 2004 21:30:32 -0700 Message-Id: <200409150430.i8F4UWDp005544@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Compensating for Bookeeping on Arrival Process Date: Tue, 14 Sep 2004 21:30:32 -0700 From: william@bourbon.usc.edu Someone wrote: > I had a question regarding the bookeeping on the arrival > process. The scenario was that the interarrival time was > 600 ms and the bookeeping time was 50 ms, so the sleep time > should be 550 ms. > > The question is this. Does the bookeeping time refer to the > previous customer. I am assuming it does since you can't > predict the time for the current customer. I just wanted to > make sure. > > What I am thinking is that the first customer you sleep from > time zero until the first arrival time. Then after putting > that customer on the queue, you sleep for the next arrival > time minus the bookeeping time to put customer one on the > queue. Correct me if I am wrong. I'm not sure exactly what you mean. But if you look at slide 4 of lecture 6, it should be pretty clear. a2-a1 is the "interarrival time" and yor are flipping coins for the "interarrival time" to match. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Sep 14 21:24:34 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8F4OYja014948 for ; Tue, 14 Sep 2004 21:24:34 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8F4RNgv002488 for ; Tue, 14 Sep 2004 21:27:23 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8F4RNJB002479 for cs551@merlot.usc.edu; Tue, 14 Sep 2004 21:27:23 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8F4RNgv002476 for ; Tue, 14 Sep 2004 21:27:23 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8F4RNP6002472 for ; Tue, 14 Sep 2004 21:27:23 -0700 Message-Id: <200409150427.i8F4RNP6002472@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: pthread_create is not creating threads in my code Date: Tue, 14 Sep 2004 21:27:23 -0700 From: william@bourbon.usc.edu Someone wrote: > > I've used pthread in the following fashion > > > > Th = pthread_create ( threaddid , NULL, function_name , (void *) arg ); > > If ( th) > > { > > Printf ( "\n thread not created\n"); > > } > > > > While running the whole code I'm getting the "thread not created " > > message. Is there anything else to do in there? > > What may be the reason of the thread no being created? > >Did you read the man pages for pthread_create? What is the > >value of errno? > > > The error number I'm getting is = -1. > it's not returning any error number like EINVAL, EPERM OR EAGAIN. > What to do? Like I said in my previous reply, please see my message with timestamp "Thu 09 Sep 17:05". -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Sep 14 15:53:58 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8EMrwja008266 for ; Tue, 14 Sep 2004 15:53:58 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8EMumgv014907 for ; Tue, 14 Sep 2004 15:56:48 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8EMumcf014905 for cs551@merlot.usc.edu; Tue, 14 Sep 2004 15:56:48 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8EMulgv014896 for ; Tue, 14 Sep 2004 15:56:48 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8EMulmV014892 for ; Tue, 14 Sep 2004 15:56:47 -0700 Message-Id: <200409142256.i8EMulmV014892@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: pthread_create is not creating threads in my code Date: Tue, 14 Sep 2004 15:56:47 -0700 From: william@bourbon.usc.edu Someone wrote: > I've used pthread in the following fashion > > Th = pthread_create ( threaddid , NULL, function_name , (void *) arg ); > If ( th) > { > Printf ( "\n thread not created\n"); > } > > While running the whole code I'm getting the "thread not created " message. > Is there anything else to do in there? > What may be the reason of the thread no being created? Did you read the man pages for pthread_create? What is the value of errno? Also, please see my message with timestamp "Thu 09 Sep 17:05". -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Sep 13 12:42:58 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8DJgwja007490 for ; Mon, 13 Sep 2004 12:42:58 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8DJjpgv020344 for ; Mon, 13 Sep 2004 12:45:51 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8DJjpQU020342 for cs551@merlot.usc.edu; Mon, 13 Sep 2004 12:45:51 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8DJjpgv020339 for ; Mon, 13 Sep 2004 12:45:51 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8DJjp2e020337 for cs551; Mon, 13 Sep 2004 12:45:51 -0700 Date: Mon, 13 Sep 2004 12:45:51 -0700 From: william@bourbon.usc.edu Message-Id: <200409131945.i8DJjp2e020337@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: hints for warmup #2 Hi, Here are some additional hints for warmup #2: 1) be familiar with all the functions mentioned on slide 2 of lecture 6 2) if you think you may be having problems with the exponential stuff, code things up for the deterministic case first, when you need to compute how must time to sleep, call a function; later on you can modify this function to handle the exponential case. 3) store clock values at all instances on slide 16 of lecture 6 for every customer, you will need this to calculate statistics -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Sep 13 10:06:37 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8DH6bja003894 for ; Mon, 13 Sep 2004 10:06:37 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8DH9Vgv011779 for ; Mon, 13 Sep 2004 10:09:31 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8DH9VjR011777 for cs551@merlot.usc.edu; Mon, 13 Sep 2004 10:09:31 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8DH9Vgv011774 for ; Mon, 13 Sep 2004 10:09:31 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8DH9Vc2011770 for ; Mon, 13 Sep 2004 10:09:31 -0700 Message-Id: <200409131709.i8DH9Vc2011770@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Thread Debuggers Date: Mon, 13 Sep 2004 10:09:30 -0700 From: william@bourbon.usc.edu Someone wrote: > there are some thread aware debuggers like smart gdb and TDI etc > but I am not sure if they are present on nunki can we download > and install them? for debugging purposes. Please see a message I forwarded to the DEN Discussion Board. You can certainly download and install anything in your home directory as long as (1) you have disk space and (2) our grading does *not* depend on it. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Sep 11 09:18:46 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8BGIkja027199 for ; Sat, 11 Sep 2004 09:18:46 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8BGLjgv007282 for ; Sat, 11 Sep 2004 09:21:45 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8BGLjJw007274 for cs551@merlot.usc.edu; Sat, 11 Sep 2004 09:21:45 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8BGLigv007271 for ; Sat, 11 Sep 2004 09:21:44 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8BGLinF007267 for ; Sat, 11 Sep 2004 09:21:44 -0700 Message-Id: <200409111621.i8BGLinF007267@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: submission deadline is getting close... Date: Sat, 11 Sep 2004 09:21:44 -0700 From: william@bourbon.usc.edu Someone wrote: > I am not able to upload the file , I followed the instructions > as given in the site it gives the following message > > Usage: bsubmit command [OPTIONS] > Possible values for 'command': > upload ; upload a file > config ; configure some parameter for later use > Possible values for OPTIONS for the 'upload' command: > [-email your_email_address] ; notify you > [-cert certificate_path] ; event certificate > [-event event_id] ; host_port_n1_n2 > [-file file_to_upload] ; data file to be uploaded > Possible values for OPTIONS for the 'config' command: > [-set CONFIGURATIONS] ; see below > Possible values for CONFIGURATIONS: > [email=your_email_address] > > what should I do? You were strongly encouraged to try out the submission program way before the deadline just to get familiar with it. Looked like you did not. There is only one policy for late submission and I must apply the same policy for all students in order to be fair: http://merlot.usc.edu/cs551-f04/description.html#late So, if you cannot submit anything because you cannot get the submission program to work, you will receive a score of zero. Sorry. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Sep 11 09:13:09 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8BGD9ja027084 for ; Sat, 11 Sep 2004 09:13:09 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8BGG7gv002054 for ; Sat, 11 Sep 2004 09:16:07 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8BGG7KA002042 for cs551@merlot.usc.edu; Sat, 11 Sep 2004 09:16:07 -0700 Date: Sat, 11 Sep 2004 09:16:07 -0700 From: william@bourbon.usc.edu Message-Id: <200409111616.i8BGG7KA002042@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: reminder about modifications... Hi, This is a reminder that you can send in changes within 24 hours of the origial submission deadline of warmup project #1. Please see: http://merlot.usc.edu/cs551-f04/projects.html#mods for rules. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 10 21:45:37 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8B4jbja012688 for ; Fri, 10 Sep 2004 21:45:37 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8B4magv001370 for ; Fri, 10 Sep 2004 21:48:36 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8B4magB001368 for cs551@merlot.usc.edu; Fri, 10 Sep 2004 21:48:36 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8B4magv001360 for ; Fri, 10 Sep 2004 21:48:36 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8B4ma4h001357 for cs551; Fri, 10 Sep 2004 21:48:36 -0700 Date: Fri, 10 Sep 2004 21:48:36 -0700 From: william@bourbon.usc.edu Message-Id: <200409110448.i8B4ma4h001357@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: submission deadline is getting close... Hi, Some of you have not even submitted *anything*. Please try to submit something soon just in case you cannot get things to work exactly the way you want near the deadline. When it gets close to the deadline, you may make mistakes and miss the deadline. The penalty for missing the deadline is *very severe* and non-negotiable. Please submit on-time! Also, most likely I will not answer any more e-mail questions tonight. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 10 21:39:54 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8B4dsja012535 for ; Fri, 10 Sep 2004 21:39:54 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8B4gsgv028408 for ; Fri, 10 Sep 2004 21:42:54 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8B4gseZ028406 for cs551@merlot.usc.edu; Fri, 10 Sep 2004 21:42:54 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8B4gsgv028403 for ; Fri, 10 Sep 2004 21:42:54 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8B4gsEJ028397 for ; Fri, 10 Sep 2004 21:42:54 -0700 Message-Id: <200409110442.i8B4gsEJ028397@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Fatal error out of the blue Date: Fri, 10 Sep 2004 21:42:54 -0700 From: william@bourbon.usc.edu Someone wrote: > I am getting this error : > fatal: libcrypto.so.0.9.6: open failed: No such file or directory > > please advise You should search through the archive of all messages: http://merlot.usc.edu/cs551-f04/msgs/bill/all.txt and look for "libcrypto". -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 10 21:37:20 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8B4bKja012472 for ; Fri, 10 Sep 2004 21:37:20 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8B4eJgv025932 for ; Fri, 10 Sep 2004 21:40:19 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8B4eJ5O025930 for cs551@merlot.usc.edu; Fri, 10 Sep 2004 21:40:19 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8B4eJgv025927 for ; Fri, 10 Sep 2004 21:40:19 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8B4eJID025923 for ; Fri, 10 Sep 2004 21:40:19 -0700 Message-Id: <200409110440.i8B4eJID025923@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Cannot get system time Date: Fri, 10 Sep 2004 21:40:19 -0700 From: william@bourbon.usc.edu Someone wrote: > I've tried to use clock() to get the system time, but it always > returns 0. Therefore, my timeout resets every time a client > connects to the server (passing the block from select). Is there > another way to monitor the system time? You can use gettimeofday(). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 10 13:30:37 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8AKUbja002288 for ; Fri, 10 Sep 2004 13:30:37 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8AKXbgv007523 for ; Fri, 10 Sep 2004 13:33:37 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8AKXb06007521 for cs551@merlot.usc.edu; Fri, 10 Sep 2004 13:33:37 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8AKXbgv007518 for ; Fri, 10 Sep 2004 13:33:37 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8AKXbtV007514 for ; Fri, 10 Sep 2004 13:33:37 -0700 Message-Id: <200409102033.i8AKXbtV007514@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: sigwait defined incorrectly in signal.h Date: Fri, 10 Sep 2004 13:33:37 -0700 From: william@bourbon.usc.edu Someone wrote: > Alright ... that seemed to work, but now I am getting other > errors implicit declartion of sigemptyset(...) and > sigaddset(...). If I try to put in the prototype, then I just > get that the symbol is undefined. This should be easy to fix for a graduate student. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Friday, September 10, 2004 1:01 pm Subject: Re: sigwait defined incorrectly in signal.h > Someone wrote: > > > I am having some difficulty with sigwait(). > > > > it is defined on most man pages as > > > > #include > > > > int sigwait(const sigset_t *set, int *sig); > > > > but when I include signal.h I get an error that I have too many > > arguments and it is only expecting the following: > > > > int sigwait(const sigset_t *set); > > > > I am using pthreads, but you are not allowed to use pthreads > > ruitines when in the context of the signal handler. In this way, > > I am trying to block the signals and then wait on them. And then > > do my work on them once I get one. > > > > Since we really can't change files in the /usr/include directory, > > do you have any suggestions? > > The man pages for sigmwait() says: > > SYNOPSIS > Default > #include > > int sigwait(sigset_t *set); > > POSIX > cc [ flag ... ] file ... -D_POSIX_PTHREAD_SEMANTICS [ library...] > #include > > int sigwait(const sigset_t *set, int *sig); > > It says that if you want the sigwait() with 2 arguments, you > should add -D_POSIX_PTHREAD_SEMANTICS when you compile it. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 10 13:28:27 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8AKSRja002202 for ; Fri, 10 Sep 2004 13:28:27 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8AKVSgv006707 for ; Fri, 10 Sep 2004 13:31:28 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8AKVSb9006705 for cs551@merlot.usc.edu; Fri, 10 Sep 2004 13:31:28 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8AKVSgv006700 for ; Fri, 10 Sep 2004 13:31:28 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8AKVStK006696 for ; Fri, 10 Sep 2004 13:31:28 -0700 Message-Id: <200409102031.i8AKVStK006696@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Autoshutting down the Server Date: Fri, 10 Sep 2004 13:31:28 -0700 From: william@bourbon.usc.edu Someone wrote: > Then information should I send to the client that the server is > down by doing a send of just 1 byte(since the timer expires and I > immidiately have to shut down the server)? so thst the client can > shutdowm gracefully. You should *not* send anything to the client to tell the client that the server is shutting down! That's not allowed because it violates the spec! My previoius message said: You should have each of your child process/thread close the connection it has with the corresponding client. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Friday, September 10, 2004 1:06 pm Subject: Re: Autoshutting down the Server > Someone wrote: > > > Given that the server should auto shut down after either t or 60 > > secs, if the server is in the middle of some transfer as you said > > it has to intimate the client some way to close down now I was > > thinking since the transfer should be of only 1 byte the server > > can only send say 1 byte and then shut down, my question is > > should I send some random character like ^ or * etc to let the > > client know that the server if off ? what if one of these > > characters occur in a file transfer ? > > You are not allowed to send special characters because that > will not violate the spec and your server will not be able to > interoperate with clients implemented by others. > > You should have each of your child process/thread close the > connection it has with the corresponding client. > > > Finally what if the (eof) packet is lost wouldnt the client wait > > on indefinetely, how can I force the client to unblock itself and > > die after some time? should I use a timer at client too then? > > I'm not sure what an EOF packet is. You must use a timer. > You should get use to timers because you need timers for > programming in networking! > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 10 13:03:23 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8AK3Nja001689 for ; Fri, 10 Sep 2004 13:03:23 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8AK6Ogv029881 for ; Fri, 10 Sep 2004 13:06:24 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8AK6Oej029879 for cs551@merlot.usc.edu; Fri, 10 Sep 2004 13:06:24 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8AK6Ngv029873 for ; Fri, 10 Sep 2004 13:06:23 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8AK6N40029866 for ; Fri, 10 Sep 2004 13:06:23 -0700 Message-Id: <200409102006.i8AK6N40029866@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Autoshutting down the Server Date: Fri, 10 Sep 2004 13:06:23 -0700 From: william@bourbon.usc.edu Someone wrote: > Given that the server should auto shut down after either t or 60 > secs, if the server is in the middle of some transfer as you said > it has to intimate the client some way to close down now I was > thinking since the transfer should be of only 1 byte the server > can only send say 1 byte and then shut down, my question is > should I send some random character like ^ or * etc to let the > client know that the server if off ? what if one of these > characters occur in a file transfer ? You are not allowed to send special characters because that will not violate the spec and your server will not be able to interoperate with clients implemented by others. You should have each of your child process/thread close the connection it has with the corresponding client. > Finally what if the (eof) packet is lost wouldnt the client wait > on indefinetely, how can I force the client to unblock itself and > die after some time? should I use a timer at client too then? I'm not sure what an EOF packet is. You must use a timer. You should get use to timers because you need timers for programming in networking! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 10 12:58:47 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8AJwlja001574 for ; Fri, 10 Sep 2004 12:58:47 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8AK1lgv028180 for ; Fri, 10 Sep 2004 13:01:47 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8AK1lWP028178 for cs551@merlot.usc.edu; Fri, 10 Sep 2004 13:01:47 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8AK1lgv028175 for ; Fri, 10 Sep 2004 13:01:47 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8AK1lWm028171 for ; Fri, 10 Sep 2004 13:01:47 -0700 Message-Id: <200409102001.i8AK1lWm028171@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: sigwait defined incorrectly in signal.h Date: Fri, 10 Sep 2004 13:01:47 -0700 From: william@bourbon.usc.edu Someone wrote: > I am having some difficulty with sigwait(). > > it is defined on most man pages as > > #include > > int sigwait(const sigset_t *set, int *sig); > > but when I include signal.h I get an error that I have too many > arguments and it is only expecting the following: > > int sigwait(const sigset_t *set); > > I am using pthreads, but you are not allowed to use pthreads > ruitines when in the context of the signal handler. In this way, > I am trying to block the signals and then wait on them. And then > do my work on them once I get one. > > Since we really can't change files in the /usr/include directory, > do you have any suggestions? The man pages for sigmwait() says: SYNOPSIS Default #include int sigwait(sigset_t *set); POSIX cc [ flag ... ] file ... -D_POSIX_PTHREAD_SEMANTICS [ library...] #include int sigwait(const sigset_t *set, int *sig); It says that if you want the sigwait() with 2 arguments, you should add -D_POSIX_PTHREAD_SEMANTICS when you compile it. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 10 11:21:09 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8AIL9ja031926 for ; Fri, 10 Sep 2004 11:21:09 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8AIOAgv024460 for ; Fri, 10 Sep 2004 11:24:10 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8AIOANM024458 for cs551@merlot.usc.edu; Fri, 10 Sep 2004 11:24:10 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8AIOAgv024455 for ; Fri, 10 Sep 2004 11:24:10 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8AIOAEL024451 for ; Fri, 10 Sep 2004 11:24:10 -0700 Message-Id: <200409101824.i8AIOAEL024451@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: md5 in case of directory Date: Fri, 10 Sep 2004 11:24:10 -0700 From: william@bourbon.usc.edu Someone wrote: > If requested file is directory, and I calculate its md5 this > is different if I compare it with md5 using on command line. > Perhaps on command line md5 also calcultes for all the files > in that directory. what should I do in case of get_req for > the directory? I'm not sure what happens if you run commandline md5 on a directory. *If* it's actually reading all the files in the directory, then your code does not have to produce the same value. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 10 11:18:22 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8AIIMja031852 for ; Fri, 10 Sep 2004 11:18:22 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8AILEgv023367 for ; Fri, 10 Sep 2004 11:21:14 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8AILEbi023365 for cs551@merlot.usc.edu; Fri, 10 Sep 2004 11:21:14 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8AILEgv023362 for ; Fri, 10 Sep 2004 11:21:14 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8AILE5o023358 for ; Fri, 10 Sep 2004 11:21:14 -0700 Message-Id: <200409101821.i8AILE5o023358@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Shutdown confusion Date: Fri, 10 Sep 2004 11:21:14 -0700 From: william@bourbon.usc.edu Someone wrote: > (I'm working with pthreads here) > 1. Do I need a separate thread for the select auto-shutdown > timeout? My assumption is the server begins shutdown after t > seconds even if there are threads processing requests or replies. > So I can't just do a select(..., .., ., timeout) before the > accept call because that will be bypassed the second a socket is > available for reading or writing. Am I correct with this > assumption? As I have mentioned before, there are many ways to write this program. Certainly, using another thread just for auto-shutdown would be fine. Making a select() call right before accept() can also work if you calculate how much you need to sleep based on the difference between the current clock value and the clock value when you server got started. > 2. Using threads, when I begin shutdown, would I use > shutdown(sockfd, ...) to close the read half of server threads so > they can finish processing and then pthread_join to synchronize > all the threads (I assume I have to use a thread pool or some > data structure to keep track of the worker threads in the server > main() thread). Or can I simply close(sockfd) all the sockets? I'm not sure what is the exactly difference between: shutdown(sockfd, SHUT_RD); close(sockfd); and simply close(sockfd); Normally, I would just call close(). By thw ay, threads are very lightweight. For this project, using a thread pool may be a overkill. You can simply create a new thread for every new connection. But if you want to get a head start on thread pools, that would certainly be fine. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 10 10:54:31 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8AHsVja031372 for ; Fri, 10 Sep 2004 10:54:31 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8AHvWgv014573 for ; Fri, 10 Sep 2004 10:57:32 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8AHvWP7014571 for cs551@merlot.usc.edu; Fri, 10 Sep 2004 10:57:32 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8AHvVgv014565 for ; Fri, 10 Sep 2004 10:57:31 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8AHvVU1014558 for ; Fri, 10 Sep 2004 10:57:31 -0700 Message-Id: <200409101757.i8AHvVU1014558@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Submit Question - CS551 Date: Fri, 10 Sep 2004 10:57:31 -0700 From: william@bourbon.usc.edu Someone wrote: > I was just wondering if we have to enter the following line each time we > perform a submit. > ~csci551b/bin/bsubmit config -set email=you@yourdomain > Or is this just a configuration command that we need to perform the > 1st time we use the software. Only the 1st time you use the software. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 10 07:49:37 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8AEnbja027582 for ; Fri, 10 Sep 2004 07:49:37 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8AEqcgv009758 for ; Fri, 10 Sep 2004 07:52:38 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8AEqcsI009753 for cs551@merlot.usc.edu; Fri, 10 Sep 2004 07:52:38 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8AEqcgv009747 for ; Fri, 10 Sep 2004 07:52:38 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8AEqcZG009737 for ; Fri, 10 Sep 2004 07:52:38 -0700 Message-Id: <200409101452.i8AEqcZG009737@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: accept returns 0 Date: Fri, 10 Sep 2004 07:52:37 -0700 From: william@bourbon.usc.edu Someone wrote: > When I call accept from my server, it returns 0. Which is not > supposed to be an error or a valid socket descriptor. I'm not > sure what to do, but it causes a serious problem in that the > server blocks on read(fd, ...) because it is trying to read from > 0 (which should be stdout I think. I don't know what to do. I've > been working on this stuff alot for the past 2 weeks. Hmm... The man pages ("man -s 3socket accept") say: The accept() function returns -1 on error. If it succeeds, it returns a non-negative integer that is a descriptor for the accepted socket. So, it shouldn't return 0 (I think 0 is stdin). Is errno set to one of the values listed in the man pages? Does this happen every time or this code use to work? I don't know how accept() can return a 0! My guess is that something is really screwed up (for example, you have trashed your memory somewhere and accept() got confused; this means that this call would be working when your server first starts, then it starts to fail). I would suggest what I have suggested before: If you are stuck, copy some working code from a book, make sure it works (or starting from a place where your code use to work), then slowly transform that code to your code and watch when it starts to fail. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Sep 9 19:15:11 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8A2FBja012032 for ; Thu, 9 Sep 2004 19:15:11 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8A2IDgv006988 for ; Thu, 9 Sep 2004 19:18:13 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8A2IDLx006986 for cs551@merlot.usc.edu; Thu, 9 Sep 2004 19:18:13 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8A2IDgv006983 for ; Thu, 9 Sep 2004 19:18:13 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8A2IDVQ006976 for ; Thu, 9 Sep 2004 19:18:13 -0700 Message-Id: <200409100218.i8A2IDVQ006976@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: auto-shutdown query Date: Thu, 09 Sep 2004 19:18:13 -0700 From: william@bourbon.usc.edu Someone wrote: > When my server shuts down, all the forked processes continue > their execution (transfer of file etc) and then shut-down > gracefully. From your previous message " the child server > processes/threads should not serve more than a few bytes after > the auto-shutdown timer goes off." > My question is: > Client is transferring 1MB file. > Main Server shuts down, thereby "not" accepting any new > connections. > Forked server will continue to run until the entire file has been > transferred. Should I change this to "Forked server should halt > by sending as few bytes as possible." I guess that's a good way to put it. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Sep 9 19:04:33 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8A24Xja011815 for ; Thu, 9 Sep 2004 19:04:33 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8A27Zgv029250 for ; Thu, 9 Sep 2004 19:07:35 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8A27Ziw029248 for cs551@merlot.usc.edu; Thu, 9 Sep 2004 19:07:35 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8A27Zgv029245 for ; Thu, 9 Sep 2004 19:07:35 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8A27Zv3029241 for ; Thu, 9 Sep 2004 19:07:35 -0700 Message-Id: <200409100207.i8A27Zv3029241@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Server autoshutdown Date: Thu, 09 Sep 2004 19:07:35 -0700 From: william@bourbon.usc.edu Someone wrote: > Is this correct than, on the alarm() timeout when sigalarm is generated, > we close the server socket so no more connect requests are served. Also > all clients are anyways are working on different ports all generated on > the accept call so they will go ahead and shut down. This is my > assumption. You *may* use alarm() and you *may* close the server socket. As I've mentioned, there are many ways to do our projects. When the auto-shutdown timer goes off, you must inform the child server processes/threads to close their connections as soon as possible. Since we are sending one byte at a time, the child server processes/threads should not serve more than a few bytes after the auto-shutdown timer goes off. > Also I think the class should discuss a lot of this on the discussion > board but thanks for helping out. I've tried my best to encourage people to do so. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Sep 9 17:38:50 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8A0coja010056 for ; Thu, 9 Sep 2004 17:38:50 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8A0frgv014218 for ; Thu, 9 Sep 2004 17:41:53 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8A0fr6J014216 for cs551@merlot.usc.edu; Thu, 9 Sep 2004 17:41:53 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8A0frgv014207 for ; Thu, 9 Sep 2004 17:41:53 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8A0frwt014203 for ; Thu, 9 Sep 2004 17:41:53 -0700 Message-Id: <200409100041.i8A0frwt014203@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Server autoshutdown Date: Thu, 09 Sep 2004 17:41:53 -0700 From: william@bourbon.usc.edu Someone wrote: > Does this mean that the server is just a sixty second server? > So it does work but only for 60 seconds and then shutdowns? Exactly! (60 seconds is the default.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Sep 9 17:20:30 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8A0KUja009689 for ; Thu, 9 Sep 2004 17:20:30 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8A0NXgv030739 for ; Thu, 9 Sep 2004 17:23:33 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8A0NX8C030737 for cs551@merlot.usc.edu; Thu, 9 Sep 2004 17:23:33 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8A0NXgv030734 for ; Thu, 9 Sep 2004 17:23:33 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8A0NXxo030730 for ; Thu, 9 Sep 2004 17:23:33 -0700 Message-Id: <200409100023.i8A0NXxo030730@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Server autoshutdown Date: Thu, 09 Sep 2004 17:23:33 -0700 From: william@bourbon.usc.edu Someone wrote: > I am confused after reading all the messages related to > shutdown of server. These two wordings taken from the messages > sent are confusing me. > > 1. "As soon as you start the server process, you should start > a timer. When this timer expires, you should shutdown > the server. In this case, you should terminate any on-going > data transfers (don't wait for them to finish)." > > 2. "when the server times out, you should let the child processes > close their sockets and clean themselves up. After all the > child processes have terminated, your parent process can > terminate." Hmm... The above 2 statements seem consistent to me! The above means that when the auto-shutdown goes off, you should force all data transfers to top by somehow notifying the child processes/threads and let them close all connections. > please suggest me whether on timeout or cntrl-c,I should let > child finish their processing before shutdown of server or I > should inform the childeren to stop their processing and > close their socket at that time only and then shutdown the > server. I mean I should go for 1st case or 2nd case. c (or other kill signals) can be handled differently. The server can simply refuse to spawn new child processes/threads. When all child processes/threads finish there operations, the server can terminate. If the auto-shutdown times goes off while the server is in this state, it should force all data transfers to top by somehow notifying the child processes/threads and let them close all connections. So, the way auto-shutdown are handled has higher priority over the way kill signals are handled. If you want to make it more uniform, you can make handling of kill signals the same as auto-shutdown, i.e., force all data transfers to top by somehow notifying the child processes/threads and let them close all connections. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Monday, September 06, 2004 9:51 PM Subject: Re: Server autoshutdown > Someone wrote: > > > When you say: the server autoshutdown, is that the timeout value > > waiting for an incoming request, or does this only apply right > > after the server starts up? > > As soon as you start the server process, you should start > a timer. When this timer expires, you should shutdown > the server. In this case, you should terminate any on-going > data transfers (don't wait for them to finish). > > The code should probably be similar to the code that handls > c (i.e., set a global flag in the main thread). But > you should somehow tell the child process to close their > sockets (since they could be transfering a large file) and > terminates gracefully. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Sep 9 17:09:58 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8A09wja009416 for ; Thu, 9 Sep 2004 17:09:58 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8A0D1gv021489 for ; Thu, 9 Sep 2004 17:13:01 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8A0D1Q4021487 for cs551@merlot.usc.edu; Thu, 9 Sep 2004 17:13:01 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8A0D0gv021484 for ; Thu, 9 Sep 2004 17:13:00 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8A0D0im021474 for ; Thu, 9 Sep 2004 17:13:00 -0700 Message-Id: <200409100013.i8A0D0im021474@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Relative Path and Port Number Problems Date: Thu, 09 Sep 2004 17:13:00 -0700 From: william@bourbon.usc.edu Someone wrote: > I have a couple of doubts > > 1. I have coded all the Client Files in dirrectory called Client > and ||ry for Server now while testing from the client for the > relative path the server is only trying to find it from its cwd > something like ./Server and not ./Client, I then have to either > hard code the relative path for the server to search or expect > the relative path to be given as ../Client/*(whatsoever file). Relative path means relative from the directory where your server is running from. If I run your server and your client from different directories and do: ./client -f nunki.usc.edu client Since there is no "client" in your server directory, I should get the FSZ_FAIL message. If I do: ./client -f nunki.usc.edu server Since the file "server" must be in the directory where your server is running, it should return the file size of the server. Make sure your server does not change the current working directory because then you have to remember the working directory the server was at before it changed directory. By the way, according to spec, your server must be named "server" and not "Server". Similiarly, your client must be named "client" and not "Client". Please follow the spec. > 2. Secondly about the port for the client and the server to > connect apart from the default port, I observe sometimes when I > connect to some port say for eg 5000 and try connecting the > client both the server and client fail(binding problem), I am > pretty sure it may be because someone else may be trying to use > the same port now my problem is what if the grader tries to test > the program on some port which at the same time may be used by > someone else on nunki ? The grader will run netstat and see if someone else is using the port. You should too. Please see the spec. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Sep 9 17:02:08 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8A028ja009301 for ; Thu, 9 Sep 2004 17:02:08 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8A05Bgv014737 for ; Thu, 9 Sep 2004 17:05:11 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8A05BCh014735 for cs551@merlot.usc.edu; Thu, 9 Sep 2004 17:05:11 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8A05Agv014726 for ; Thu, 9 Sep 2004 17:05:10 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8A05A7X014722 for ; Thu, 9 Sep 2004 17:05:10 -0700 Message-Id: <200409100005.i8A05A7X014722@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Problem with pthread_create Date: Thu, 09 Sep 2004 17:05:10 -0700 From: william@bourbon.usc.edu Someone wrote: > I'm having a major problem with pthread_create. My client > connects to the server and then the server issues a > pthread_create to handle the reading from the socket. I've > implemented all the error handling for the function, but the > pthread_create() always fails with an "Unknown error". Is there > any way you can help me out with this? > > //prototype: int handleRequest(int sockfd); > //Thread creation code > t = (pthread_t*)malloc(sizeof(pthread_t)); > if ((t_rtn = pthread_create(t, NULL, (void *)handleRequest, &connfd)) != 0){ > fprintf(stderr, "Error: pthread_create, "); > if (t_rtn == EAGAIN) > fprintf(stderr, "Insufficient resources\n"); > else if (t_rtn == EINVAL) > fprintf(stderr, "Invalid arguments\n"); > else if (t_rtn == EPERM) > fprintf(stderr, "Invalid permissions\n"); > else > fprintf(stderr, "%s\n", strerror(t_rtn)); > exit(1); > } > //detach worker thread > pthread_detach(*t); > free(t); I'm not sure what the problem is, but here are a few things I could comment on: 1) The argument for handleRequest() should be (void*) and not int. 2) You should get into the habbit of initializing *all* variables, no matter what! Your variable t points to uninitialized memory! 3) Personally, I would not call pthread_detach(). I would use pthread_cancel() and pthread_join() to synchronize the termination of the child threads so I know exactly when things happen. This goes along with my philosophy of trying to know exactly what your program is doing. 4) If you are stuck, copy some working code from a book, make sure it works, then slowly transform that code your code and watch when it starts to fail. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Sep 8 23:33:50 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i896Xoja020164 for ; Wed, 8 Sep 2004 23:33:50 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i896atgv030261 for ; Wed, 8 Sep 2004 23:36:55 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i896at86030259 for cs551@merlot.usc.edu; Wed, 8 Sep 2004 23:36:55 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i896atgv030256 for ; Wed, 8 Sep 2004 23:36:55 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i896atNe030252 for ; Wed, 8 Sep 2004 23:36:55 -0700 Message-Id: <200409090636.i896atNe030252@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: MD5 problem for binary files Date: Wed, 08 Sep 2004 23:36:55 -0700 From: william@bourbon.usc.edu Someone wrote: > Adding to my previous question, I did read the message archive > http://merlot.usc.edu/cs551-s04/msgs/bill/46 There is no such message. > I assume that I may > be reading the file incorrectly, but how do I check it? Use GDB > and check the value? Tried that approach, but it shows garbage > value. I don't see how gdb can give you garbage! If you read 100 bytes from your input file into buf, which is declared as: char buf[100]; Then you do "print buf" in gdb (which means print in ASCII). What do you expect gdb to do? Well, it will treat the data in buf as if they were ASCII (and of course they were not). May be this is what you mean by garbage. What you should do is to do the following in gdb: print buf[0] print buf[1] print buf[2] ... print buf[99] But this prints the character values out in decimal and character format. If you run the hexdump program as suggested in the spec, it prints in hex. Now all you have to do is compare the hex value and the decimal value and see if they are the same. One thing you can do is do something like: print 0x65 in gdb. This will output 101 which is in decimal. Then you can compare. This sounds tedious! Another approach is to write debugging routines to print things out in hex. It is a common problem that people are not reading the input files correctly (especially with binary files). You must first convince yourself that you are reading the file data correctly. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Sep 8 23:22:47 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i896Mkja019954 for ; Wed, 8 Sep 2004 23:22:46 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i896Ppgv019735 for ; Wed, 8 Sep 2004 23:25:51 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i896PpAm019733 for cs551@merlot.usc.edu; Wed, 8 Sep 2004 23:25:51 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i896Ppgv019730 for ; Wed, 8 Sep 2004 23:25:51 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i896PpuF019720 for ; Wed, 8 Sep 2004 23:25:51 -0700 Message-Id: <200409090625.i896PpuF019720@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: MD5 problem for Binary files Date: Wed, 08 Sep 2004 23:25:51 -0700 From: william@bourbon.usc.edu Someone wrote: > I calculate MD5 from my C program and it gives correct value for > 'txt' files. ie. values from my C program and the program @ > nunki: md5 give the same value. > However, the same does not work correctly for binary files (I am > reading the file in binary mode). > >From nunki.usc.edu: > bash-2.05b$ md5 client.o > MD5 (client.o) = 2c99f1186afc57702bbfb37106c2db56 > >From my program: > MD5 Sum is: 3e5731b31bd579ac2369ccaaf5120694 > > For debugging purpose, I did a fwrite and the file size of > original file @ server and the transferred file @ client is the > same. Any pointers? I would write a small program to compute the MD5 checksum of a binary file such as your client.o and make sure that it produce the same value as "md5 client.o". If this works, then you are doing something wrong with your client/server. If this doesn't work, you are not calling the MD5 functions correctly. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Sep 8 14:40:35 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i88LeYja009493 for ; Wed, 8 Sep 2004 14:40:35 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i88Lhegv026863 for ; Wed, 8 Sep 2004 14:43:40 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i88Lhexq026861 for cs551@merlot.usc.edu; Wed, 8 Sep 2004 14:43:40 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i88Lhegv026858 for ; Wed, 8 Sep 2004 14:43:40 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i88Lhe1d026854 for ; Wed, 8 Sep 2004 14:43:40 -0700 Message-Id: <200409082143.i88Lhe1d026854@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: MD5 hash display bit operations Date: Wed, 08 Sep 2004 14:43:40 -0700 From: william@bourbon.usc.edu Hi, I'm just forwarding a message from a student. This will be the *last* such e-mail I will forward. I strongly encourage students to help each other with sharing information like this. But please use the Forum in DEN for this class to do stuff like this. Thanks and keep up the good work! -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Wed, 08 Sep 2004 01:13:24 -0700 To: william@bourbon.usc.edu Subject: MD5 hash display bit operations I am not sure if it is OK to share this, but I thought the other folks in th e class might find it useful if they haven't figured it out already. For the MD5 you need to do bitwise operations. The following were useful for me: bitwise and: & right shift : argument >> n or effectively divide by 2 to the n left shift : argument << n which multiplies by 2 to the n The only interesting thing is when I was doing the and I had to and with the hex value and not the individual bits. i.e. 0xF instead of 1111. Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Sep 8 14:36:15 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i88LaFja009383 for ; Wed, 8 Sep 2004 14:36:15 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i88LdLgv025217 for ; Wed, 8 Sep 2004 14:39:21 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i88LdLZq025215 for cs551@merlot.usc.edu; Wed, 8 Sep 2004 14:39:21 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i88LdKgv025212 for ; Wed, 8 Sep 2004 14:39:21 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i88LdKGB025208 for ; Wed, 8 Sep 2004 14:39:20 -0700 Message-Id: <200409082139.i88LdKGB025208@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: SERVER single or multithreaded?? Date: Wed, 08 Sep 2004 14:39:20 -0700 From: william@bourbon.usc.edu Hi, I'm just forwarding an e-mail message from a student. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Wed, 08 Sep 2004 10:26:14 +0530 To: william@bourbon.usc.edu Subject: Re: SERVER single or multithreaded?? Prof., With reference to the above email: I will suggest the student to go and read Beej's n/w (http://www.ecst.csuchico.edu/~beej/guide/net/html/clientserver.html ). Multithreaded using fork() is explained, it also talks about handling SIGNAL calls and cleaning up of processes. :) ----- Original Message ----- From: To: Sent: Wednesday, September 08, 2004 8:12 AM Subject: Re: SERVER single or multithreaded?? > Someone wrote: > > > My server program does handle one request at a time as it is in the > > book stevens, is it required to make it handling multi requests at a time? > > Yes! > > > In multi requests case only,I'' be having parent or child > > threads(processes) and will need to take care of child exit before parent > > does . Please suggest, whether single threaded server is fine or i should go > > for multi threaded(process) server. > > In the Miscellaneous section of the spec, it says: > > You are encouraged to use threads for this project. > Althought there is no penalty for using fork(). > > Please read the *whole* project spec. There are other > useful hints. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Sep 8 14:34:35 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i88LYZja009336 for ; Wed, 8 Sep 2004 14:34:35 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i88Lbfgv024579 for ; Wed, 8 Sep 2004 14:37:41 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i88LbeZS024571 for cs551@merlot.usc.edu; Wed, 8 Sep 2004 14:37:40 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i88Lbegv024568 for ; Wed, 8 Sep 2004 14:37:40 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i88Lbegv024564 for ; Wed, 8 Sep 2004 14:37:40 -0700 Message-Id: <200409082137.i88Lbegv024564@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: breaking server in case of malicious client Date: Wed, 08 Sep 2004 14:37:40 -0700 From: william@bourbon.usc.edu Someone wrote: > The last requirement about breaking the server "about 1 billion > length of bytes in ".. there can be multiple ways to break the > server .. e.g. 1) length is incorrect 2) client is so slow that > he send 1 byte in one minute 3) there is a newline character or > null in the string having data 4) client stop sending bytes in > between ... etc. etc... > it is tough to complete this much work in such a short time > (although 3 weeks). 3 weeks is a very long time for this project. You are encouraged to start working hard on this since day one and not to fall behind! > if you don't know exactly whether something > is really required and to what level it is required. I think we > must focus on the networking part not on the OS programming part. I guess we just have different opinions on this. I consider these networking issues. To me, writing a *robust* server is important for this class. If you disagree, then there is probably nothing I can say to convince you. I can tell you that some students ended up getting good jobs offers because they have worked hard on these projects and understood the issues (so I was told). > Please suggest what is exactly required to be covered in case of > malicious client? I'm sorry that I will not let you know exactly what we will be testing (same goes for midterm and final exams). This is an *assignment* after all. You are suppose to figure out what is important to take care of for a robust server and a robust client. (I don't know if this is your first graduate level course or not, but you should start getting use to this!) If you really think hard about this, you will realize that there is not infinite number of things that can go wrong! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Sep 8 14:18:03 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i88LI3ja008954 for ; Wed, 8 Sep 2004 14:18:03 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i88LL9gv018552 for ; Wed, 8 Sep 2004 14:21:09 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i88LL9Y3018550 for cs551@merlot.usc.edu; Wed, 8 Sep 2004 14:21:09 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i88LL8gv018547 for ; Wed, 8 Sep 2004 14:21:09 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i88LL8oO018543 for ; Wed, 8 Sep 2004 14:21:08 -0700 Message-Id: <200409082121.i88LL8oO018543@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: SERVER single or multithreaded?? Date: Wed, 08 Sep 2004 14:21:08 -0700 From: william@bourbon.usc.edu Someone wrote: > It is *not* written in specification that server has to be multithreaded or > multiple requests must be processed at a time. It should go without saying it explicitly! If you are implementing a *server* like the one in the spec, it *should* serve things in parallel. (The spec also does not say that you must indent your source code but that's understood also.) I've also made a general statements that "if another studnet's code works better than yours, he/she may get more points". -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Tuesday, September 07, 2004 7:42 PM Subject: Re: SERVER single or multithreaded?? > Someone wrote: > > > My server program does handle one request at a time as it is in the > > book stevens, is it required to make it handling multi requests at a time? > > Yes! > > > In multi requests case only,I'' be having parent or child > > threads(processes) and will need to take care of child exit before parent > > does . Please suggest, whether single threaded server is fine or i should go > > for multi threaded(process) server. > > In the Miscellaneous section of the spec, it says: > > You are encouraged to use threads for this project. > Althought there is no penalty for using fork(). > > Please read the *whole* project spec. There are other > useful hints. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Sep 7 19:39:35 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i882dZja018645 for ; Tue, 7 Sep 2004 19:39:35 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i882gggv014924 for ; Tue, 7 Sep 2004 19:42:42 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i882gg6x014922 for cs551@merlot.usc.edu; Tue, 7 Sep 2004 19:42:42 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i882gggv014919 for ; Tue, 7 Sep 2004 19:42:42 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i882ggj0014915 for ; Tue, 7 Sep 2004 19:42:42 -0700 Message-Id: <200409080242.i882ggj0014915@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: SERVER single or multithreaded?? Date: Tue, 07 Sep 2004 19:42:42 -0700 From: william@bourbon.usc.edu Someone wrote: > My server program does handle one request at a time as it is in the > book stevens, is it required to make it handling multi requests at a time? Yes! > In multi requests case only,I'' be having parent or child > threads(processes) and will need to take care of child exit before parent > does . Please suggest, whether single threaded server is fine or i should go > for multi threaded(process) server. In the Miscellaneous section of the spec, it says: You are encouraged to use threads for this project. Althought there is no penalty for using fork(). Please read the *whole* project spec. There are other useful hints. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Sep 7 14:07:05 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i87L75ja012041 for ; Tue, 7 Sep 2004 14:07:05 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i87LADgv017524 for ; Tue, 7 Sep 2004 14:10:13 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i87LADWl017522 for cs551@merlot.usc.edu; Tue, 7 Sep 2004 14:10:13 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i87LADgv017515 for ; Tue, 7 Sep 2004 14:10:13 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i87LADTM017509 for ; Tue, 7 Sep 2004 14:10:13 -0700 Message-Id: <200409072110.i87LADTM017509@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS551: process blocked on read call Date: Tue, 07 Sep 2004 14:10:13 -0700 From: william@bourbon.usc.edu I'm just forwarding a message from a student. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Tue, 07 Sep 2004 13:57:45 -0700 To: william@bourbon.usc.edu Subject: Re: CS551: process blocked on read call Sir, I too had a similar problem but I got around it, I think one way to test is p ut a send/recv pair at client and recv/send at server and test for the socket.o nce made sure the connection is working fine for full duplex.I think it would b e better to send in like 2 bytes (eg like in a for loop sending 1 byte at a tim e)for Message header and receive 2 bytes(sprinkle some sort of printf or gdb to test)and then 4 bytes for data length and then receive the Data, this might he lp in atleast pin pointing to problem area. ----- Original Message ----- From: william@bourbon.usc.edu Date: Tuesday, September 7, 2004 11:15 am Subject: Re: CS551: process blocked on read call > Someone wrote: > > > My client can write to the socket and my server can read from the socket > > to get the data. When my server writes back to socket, the client just > > blocks on the read() call. I don't understand why client is blocked on > > read even though my server has written data to the network. Do you have > > any suggestion? > > I would not know exactly what's causing this. If there were > a point where the code was working before, you can do binary > search by reverting half the code to the old state and do > this recursively until you find the bug. > > > Or should I use select call? > > I think select() is a very useful function, especially when > things get messy. So, I would strongly recommand it. Also, > you need a timeout mechanism in case the server or the client > is malicious. Select() has a timeout built in, so you > don't have to use a separate timer. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Sep 7 11:46:27 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i87IkRja009244 for ; Tue, 7 Sep 2004 11:46:27 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i87InZgv024736 for ; Tue, 7 Sep 2004 11:49:35 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i87InZro024734 for cs551@merlot.usc.edu; Tue, 7 Sep 2004 11:49:35 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i87InZgv024731 for ; Tue, 7 Sep 2004 11:49:35 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i87InZO6024727 for ; Tue, 7 Sep 2004 11:49:35 -0700 Message-Id: <200409071849.i87InZO6024727@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Display MD5 Hash Date: Tue, 07 Sep 2004 11:49:35 -0700 From: william@bourbon.usc.edu Someone wrote: > I have gotten to the point of calculating the MD5 hash on the fly > after the file download, but I have yet to figure out how to > display at as the spec says. > > There isn't much information on the site given on the spec sheet > about displaying the MD5 hash. It looks as though it's a 16 byte > string of unsigned char. Yes. MD5_DIGEST_LENGTH is defined as 16 in /usr/usc/openssl/default/include/openssl/md5.h > Are we supposed to split it up into 4 int and display in hex ? No. > or is there some other trick in terms of > displaying that 32 char string on the site. I would write a general purpose function to print any number of bytes from a memory location: void PrintBufInHexString(FILE *fp, unsigned char *buf, int number_of_bytes) { for (int i=0; i < number_of_bytes; i++) { PrintUnsignedCharInHexString(fp, buf[i]); } } where PrintUnsignedCharInHexString() will print a hex digit ('0'-'9' or 'a'-'f') for the upper 4 bits first and then print a hex digit for the lower 4 bits into fp. You can even use this when you debug. Of course you should replace FILE* with whatever I/O stream you are using. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Sep 7 11:30:57 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i87IUvja008930 for ; Tue, 7 Sep 2004 11:30:57 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i87IY5gv011007 for ; Tue, 7 Sep 2004 11:34:05 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i87IY5ec011005 for cs551@merlot.usc.edu; Tue, 7 Sep 2004 11:34:05 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i87IY5gv011002 for ; Tue, 7 Sep 2004 11:34:05 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i87IY5cv010995 for ; Tue, 7 Sep 2004 11:34:05 -0700 Message-Id: <200409071834.i87IY5cv010995@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Receiving Problem Date: Tue, 07 Sep 2004 11:34:05 -0700 From: william@bourbon.usc.edu Someone wrote: > as per the specification which says the data length should be an > integer (ie 4 bytes here), I am sending the entire message as a > string (using sprintf) including the type, length etc.so for eg > if the request is for address of www.ibm.com > the string looks like this "--11www.ibm.com"(the first 2 bytes > for the message header)followed by data length , the message now > at the receiving side I am facing a problem since size of int is > 4 bytes I am looping through four times thereby getting 11ww > instead of just 11 in this case. > > What should I do? Your server suppose to interoperate with clients implemented by other students and your client suppose to interoperate with servers implemented by other students. Therefore, you *must* follow the spec. Otherwise, how can you "communicate"? (It would be like speaking in Greek while everybody else is speaking in English.) So, please follow the spec. The first 2 bytes must be a 2-byte number in the network-byte-order format. The next 4 bytes must be a 4-byte number in the network-byte-order format. The rest depends on the content of the first 6 bytes. Do *not* use sprintf() unless you know *exactly* what you are doing. Can you output a numeric value (such as a 2-byte integer) using sprintf()? I think all it can to is to output strings. So, how can one put 0x1234 into a buffer (char *buf)? Well, how about: buf[0]=0x12; buf[1]=0x34; If you use sprintf() and do something like: int v=0x1234; sprintf(buf, "%d", v); buf will contain "4660" when you are done (here I use double-quotes because that's the C/C++ notation for *strings*). If you examine the memory of buf, you will see that buf[0]=52 (or 0x34), buf[1]=buf[2]=54 (or 0x36), buf[3]=48 (or 0x30), and buf[4]=0. Clearly, this is very different from simple assignments. So, don't use sprintf() for the first 6 bytes. Use it for the other parts. For example, it's perfectly okay to do: sprintf(&buf[6], "%s", "www.cnn.com"); but you have to remember to allocate an extra byte for buf since there is an implied '\0' when you use sprintf(). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Sep 7 11:12:31 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i87ICVja008553 for ; Tue, 7 Sep 2004 11:12:31 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i87IFdgv027078 for ; Tue, 7 Sep 2004 11:15:39 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i87IFdgA027076 for cs551@merlot.usc.edu; Tue, 7 Sep 2004 11:15:39 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i87IFdgv027070 for ; Tue, 7 Sep 2004 11:15:39 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i87IFdHf027061 for ; Tue, 7 Sep 2004 11:15:39 -0700 Message-Id: <200409071815.i87IFdHf027061@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS551: process blocked on read call Date: Tue, 07 Sep 2004 11:15:39 -0700 From: william@bourbon.usc.edu Someone wrote: > My client can write to the socket and my server can read from the socket > to get the data. When my server writes back to socket, the client just > blocks on the read() call. I don't understand why client is blocked on > read even though my server has written data to the network. Do you have > any suggestion? I would not know exactly what's causing this. If there were a point where the code was working before, you can do binary search by reverting half the code to the old state and do this recursively until you find the bug. > Or should I use select call? I think select() is a very useful function, especially when things get messy. So, I would strongly recommand it. Also, you need a timeout mechanism in case the server or the client is malicious. Select() has a timeout built in, so you don't have to use a separate timer. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Sep 6 21:55:54 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i874tsja024429 for ; Mon, 6 Sep 2004 21:55:54 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i874x4gv028240 for ; Mon, 6 Sep 2004 21:59:04 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i874x4gI028238 for cs551@merlot.usc.edu; Mon, 6 Sep 2004 21:59:04 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i874x4gv028231 for ; Mon, 6 Sep 2004 21:59:04 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i874x4kf028225 for ; Mon, 6 Sep 2004 21:59:04 -0700 Message-Id: <200409070459.i874x4kf028225@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Compiler object problem Date: Mon, 06 Sep 2004 21:59:04 -0700 From: william@bourbon.usc.edu Someone wrote: > I get the following error messages when I try to compile, and > I cannot seem to figure out how to fix this. I appologize > for asking a stupid question. > > nunki.usc.edu(3): gcc -oserver server.c > Undefined first referenced > symbol in file > bind /var/tmp/ccJNsmBF.o > accept /var/tmp/ccJNsmBF.o > listen /var/tmp/ccJNsmBF.o > gethostbyname /var/tmp/ccJNsmBF.o > socket /var/tmp/ccJNsmBF.o > ld: fatal: Symbol referencing errors. No output written to server > collect2: ld returned 1 exit status > nunki.usc.edu(4): > > note: "gcc -o server server.c" gives the same results. > > for bind, accept, listen, socket, I have "#include " > for gethostbyname, i have "#include " > etc.. > > I am stuck. Am I using the wrong gcc arguments? Sorry to have to ask. Please see my message with timestamp "Tue 31 Aug 07:50". -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Sep 6 21:52:41 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i874qfja024382 for ; Mon, 6 Sep 2004 21:52:41 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i874tpgv025189 for ; Mon, 6 Sep 2004 21:55:51 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i874tpoq025181 for cs551@merlot.usc.edu; Mon, 6 Sep 2004 21:55:51 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i874togv025178 for ; Mon, 6 Sep 2004 21:55:50 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i874tous025174 for ; Mon, 6 Sep 2004 21:55:50 -0700 Message-Id: <200409070455.i874tous025174@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: graceful shutdown Date: Mon, 06 Sep 2004 21:55:50 -0700 From: william@bourbon.usc.edu Someone wrote: > My question is if we do close the server socket and exit that > process the other processes will shut down eventually so all > I would need to do is disallow new connection after a SIGINT. > > Although on SIGALARM I just close the open socket, child(forked > process doing send/rcv on port setup in Accept()) or parent > (parent process with port setup by bind..). When the server times out, you should let the child processes close their sockets and clean themselves up. After all the child processes have terminated, your parent process can terminate. -- Bill Cheng // bill.cheng@usc.edu   >>-----Original Message----- >>From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] >>Sent: Monday, September 06, 2004 5:41 PM >>To: cs551@bourbon.usc.edu >>Subject: Re: graceful shutdown >> >>Someone wrote: >> >> > Specs mention that the server should shutdown gracefully. >> > If I do a ps -gx and kill the PID of my "parent server", the >> > forked process continue their execution and shut-down gracefully. >> >>If you do "man -s 1 kill" on nunki, you can see that SIGTERM >>is delivered by default. No process can catch SIGTERM. >> >> > However, if I do a Ctrl-C from the window where my server is >> > running, the client/s window gives a message "Broken Pipe" >> >>c is SIGINT and you can write code to catch this. >>So, do that and make sure your server do not die until >>all child processes have exited. >> >> > By "graceful shutdown" do you intend us to take care of Ctrl-C, >> > that is: Ctrl-C only kills the parent and "not parent and child". >> >>It should *not* kill the parent. SIGINT is delievered to the >>parent and your code should catch it and set a global flag. >>If this global flag is set, it should refuse to accept any >>new connection requests. At this point, the parent can either >>kill the child processes gracefully or wait until all child >>process to finish (and probably print some good status messages >>telling the user what it's doing). >>-- >>Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Sep 6 21:48:49 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i874mnja024274 for ; Mon, 6 Sep 2004 21:48:49 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i874pxgv021472 for ; Mon, 6 Sep 2004 21:51:59 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i874pxU8021467 for cs551@merlot.usc.edu; Mon, 6 Sep 2004 21:51:59 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i874pwgv021462 for ; Mon, 6 Sep 2004 21:51:58 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i874pwXK021457 for ; Mon, 6 Sep 2004 21:51:58 -0700 Message-Id: <200409070451.i874pwXK021457@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Server autoshutdown Date: Mon, 06 Sep 2004 21:51:58 -0700 From: william@bourbon.usc.edu Someone wrote: > When you say: the server autoshutdown, is that the timeout value > waiting for an incoming request, or does this only apply right > after the server starts up? As soon as you start the server process, you should start a timer. When this timer expires, you should shutdown the server. In this case, you should terminate any on-going data transfers (don't wait for them to finish). The code should probably be similar to the code that handls c (i.e., set a global flag in the main thread). But you should somehow tell the child process to close their sockets (since they could be transfering a large file) and terminates gracefully. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Sep 6 21:43:54 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i874hsja024155 for ; Mon, 6 Sep 2004 21:43:54 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i874l3gv016796 for ; Mon, 6 Sep 2004 21:47:03 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i874l3qf016794 for cs551@merlot.usc.edu; Mon, 6 Sep 2004 21:47:03 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i874l3gv016791 for ; Mon, 6 Sep 2004 21:47:03 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i874l3ON016787 for ; Mon, 6 Sep 2004 21:47:03 -0700 Message-Id: <200409070447.i874l3ON016787@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: graceful shutdown Date: Mon, 06 Sep 2004 21:47:03 -0700 From: william@bourbon.usc.edu Someone wrote: > Thanks for your reply. > The solution I am desiging is : > When is pressed, the parent server (the process > accepting connections) should not accept any new connections. Any > old transfers should continue uninterrupted and proceed to finish > and then the respective processes exit the system. This is one of the general approach I've mentioned in class. > The way I am currently achieving this is: > I use setsid() in the forked process to detach the parent and the > child processes. When parent receives a signal, it > leaves the system (subsequently not accepting any new > connections). The forked processes (which were detached) finish > their job and leave the system (ensuring no zombies). Is this an > acceptable implementation? As I have mentioned in class, anything is "acceptable". Will it get you perfect score? It depends on whether you've done a good job. > Please comment on my design and it's implementation In general, I will not comment on a design over e-mail. If everyone sends me his/her design and asks me to comment on it, there is not enough time to comment to all. You are welcome to come to one of my office hours and ask questions like this. But, keep in mind that there are many many ways to do the projects. Almost any *reasonable* design will probably work. (I've suggested that you started with some code you find in books and I think that's a good way to start.) It's up to you to test it thoroughly and make sure that it works well and works according to spec. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Monday, September 6, 2004 5:41 pm Subject: Re: graceful shutdown > Someone wrote: > > > Specs mention that the server should shutdown gracefully. > > If I do a ps -gx and kill the PID of my "parent server", the > > forked process continue their execution and shut-down gracefully. > > If you do "man -s 1 kill" on nunki, you can see that SIGTERM > is delivered by default. No process can catch SIGTERM. > > > However, if I do a Ctrl-C from the window where my server is > > running, the client/s window gives a message "Broken Pipe" > > c is SIGINT and you can write code to catch this. > So, do that and make sure your server do not die until > all child processes have exited. > > > By "graceful shutdown" do you intend us to take care of Ctrl-C, > > that is: Ctrl-C only kills the parent and "not parent and child". > > It should *not* kill the parent. SIGINT is delievered to the > parent and your code should catch it and set a global flag. > If this global flag is set, it should refuse to accept any > new connection requests. At this point, the parent can either > kill the child processes gracefully or wait until all child > process to finish (and probably print some good status messages > telling the user what it's doing). > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Sep 6 17:40:10 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i870e9ja019348 for ; Mon, 6 Sep 2004 17:40:09 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i870hKgv014479 for ; Mon, 6 Sep 2004 17:43:20 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i870hK58014477 for cs551@merlot.usc.edu; Mon, 6 Sep 2004 17:43:20 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i870hKgv014474 for ; Mon, 6 Sep 2004 17:43:20 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i870hJ8h014470 for ; Mon, 6 Sep 2004 17:43:19 -0700 Message-Id: <200409070043.i870hJ8h014470@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: GET directory unclear Date: Mon, 06 Sep 2004 17:43:19 -0700 From: william@bourbon.usc.edu Someone wrote: > I saw in your message regarding a GET_REQ for a directory you > said "so be it". What does that mean. Will the system just send > the binary contents of the directory inode, Yes. > or do we actually > need to traverse the directory and stream the contents? No. > Please elaborate. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Sep 6 17:38:16 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i870cGja019274 for ; Mon, 6 Sep 2004 17:38:16 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i870fQgv012868 for ; Mon, 6 Sep 2004 17:41:26 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i870fQn7012860 for cs551@merlot.usc.edu; Mon, 6 Sep 2004 17:41:26 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i870fQgv012857 for ; Mon, 6 Sep 2004 17:41:26 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i870fQqW012853 for ; Mon, 6 Sep 2004 17:41:26 -0700 Message-Id: <200409070041.i870fQqW012853@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: graceful shutdown Date: Mon, 06 Sep 2004 17:41:26 -0700 From: william@bourbon.usc.edu Someone wrote: > Specs mention that the server should shutdown gracefully. > If I do a ps -gx and kill the PID of my "parent server", the > forked process continue their execution and shut-down gracefully. If you do "man -s 1 kill" on nunki, you can see that SIGTERM is delivered by default. No process can catch SIGTERM. > However, if I do a Ctrl-C from the window where my server is > running, the client/s window gives a message "Broken Pipe" c is SIGINT and you can write code to catch this. So, do that and make sure your server do not die until all child processes have exited. > By "graceful shutdown" do you intend us to take care of Ctrl-C, > that is: Ctrl-C only kills the parent and "not parent and child". It should *not* kill the parent. SIGINT is delievered to the parent and your code should catch it and set a global flag. If this global flag is set, it should refuse to accept any new connection requests. At this point, the parent can either kill the child processes gracefully or wait until all child process to finish (and probably print some good status messages telling the user what it's doing). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Sep 6 15:41:10 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i86MfAja016759 for ; Mon, 6 Sep 2004 15:41:10 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i86MiLgv011083 for ; Mon, 6 Sep 2004 15:44:21 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i86MiLeE011081 for cs551@merlot.usc.edu; Mon, 6 Sep 2004 15:44:21 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i86MiLgv011078 for ; Mon, 6 Sep 2004 15:44:21 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i86MiK5X011074 for ; Mon, 6 Sep 2004 15:44:21 -0700 Message-Id: <200409062244.i86MiK5X011074@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Directory file size Date: Mon, 06 Sep 2004 15:44:20 -0700 From: william@bourbon.usc.edu Someone wrote: > When we send a -f or a -g request to the server, should the > server return the file size as 512 (as given by ls -al) or should > it return the sum of size of all files in that directory.? Please see my message with timestamp "Wed 25 Aug 08:46". > Can md5 be run on an directory ? The same rules above can apply. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Sep 5 21:53:19 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i864rJja027159 for ; Sun, 5 Sep 2004 21:53:19 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i864uVgv005093 for ; Sun, 5 Sep 2004 21:56:31 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i864uVZj005091 for cs551@merlot.usc.edu; Sun, 5 Sep 2004 21:56:31 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i864uVgv005088 for ; Sun, 5 Sep 2004 21:56:31 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i864uV5S005084 for ; Sun, 5 Sep 2004 21:56:31 -0700 Message-Id: <200409060456.i864uV5S005084@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Reaping Dead Child Process Date: Sun, 05 Sep 2004 21:56:31 -0700 From: william@bourbon.usc.edu Someone wrote: > This might be a question already asked but in Beej's guide the > code for killing dead processes exists already. Is reusing that code, or > a variation of that code, after acknowledging it as a reference, > allowed? The code in question is on page 24 of the guide on the website. Yes. It is allowed as long as you acknowledge it. But you must acknowledge it in the right way. You should say that the code from A to B is from page 24 of ... Don't just say it in the README file that you have used some code from page 24 of ... -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Sep 5 21:45:20 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i864jKja026983 for ; Sun, 5 Sep 2004 21:45:20 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i864mWgv029883 for ; Sun, 5 Sep 2004 21:48:32 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i864mWqc029879 for cs551@merlot.usc.edu; Sun, 5 Sep 2004 21:48:32 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i864mWgv029875 for ; Sun, 5 Sep 2004 21:48:32 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i864mW40029871 for ; Sun, 5 Sep 2004 21:48:32 -0700 Message-Id: <200409060448.i864mW40029871@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Using threads with reentrant functions Date: Sun, 05 Sep 2004 21:48:32 -0700 From: william@bourbon.usc.edu Someone wrote: > I'm using pthreads for the warmup1 assignment. I realized that > for the ADDR_REQ we need to call gethostbyaddr to resolve the IP > address of the hostname. However, gethostbyaddr is a > non-reentrant function, so I cannot use it with threads. There > is a reentrant version gethostbyaddr_r but this requires the > allocation of a buffer of at least 8192 bytes, as indicated by > the UNIX Network Programming text. Hmm... sizeof(struct hostent) is 20 on nunki. I don't know what is at least 8192 bytes! > I want to make sure this is > okay, or do you have another suggestion on how to approach this > problem. I assume it is not acceptible to just call the > non-reentrant version from the thread. > > Your thoughts? You can use a mutex to assure that only one thread is calling gethostbyname() at a time. > Also, the assignment spec suggests in parenthesis to use > gethostbyname(), inet_addr(), and inet_ntoa() for the ADDR_REQ. > I believe this is incorrect, because you need to get the IP > address from the domain name (gethostbyaddr()) or just check > inet_addr != INADDR_NONE to see if the request data was a valid > IP address. That is all. If I am correct in this assumption, > please let me know. Hmm... I'm pretty sure gethostbyname() works. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Sep 5 21:16:05 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i864G5ja026413 for ; Sun, 5 Sep 2004 21:16:05 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i864JIgv001940 for ; Sun, 5 Sep 2004 21:19:18 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i864JI4n001938 for cs551@merlot.usc.edu; Sun, 5 Sep 2004 21:19:18 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i864JHgv001929 for ; Sun, 5 Sep 2004 21:19:17 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i864JH41001925 for ; Sun, 5 Sep 2004 21:19:17 -0700 Message-Id: <200409060419.i864JH41001925@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: ADDR request for www.usc.edu Date: Sun, 05 Sep 2004 21:19:17 -0700 From: william@bourbon.usc.edu Please do *not* send e-mail to cs551@bourbon.usc.edu. Please do *not* send me e-mail twice. Thanks! -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Sun, 05 Sep 2004 16:27:07 -0700 To: william@bourbon.usc.edu, cs551@bourbon.usc.edu, chengw@usc.edu Subject: ADDR request for www.usc.edu gethosname("www.yahoo.com") returns 66.94.230.51 which is fine. but if I do gethostname(www.usc.edu) or gethostname("nunki") it returns me 128.125.2531 Is this 128.125.2531 valid IP address ?? Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Sep 5 21:15:01 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i864F1ja026366 for ; Sun, 5 Sep 2004 21:15:01 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i864IDgv000899 for ; Sun, 5 Sep 2004 21:18:13 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i864IDkH000891 for cs551@merlot.usc.edu; Sun, 5 Sep 2004 21:18:13 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i864IDgv000888 for ; Sun, 5 Sep 2004 21:18:13 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i864IDGG000884 for ; Sun, 5 Sep 2004 21:18:13 -0700 Message-Id: <200409060418.i864IDGG000884@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: ADDR request for www.usc.edu Date: Sun, 05 Sep 2004 21:18:13 -0700 From: william@bourbon.usc.edu Someone wrote: > gethosname("www.yahoo.com") returns 66.94.230.51 which is fine. > but if I do gethostname(www.usc.edu) or gethostname("nunki") it > returns me 128.125.2531 > > Is this 128.125.2531 valid IP address ?? Depends on how you look at it. If you look at 2531 as 2531=9*256+227, then 128.125.2531 can be thought of as 128.125.9.227. By the way, did you read the man page for gethostname()? It doesn't seem to be the right function to call. You should read man pages in detail for functions you are not familiar with. Same function may also work differently on different platforms. You should probably call gethostbyname() as suggested in the spec. Make sure you read the man pages first! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Sep 5 21:06:39 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8646dja026189 for ; Sun, 5 Sep 2004 21:06:39 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8649pgv025308 for ; Sun, 5 Sep 2004 21:09:51 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8649pMG025306 for cs551@merlot.usc.edu; Sun, 5 Sep 2004 21:09:51 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8649pgv025300 for ; Sun, 5 Sep 2004 21:09:51 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8649pur025293 for ; Sun, 5 Sep 2004 21:09:51 -0700 Message-Id: <200409060409.i8649pur025293@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: submission of project 1 Date: Sun, 05 Sep 2004 21:09:51 -0700 From: william@bourbon.usc.edu Someone wrote: > I was trying to submit my files and for the command > ~csci551/bin/bsubmit config -set email=...@usc.edu ( that's by email > address) ... it is giving the following error.. > > /home/scf-22/csci551/bin/bsubmit: permission denied. It's "~csci551b" (with a 'b' at the end) and not "~csci551". -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Sep 4 22:01:15 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8551Fja020187 for ; Sat, 4 Sep 2004 22:01:15 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8554Ugv014726 for ; Sat, 4 Sep 2004 22:04:30 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8554Uxv014724 for cs551@merlot.usc.edu; Sat, 4 Sep 2004 22:04:30 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8554Ugv014721 for ; Sat, 4 Sep 2004 22:04:30 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8554Upr014717 for ; Sat, 4 Sep 2004 22:04:30 -0700 Message-Id: <200409050504.i8554Upr014717@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Assumptions about packet dataLength Date: Sat, 04 Sep 2004 22:04:30 -0700 From: william@bourbon.usc.edu Someone wrote: > For CS551 warmup1, is it safe to assume that for all requests > (ADDR, FILESIZE, GET) that the dataLength will be less than the > max buffer size of 512 bytes? I think it's fine to assume that for requests. > I'd like to assume this is true so > that I may call gethostbyname() and fopen() on the contents of > the buffer. I realize we cannot assume this for GET replies, but > I should be able to assume it for ADDR and FILESIZE replies. Sounds reasonable. Just make sure that if there is too much data in a request message, you respond properly. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Sep 4 21:57:23 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i854vNja020075 for ; Sat, 4 Sep 2004 21:57:23 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8550bgv011023 for ; Sat, 4 Sep 2004 22:00:37 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8550b7v011021 for cs551@merlot.usc.edu; Sat, 4 Sep 2004 22:00:37 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8550bgv011012 for ; Sat, 4 Sep 2004 22:00:37 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8550bEt011008 for ; Sat, 4 Sep 2004 22:00:37 -0700 Message-Id: <200409050500.i8550bEt011008@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Fragmentation of message Date: Sat, 04 Sep 2004 22:00:37 -0700 From: william@bourbon.usc.edu Someone wrote: > The project in the first paragraph has the following requirement > : "You must not fragment the response message into packets or > multiple messages. It should be sent in one message. " > > else where in the project the following requirement is given : > "To appreciate the stream abstraction of TCP, when you write to a > socket, you are required to write only one byte at a time. This > means that if you call send() or write() with the first argument > being a socket descriptor, the 3rd argument must be 1. Similarly, > when you read from a socket, you are required to read only one > byte at a time. This means that if you call () or read() with > the first argument being a socket descriptor, the 3rd argument > must be 1. " > > If we only send or receive 1 Byte at a time , isn't it same as > fragmenting the message? No! > The above 2 statements appear to be contradictory. This is the whole point of slide 7 of lecture 2. When you think about TCP, you should not think about packets. It's just a stream of bytes. For example, if you call send() with a single byte of data, 0x12; then you call send() again with another byte of data, 0x34; then you call send() again with another byte of data, 0x56; the receiver does not get 3 messages. The receiver gets one message that's 3 bytes long. If the receiver calls recv() and just read 1 byte of data, it will get 0x12 the first time. The next time the receive calls recv() to read 1 byte of data, it will get 0x34. If it calls recv() one more time to read 1 byte of data, it will get 0x56. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Sep 4 21:50:30 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i854oUja019959 for ; Sat, 4 Sep 2004 21:50:30 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i854rigv004453 for ; Sat, 4 Sep 2004 21:53:44 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i854ricj004451 for cs551@merlot.usc.edu; Sat, 4 Sep 2004 21:53:44 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i854rigv004445 for ; Sat, 4 Sep 2004 21:53:44 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i854rihw004438 for ; Sat, 4 Sep 2004 21:53:44 -0700 Message-Id: <200409050453.i854rihw004438@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: C++ STL and template Date: Sat, 04 Sep 2004 21:53:44 -0700 From: william@bourbon.usc.edu Someone wrote: > I just have a few questions about project 1. In my code, I will > be heavily using C++ STL stuff like vector and map containers to > store stuff and templatized class and functions, just wondering > if this is allowed. If the grader can compile it on nunki, then it's allowed. In general, you can use anything already installed in the system directories on nunki. > Since I am using STL, the bold word in the spec "The maximum size > of a memory buffer is limited to 512 bytes" would not mean much > to me, would it? And I will be using fstream file stream to send > file data, so I guess I don't even to initialize a buffer. If you allocate any buffer, you must not allocate anything larger than 512 bytes. If the system allocates a buffer and you do not have control easily, you don't need to worry about it. > Also, in the specification, you said about separate compilation, > but I use two class, "class server" and "class client" on > separate header files to indicate two application, however, they > both derived from the same templatized "class network", in which > case my main() will be the same for both of them like this > > #ifdef SERVER > #define APPLICATION server > #endif > > #ifdef CLIENT > #define APPLICATION client > #endif > > int main(int argc, char* argv[]) > { > network* app = network::init(); > vector arg; > for (int i = 0;i < argc;i++) > arg.push_back(string(argv[i])); > int ret = app->run(arg); > app->shutdown(); > return ret; > } > > Is that acceptable? Or I still need to have separate main.cc for > each client and server. It is acceptable. But, I would use a separate "client.cc" and a "server.cc". Reusing code is nice, but I don't think one should over-do it. > Another issues raised from my code is that the spec is unclear in > the situation where if you don't recognise the message header > MessageType, should you send a failed response right away, or you > have to eat up the Data followed by the header with DataLength > size before you send the failed response right away. In my code, > I just eat up what's indicated in DataLength, and then send a > failed response. That case the client send and server send will > not be in a locked up situation where both parties need to send > stuff without one executing a recv command. What if DataLength is > wrong/corrupted? If you don't recognize the MessageType, you don't have to read all the data. You can just send a failed response. If you recognize the MessageType but the DataLength is too large, you should use a timeout (I've mentioned this in class). > Inferred from the above issue, it is really a bad idea to strip > down the message header into 1 byte each send, because I am > making an assumption the header must be in the right size and > have the right data in it. Anyway, I'll follow the spec. Since there are malicious clients and servers, you cannot assume that a client/server will send the correct anything. > Also, Regarding the ADDR response, should I reponse to a client > making request like resolving "128.125.19.146" to > "128.125.19.146" and "10.0.0.1" to fail. In the spec, you just > said get the IP address, but there is no indication on what > source type, DNS or IP or both? If the ADDR request starts with an ASCII character between '0' and '9', you can call inet_addr(). If that failed, you can then call gethostbyname(). > Sorry haven't asked you earlier since all these issues just > brought up when I am almost done with my code. No problem. I'm glad you are almost done with your code! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 3 17:01:56 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i8401uja017568 for ; Fri, 3 Sep 2004 17:01:56 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8405Egv011090 for ; Fri, 3 Sep 2004 17:05:14 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i8405E8K011088 for cs551@merlot.usc.edu; Fri, 3 Sep 2004 17:05:14 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i8405Egv011085 for ; Fri, 3 Sep 2004 17:05:14 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i8405Egp011081 for ; Fri, 3 Sep 2004 17:05:14 -0700 Message-Id: <200409040005.i8405Egp011081@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Printing variable value in network byte order Date: Fri, 03 Sep 2004 17:05:14 -0700 From: william@bourbon.usc.edu Someone wrote: > --begin - snippet of code-- > short unsigned int a; > a=6; > a=htons(a); > printf("%d ",a); > --end - snippet of code-- > > Since we have converted 'a' to network-byte order, should the > above printf statement print something other than '6'? Its > printing '6' for me and I want to know how does 'a' look like in > network-byte order. How do I find it out? If unsigned short is a 2-byte quantity and you put a 6 in it. You should get: 0x0006 When you convert a 2-byte quantity to network-byte-order, the bytes will either reversed or not. So, you will get either 0x0006 or 0x0600 As it turns out, it won't make a difference on SPARC machines (such as nunki). But your code still need to do the right things. You should write a routine that can print an unsigned short value to the screen in HEX format (like I have above) to help you examine memory locations easier. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 3 16:26:18 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i83NQIja016865 for ; Fri, 3 Sep 2004 16:26:18 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i83NTagv013179 for ; Fri, 3 Sep 2004 16:29:36 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i83NTaCd013177 for cs551@merlot.usc.edu; Fri, 3 Sep 2004 16:29:36 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i83NTZgv013174 for ; Fri, 3 Sep 2004 16:29:35 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i83NTZoF013167 for ; Fri, 3 Sep 2004 16:29:35 -0700 Message-Id: <200409032329.i83NTZoF013167@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Server and Client Sharing Files for Warmup Project #1 Date: Fri, 03 Sep 2004 16:29:35 -0700 From: william@bourbon.usc.edu Someone wrote: > I was speaking to some classmates and this question came up. > > I am trying to avoid writing code for the same operation more > than once so some functions are held in server files and some are > held in client files. > > The wrapper functions for socket,bind,listen,accept,close,and > recv are in the main server file > > I have a separate file for the server to handle the requests > > The wrapper functions for connect and send are in the main client > file > > I have a separate file for the client to send requests > > I also have a common main.cc file which uses #ifdef, #endif for > the client/server sections as well as a common file to define > constants such as the message types and a common file for error > handling. > > Do I need to split these files up so there is no crossover > between client/server regardless of having common code in both > sections or is it OK to have certain functions shared between the > client and server sides. One of the reasons I require using "separate compilation" is to force people to divide things up into modules. Then you can pick which modules you want to include in your application. Therefore, you are strongly encourage to reuse the same code for your client and your server! (Personally, I would probably not use one "main.cc" for two different applications. I would have a "client.cc" and a "server.cc" so that it's less confusing.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 3 16:21:01 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i83NL1ja016750 for ; Fri, 3 Sep 2004 16:21:01 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i83NOIgv008691 for ; Fri, 3 Sep 2004 16:24:18 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i83NOIcl008689 for cs551@merlot.usc.edu; Fri, 3 Sep 2004 16:24:18 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i83NOIgv008680 for ; Fri, 3 Sep 2004 16:24:18 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i83NOIej008676 for ; Fri, 3 Sep 2004 16:24:18 -0700 Message-Id: <200409032324.i83NOIej008676@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Using gmake vs make for Warm-up Project #1 Date: Fri, 03 Sep 2004 16:24:18 -0700 From: william@bourbon.usc.edu Someone wrote: > I am wondering if we have to use make for the first project. I > have been compiling with gmake and it has been working > successfully. When I try to use the same Makefile with make it > fails. > > Should I troubleshoot make to get it to work with my Makefile or > can I specify in my README to use gmake. On nunki, it looks like gmake is the same as make: lrwxrwxrwx 21 Jan 3 1999 /usr/usc/bin/gmake -> /usr/usc/gnu/bin/make If I do "man make", I get the GNU make man pages. If you require the grader to do something different in order to compile your code on nunki, make sure you put it at the top of your README file. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Sep 2 14:01:22 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i82L1Mja017142 for ; Thu, 2 Sep 2004 14:01:22 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i82L4ggv016953 for ; Thu, 2 Sep 2004 14:04:42 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i82L4gtN016951 for cs551@merlot.usc.edu; Thu, 2 Sep 2004 14:04:42 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i82L4ggv016948 for ; Thu, 2 Sep 2004 14:04:42 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i82L4giT016944 for ; Thu, 2 Sep 2004 14:04:42 -0700 Message-Id: <200409022104.i82L4giT016944@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Handling Special Network Cases Date: Thu, 02 Sep 2004 14:04:42 -0700 From: william@bourbon.usc.edu Someone wrote: > The UNIX Network Programming book discusses many special TCP > client/server cases that have different complicated requirements > for handling them (Chapter 5). I'm curious if we need to worry > about these, or can we just assume our light network load and > that conditions like these will not occur: > - handling interrupted system calls > - POSIX signal handling > - connection aborts before "accept" returns > - premature termination of server process > etc.. For the final project, you should worry about all of this. Since the warmup projects are there to prepare you for the final project. I strongly recommand that you get all these code in. It's all about writing good code. Do it right once and you will have learned something very useful! If you don't do all this, it's very likely that when the grader tests your code, failures do not occur and you will not lose any points. But it's also possible that failures will occur and you may lose points. But what's more important, points or learning? :-) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Sep 1 16:45:42 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i81Njgja023392 for ; Wed, 1 Sep 2004 16:45:42 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i81Nn5gv020243 for ; Wed, 1 Sep 2004 16:49:05 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i81Nn54F020241 for cs551@merlot.usc.edu; Wed, 1 Sep 2004 16:49:05 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i81Nn5gv020238 for ; Wed, 1 Sep 2004 16:49:05 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i81Nn57U020234 for ; Wed, 1 Sep 2004 16:49:05 -0700 Message-Id: <200409012349.i81Nn57U020234@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Number of threads/processes Date: Wed, 01 Sep 2004 16:49:05 -0700 From: william@bourbon.usc.edu Someone wrote: > How many simultaneous requests shall the server be able to > handle? Or does this matter? It should be able to handle quite a few if you are using threads. If you are using processes, ISD will complain when you get beyond 10. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Sep 1 07:38:38 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i81Eccja010095 for ; Wed, 1 Sep 2004 07:38:38 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i81Eg2gv023412 for ; Wed, 1 Sep 2004 07:42:02 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i81Eg2cP023410 for cs551@merlot.usc.edu; Wed, 1 Sep 2004 07:42:02 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i81Eg1gv023407 for ; Wed, 1 Sep 2004 07:42:01 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i81Eg1qx023397 for ; Wed, 1 Sep 2004 07:42:01 -0700 Message-Id: <200409011442.i81Eg1qx023397@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Zombies Date: Wed, 01 Sep 2004 07:42:01 -0700 From: william@bourbon.usc.edu Someone wrote: > You had given in the project specs regarding handling of the > child process's zombies (of course it will not arise if I use > threads) but doesnt the kernel assign all the zombies to the init > process thereby taking care of the zombies and later killing them > one by one? But this is like saying, "Why free any memory? When the process dies, the kernel will free up all the memory associated with the process." The zombies can stay around for a very long time. You should write good code so they do not appear. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Aug 31 07:47:20 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i7VElKja013168 for ; Tue, 31 Aug 2004 07:47:20 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i7VEokgv017479 for ; Tue, 31 Aug 2004 07:50:46 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i7VEok21017477 for cs551@merlot.usc.edu; Tue, 31 Aug 2004 07:50:46 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i7VEokgv017468 for ; Tue, 31 Aug 2004 07:50:46 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i7VEokC2017464 for ; Tue, 31 Aug 2004 07:50:46 -0700 Message-Id: <200408311450.i7VEokC2017464@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS-551 Date: Tue, 31 Aug 2004 07:50:46 -0700 From: william@bourbon.usc.edu Someone wrote: > The Nunki machine which I suppose is a Sun machine which has some > requirements like linking the libraries -lsocket and -lnsl, I > tried just by including the sys/socket and other header files but > it didnt work until I had to explicitly link the above two > libraries I suppose. Of course! Compiling and linking are different things. You must find out what libraries you need to link to. If you do "man socket", you should see that you need to do "-lsocket -lnsl". If you use a library function, you should be familiar with its man pages. By the way, please do not use "CS-551" as the title of your e-mail messages. Please use a more descriptive message title. Thanks! -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Monday, August 30, 2004 9:50 pm Subject: Re: CS-551 > Someone wrote: > > > Professor it's not working. It's giving the same error.. > > May be I got the file name wrote. Try add those 2 lines > in ~/.bashrc or create ~/.bashrc with those 2 lines in it. > Then logout and log back in. > > As I have mentioned before, I don't know bash. Please > consult someone who does. If you cannot find anyone, > either stop using bash or read the bash man pages. You > are a grad student, you should be able to solve this > trivial problem. > -- > Bill Cheng // bill.cheng@usc.edu > > > > -----Original Message----- > From: william@bourbon.usc.edu [william@bourbon.usc.edu] > Sent: Monday, August 30, 2004 7:53 PM > To: cs551@bourbon.usc.edu > Subject: Re: CS-551 > > Someone wrote: > > > I'm compling the code with -lcrypto and it has compiled.. > > > > While running the code it gives the following error > > > > "ld.so.1: client: fatal: libcrypto.so.0.9.6: open failed: No such file > or > > directory > > > > Killed" > > > > Then I looked on the website and it said to run the code we need to do > the > > following > > > > "setenv LD_LIBRARY_PATH /usr/usc/openssl/default/lib:/usr/lib" > > > > But it gives the following error . "setenv: command not found" > > > > I work in the "bash" shell > > I don't use bash, but I think you can add the following to > your ~/.bash_profile file: > > LD_LIBRARY_PATH=/usr/usc/openssl/default/lib:/usr/lib > export LD_LIBRARY_PATH > > If I'm wrong, please consult someone who knows bash. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Aug 30 21:46:36 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i7V4kZja000781 for ; Mon, 30 Aug 2004 21:46:36 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i7V4o3gv031200 for ; Mon, 30 Aug 2004 21:50:03 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i7V4o3FJ031198 for cs551@merlot.usc.edu; Mon, 30 Aug 2004 21:50:03 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i7V4o3gv031195 for ; Mon, 30 Aug 2004 21:50:03 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i7V4o3x8031187 for ; Mon, 30 Aug 2004 21:50:03 -0700 Message-Id: <200408310450.i7V4o3x8031187@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS-551 Date: Mon, 30 Aug 2004 21:50:03 -0700 From: william@bourbon.usc.edu Someone wrote: > Professor it's not working. It's giving the same error.. May be I got the file name wrote. Try add those 2 lines in ~/.bashrc or create ~/.bashrc with those 2 lines in it. Then logout and log back in. As I have mentioned before, I don't know bash. Please consult someone who does. If you cannot find anyone, either stop using bash or read the bash man pages. You are a grad student, you should be able to solve this trivial problem. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] Sent: Monday, August 30, 2004 7:53 PM To: cs551@bourbon.usc.edu Subject: Re: CS-551 Someone wrote: > I'm compling the code with -lcrypto and it has compiled.. > > While running the code it gives the following error > > "ld.so.1: client: fatal: libcrypto.so.0.9.6: open failed: No such file or > directory > > Killed" > > Then I looked on the website and it said to run the code we need to do the > following > > "setenv LD_LIBRARY_PATH /usr/usc/openssl/default/lib:/usr/lib" > > But it gives the following error . "setenv: command not found" > > I work in the "bash" shell I don't use bash, but I think you can add the following to your ~/.bash_profile file: LD_LIBRARY_PATH=/usr/usc/openssl/default/lib:/usr/lib export LD_LIBRARY_PATH If I'm wrong, please consult someone who knows bash. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Aug 30 19:49:02 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i7V2n2ja030538 for ; Mon, 30 Aug 2004 19:49:02 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i7V2qUgv016689 for ; Mon, 30 Aug 2004 19:52:30 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i7V2qUwQ016681 for cs551@merlot.usc.edu; Mon, 30 Aug 2004 19:52:30 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i7V2qUgv016678 for ; Mon, 30 Aug 2004 19:52:30 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i7V2qUFv016674 for ; Mon, 30 Aug 2004 19:52:30 -0700 Message-Id: <200408310252.i7V2qUFv016674@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS-551 Date: Mon, 30 Aug 2004 19:52:30 -0700 From: william@bourbon.usc.edu Someone wrote: > I'm compling the code with -lcrypto and it has compiled.. > > While running the code it gives the following error > > "ld.so.1: client: fatal: libcrypto.so.0.9.6: open failed: No such file or > directory > > Killed" > > Then I looked on the website and it said to run the code we need to do the > following > > "setenv LD_LIBRARY_PATH /usr/usc/openssl/default/lib:/usr/lib" > > But it gives the following error . "setenv: command not found" > > I work in the "bash" shell I don't use bash, but I think you can add the following to your ~/.bash_profile file: LD_LIBRARY_PATH=/usr/usc/openssl/default/lib:/usr/lib export LD_LIBRARY_PATH If I'm wrong, please consult someone who knows bash. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Aug 30 07:56:18 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i7UEuIja015568 for ; Mon, 30 Aug 2004 07:56:18 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i7UExkgv020333 for ; Mon, 30 Aug 2004 07:59:46 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i7UExk6U020331 for cs551@merlot.usc.edu; Mon, 30 Aug 2004 07:59:46 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i7UExkgv020322 for ; Mon, 30 Aug 2004 07:59:46 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i7UExk7j020318 for ; Mon, 30 Aug 2004 07:59:46 -0700 Message-Id: <200408301459.i7UExk7j020318@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: notes added for warmup project #1 Date: Mon, 30 Aug 2004 07:59:46 -0700 From: william@bourbon.usc.edu Someone wrote: > I think what Someone was referring to were the ephemeral ports > returned by the accept() and (unbound) connect() calls. Just > making sure I understand, does the spec refer to those ports as > well, or just to the server's (original) listening port? If so, > does that inherently limit us to only a handful of simultaneous > connections? It was my mistake. The spec refers to the server's original listening port only. Sorry that I misread Someone's message. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Sunday, August 29, 2004 11:08 pm Subject: Re: notes added for warmup project #1 > Someone wrote: > > > For project 1 must we bind our clients to a specific port instead of > letting > the kernel choose an ephemeral port, so that the kernel will not > > accidentally choose one of our classmates ports? Or is it OK to > follow the > > standard procedure and just let the kernel pick a port for the client? > > The spec calls for a specified port, so please follow the spec. > > (For your own testing, you can do whatever you want. But > in the code you submit, you must follow the spec.) > -- > Bill Cheng // bill.cheng@usc.edu > > > > ----- Original Message ----- > From: > To: > Sent: Sunday, August 29, 2004 9:42 PM > Subject: Re: notes added for warmup project #1 > > > > Someone wrote: > > > > > The permissions for ~csci551/bin/hexdump do not seem to > > > be set, because I can't access it. > > > > It's "~csci551b" (there's a 'b' at the end) and not "~csci551". > > -- > > Bill Cheng // bill.cheng@usc.edu > > > > > > > > ----- Original Message ----- > > From: william@bourbon.usc.edu > > Date: Sunday, August 29, 2004 3:25 pm > > Subject: notes added for warmup project #1 > > > > > Hi, > > > > > > I've added some notes for warmup project #1. Please > > > see the updated web page. The updates are in blue > > > and looks like "[BC: ...]". > > > > > > Please work on it *early*! > > > -- > > > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Aug 30 07:50:49 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i7UEonja015453 for ; Mon, 30 Aug 2004 07:50:49 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i7UEsIgv015311 for ; Mon, 30 Aug 2004 07:54:18 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i7UEsI15015309 for cs551@merlot.usc.edu; Mon, 30 Aug 2004 07:54:18 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i7UEsIgv015301 for ; Mon, 30 Aug 2004 07:54:18 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i7UEsIR3015296 for ; Mon, 30 Aug 2004 07:54:18 -0700 Message-Id: <200408301454.i7UEsIR3015296@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Protocol for GET_RPLY message Date: Mon, 30 Aug 2004 07:54:18 -0700 From: william@bourbon.usc.edu Someone wrote: > If the file size is large, then there may be multiple GET_RPLY > messages for a given GET_REQ message. How does client recognize > the last GET_RPLY message for a given GET_REQ message? Can we > assume that the last GET_RPLY message has msg_type as GET_RPLY > and data length to be zero? This is the whole point about "TCP's stream abstraction" lecture. There is only *one* message from the server to the client. The networking software will take care of message fragmentation and you do not have to worry about it. The client can simply read the first 6 bytes of the message and determines how many more bytes it has to read. (By the way, the client should handle the case where the server is dishonest and should never hang or crash.) Please note that it's not necessary to make a reciprocal connect from the server back to the client. The server can simply write to the socket returned by accept() and close this socket when it finishes writing all the bytes. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Aug 30 07:41:20 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i7UEfKja015241 for ; Mon, 30 Aug 2004 07:41:20 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i7UEimgv006534 for ; Mon, 30 Aug 2004 07:44:48 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i7UEimnX006529 for cs551@merlot.usc.edu; Mon, 30 Aug 2004 07:44:48 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i7UEimgv006523 for ; Mon, 30 Aug 2004 07:44:48 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i7UEimAd006519 for ; Mon, 30 Aug 2004 07:44:48 -0700 Message-Id: <200408301444.i7UEimAd006519@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Port on which client is supposed to run Date: Mon, 30 Aug 2004 07:44:48 -0700 From: william@bourbon.usc.edu Someone wrote: > If the port specified in command line of client is > "SERVER_PORT", to which client socket has to be connected, > then where should we specify the port on which client is > supposed to run? Is the port of client socket to be > hard-coded in client program? Oops! Now I realize that I have misread the previous message. Sorry. The client should bind to an ephemeral port. The client should never bind to a fixed port. The server listens on either SERVER_PORT (you should have a "#define SERVER_PORT 16xxx" in a header file of yours) if the server is started without the [port] argument or a specified port number. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Sun, 29 Aug 2004 23:32:27 -0700 From: sita allamudi To: william@bourbon.usc.edu Subject: Port on which client is supposed to run > > For project 1 must we bind our clients to a specific port instead of > letting > the kernel choose an ephemeral port, so that the kernel will not > > accidentally choose one of our classmates ports? Or is it OK to > follow the > > standard procedure and just let the kernel pick a port for the client? > > > The spec calls for a specified port, so please follow the spec. > > (For your own testing, you can do whatever you want. But > in the code you submit, you must follow the spec.) > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Aug 29 23:04:54 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i7U64sja004452 for ; Sun, 29 Aug 2004 23:04:54 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i7U68Ogv003583 for ; Sun, 29 Aug 2004 23:08:24 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i7U68Oss003581 for cs551@merlot.usc.edu; Sun, 29 Aug 2004 23:08:24 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i7U68Ngv003573 for ; Sun, 29 Aug 2004 23:08:23 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i7U68NPF003568 for ; Sun, 29 Aug 2004 23:08:23 -0700 Message-Id: <200408300608.i7U68NPF003568@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: notes added for warmup project #1 Date: Sun, 29 Aug 2004 23:08:23 -0700 From: william@bourbon.usc.edu Someone wrote: > For project 1 must we bind our clients to a specific port instead of letting > the kernel choose an ephemeral port, so that the kernel will not > accidentally choose one of our classmates ports? Or is it OK to follow the > standard procedure and just let the kernel pick a port for the client? The spec calls for a specified port, so please follow the spec. (For your own testing, you can do whatever you want. But in the code you submit, you must follow the spec.) -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Sunday, August 29, 2004 9:42 PM Subject: Re: notes added for warmup project #1 > Someone wrote: > > > The permissions for ~csci551/bin/hexdump do not seem to > > be set, because I can't access it. > > It's "~csci551b" (there's a 'b' at the end) and not "~csci551". > -- > Bill Cheng // bill.cheng@usc.edu > > > > ----- Original Message ----- > From: william@bourbon.usc.edu > Date: Sunday, August 29, 2004 3:25 pm > Subject: notes added for warmup project #1 > > > Hi, > > > > I've added some notes for warmup project #1. Please > > see the updated web page. The updates are in blue > > and looks like "[BC: ...]". > > > > Please work on it *early*! > > -- > > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Aug 29 21:39:07 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i7U4d7ja002691 for ; Sun, 29 Aug 2004 21:39:07 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i7U4gbgv019311 for ; Sun, 29 Aug 2004 21:42:37 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i7U4gbJ3019309 for cs551@merlot.usc.edu; Sun, 29 Aug 2004 21:42:37 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i7U4gagv019306 for ; Sun, 29 Aug 2004 21:42:36 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i7U4gawC019299 for ; Sun, 29 Aug 2004 21:42:36 -0700 Message-Id: <200408300442.i7U4gawC019299@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: notes added for warmup project #1 Date: Sun, 29 Aug 2004 21:42:36 -0700 From: william@bourbon.usc.edu Someone wrote: > The permissions for ~csci551/bin/hexdump do not seem to > be set, because I can't access it. It's "~csci551b" (there's a 'b' at the end) and not "~csci551". -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Sunday, August 29, 2004 3:25 pm Subject: notes added for warmup project #1 > Hi, > > I've added some notes for warmup project #1. Please > see the updated web page. The updates are in blue > and looks like "[BC: ...]". > > Please work on it *early*! > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Aug 29 15:22:16 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i7TMMGja027686 for ; Sun, 29 Aug 2004 15:22:16 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i7TMPkgv012579 for ; Sun, 29 Aug 2004 15:25:46 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i7TMPkTh012577 for cs551@merlot.usc.edu; Sun, 29 Aug 2004 15:25:46 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i7TMPkgv012574 for ; Sun, 29 Aug 2004 15:25:46 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i7TMPk6c012572 for cs551; Sun, 29 Aug 2004 15:25:46 -0700 Date: Sun, 29 Aug 2004 15:25:46 -0700 From: william@bourbon.usc.edu Message-Id: <200408292225.i7TMPk6c012572@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: notes added for warmup project #1 Hi, I've added some notes for warmup project #1. Please see the updated web page. The updates are in blue and looks like "[BC: ...]". Please work on it *early*! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Aug 25 08:42:42 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id i7PFggja019487 for ; Wed, 25 Aug 2004 08:42:42 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i7PFkNgv014695 for ; Wed, 25 Aug 2004 08:46:23 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id i7PFkN2G014689 for cs551@merlot.usc.edu; Wed, 25 Aug 2004 08:46:23 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id i7PFkNgv014684 for ; Wed, 25 Aug 2004 08:46:23 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id i7PFkNsQ014680 for ; Wed, 25 Aug 2004 08:46:23 -0700 Message-Id: <200408251546.i7PFkNsQ014680@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Warmup #1 Questions Date: Wed, 25 Aug 2004 08:46:23 -0700 From: william@bourbon.usc.edu Someone wrote: > I had some basic questions regarding the first warmup project. > > 1. Do you have any preference on how we handle links, > directories, and other special files? For example, a client > might issue a GET request for a directory or a FILESIZE request > for a link. You should just open the file in binary mode and read everything from it and send it back. If it's a link, the file system will do the right thing for you. If you are sending the content of a directory, so be it! > 2. Are file sizes measured in bytes? Again, what about > directories, etc.? You should just get the size of the target (using something like stat()) and return it. Again, you don't need to examine if it's a regular file, a directory, a link, or a special file. 1+2 above means that there will be some inconsistencies. For example, if the target happens to be a link, the file size returned by the FILESIZE request may not match the size of the file you retrieved using GET. But that's okay for this project. > 3. What did you mean by saying that the retrieved file be issued > in cleartext? Just telling us to not encrypt it? Mainly not to "encode" it. Cleartext means "don't modify at all". -- Bill Cheng // bill.cheng@usc.edu