Return-Path: william@bourbon.usc.edu Delivery-Date: Thu May 4 23:37:22 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k456bMNC001591; Thu, 4 May 2006 23:37:22 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k456bFvD009913; Thu, 4 May 2006 23:37:15 -0700 Message-Id: <200605050637.k456bFvD009913@bourbon.usc.edu> To: cs530@merlot.usc.edu, cs551@merlot.usc.edu, csac@merlot.usc.edu Subject: Fwd: JPL Summer Job (US citizenship required) Date: Thu, 04 May 2006 23:37:15 -0700 From: william@bourbon.usc.edu Hi, I got the following summer job announcement from JPL (in Pasadena, CA). Please look through the requirements before applying. Both jobs require US citizenship. -- Bill Cheng // bill.cheng@usc.edu ----- Begin forwarded message: > From: "Scott Darden" > Date: May 4, 2006 3:15:57 PM PDT > To: ortega@sipi.usc.edu > Cc: "Clay Okino" , > "Winston Kwong" > Subject: JPL Summer Job > > JPL is looking for summer interns for the following job descriptions. > > Job Description #1: Video over space links > > There is interest in investigating off the shelf video techniques for > use in a space environment. In particular, of video teleconference > applications. > > Requirements: U.S. Citizenship, graduate student with a background in > video codex, VTC protocols (such as H.323), C or C++, Visual > Studio. Knowledge of computer and or communication networks is > desired but not required. > > Job Description #2: VOIP over space links > > There is interest in investigating off the shelf voice over IP > techniques for use in a space environment. > > Requirements: U.S. Citizenship, graduate student with a background in > audio codex (such as CELP and MELP), C or C++, Visual Studio. > Knowledge of session initiation protocol (SIP), real time protocol > (RTP), real time control protocol (RTCP). > > Please send resumes to Scott Darden at darden@aria.jpl.nasa.gov. > > Scott Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Dec 21 07:59:31 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jBLFxUa2017349 for ; Wed, 21 Dec 2005 07:59:30 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jBLFvOOx009589 for ; Wed, 21 Dec 2005 07:57:24 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jBLFvOYh009588 for cs551@merlot; Wed, 21 Dec 2005 07:57:24 -0800 Date: Wed, 21 Dec 2005 07:57:24 -0800 From: william@bourbon.usc.edu Message-Id: <200512211557.jBLFvOYh009588@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: deleting project spec... Hi, I'm deleting the project specs this Friday. If you think you might need it when you go for job interviews in the future, you should save a copy of it. (Once I've deleted the spec, I will not put it back up or find it in the database and send it to you.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Dec 12 11:39:29 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jBCJdTOc023480 for ; Mon, 12 Dec 2005 11:39:29 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jBCJbrDV019663 for ; Mon, 12 Dec 2005 11:37:53 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jBCJbrra019662 for cs551@merlot; Mon, 12 Dec 2005 11:37:53 -0800 Date: Mon, 12 Dec 2005 11:37:53 -0800 From: william@bourbon.usc.edu Message-Id: <200512121937.jBCJbrra019662@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: final letter grade... Hi, I just want to mention that there are *huge* gaps between letter grades. So, if you are thinking about complaining about the project grades here and there just to get a few points, chances are, they will have no impact of your final letter grade. Please also remember that we must grade what you have submitted. You will not get *any* credit for work done after the submission deadline. (When it comes to grading, fairness is my primary concern.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Dec 6 11:46:37 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jB6JkbUM032257 for ; Tue, 6 Dec 2005 11:46:37 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jB6JjLCR029274 for ; Tue, 6 Dec 2005 11:45:21 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jB6JjLbN029273 for cs551@merlot.usc.edu; Tue, 6 Dec 2005 11:45:21 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jB6JjLin029270 for ; Tue, 6 Dec 2005 11:45:21 -0800 Message-Id: <200512061945.jB6JjLin029270@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: TCP throughput modeling Date: Tue, 06 Dec 2005 11:45:21 -0800 From: william@bourbon.usc.edu Someone wrote: > Are we expected to know the TCP throughput modeling equations for Bandwidth > B(p), from the TCP throughput modeling paper? You do not need to know the derivation, but you should be familiar with the solution form. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Dec 5 13:33:08 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jB5LX8DN020167 for ; Mon, 5 Dec 2005 13:33:08 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jB5LVtjl024150 for ; Mon, 5 Dec 2005 13:31:55 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jB5LVti8024149 for cs551@merlot.usc.edu; Mon, 5 Dec 2005 13:31:55 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jB5LVtBc024146 for ; Mon, 5 Dec 2005 13:31:55 -0800 Message-Id: <200512052131.jB5LVtBc024146@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: RED (cont) Date: Mon, 05 Dec 2005 13:31:55 -0800 From: william@bourbon.usc.edu Someone wrote: > I just wanted to add, that I do understand how early drop is done and what > it does, but I didn't understand how this early drop helps accommodate > burst. Early drop keeps the queue size relatively low, so when a burst of packets come in, there is room in the queue to handle it (instead of dropping some of it). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Dec 5 13:31:03 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jB5LV2Xr020098 for ; Mon, 5 Dec 2005 13:31:02 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jB5LTo2b024117 for ; Mon, 5 Dec 2005 13:29:50 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jB5LToDn024116 for cs551@merlot.usc.edu; Mon, 5 Dec 2005 13:29:50 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jB5LTokD024113 for ; Mon, 5 Dec 2005 13:29:50 -0800 Message-Id: <200512052129.jB5LTokD024113@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: RED Date: Mon, 05 Dec 2005 13:29:50 -0800 From: william@bourbon.usc.edu Someone wrote: > In RED active queue management, there is a statement saying that the queue > size should reflect the burst size we want to absorb and not steady-state > queuing. I did not understand what it means? That justifies early drop. Basically, it says that it's okay to drop packets early (before the queue becomes full) because large steady-state queue should not occur. > Actually I have not understood > the concept of how RED accommodates congestion, maybe that is where the > doubt comes from. RED accomodates congestion by random drop and early drop (while a drop-tail queue accomodated congestion by drop-tail). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Dec 5 13:24:10 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jB5LOA5P019906 for ; Mon, 5 Dec 2005 13:24:10 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jB5LMwsY024040 for ; Mon, 5 Dec 2005 13:22:58 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jB5LMwdM024039 for cs551@merlot.usc.edu; Mon, 5 Dec 2005 13:22:58 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jB5LMwjD024036 for ; Mon, 5 Dec 2005 13:22:58 -0800 Message-Id: <200512052122.jB5LMwjD024036@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: lect 23 slide 17 Date: Mon, 05 Dec 2005 13:22:58 -0800 From: william@bourbon.usc.edu Someone wrote: > But if it sends the reply with a new address.. I think this is really a > basic doubt. > > If I have a TCP connection between IP add x (port a) and IP add y (port b). > i.e x:a <---> y:b > > Now if the reply comes with a different IP address z (instead of y), then > will it still go to the process waiting on x:a ? The packet will go to the right process. Although the response will look like an unsolicited response. The would also depend on the application. If the application on CH does not check the source address of the response, then it would work. If it does, then it may throw away packets not coming from where it's expecting. I think the mobile host can also reply with its original IP address! But if the foreign network has source filtering turned on, then then pack will not get out of the foreign network. But then if the foreign network is mobile IP-aware, it would probably allow it. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] Sent: Monday, December 05, 2005 2:25 PM To: cs551@bourbon.usc.edu Subject: Re: lect 23 slide 17 Someone wrote: > In 17th slide of lect 23, when the mobile host replies t the "CH", it does > this directly? Then what will be the source IP address in this reply packet. > Will it be the new IP address that the mobile host has got in the foreign > network or will it be the IP address that it was using in home network? It will be the new IP address. So, this may cause problems because the response would look like an unsolicited response. If the CH has some security software installed that detects "strange" connections. This type of reply may cause the security software to block the reply! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Dec 5 09:25:42 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jB5HPgWK012774 for ; Mon, 5 Dec 2005 09:25:42 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jB5HOU8l022625 for ; Mon, 5 Dec 2005 09:24:30 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jB5HOUbu022624 for cs551@merlot.usc.edu; Mon, 5 Dec 2005 09:24:30 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jB5HOUQi022621 for ; Mon, 5 Dec 2005 09:24:30 -0800 Message-Id: <200512051724.jB5HOUQi022621@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: lect 23 slide 17 Date: Mon, 05 Dec 2005 09:24:30 -0800 From: william@bourbon.usc.edu Someone wrote: > In 17th slide of lect 23, when the mobile host replies t the "CH", it does > this directly? Then what will be the source IP address in this reply packet. > Will it be the new IP address that the mobile host has got in the foreign > network or will it be the IP address that it was using in home network? It will be the new IP address. So, this may cause problems because the response would look like an unsolicited response. If the CH has some security software installed that detects "strange" connections. This type of reply may cause the security software to block the reply! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Dec 5 09:21:45 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jB5HLjWm012647 for ; Mon, 5 Dec 2005 09:21:45 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jB5HKYW4022604 for ; Mon, 5 Dec 2005 09:20:34 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jB5HKY3x022603 for cs551@merlot.usc.edu; Mon, 5 Dec 2005 09:20:34 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jB5HKYhf022600 for ; Mon, 5 Dec 2005 09:20:34 -0800 Message-Id: <200512051720.jB5HKYhf022600@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: lect 22 slide 7 Date: Mon, 05 Dec 2005 09:20:34 -0800 From: william@bourbon.usc.edu [ Sorry for the late reply. I was sick most of Sunday. ] Someone wrote: > I did not understand what you were trying to say for the 7th > slide of lec 22. > > It is about loss patterns. > > Is the loss pattern for data exponentially distributed or does > it have heavy tail distribution. Loss pattern for data is exponentially distributed while loss pattern for ACKs was not. > What happens on bursts. Wht is the distribution of ack losses. When you have a burst of losses, it's referred to as an outage in the paper. Part of the ACK outage duration is consistent with the Pareto distribution. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Nov 30 12:04:49 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jAUK4nYV002772 for ; Wed, 30 Nov 2005 12:04:49 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAUK3tdw006704 for ; Wed, 30 Nov 2005 12:03:55 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jAUK3tl1006703 for cs551@merlot.usc.edu; Wed, 30 Nov 2005 12:03:55 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAUK3tlx006700 for ; Wed, 30 Nov 2005 12:03:55 -0800 Message-Id: <200511302003.jAUK3tlx006700@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Enhanced-clustered cache replacement scheme Date: Wed, 30 Nov 2005 12:03:55 -0800 From: william@bourbon.usc.edu Someone wrote: > I have a doubt in Enhanced-clustered cache replacement scheme > [slide 17 of lecture 18] > > We dont want to strictly throw off the farthest one. > In slide 17 of lecture 18, the algorithm presented is doing the reverse. > If v is farther from u, we are evicting it with probablity = 1. > I did not understand why is this so. It's not that "we don't want to throw away the farthest one". It's "we don't want to *always* throw away the farthest one". To achieve Small World Model, we must have short-distance clustering and long-distance shortcuts. So, the first rule on slide 17 of lecture 18 is to achieve short-distance clustering. The 2nd (the one you asked about) is to achieve long-distance shortcuts. (And it's not with probability 1, but some p, which can be a function of the distance between u and the seed). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Nov 23 14:59:16 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jANMxG20006655 for ; Wed, 23 Nov 2005 14:59:16 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jANMwk0i016153 for ; Wed, 23 Nov 2005 14:58:46 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jANMwkvw016152 for cs551@merlot.usc.edu; Wed, 23 Nov 2005 14:58:46 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jANMwkYd016149 for ; Wed, 23 Nov 2005 14:58:46 -0800 Message-Id: <200511232258.jANMwkYd016149@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: difference between Cached and Permenant files Date: Wed, 23 Nov 2005 14:58:46 -0800 From: william@bourbon.usc.edu Someone wrote: > The spec says this abt StoreProb... > > StoreProb - When a node receives a store request from a neighbor, > it flips a coin (with this probability of getting a positive > outcome) to decide if it should cache a copy of it. If the result > is positive, a copy of the file is stored. The node where this > store request was originated ignores this value. The default > value is 0.1. > > here the underline part "cache a copy" means should the file be a > part of permament files or the cache ones? Cache. > because in the next > statement it is sayed, a copy of the file is stored. You can "store" in either the permanent space or the cached space. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Nov 22 23:21:17 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jAN7LHTa016333 for ; Tue, 22 Nov 2005 23:21:17 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAN7Ko52012271 for ; Tue, 22 Nov 2005 23:20:50 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jAN7KoYj012270 for cs551@merlot.usc.edu; Tue, 22 Nov 2005 23:20:50 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAN7Kojx012267 for ; Tue, 22 Nov 2005 23:20:50 -0800 Message-Id: <200511230720.jAN7Kojx012267@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: nounce Date: Tue, 22 Nov 2005 23:20:50 -0800 From: william@bourbon.usc.edu Someone wrote: > Just wanted to confirm.. > In Section B) Mixed nodes, part 1a), > we are performing 3 get's. So, before making a copy of the > get file in the permanent memory of > the node that originated get msg, should i check if that file > is already there in the node's permanent memory? > > And if present, should i still copy this again? Again, if you do not give me a line number in the grading guidelines file, I cannot answer your specific question. I'll answer your question in general. If you type, for example, "get 2" and the corresponding file is already in the permanent storage of that node, then you don't have to send out a GET request. But, you still need to copy the corresponding file into the current working directory. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Tuesday, November 22, 2005 8:54 pm Subject: Re: nounce To: cs551@bourbon.usc.edu > Someone wrote: > > > When we recieve the store msg from neighbour node, should we copy > > the meta and data file in the store msg as it is? > > Yes. > > > If yes, i have > > a doubt in the grading guidelines Section "(B) Mix of nodes" > > > > In 1a) CacheProb=1, StoreProb=1, NeighborStoreProb=1 > > First we did a "store" at node 02. > > [store blondie1.mp3 2 title="Heart of Glass"] > > > > blondie1.mp3 is stored at other nodes because, they recieved store > > from node 02. So, All the files will have same sha, nounce and > > filenames. Is this correct? > > Exactly. > > > then in the node 08: search filename=blondie1.mp3 > > should get 5 responses, > > look for the nonce that matches the > nonce at > > node *02, let's call this x, then > type: get [x] > > > > Why will the nonce values be different? > > They should all have the same nonce value *for this particular > example*. In general, that need not be true. The grading > guidelines have gone through several revisions. In a previous > version, there were other blondie1.mp3 stored. Sorry about > the confusion. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Nov 22 20:53:57 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jAN4rv8Z012895 for ; Tue, 22 Nov 2005 20:53:57 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAN4rUPC011611 for ; Tue, 22 Nov 2005 20:53:30 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jAN4rUNW011610 for cs551@merlot.usc.edu; Tue, 22 Nov 2005 20:53:30 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAN4rU9g011607 for ; Tue, 22 Nov 2005 20:53:30 -0800 Message-Id: <200511230453.jAN4rU9g011607@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: nounce Date: Tue, 22 Nov 2005 20:53:30 -0800 From: william@bourbon.usc.edu Someone wrote: > When we recieve the store msg from neighbour node, should we copy > the meta and data file in the store msg as it is? Yes. > If yes, i have > a doubt in the grading guidelines Section "(B) Mix of nodes" > > In 1a) CacheProb=1, StoreProb=1, NeighborStoreProb=1 > First we did a "store" at node 02. > [store blondie1.mp3 2 title="Heart of Glass"] > > blondie1.mp3 is stored at other nodes because, they recieved store > from node 02. So, All the files will have same sha, nounce and > filenames. Is this correct? Exactly. > then in the node 08: search filename=blondie1.mp3 > should get 5 responses, > look for the nonce that matches the nonce at > node *02, let's call this x, then type: get [x] > > Why will the nonce values be different? They should all have the same nonce value *for this particular example*. In general, that need not be true. The grading guidelines have gone through several revisions. In a previous version, there were other blondie1.mp3 stored. Sorry about the confusion. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Nov 22 20:48:59 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jAN4mxSV012788 for ; Tue, 22 Nov 2005 20:48:59 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAN4mWTA011530 for ; Tue, 22 Nov 2005 20:48:32 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jAN4mWhF011529 for cs551@merlot.usc.edu; Tue, 22 Nov 2005 20:48:32 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAN4mV4g011526 for ; Tue, 22 Nov 2005 20:48:31 -0800 Message-Id: <200511230448.jAN4mV4g011526@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: storeprob Date: Tue, 22 Nov 2005 20:48:31 -0800 From: william@bourbon.usc.edu Someone wrote: > When a node gets a store message, i.e when a node gets a file to > store - shud it store this file or cache it? If this node originated a GET, then it should store it in permanent storage. All other nodes should store it in cache, if it decides to store it. > StoreProb - When a node receives a store request from a neighbor, > it flips a coin (with this probability of getting a positive > outcome) to decide if it should cache a copy of it. If the result > is positive, a copy of the file is stored. The node where this > store request was originated ignores this value. The default > value is 0.1. > > The specs says the above, so I guess we need to cache it. > > So I just want to confirm that the node stores a file only if > gets a reply to its own "get" message or a file is locally > stored. Is that right? If this node originated the GET request, then it must store it in permanent storage. All other nodes should store it in cache, if it decides to store it. I'm not sure what you meant by "locally stored". -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Nov 22 08:13:12 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jAMGDCHq028011 for ; Tue, 22 Nov 2005 08:13:12 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAMGClVe008431 for ; Tue, 22 Nov 2005 08:12:47 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jAMGClBD008430 for cs551@merlot.usc.edu; Tue, 22 Nov 2005 08:12:47 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAMGCl5R008427 for ; Tue, 22 Nov 2005 08:12:47 -0800 Message-Id: <200511221612.jAMGCl5R008427@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Format of "get" result Date: Tue, 22 Nov 2005 08:12:47 -0800 From: william@bourbon.usc.edu Someone wrote: > I got a bit confused. > When the user says "get 1 [], if the extfile > exists, the user shuld be asked for replacement or not? If > the user says no, should the 5.data,5.cert and 5.certify be > created? I think they should still be created. You can create these files first and then prompt the user and copy 5.data to the current working directory. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Nov 21 23:01:27 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jAM71R9m014710 for ; Mon, 21 Nov 2005 23:01:27 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAM713PN006572 for ; Mon, 21 Nov 2005 23:01:03 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jAM713QL006571 for cs551@merlot.usc.edu; Mon, 21 Nov 2005 23:01:03 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAM7132L006568 for ; Mon, 21 Nov 2005 23:01:03 -0800 Message-Id: <200511220701.jAM7132L006568@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Format of "get" result Date: Mon, 21 Nov 2005 23:01:03 -0800 From: william@bourbon.usc.edu Someone wrote: > Should the output of get be written to one file or should be it divided into > .meta, .cert and .data files ? Also, if written to one file, is there any > specific format or can I just append meta + cert + data in that order ? I'm not sure what you meant by "output of get". There are 2 things you should do. If you look at line 876 of the grading guidelines, it says: get 1 "blondie1.mp3" should be created in the current directory So, the *output* of "get 1" here is to create a file "blondie1.mp3" in the currently working directory. *Also*, according to item (8) in the Summary of Basic Message Types section of the spec: If the user at node X attempts to retrieve file F and file F was successfully retrived, node X must serve file F (i.e., respond properly to future search messages). File F should be stored in the permanent area and not stored in its cache. Intermediate nodes, i.e., nodes on the return path of the get response message (other than the originating and the final nodes) cache file F probabilistically. If the next availabe file number is 5, you should also create "5.data", "5.meta", "5.cert", etc. in the files subdirectory of the node's HomeDir *so that you can serve this file*. Of couse, you need to update all your indices and index files so that this node can repond to search and get and delete messages properly. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Nov 19 14:39:48 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jAJMdmE6007589 for ; Sat, 19 Nov 2005 14:39:48 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAJMZWVd019136 for ; Sat, 19 Nov 2005 14:35:32 -0800 Message-Id: <200511192235.jAJMZWVd019136@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: final project part (2) extension! Date: Sat, 19 Nov 2005 14:35:32 -0800 From: william@bourbon.usc.edu Hi, I forgot to mention, the machine I read e-mails on will also be shutdown. Since it cannot be turned on remotely, I will only be able to boot it on Monday around 10am. So, I won't be able to reply to e-mail messages between midnight tonight and 10am on Monday. Sorry about the inconvenience. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Sat, 19 Nov 2005 14:23:46 -0800 From: william@bourbon.usc.edu To: cs551@merlot.usc.edu Subject: final project part (2) extension! I was going to see if it was my mistake regarding the bit-vector. And if it were, I will extend the deadline by one day. Then I got the message below regarding an emergency power outage for tomorrow (Sunday 11/20) from 2am to 10pm. I'm not sure if nunki and aludra will be down during this time. But looks like the USC network will be down. So, this is what I'm going to do. The deadline for final project part (2) will be extended by two days to Wed 11/23/2005 at 11:45pm. There will be no additional extension if the power outage will last till Monday. (If it lasts till Tuesday, we will most likely have another extension). Most likely, USC network will be down. This means that you will not be able to access the web server and I will not be able to reach my e-mail. It would probably be a good idea if you make a copy of the project spec, especially if you have a home machine to continue to work on your project. -- Bill Cheng // bill.cheng@usc.edu -----Forwarded Message----- Date: Sat, 19 Nov 2005 12:53:35 -0800 From: CS Sys Admin To: CS System Administrator Subject: Alert: Power/Network Outage on Sunday 20 NOV Hi All, Please take note of the below message from ISD. There will be Power and/or Network outage on Sunday, November 20th, 2:00 a.m. until 10:00 p.m on most buildings in University Park Campus. The emergency Power shutdown is because of the electric work on the Biegler vault. SAL, PHE, HNB, ACB, OHE are included on the list for confirmed power and network outage. RTH may not have power outage but network outage is confirmed because the rest of the network switches will be down. Detailed list is given in below emails. Please shutdown computers/equipment (or take appropriate precautionary measures). http://www.usc.edu/isd/it/alerts/upc_power_outage_november_20th.html Regards, Vishal Thakkar IT and Web Consultant Computer Science Department, USC ---------- Forwarded message ---------- Date: Nov 19, 2005 10:47 AM Subject: Fwd: Power Outage Sunday, please forward ISD has learned from FMS this morning that this outage will be extended until 10:00 p.m. Sunday night. ---------- Forwarded message ---------- Date: Nov 18, 2005 11:25 PM Subject: Power Outage Sunday, please forward ISD has learned of an emergency power outage scheduled for the University Park campus this weekend. Facilities Management Services has informed us that the outage will take place on Sunday, November 20th, 2:00 a.m. until 6:00 p.m., and will affect all buildings fed by the Biegler Vault (see complete list below). Buildings fed by this vault will be without power an d network service for the duration of the outage. In addition, because Bridge Hall and Powell Hall house network switches tha t support adjacent buildings, network service likely will be unavailable in those adjacent buildings as well, even though the power there will remain on. Should you encounter any difficulty re-establishing network connectivity once the power has been restored, please call ISDÂ’s Customer Support Center at x05555. We apologize in advance to members of the University community for any inconvenience that may result from this power outage. Buildings Served by Biegler Vault: Administration Ahmanson - East/West Alan Hancock Annex Building II Biegler Hall of Eng. Birnkrant (N. Complex) Bookstore Bridge Hall Center for Electron Microscopy Childs Way I and II College University (N. Complex) Commons Davidson Conf. Dedeaux Field Denny Research Dental School Doheny Library Drama Center Electrical Engineering Bldg. EVK (N. Complex) Faculty Center Financial Services Gerontology Grace Ford Sal. Harris Hall of Architecture Harris Hall of Residence (N. Complex) Hedco Neurosciences Hedco/PCE Henry Salvatori Hoffman Hall/GSBA Human Relations Center Law Center Lewis Hall 120/208 Loker Hydrocarbon '95 Add.. Loker Hydrocarbon Original Mudd Hall of Philosophy Norris Cinema Theater North Complex Olin Hall of Engineering Organic Chemistry Wing Parking Structure "A" Parkside Apartments Powell Hall Rapp Research/APL Scene Dock School of Accounting Science Hall (North and South) Seaver Science Building Seaver Science Library Seeley G. Mudd Stabler Hall Stauffer Hall of Science Stauffer Lecture Hall Stonier Hall Student Union Student Admin. Services Telephone Vault/Olin Hall Tennis Stadium Topping Student Center Town and Gown Vivian Hall of Engineering Watt Hall Webb Tower YWCA Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Nov 19 14:28:02 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jAJMS21Z007338 for ; Sat, 19 Nov 2005 14:28:02 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAJMNksu019060 for ; Sat, 19 Nov 2005 14:23:46 -0800 Message-Id: <200511192223.jAJMNksu019060@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: final project part (2) extension! Date: Sat, 19 Nov 2005 14:23:46 -0800 From: william@bourbon.usc.edu I was going to see if it was my mistake regarding the bit-vector. And if it were, I will extend the deadline by one day. Then I got the message below regarding an emergency power outage for tomorrow (Sunday 11/20) from 2am to 10pm. I'm not sure if nunki and aludra will be down during this time. But looks like the USC network will be down. So, this is what I'm going to do. The deadline for final project part (2) will be extended by two days to Wed 11/23/2005 at 11:45pm. There will be no additional extension if the power outage will last till Monday. (If it lasts till Tuesday, we will most likely have another extension). Most likely, USC network will be down. This means that you will not be able to access the web server and I will not be able to reach my e-mail. It would probably be a good idea if you make a copy of the project spec, especially if you have a home machine to continue to work on your project. -- Bill Cheng // bill.cheng@usc.edu -----Forwarded Message----- Date: Sat, 19 Nov 2005 12:53:35 -0800 From: CS Sys Admin To: CS System Administrator Subject: Alert: Power/Network Outage on Sunday 20 NOV Hi All, Please take note of the below message from ISD. There will be Power and/or Network outage on Sunday, November 20th, 2:00 a.m. until 10:00 p.m on most buildings in University Park Campus. The emergency Power shutdown is because of the electric work on the Biegler vault. SAL, PHE, HNB, ACB, OHE are included on the list for confirmed power and network outage. RTH may not have power outage but network outage is confirmed because the rest of the network switches will be down. Detailed list is given in below emails. Please shutdown computers/equipment (or take appropriate precautionary measures). http://www.usc.edu/isd/it/alerts/upc_power_outage_november_20th.html Regards, Vishal Thakkar IT and Web Consultant Computer Science Department, USC ---------- Forwarded message ---------- Date: Nov 19, 2005 10:47 AM Subject: Fwd: Power Outage Sunday, please forward ISD has learned from FMS this morning that this outage will be extended until 10:00 p.m. Sunday night. ---------- Forwarded message ---------- Date: Nov 18, 2005 11:25 PM Subject: Power Outage Sunday, please forward ISD has learned of an emergency power outage scheduled for the University Park campus this weekend. Facilities Management Services has informed us that the outage will take place on Sunday, November 20th, 2:00 a.m. until 6:00 p.m., and will affect all buildings fed by the Biegler Vault (see complete list below). Buildings fed by this vault will be without power and network service for the duration of the outage. In addition, because Bridge Hall and Powell Hall house network switches that support adjacent buildings, network service likely will be unavailable in those adjacent buildings as well, even though the power there will remain on. Should you encounter any difficulty re-establishing network connectivity once the power has been restored, please call ISDÂ’s Customer Support Center at x05555. We apologize in advance to members of the University community for any inconvenience that may result from this power outage. Buildings Served by Biegler Vault: Administration Ahmanson - East/West Alan Hancock Annex Building II Biegler Hall of Eng. Birnkrant (N. Complex) Bookstore Bridge Hall Center for Electron Microscopy Childs Way I and II College University (N. Complex) Commons Davidson Conf. Dedeaux Field Denny Research Dental School Doheny Library Drama Center Electrical Engineering Bldg. EVK (N. Complex) Faculty Center Financial Services Gerontology Grace Ford Sal. Harris Hall of Architecture Harris Hall of Residence (N. Complex) Hedco Neurosciences Hedco/PCE Henry Salvatori Hoffman Hall/GSBA Human Relations Center Law Center Lewis Hall 120/208 Loker Hydrocarbon '95 Add.. Loker Hydrocarbon Original Mudd Hall of Philosophy Norris Cinema Theater North Complex Olin Hall of Engineering Organic Chemistry Wing Parking Structure "A" Parkside Apartments Powell Hall Rapp Research/APL Scene Dock School of Accounting Science Hall (North and South) Seaver Science Building Seaver Science Library Seeley G. Mudd Stabler Hall Stauffer Hall of Science Stauffer Lecture Hall Stonier Hall Student Union Student Admin. Services Telephone Vault/Olin Hall Tennis Stadium Topping Student Center Town and Gown Vivian Hall of Engineering Watt Hall Webb Tower YWCA Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Nov 19 14:10:57 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jAJMAvjO006886 for ; Sat, 19 Nov 2005 14:10:57 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAJM6f5b019007 for ; Sat, 19 Nov 2005 14:06:41 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jAJM6f4i019006 for cs551@merlot.usc.edu; Sat, 19 Nov 2005 14:06:41 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAJM6fHT019003 for ; Sat, 19 Nov 2005 14:06:41 -0800 Message-Id: <200511192206.jAJM6fHT019003@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: grading guidline Date: Sat, 19 Nov 2005 14:06:41 -0800 From: william@bourbon.usc.edu Someone wrote: > In the following test case - > (B) Mix of nodes : +25 points > ---------------------------------------------------------------------------- > > (1) Network with 2 beacon nodes and 4 non-beacon nodes : +25 points > autoshutdown=600 sec, keepalive timeout=10 sec, msglifetime=15 > sec, CacheSize=5, PermSize=25 > > (a) CacheProb=1, StoreProb=1, NeighborStoreProb=1 > (+15 points) > topology: /------ n08 > | | > v v > n00* <--> n01* > ^^ ^ > || | > |\------ n04 <----\ > | ^ | > | | | > \------- n03 <-- n02 > > in one window, do: > ./sv_node n00.ini > (wait till all other nodes get started) > > in 2nd window, do: > ./sv_node n01.ini > (wait till all other nodes get started) > > in 3rd window, do: > ./sv_node n04.ini > (wait till all other nodes get started) > > in 4th window, do: > ./sv_node n03.ini > (wait till all other nodes get started) > > in 5th window, do: > ./sv_node n02.ini > (wait till all other nodes get started) > > in 6th window, do: > ./sv_node n08.ini > (wait till all other nodes get started) > > *wait* for all nodes to autoshutdown > > (+2 points) > in 1st window (node *00), type: > "status neighbors 5 00.out", look at "00.out", > and make sure the network looks corrct. > > *restart the net in the same order in windows 1 through 6* > > in 5th window (node *02), type: > store blondie1.mp3 2 title="Heart of Glass" > > in 5th window (node *02), type: > "status files 5 04.out", look at "04.out", > (+1 points) > every node except node *08 should have this > file, node *08 should have no files > > Why have you said that node 08 shud have no files when the .ini file of all > the nodes is identical. They all have storeprob and cacheprob = 1 > > And I am getting the files in all nodes (even node 08). The "store" command above is done at node *02 and a TTL of 2 was used. Given the network topology above, the "store" message should not reached node *08. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Nov 19 14:07:00 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jAJM70mB006779 for ; Sat, 19 Nov 2005 14:07:00 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAJM2iKY018966 for ; Sat, 19 Nov 2005 14:02:44 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jAJM2iv1018965 for cs551@merlot.usc.edu; Sat, 19 Nov 2005 14:02:44 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAJM2iia018962 for ; Sat, 19 Nov 2005 14:02:44 -0800 Message-Id: <200511192202.jAJM2iia018962@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: grading guidlines Date: Sat, 19 Nov 2005 14:02:44 -0800 From: william@bourbon.usc.edu Someone wrote: > I am also getting the same bit-vector as mentioned in the email below. Here > is what I get: > > Keywords=categories audio mp3 artist blondie > Bit-vector= > 010000000000000000020000000000000000000000000000 > 000000000000000000200000000000000000000000000000 > 000000000004800000000000000000000000000000000000 > 000000000000000000000008800000000000000040008000 > 000000000000000000000010000000000000000000000000 > 0000000000000000 > > In the grading guidelines the list of keywords in the meta file reads: > Keywords=categories audio mp3 artist Blondie > > The 'B' in blondie should be lowercase. Perhaps thats the reason for a > different bit-vector. I checked and that wasn't the reason. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Saturday, November 19, 2005 9:52 AM Subject: Re: grading guidlines > Someone wrote: > > > I'm another one that got different bitvector on > > Keywords=categories audio mp3 artist Blondie. > > I don't know why this particular set of keywords I got the answer > > different from grading guideline, although my program generated right > > answers on all other examples. > > > > This is my bitvector that I got for 'Keywords=categories audio mp3 > > artist Blondie'. > > 010000000000000000020000000000000000000000000000 > > 000000000000000000200000000000000000000000000000 > > 000000000004800000000000000000000000000000000000 > > 000000000000000000000008800000000000000040008000 > > 000000000000000000000010000000000000000000000000 > > 0000000000000000 > > > > Could Professor check the bitvector of these keywords in grading > > guideline again? > > Hmm... I checked again and it seemed that what's in the > grading guideline was wrong! I have *not* modified the > grading guidelines yet. If anyone get the same value as the > previous grading guidelines, please let me know ASAP! > > I won't get a chance to check e-mail until later this > afternoon. If by 6pm I do not get an e-mail saying that the > previous grading guidelines was correct, then I will make the > change. Thanks! > -- > Bill Cheng // bill.cheng@usc.edu > > > > > -----Original Message----- > From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] > Sent: Thursday, November 17, 2005 12:15 PM > To: cs551@bourbon.usc.edu > Subject: Re: grading guidlines > > Someone wrote: > > > For the very first test case where we are storing the following - > > > > store blondie1.mp3 1 categories="audio mp3" artist="Blondie" > > > > my bitvector is turing on wrong bits for the keyword artist, though > it is > > computing the sha1 and md5 on the word "artist". Could there be a > reason? > > The spec says that you must convert a keyword to all lowercase > before computing the bit-vector. Imagine that if you don't > and others do, then searching will be a problem. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Nov 19 09:56:28 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jAJHuSB6001070 for ; Sat, 19 Nov 2005 09:56:28 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAJHqDY0018197 for ; Sat, 19 Nov 2005 09:52:13 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jAJHqDZn018196 for cs551@merlot.usc.edu; Sat, 19 Nov 2005 09:52:13 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAJHqDGF018193 for ; Sat, 19 Nov 2005 09:52:13 -0800 Message-Id: <200511191752.jAJHqDGF018193@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: grading guidlines Date: Sat, 19 Nov 2005 09:52:13 -0800 From: william@bourbon.usc.edu Someone wrote: > I'm another one that got different bitvector on > Keywords=categories audio mp3 artist Blondie. > I don't know why this particular set of keywords I got the answer > different from grading guideline, although my program generated right > answers on all other examples. > > This is my bitvector that I got for 'Keywords=categories audio mp3 > artist Blondie'. > 010000000000000000020000000000000000000000000000 > 000000000000000000200000000000000000000000000000 > 000000000004800000000000000000000000000000000000 > 000000000000000000000008800000000000000040008000 > 000000000000000000000010000000000000000000000000 > 0000000000000000 > > Could Professor check the bitvector of these keywords in grading > guideline again? Hmm... I checked again and it seemed that what's in the grading guideline was wrong! I have *not* modified the grading guidelines yet. If anyone get the same value as the previous grading guidelines, please let me know ASAP! I won't get a chance to check e-mail until later this afternoon. If by 6pm I do not get an e-mail saying that the previous grading guidelines was correct, then I will make the change. Thanks! -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] Sent: Thursday, November 17, 2005 12:15 PM To: cs551@bourbon.usc.edu Subject: Re: grading guidlines Someone wrote: > For the very first test case where we are storing the following - > > store blondie1.mp3 1 categories="audio mp3" artist="Blondie" > > my bitvector is turing on wrong bits for the keyword artist, though it is > computing the sha1 and md5 on the word "artist". Could there be a reason? The spec says that you must convert a keyword to all lowercase before computing the bit-vector. Imagine that if you don't and others do, then searching will be a problem. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Nov 18 21:38:27 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jAJ5cR3f016113 for ; Fri, 18 Nov 2005 21:38:27 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAJ5YE1k016399 for ; Fri, 18 Nov 2005 21:34:14 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jAJ5YD1U016398 for cs551@merlot.usc.edu; Fri, 18 Nov 2005 21:34:13 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAJ5YDgH016395 for ; Fri, 18 Nov 2005 21:34:13 -0800 Message-Id: <200511190534.jAJ5YDgH016395@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: cachesize = 0, permsize = 0 Date: Fri, 18 Nov 2005 21:34:13 -0800 From: william@bourbon.usc.edu Someone wrote: > When cache size and permsize both are zero - > > 1. if I search for a file and a remote node replies. > 2. I do a get (ex get 1) > 3. now I get this file - but I am not supposed to store it as my > permsize = 0, right? > 4. so I can only do a get 1 'filename' and store this file in the given > filename. Right? If I'm not misunderstanding what you are saying, it would be correct. > Please tell me if this is wrong, cuz the grading guidelines wants me us to > store the file as a reply of get evn if permsize is zero. I'm not sure exactly what you meant by "store" here. When you do a get, a copy of the file should be "stored" in the current working directory. This should be done independent of PermSize. I think you are asking, in addition, if PermSize is zero (or your perm space is used up), should a copy of the file goes into the mini filesystem. In this case, the answer is no. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Nov 18 12:21:02 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jAIKL2lr003372 for ; Fri, 18 Nov 2005 12:21:02 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAIKGoc2014414 for ; Fri, 18 Nov 2005 12:16:50 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jAIKGosq014413 for cs551@merlot; Fri, 18 Nov 2005 12:16:50 -0800 Date: Fri, 18 Nov 2005 12:16:50 -0800 From: william@bourbon.usc.edu Message-Id: <200511182016.jAIKGosq014413@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: cancelling office hour next Monday (11/21)... Hi, I apologize that I have to cancel office hour next Monday. I've a doctor's appointment that cannot be changed. If you have questions regarding the final project, please send me e-mails. I apologize about the inconvenience. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Nov 17 23:28:00 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jAI7S0bm017579 for ; Thu, 17 Nov 2005 23:28:00 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAI7Noex012039 for ; Thu, 17 Nov 2005 23:23:50 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jAI7NoKI012038 for cs551@merlot.usc.edu; Thu, 17 Nov 2005 23:23:50 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAI7NoKV012035 for ; Thu, 17 Nov 2005 23:23:50 -0800 Message-Id: <200511180723.jAI7NoKV012035@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: status file format Date: Thu, 17 Nov 2005 23:23:50 -0800 From: william@bourbon.usc.edu Someone wrote: > regarding the number of files : > > there is no means to tell the number of files till the end of > message. Since the data is read sequentially from the socket, > (with a upper limit on the buffer size), this would require that > we write the data into a temporary file (consider a situation > where one node has lotsa/huge metafiles stored), count the number > of files and then report it and proceed to print the temporary > file into the required status_file. > > is it ok to store the temporary file? Yes. I don't recall having any restriction on using temporary files in general for this project. > PS:another option is to tweak the status_reponse to include the > number of records. That would be too much change in the spec! Well, given what you said, I think it's a bit unnecessarily complex. Therefore, I'm removing the restriction on the number of files. You can either output the number of files in the output as in the following example: nunki.usc.edu:12345 has 2 files or you can output it without the number of files as in the following example (please choose the appropriate one): nunki.usc.edu:12345 has no file nunki.usc.edu:12345 has the following file nunki.usc.edu:12345 has the following files You should be able to decide which one of the 3 to output without using a temporary file. I've updated the spec. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Tuesday, November 15, 2005 11:44 am Subject: Re: status file format To: cs551@bourbon.usc.edu > Someone wrote: > > > What is the expected format of the status output file in case > of > > "Status file" Command? > > You need to have the hostname and hostport of the reporting > host and the files that it has (full metadata). For example, > you can have (please replace the "..." with the correct > information in the status response message): > > nunki.usc.edu:12345 has with 2 files > > [metadata] > FileName=blondie1.mp3 > FileSize=1874 > SHA1=8ae005585be9c44ef1910d25dd6f8da58c432ab5 > Nonce=... > Keywords=categories audio mp3 artist Blondie > Bit-vector=... > > [metadata] > FileName=usctommy.gif > FileSize=1689 > SHA1=11cddf2a0378d6a892cf43198847ce379e85d149 > Nonce=... > Keywords=usc tommy trojan gif > Bit-vector=... > > I will soon update the spec with this information. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Nov 17 12:19:30 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jAHKJUdR002240 for ; Thu, 17 Nov 2005 12:19:30 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAHKFLWg008400 for ; Thu, 17 Nov 2005 12:15:21 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jAHKFLXA008399 for cs551@merlot.usc.edu; Thu, 17 Nov 2005 12:15:21 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAHKFL1D008396 for ; Thu, 17 Nov 2005 12:15:21 -0800 Message-Id: <200511172015.jAHKFL1D008396@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: grading guidlines Date: Thu, 17 Nov 2005 12:15:21 -0800 From: william@bourbon.usc.edu Someone wrote: > For the very first test case where we are storing the following - > > store blondie1.mp3 1 categories="audio mp3" artist="Blondie" > > my bitvector is turing on wrong bits for the keyword artist, though it is > computing the sha1 and md5 on the word "artist". Could there be a reason? The spec says that you must convert a keyword to all lowercase before computing the bit-vector. Imagine that if you don't and others do, then searching will be a problem. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Nov 17 12:17:05 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jAHKH5Xp002180 for ; Thu, 17 Nov 2005 12:17:05 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAHKCupW008358 for ; Thu, 17 Nov 2005 12:12:56 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jAHKCujC008357 for cs551@merlot.usc.edu; Thu, 17 Nov 2005 12:12:56 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAHKCux2008354 for ; Thu, 17 Nov 2005 12:12:56 -0800 Message-Id: <200511172012.jAHKCux2008354@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: " " marks in keywords Date: Thu, 17 Nov 2005 12:12:56 -0800 From: william@bourbon.usc.edu Someone wrote: > In the three beacons network, there is a test case as follows > search keywords=glass of heart title > should get 3 responses > > the above keywords should be inside double quote according the following > spec > > search keywords="key1 key2 key3" > > There should be no blank characters around the equal sign. The double > quotation marks are mandatory unless there is only one keyword. Thanks for catching it! There is another one like it. I've fixed the grading guidelines. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Nov 17 12:11:37 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jAHKBaeI001986 for ; Thu, 17 Nov 2005 12:11:36 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAHK7S6P008253 for ; Thu, 17 Nov 2005 12:07:28 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jAHK7S49008252 for cs551@merlot.usc.edu; Thu, 17 Nov 2005 12:07:28 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAHK7Rkw008249 for ; Thu, 17 Nov 2005 12:07:27 -0800 Message-Id: <200511172007.jAHK7Rkw008249@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: delete msg Date: Thu, 17 Nov 2005 12:07:27 -0800 From: william@bourbon.usc.edu Someone wrote: > I could generate and verify the digital signature for a file > using > openssl smime -sign -in foo -out bar -nocerts -signer cert.pem > -inkey private.pem and > openssl smime -verify -noverify -in bar -out /dev/null -signer > cert.pem -certfile cert.pem > > While sending the delete msg, we should sign the filespec > digitally and send it. > I did not understand this part[signing the filespec digitally]. > User will input the filespec [filename, sha, nounce] in the cmd > line. > we will put it all together in the msg [separate by \r\n] and > send it. And you need to put it in the specified format: FileName=...\r\n SHA1=...\r\n Nonce=...\r\n > Before sending how should i sign the filespec digitally. > How should i use the above cmds[openssl ---] from the program? Please see: http://merlot.usc.edu/cs551-f05/projects/final.html#popen -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Nov 15 23:02:01 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jAG721N9006128 for ; Tue, 15 Nov 2005 23:02:01 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAG6vvnI022272 for ; Tue, 15 Nov 2005 22:57:57 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jAG6vvXO022271 for cs551@merlot.usc.edu; Tue, 15 Nov 2005 22:57:57 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAG6vvAX022268 for ; Tue, 15 Nov 2005 22:57:57 -0800 Message-Id: <200511160657.jAG6vvAX022268@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: difference between Cached and Permenant files Date: Tue, 15 Nov 2005 22:57:57 -0800 From: william@bourbon.usc.edu Someone wrote: > So then what is the difference between chached files and permanent files? > I don't understand why we have those two categories? Well, caching is to improve performance. Permanent files is more about "functionality" (may be this is not exactly the right word, but that's the best I can think of right now). How would the network behave if caching is turned off everywhere? Files will still get copied if someone does a "store" or a "get". So, if a file is popular, it would still get copied everywhere. Caching, in addition, can improve performance in this type of a p2p network. > Will I store the cached file in the Homedir/files dir too? With n.data > n.meta names? There is no specific one should do this. But I would probably store both cached files and permanent files in the $HomeDir/files directory and just keep a bit somewhere to indicate if a file is cached or permanent. For example, if you have a file called "n.extra" to keep additional information about "n.data" and "n.meta" and it's in the INI format, you can have: Cached=0 (or 1) in it. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] Sent: Wednesday, November 16, 2005 3:00 AM To: cs551@bourbon.usc.edu Subject: Re: difference between Cached and Permenant files Someone wrote: > What is the difference between cached and permanent files? The only difference is that a cached file is subject to LRU replacement. > If I get a search will I search in my cache too? Or just in permanent? If you only search permanent files, then what would be the point of caching? You should search all files. > Will I delete all my cache files when the node goes down? No. This is similar to the cached files in your browser. When you shutdown your browser, it does not delete all the cached files. For us, when you do -reset, all files disappaer. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Nov 15 22:04:13 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jAG64DHU004840 for ; Tue, 15 Nov 2005 22:04:13 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAG6094R022061 for ; Tue, 15 Nov 2005 22:00:09 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jAG609G2022060 for cs551@merlot.usc.edu; Tue, 15 Nov 2005 22:00:09 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAG609ZR022057 for ; Tue, 15 Nov 2005 22:00:09 -0800 Message-Id: <200511160600.jAG609ZR022057@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: difference between Cached and Permenant files Date: Tue, 15 Nov 2005 22:00:09 -0800 From: william@bourbon.usc.edu Someone wrote: > What is the difference between cached and permanent files? The only difference is that a cached file is subject to LRU replacement. > If I get a search will I search in my cache too? Or just in permanent? If you only search permanent files, then what would be the point of caching? You should search all files. > Will I delete all my cache files when the node goes down? No. This is similar to the cached files in your browser. When you shutdown your browser, it does not delete all the cached files. For us, when you do -reset, all files disappaer. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Nov 15 12:20:37 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jAFKKb0c023814 for ; Tue, 15 Nov 2005 12:20:37 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAFKGZfu020060 for ; Tue, 15 Nov 2005 12:16:35 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jAFKGZ4Z020059 for cs551@merlot.usc.edu; Tue, 15 Nov 2005 12:16:35 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAFKGZES020056 for ; Tue, 15 Nov 2005 12:16:35 -0800 Message-Id: <200511152016.jAFKGZES020056@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: status file format Date: Tue, 15 Nov 2005 12:16:35 -0800 From: william@bourbon.usc.edu Someone wrote: > Should it have FileID in Status output? I saw the follow line in grading > guidline. > > (a) CacheProb=0, StoreProb=1, NeighborStoreProb=1 > (+15 points) > > in one window, do: > ~csci551b/bin/resetf2 > /bin/rm n??.ini ??.out > cp ~csci551b/grading/guidelines/final2/b4/n??.ini . > cp ~csci551b/public/final2/*.gif . > cp ~csci551b/public/final2/*.jpg . > cp ~csci551b/public/final2/*.mp3 . > ./sv_node n00.ini > (wait till all other nodes get started) > > in 2nd window, do: > ./sv_node n01.ini > (wait till all other nodes get started) > > in 3rd window, do: > ./sv_node n02.ini > (wait till all other nodes get started) > > in 1st window, type: > store blondie1.mp3 1 title="Heart of Glass" > > in 2nd window, type: > "status files 1 01.out", look at "01.out", > every node should have this file, make sure the > << file ID >> are different, the metadata should > look like the following: > > It has mentioned to << File ID >> in the status files output. I'm glad you caught this! It's a bug in the grading guidelines! Since you only need a FileID when you send search responses, there should not be a FileID in a status response. I've just updated the grading guidelines. Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Nov 15 11:57:30 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jAFJvUs5023141 for ; Tue, 15 Nov 2005 11:57:30 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAFJrSim019820 for ; Tue, 15 Nov 2005 11:53:28 -0800 Message-Id: <200511151953.jAFJrSim019820@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: status file format Date: Tue, 15 Nov 2005 11:53:28 -0800 From: william@bourbon.usc.edu I've just udpated the spec. I've also removed the blank lines in the example. Please see: http://merlot.usc.edu/cs551-f05/projects/final.html#cmdline -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Tue, 15 Nov 2005 11:39:42 -0800 From: william@bourbon.usc.edu To: cs551@bourbon.usc.edu Subject: Re: status file format Someone wrote: > What is the expected format of the status output file in case of > "Status file" Command? You need to have the hostname and hostport of the reporting host and the files that it has (full metadata). For example, you can have (please replace the "..." with the correct information in the status response message): nunki.usc.edu:12345 has with 2 files [metadata] FileName=blondie1.mp3 FileSize=1874 SHA1=8ae005585be9c44ef1910d25dd6f8da58c432ab5 Nonce=... Keywords=categories audio mp3 artist Blondie Bit-vector=... [metadata] FileName=usctommy.gif FileSize=1689 SHA1=11cddf2a0378d6a892cf43198847ce379e85d149 Nonce=... Keywords=usc tommy trojan gif Bit-vector=... I will soon update the spec with this information. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Nov 15 11:43:44 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jAFJhilM022772 for ; Tue, 15 Nov 2005 11:43:44 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAFJdhcW019740 for ; Tue, 15 Nov 2005 11:39:43 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jAFJdhtx019739 for cs551@merlot.usc.edu; Tue, 15 Nov 2005 11:39:43 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAFJdgA4019736 for ; Tue, 15 Nov 2005 11:39:42 -0800 Message-Id: <200511151939.jAFJdgA4019736@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: status file format Date: Tue, 15 Nov 2005 11:39:42 -0800 From: william@bourbon.usc.edu Someone wrote: > What is the expected format of the status output file in case of > "Status file" Command? You need to have the hostname and hostport of the reporting host and the files that it has (full metadata). For example, you can have (please replace the "..." with the correct information in the status response message): nunki.usc.edu:12345 has with 2 files [metadata] FileName=blondie1.mp3 FileSize=1874 SHA1=8ae005585be9c44ef1910d25dd6f8da58c432ab5 Nonce=... Keywords=categories audio mp3 artist Blondie Bit-vector=... [metadata] FileName=usctommy.gif FileSize=1689 SHA1=11cddf2a0378d6a892cf43198847ce379e85d149 Nonce=... Keywords=usc tommy trojan gif Bit-vector=... I will soon update the spec with this information. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Nov 14 22:34:38 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jAF6YcPL028397 for ; Mon, 14 Nov 2005 22:34:38 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAF6UdK4016701 for ; Mon, 14 Nov 2005 22:30:39 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jAF6UdCw016700 for cs551@merlot.usc.edu; Mon, 14 Nov 2005 22:30:39 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAF6Uc0Q016697 for ; Mon, 14 Nov 2005 22:30:38 -0800 Message-Id: <200511150630.jAF6Uc0Q016697@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Store Keywords Date: Mon, 14 Nov 2005 22:30:38 -0800 From: william@bourbon.usc.edu Someone wrote: > For a keyvalue pair like -- categories="audio mp3" -- should we > consider 'audio' and 'mp3' as seperate keywords or we should > consider 'audio mp3' as one keyword. There are 3 keywords here: "categories", "audio", and "mp3". -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Nov 12 20:57:42 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jAD4vgZ6001291 for ; Sat, 12 Nov 2005 20:57:42 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAD4roei018382 for ; Sat, 12 Nov 2005 20:53:50 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jAD4roVU018381 for cs551@merlot.usc.edu; Sat, 12 Nov 2005 20:53:50 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAD4rosh018378 for ; Sat, 12 Nov 2005 20:53:50 -0800 Message-Id: <200511130453.jAD4rosh018378@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CHECK messages... Date: Sat, 12 Nov 2005 20:53:50 -0800 From: william@bourbon.usc.edu Someone wrote: > referring to the line in grading guidelines (towards the end) > > "Any CHECK messages in a log file : -2 points" > > consider the possibility > > 1. 3 nodes, A<-->B<-->C > 2. Node A shutsdown.... (sends notify) > 3. I am slow in typing shutdown on node B, > a) node B receives notify from A > > option 1. > Behave normally, send a CHECK to node C > > option 2. > NOT implement (remove from code) CHECK messaging > > option 3. > Just ignore the CHECK messages got, that is, don't log/flood them > > which one of options 1/2/3 do we choose? > > it really wont matter as far as the system operation goes, since > node B would probably shutdown (user typed) soon after sending > the CHECK message (my implementation will shutdown after pending > writes on the port, to maintain sane reads on the client). So, given the above choices, I would say (2). But, for part (2) of the final project, NoCheck in all startup configuration file is set to 1. So I wouldn't say "not implement check", but would say "implement check" according the value of NoCheck in a startup configuration file. This should be really easy to implement, especially if you have check implemented already. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Nov 10 11:45:30 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jAAJjUeH017312 for ; Thu, 10 Nov 2005 11:45:30 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAAJfiuA011797 for ; Thu, 10 Nov 2005 11:41:44 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jAAJfiBQ011795 for cs551@merlot.usc.edu; Thu, 10 Nov 2005 11:41:44 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAAJfigM011792 for ; Thu, 10 Nov 2005 11:41:44 -0800 Message-Id: <200511101941.jAAJfigM011792@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: FileID Date: Thu, 10 Nov 2005 11:41:44 -0800 From: william@bourbon.usc.edu Someone wrote: > So when I get a "get" message - I should chek if I have that FileID - else I > shud pass it on? You should always pass it on, based on TTL. > But isn't this very inefficient - that every node checks for the FileID Yes! Do you have a suggestion (and preserves anonymity)? -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] Sent: Thursday, November 10, 2005 12:35 PM To: cs551@bourbon.usc.edu Subject: Re: FileID Someone wrote: > I understand that I can use GetUOID to generate the FileID, but the get > message is going to come to me with this FileID - so when I send a search > reply shoud I keep a list mapping FileID's to my files inode number - cuz if > I try to generate this FileID again I am going to get a different number. You definitely should have an in-memory index so that you can search efficiently. This would be true if you only generate a temporary FileID (in-memory) when you get a hit or if you generate a permanent FileID (has an image on disk) when a file is created. Again, which approach you take is up to you, but there are different efficiency implications if you decide to go one way or another. > How long shud this mapping list live? Wht happens if I get search req from > multiple neighbors? How will I identify one mapping list form the other. If you take the in-memory only FileID approach, I would say that you need to keep this in memory until your node dies. The reason is that there is no time limit set between the time a search response is received and the time subsequent get requests are issued. If someone issues a get request after your node reboots, it is okay not to respond. If you take the on-disk FileID approach, you will need to build an in-memory cache of FileID's whenever your node reboots. So, you need to create an on-disk FileID index file, similar to the SHA1 index file. I'm not sure what you meant when you ask about multiple neighbors. For a file, say "3.data", if you take the in-memory only FileID approach, you can have multiple FileID's for this file! If you take the on-disk FileID approach, then each file should only have one unique FileID. The in-memory index should be keyed on FileID (just like SHA1) and a node in the index data structure can just store the value "3" to respond to a get request. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] Sent: Thursday, November 10, 2005 4:36 AM To: cs551@bourbon.usc.edu Subject: Re: FileID Someone wrote: > I did not understand how is the FileID generated. When I am sending the file > across I shud generate a FileID for every file. But how? You can just use GetUOID(). It's *like* another nonce (but different from the nonce in a file metadata). Please read the description about Nonce & FileID carefully. You don't need to generate a FileID for every file. When you get a hit for a search command, it's only at that time you need to genearte a FileID for a file that got a hit. Of course, you could generate a FileID for every file if you want. This is entirely up to you. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Nov 10 07:38:36 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jAAFcaKL011736 for ; Thu, 10 Nov 2005 07:38:36 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAAFYphc010894 for ; Thu, 10 Nov 2005 07:34:51 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jAAFYpUx010893 for cs551@merlot.usc.edu; Thu, 10 Nov 2005 07:34:51 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAAFYoEU010890 for ; Thu, 10 Nov 2005 07:34:50 -0800 Message-Id: <200511101534.jAAFYoEU010890@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: FileID Date: Thu, 10 Nov 2005 07:34:50 -0800 From: william@bourbon.usc.edu Someone wrote: > I understand that I can use GetUOID to generate the FileID, but the get > message is going to come to me with this FileID - so when I send a search > reply shoud I keep a list mapping FileID's to my files inode number - cuz if > I try to generate this FileID again I am going to get a different number. You definitely should have an in-memory index so that you can search efficiently. This would be true if you only generate a temporary FileID (in-memory) when you get a hit or if you generate a permanent FileID (has an image on disk) when a file is created. Again, which approach you take is up to you, but there are different efficiency implications if you decide to go one way or another. > How long shud this mapping list live? Wht happens if I get search req from > multiple neighbors? How will I identify one mapping list form the other. If you take the in-memory only FileID approach, I would say that you need to keep this in memory until your node dies. The reason is that there is no time limit set between the time a search response is received and the time subsequent get requests are issued. If someone issues a get request after your node reboots, it is okay not to respond. If you take the on-disk FileID approach, you will need to build an in-memory cache of FileID's whenever your node reboots. So, you need to create an on-disk FileID index file, similar to the SHA1 index file. I'm not sure what you meant when you ask about multiple neighbors. For a file, say "3.data", if you take the in-memory only FileID approach, you can have multiple FileID's for this file! If you take the on-disk FileID approach, then each file should only have one unique FileID. The in-memory index should be keyed on FileID (just like SHA1) and a node in the index data structure can just store the value "3" to respond to a get request. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] Sent: Thursday, November 10, 2005 4:36 AM To: cs551@bourbon.usc.edu Subject: Re: FileID Someone wrote: > I did not understand how is the FileID generated. When I am sending the file > across I shud generate a FileID for every file. But how? You can just use GetUOID(). It's *like* another nonce (but different from the nonce in a file metadata). Please read the description about Nonce & FileID carefully. You don't need to generate a FileID for every file. When you get a hit for a search command, it's only at that time you need to genearte a FileID for a file that got a hit. Of course, you could generate a FileID for every file if you want. This is entirely up to you. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Nov 9 23:39:57 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jAA7dvZi032422 for ; Wed, 9 Nov 2005 23:39:57 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAA7aDHd009329 for ; Wed, 9 Nov 2005 23:36:13 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jAA7aDA8009328 for cs551@merlot.usc.edu; Wed, 9 Nov 2005 23:36:13 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAA7aCRL009325 for ; Wed, 9 Nov 2005 23:36:13 -0800 Message-Id: <200511100736.jAA7aCRL009325@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: FileID Date: Wed, 09 Nov 2005 23:36:12 -0800 From: william@bourbon.usc.edu Someone wrote: > I did not understand how is the FileID generated. When I am sending the file > across I shud generate a FileID for every file. But how? You can just use GetUOID(). It's *like* another nonce (but different from the nonce in a file metadata). Please read the description about Nonce & FileID carefully. You don't need to generate a FileID for every file. When you get a hit for a search command, it's only at that time you need to genearte a FileID for a file that got a hit. Of course, you could generate a FileID for every file if you want. This is entirely up to you. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Nov 9 23:03:58 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jAA73wvT031512 for ; Wed, 9 Nov 2005 23:03:58 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAA70EaK009228 for ; Wed, 9 Nov 2005 23:00:14 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jAA70EM1009227 for cs551@merlot.usc.edu; Wed, 9 Nov 2005 23:00:14 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jAA70E1I009224 for ; Wed, 9 Nov 2005 23:00:14 -0800 Message-Id: <200511100700.jAA70E1I009224@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: final project Date: Wed, 09 Nov 2005 23:00:14 -0800 From: william@bourbon.usc.edu Someone wrote: > As one of previous message suggested that not all the things of > part 1 needs to be done for part 2. Is there anything I could > skip from part 1 and I would be fine with part 2. I am asking > this as I was only able to make part 1 work for beacon only > network, and I have only enough time that I could do the same for > part 2. Although Join and Check do not have to work, for a regular node, you must handle a manually created init_neighbor_list file correctly. Please also read my messages with timestamps "Mon 31 Oct 13:14" and "Wed 02 Nov 17:00". The grading guidelines for part (2) have been posted for a week now. Please take a look when you have some time. The TA has mentioned to me that some students' part (1) cannot work with any of the startup configuration files specified in the part (1) grading guidelines. I really don't understand why these students do not test their code against the startup configuration files specified in the part (1) grading guidelines. I think I've made it very clear that the TA will use the grading guidelines to grade! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 9 12:43:47 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jA9Khk7X016656 for ; Wed, 9 Nov 2005 12:43:47 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jA9Ke4Yi006626 for ; Wed, 9 Nov 2005 12:40:04 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jA9Ke48V006625 for cs551@merlot; Wed, 9 Nov 2005 12:40:04 -0800 Date: Wed, 9 Nov 2005 12:40:04 -0800 From: william@bourbon.usc.edu Message-Id: <200511092040.jA9Ke48V006625@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: correct to today's lecture... Hi, I just realized that I've made a mistake in today's lecture. I was talking about the fact that ACK compression can cause problem for bottleneck bandwidth estimation on the ACK path. I made the comment that in the forward path, *data* timing compression cannot cause a similar problem. That is incorrect. (I must have been thinking about something else.) The good news is that data timing compression does not happen very often. But one still needs to examine the measurements very carefully to throw out bad measurements when data timing compression do occur. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Nov 7 08:03:21 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jA7G3LHC018185 for ; Mon, 7 Nov 2005 08:03:21 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jA7FxkJF030022 for ; Mon, 7 Nov 2005 07:59:46 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jA7FxklM030021 for cs551@merlot.usc.edu; Mon, 7 Nov 2005 07:59:46 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jA7FxkGv030018 for ; Mon, 7 Nov 2005 07:59:46 -0800 Message-Id: <200511071559.jA7FxkGv030018@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Regarding first part final project Date: Mon, 07 Nov 2005 07:59:46 -0800 From: william@bourbon.usc.edu Someone wrote: > I just found out a big flaw in my first > part submission of final project. Can I allow to make changes > into the first part.. > Actually, I have created a linklist and at one point I for got to > move the pointer to next that's why it goes to infinite loop > while I send status message into more than 2 mesh. The modification deadline was 24 hours after the submission deadline and it costs 3 points per line during the modification period. There was no provision made to make changes after the modification deadline. Please remember that one major reason points are taken off for projects is for not testing your program well enough. So, even if a bug is minor, you can lose many points. Also, please keep in mind that given infinite amount of time, everyone can get their project to work right. Therefore, doing things on time is important when it comes to grading. Also, grading of these projects is very time consuming. Asking the TA to do regrades after regrades is not fair to him, so there must be a deadline for regrade requests. You can show your changes to the TA and may be he can give you a few points back. But he cannot do a regrade base on changes after the modification deadline. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Nov 4 22:09:22 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jA569LLO002735 for ; Fri, 4 Nov 2005 22:09:22 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jA565t65029884 for ; Fri, 4 Nov 2005 22:05:55 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jA565toS029883 for cs551@merlot.usc.edu; Fri, 4 Nov 2005 22:05:55 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jA565tiw029880 for ; Fri, 4 Nov 2005 22:05:55 -0800 Message-Id: <200511050605.jA565tiw029880@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: filename in store msg Date: Fri, 04 Nov 2005 22:05:55 -0800 From: william@bourbon.usc.edu Someone wrote: > Store msg is flooded to neighbors according to the > "neighborStoreProb". > what should we do, if the neighbour node already has a file with > the the same filename that is specified in the metadata of the > store message. > > Shall i overwrite it or ignore the store msg. In the first paragraph of: http://merlot.usc.edu/cs551-f05/projects/final.html#nonce the spec says: we consider that file Y is a copy of file X if X and Y have identical FileName, SHA1, and Nonce So, if only the FileName is the same, then you must store the file. (Even if the FileName and SHA1 are the same but the Nonce is different, you must also store the file.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Nov 4 14:39:53 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jA4MdrbO024591 for ; Fri, 4 Nov 2005 14:39:53 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jA4MaSjx025431 for ; Fri, 4 Nov 2005 14:36:28 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jA4MaSTr025430 for cs551@merlot.usc.edu; Fri, 4 Nov 2005 14:36:28 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jA4MaSJi025427 for ; Fri, 4 Nov 2005 14:36:28 -0800 Message-Id: <200511042236.jA4MaSJi025427@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: store probability Date: Fri, 04 Nov 2005 14:36:28 -0800 From: william@bourbon.usc.edu Someone wrote: > I did not understand how to use the "StoreProb". > Upon recieving a store message, should we store it only if > the StoreProb >= 0.5 > > i did not understand how exactly should i treat StoreProb Well, let's say that StoreProb=0.1. This means that you should store every 1 out of 10 times. If you use drand48(), it will return you a value between 0 and 1.0, uniformly distributed. So, if you want to store 10% of the time, you can say that if drand48() returns anything <= 0.1 (which is the value of StoreProb above), you will store. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Nov 3 16:39:48 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jA40dmNj026226 for ; Thu, 3 Nov 2005 16:39:48 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jA40aQ6G020731 for ; Thu, 3 Nov 2005 16:36:26 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jA40aQZj020730 for cs551@merlot.usc.edu; Thu, 3 Nov 2005 16:36:26 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jA40aQiM020727 for ; Thu, 3 Nov 2005 16:36:26 -0800 Message-Id: <200511040036.jA40aQiM020727@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: bitvector Date: Thu, 03 Nov 2005 16:36:26 -0800 From: william@bourbon.usc.edu Someone wrote: > we have the following file meta data example in the spec: > [metadata] > FileName=blondie1.mp3 > FileSize=4885526 > SHA1=730764e28a5b66e3f95ceadc976c038d389bd89e > Nonce=b56dba4b2ec8f224de8fc45d6041cdb9f2db9d69 > Keywords=categories audio mp3 artist Blondie \ > title Heart of Glass \ > url http://www.blondie.net/ \ > additional_keywords debra harry > Bit-vector= \ > 110000100000000420020000000000000000000000000000 \ > 100000000000000000200000000000000000010000010004 \ > 000000000004800000000800000000000000000000000000 \ > 000000000000000000100008800000000000000040048400 \ > 000002100000000000000810000000000000200002000200 \ > 0000000000000000 > > > 1) I tried to calculate the metadata value for the keywords given above. > My answer matched with the above given bit vector, when i changed all > capital letters in the keywords into lower case. is this right.. > [example "Heart" -> "heart" ] Yes. That's what the spec says in: http://merlot.usc.edu/cs551-f05/projects/final.html#bitvec > 2) for Nounce, to generate a 20byte random number, iam using RAND_bytes( ) > function of "openssl/rand.h". is this correct? You can just use GetUIOD(). -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 2 17:03:52 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jA313qjC024833 for ; Wed, 2 Nov 2005 17:03:52 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jA310Ygt015713 for ; Wed, 2 Nov 2005 17:00:34 -0800 Message-Id: <200511030100.jA310Ygt015713@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: final project part (2) grading guidelines is available... Date: Wed, 02 Nov 2005 17:00:34 -0800 From: william@bourbon.usc.edu Hi, I've just made the grading guidelines for final project part (2) available on the project spec (near the bottom). The grading guidelines is fairly long (almost 900 lines). It's probably not a good idea to read through it. Once your code is in a reasonable shape, you should just cut and paste from this file and see if things are what you expect. If you don't use csh/tcsh, you can simply do "tcsh" before you cut and paste. I've also added additional notes at the bottom of part (2) testdata page. There are some scripts that have been created to help you covert the test data files to use your own ports. The scripts is not bulletproof. So, please follow the instructions carefully and make sure you are in the *correct directory*! If you are in the wrong directory, press c right away! (The script does "rm -rf final2". So, please make sure you don't have a directory named final2 or your current working directory is not just above where all your code is.) It's probably a good idea to make a backup of your work before you run these scripts. By the way, part (2) still assumes that you have "status neighbors" implemented correctly. If it's not working, you need to get it to work! If you have questions, please let me know. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Nov 2 13:55:07 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jA2Lt7YL019698 for ; Wed, 2 Nov 2005 13:55:07 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jA2Lpoac014278 for ; Wed, 2 Nov 2005 13:51:50 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jA2LpnNk014277 for cs551@merlot.usc.edu; Wed, 2 Nov 2005 13:51:50 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jA2Lpndl014274 for ; Wed, 2 Nov 2005 13:51:49 -0800 Message-Id: <200511022151.jA2Lpndl014274@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Calculating SHA1 Date: Wed, 02 Nov 2005 13:51:49 -0800 From: william@bourbon.usc.edu I just noticed that the link was provided in the spec. May be I misunderstood the question. You should do what you did in warmup #1 but with SHA1 and verify what you calculated with the output of running "openssl" from the commandline. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Wed, 02 Nov 2005 13:46:39 -0800 From: william@bourbon.usc.edu To: cs551@bourbon.usc.edu Subject: Re: Calculating SHA1 Someone wrote: > This might be a silly doubt, but I was wondering how should we calculate > SHA1 for the file? By reading blocks of data and computing SHA1 on them l ike > we did to compute MD5 in warmup1. or is there another way? I forgot to provide a link to: http://www.openssl.org/docs/crypto/sha.html It's very similar to MD5 in terms of calling convention. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Nov 2 13:49:57 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jA2Lnv5L019503 for ; Wed, 2 Nov 2005 13:49:57 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jA2Lkdnl014244 for ; Wed, 2 Nov 2005 13:46:39 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jA2LkdPG014243 for cs551@merlot.usc.edu; Wed, 2 Nov 2005 13:46:39 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jA2LkddC014240 for ; Wed, 2 Nov 2005 13:46:39 -0800 Message-Id: <200511022146.jA2LkddC014240@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Calculating SHA1 Date: Wed, 02 Nov 2005 13:46:39 -0800 From: william@bourbon.usc.edu Someone wrote: > This might be a silly doubt, but I was wondering how should we calculate > SHA1 for the file? By reading blocks of data and computing SHA1 on them like > we did to compute MD5 in warmup1. or is there another way? I forgot to provide a link to: http://www.openssl.org/docs/crypto/sha.html It's very similar to MD5 in terms of calling convention. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Nov 1 11:45:56 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jA1JjuOf013890 for ; Tue, 1 Nov 2005 11:45:56 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jA1JggWT002553 for ; Tue, 1 Nov 2005 11:42:42 -0800 Message-Id: <200511011942.jA1JggWT002553@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: About the grading guideline. Date: Tue, 01 Nov 2005 11:42:42 -0800 From: william@bourbon.usc.edu Hi, I decided to just change the AutoShutdown value for beacon nodes to be 1.5 times that for the non-beacon nodes. Things should work now if the TA types/grades fast enough, :-) -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Tue, 01 Nov 2005 11:29:51 -0800 From: william@bourbon.usc.edu To: cs551@bourbon.usc.edu Subject: Re: About the grading guideline. Someone wrote: > I am sorry if I was not able to clearly mention what I meant abt the grad ing > guidelines. I did not mean that anything was wrong with them. They are do ing > the right thing. > > Whatever I have been saying is only for TA's convenience in grading the > project. > I am talking abt the test cases where the first test case B(a) and B(b) - > i.e the first test case in section B of the grading guidelines and second > test case in section B. > The test case (a) is testing if the node does a join. > Test case (b) checks if the node does a join even if it has a > init_neighbor_list file. > If the TA runs the test case B(a). The reqular node will come up and crea te > its init_neighbor_file. Now if we let both the nodes autoshutdown in test > case (a) and then run test case B(b), I guess it is expected that the > regualar node uses the init_neighbor_list file it creates in the earlier > test case i.e B(a). But as the shutdown timeouts are same when both nodes > auto shutdown at the end of test case B(a) - the init_neighbor_file will be > deleted and when Leslie runs test case B(b) - to check if the node is doi ng > a join if it has a init_nieghbor_list file - that file will not exist and > the node will do a join. > > So the problem is running B(b) after B(a) - that's all. So for his > convenience if he sets the autoshutdown of beacon higher - he will have t he > init_neighbor_list file for the regular node when he runs B(b). > > I hope I have been able to say it clearly this time. I am sure Leslie wil l > be able to find a work around otherwise. Good point! Thanks for pointing out the problem! So, the grading guidlines must be modified. Instead of having: *wait* for both nodes to autoshutdown on line 200, it should be: type "shutdown" in the 2nd window type "shutdown" in the 1st window It would also make sense to make the AutoShutdown value for beacon nodes longer. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Nov 1 11:33:05 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jA1JX5mX013516 for ; Tue, 1 Nov 2005 11:33:05 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jA1JTpTp002366 for ; Tue, 1 Nov 2005 11:29:51 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id jA1JTp1c002365 for cs551@merlot.usc.edu; Tue, 1 Nov 2005 11:29:51 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id jA1JTpgx002362 for ; Tue, 1 Nov 2005 11:29:51 -0800 Message-Id: <200511011929.jA1JTpgx002362@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: About the grading guideline. Date: Tue, 01 Nov 2005 11:29:51 -0800 From: william@bourbon.usc.edu Someone wrote: > I am sorry if I was not able to clearly mention what I meant abt the grading > guidelines. I did not mean that anything was wrong with them. They are doing > the right thing. > > Whatever I have been saying is only for TA's convenience in grading the > project. > I am talking abt the test cases where the first test case B(a) and B(b) - > i.e the first test case in section B of the grading guidelines and second > test case in section B. > The test case (a) is testing if the node does a join. > Test case (b) checks if the node does a join even if it has a > init_neighbor_list file. > If the TA runs the test case B(a). The reqular node will come up and create > its init_neighbor_file. Now if we let both the nodes autoshutdown in test > case (a) and then run test case B(b), I guess it is expected that the > regualar node uses the init_neighbor_list file it creates in the earlier > test case i.e B(a). But as the shutdown timeouts are same when both nodes > auto shutdown at the end of test case B(a) - the init_neighbor_file will be > deleted and when Leslie runs test case B(b) - to check if the node is doing > a join if it has a init_nieghbor_list file - that file will not exist and > the node will do a join. > > So the problem is running B(b) after B(a) - that's all. So for his > convenience if he sets the autoshutdown of beacon higher - he will have the > init_neighbor_list file for the regular node when he runs B(b). > > I hope I have been able to say it clearly this time. I am sure Leslie will > be able to find a work around otherwise. Good point! Thanks for pointing out the problem! So, the grading guidlines must be modified. Instead of having: *wait* for both nodes to autoshutdown on line 200, it should be: type "shutdown" in the 2nd window type "shutdown" in the 1st window It would also make sense to make the AutoShutdown value for beacon nodes longer. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Oct 31 14:06:31 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9VM6VYN016022 for ; Mon, 31 Oct 2005 14:06:31 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9VM3LVJ029509 for ; Mon, 31 Oct 2005 14:03:21 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9VM3Lxb029508 for cs551@merlot.usc.edu; Mon, 31 Oct 2005 14:03:21 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9VM3KeV029505 for ; Mon, 31 Oct 2005 14:03:20 -0800 Message-Id: <200510312203.j9VM3KeV029505@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Regarding the change in 3 lines Date: Mon, 31 Oct 2005 14:03:20 -0800 From: william@bourbon.usc.edu Someone wrote: > I wanted to know what is the procedure for changing three > lines in the code. Whom should I mail, and what should be the > mail content,like line nos or something like that. Please see: http://merlot.usc.edu/cs551-f05/projects.html#mods The deadline for this is the end of tonight. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 31 13:17:31 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9VLHVKj014755 for ; Mon, 31 Oct 2005 13:17:31 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9VLELqa029032 for ; Mon, 31 Oct 2005 13:14:21 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9VLELTB029031 for cs551@merlot; Mon, 31 Oct 2005 13:14:21 -0800 Date: Mon, 31 Oct 2005 13:14:21 -0800 From: william@bourbon.usc.edu Message-Id: <200510312114.j9VLELTB029031@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: new commandline option for sv_node... Hi, I've just modified the definitino of the NoCheck key in the startup configuration file. It now reads: [BC: Modified 10/31/2005] If this value is 0, sending of check messages is enabled when a non-beacon node loses connection with one of its neighbors. If this value is 1, sending of cehck messgaes should be disabled for a non-beacon node. For a beacon node, it must ignore all check messages. The default value is 0. Please note that for grading of part (2), this value will always be 1 for all nodes. During class today, I mentioned about adding a -nocheck commandline argument. Since there is a NoCheck key in the startup configuration file already, there is no need to add the -nocheck commandline argument. As I mentioned in class today, for the grading of part (2), we will supply all the init_neighbor_list files for non-beacon nodes and all startup configuration files will have NoCheck=1 in them. Also, each line in an init_neighbor_list file can be terminated by either a '\n' or "\r\n", you must make sure you can handle both cases. You can read a line as before, then check if the last character (just before '\n') is a '\r'. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 30 22:29:31 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9V6TVpK019878 for ; Sun, 30 Oct 2005 22:29:31 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9V6QNld019823 for ; Sun, 30 Oct 2005 22:26:23 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9V6QNhe019822 for cs551@merlot; Sun, 30 Oct 2005 22:26:23 -0800 Date: Sun, 30 Oct 2005 22:26:23 -0800 From: william@bourbon.usc.edu Message-Id: <200510310626.j9V6QNhe019822@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: submission event ID for final project part (1)... Hi, Just want to make sure that you are using the correct event ID for making your final project part (1) submission. The event ID was changed a few weeks back and it is: merlot.usc.edu_9996_1128715191_1 If you have an old printout of the Electronic Submission Guidelines web page, the information is out of date. Please make sure you use the correct event ID when submitting. Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 30 21:26:18 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9V5QIJn018162 for ; Sun, 30 Oct 2005 21:26:18 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9V5NAxK019340 for ; Sun, 30 Oct 2005 21:23:10 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9V5NAeI019339 for cs551@merlot; Sun, 30 Oct 2005 21:23:10 -0800 Date: Sun, 30 Oct 2005 21:23:10 -0800 From: william@bourbon.usc.edu Message-Id: <200510310523.j9V5NAeI019339@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: project part (1) deadline approaching... Hi, Some of you have not submitted *anything*. I strongly urge that you submit something *now*. Please remember that the penalty for late submission is severe and I cannot make any exceptions. Even if you are one second late, according to the server clock, 25% of the total points will be taken off! Please also remember that you can make multiple submissions and by default, we will grade the last one-time submission. For those who are not aware, we are no longer in day light savings time since last night! Please be aware of the server's clock. If you want to synchronize your watch with the server's clock, please visit: http://merlot.usc.edu:9996/bistro/myip.html -- Bill Cheng // bill.cheng@acm.org Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Oct 30 15:18:56 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9UNIuuS009768 for ; Sun, 30 Oct 2005 15:18:56 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9UNFn1L017649 for ; Sun, 30 Oct 2005 15:15:49 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9UNFnob017648 for cs551@merlot.usc.edu; Sun, 30 Oct 2005 15:15:49 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9UNFnrm017645 for ; Sun, 30 Oct 2005 15:15:49 -0800 Message-Id: <200510302315.j9UNFnrm017645@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: closing socket Date: Sun, 30 Oct 2005 15:15:49 -0800 From: william@bourbon.usc.edu Someone wrote: > About the test case. I am was talking in general but I can explain what I am > saying with example of test case B(a) and B(b). > In B(a) - the new node will send a join and join the n/w. now as there r > only 2 nodes in the n/w. so the beacon is going to be this nodes neighbor. > When the beacon will go down(Which will before the req node, cuz we r > starting the beacon early), the node will delete its init_neighbor and try > to reconnect. This test case is fine - cuz we can see the result with > status. > But now when we restart the reg node in B(b) - its init_neighbor_list is > deleted in earlier excution i.e in B(a) - so it will send a join again. > > Which is not what we r trying to test. If you don't tell me which line you are referring to in the grading guidlines, I cannot figure out what "are we trying to test" here! -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] Sent: Sunday, October 30, 2005 6:10 PM To: cs551@bourbon.usc.edu Subject: Re: closing socket Someone wrote: > I still have a doubt in notify. If I get a keepalive timeout, that means my > neighbor is already dead. How do you know the state of your neighbor? What if it's a configuration error and its keeplive timeout is wrong? > Then how will / or why will I send a notify on a > dead connection. Shud I just log in my log file that this neighbor died? Or > I shud still send it a notify with error code 0 and log that in my file - > but this message is not going to go to my neighbor. It is dead !! You must send NTFY. It's a distributed system. You must follow the protocol and not assume anything that you cannot determine for sure. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] Sent: Saturday, October 22, 2005 1:41 PM To: cs551@bourbon.usc.edu Subject: Re: closing socket Someone wrote: > just a final clarification. > > When I do not receive keepalive msg from my neighbor for more than > keepalivetimeout time I send this node a notify message with error code = 0. > Is this right? Yes (and you close the connection right after). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Oct 30 15:16:37 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9UNGbT2009713 for ; Sun, 30 Oct 2005 15:16:37 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9UNDUYL017631 for ; Sun, 30 Oct 2005 15:13:30 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9UNDUhR017630 for cs551@merlot.usc.edu; Sun, 30 Oct 2005 15:13:30 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9UNDUeC017627 for ; Sun, 30 Oct 2005 15:13:30 -0800 Message-Id: <200510302313.j9UNDUeC017627@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: log Date: Sun, 30 Oct 2005 15:13:30 -0800 From: william@bourbon.usc.edu Someone wrote: > should i log only last 4 bytes or all the 20 bytes for the > in the data part of JNRS msg. Isn't the spec very clear about this? -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Oct 30 13:16:56 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9ULGubJ005744 for ; Sun, 30 Oct 2005 13:16:56 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9ULDnI1015873 for ; Sun, 30 Oct 2005 13:13:49 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9ULDnco015872 for cs551@merlot.usc.edu; Sun, 30 Oct 2005 13:13:49 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9ULDnsv015869 for ; Sun, 30 Oct 2005 13:13:49 -0800 Message-Id: <200510302113.j9ULDnsv015869@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: closing socket Date: Sun, 30 Oct 2005 13:13:49 -0800 From: william@bourbon.usc.edu Someone wrote: > Just one more doubt - if I am going down cuz my check failed.. wht shud be > the notify error -2? There are only 3 codes: 0: Unknown 1: user shutdown 2: unexpected kill signal received Failing CHECK is certainly neither 1 or 2. -- Bill Cheng // bill.cheng@usc.edu > -----Original Message----- > From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] > Sent: Saturday, October 22, 2005 1:41 PM > To: cs551@bourbon.usc.edu > Subject: Re: closing socket > > Someone wrote: > > > just a final clarification. > > > > When I do not receive keepalive msg from my neighbor for more than > > keepalivetimeout time I send this node a notify message with error code > = 0. > > Is this right? > > Yes (and you close the connection right after). > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Oct 30 13:12:54 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9ULCsI4005646 for ; Sun, 30 Oct 2005 13:12:54 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9UL9lrl015775 for ; Sun, 30 Oct 2005 13:09:47 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9UL9llk015774 for cs551@merlot.usc.edu; Sun, 30 Oct 2005 13:09:47 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9UL9kR0015771 for ; Sun, 30 Oct 2005 13:09:46 -0800 Message-Id: <200510302109.j9UL9kR0015771@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: closing socket Date: Sun, 30 Oct 2005 13:09:46 -0800 From: william@bourbon.usc.edu Someone wrote: > I still have a doubt in notify. If I get a keepalive timeout, that means my > neighbor is already dead. How do you know the state of your neighbor? What if it's a configuration error and its keeplive timeout is wrong? > Then how will / or why will I send a notify on a > dead connection. Shud I just log in my log file that this neighbor died? Or > I shud still send it a notify with error code 0 and log that in my file - > but this message is not going to go to my neighbor. It is dead !! You must send NTFY. It's a distributed system. You must follow the protocol and not assume anything that you cannot determine for sure. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] Sent: Saturday, October 22, 2005 1:41 PM To: cs551@bourbon.usc.edu Subject: Re: closing socket Someone wrote: > just a final clarification. > > When I do not receive keepalive msg from my neighbor for more than > keepalivetimeout time I send this node a notify message with error code = 0. > Is this right? Yes (and you close the connection right after). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Oct 30 13:10:40 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9ULAeJQ005591 for ; Sun, 30 Oct 2005 13:10:40 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9UL7XLJ015678 for ; Sun, 30 Oct 2005 13:07:33 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9UL7XRs015677 for cs551@merlot.usc.edu; Sun, 30 Oct 2005 13:07:33 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9UL7XZA015674 for ; Sun, 30 Oct 2005 13:07:33 -0800 Message-Id: <200510302107.j9UL7XZA015674@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: About the grading guideline. Date: Sun, 30 Oct 2005 13:07:33 -0800 From: william@bourbon.usc.edu Someone wrote: > Even I have been thinking about this problem. According to me the problem is > not in the same test case where we are testing join, but in the one > following it. As the one following it checks if the node sends a join if it > has an init_neighbor_list file. But this file is getting deleted before the > node goes down.. so it again send a join request in the next test case. I really have no idea which case you are referring to without a specific line number. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] Sent: Sunday, October 30, 2005 12:36 PM To: cs551@bourbon.usc.edu Subject: Re: About the grading guideline. Someone wrote: > I have some comments on the grading guideline. In many test cases, > beacon nodes and normal nodes usually have the same AutoShutdown value. > This might raise some problem on grading. For example, suppose we want > to test node B 'join function', we start beacon node A first and then > after 10 sec start node B. > Node B successfully performs its join function and writes the output to > 'init_neighbor_list' file. Suppose AutoShutdown period is 60 sec and > JoinTimeout is 5 sec. > At 60th sec, the beacon node A shutdown itself. Node B senses that it > get disconnect from neighbor and flood check-req message. > At 65th sec, check-req timeout, node B will delete it > 'init_neighbor_list' and rejoin the network which ultimately it will > fail to rejoin and shutdown itself. What you said is correct. I don't see how this is in conflict with the grading guidelines. Could you point out exactly which line number or give me a section.subsection.subsubsection. > So, we cannot see the result of node B 'join function' which is our > original intention due to auto-deletion of init_neigbor_list. And that's an expected behavior. > I would like to inform this problem on grading, but if I > misunderstand in any point, please remind me. It's possible that you may have misunderstood the grading guidelines since it's not possible to give *all* details. The TA is suppose to exercise his judgement and grade fairly! The grading guidelines is there to give you an idea how grading is done. You should worry about doing things correctly and not spend too much time on the grading guidelines. If your program is behaving largely correct according to the grading guidelines, you are in pretty good shape! Even after the grading ends, if you see a bug in the grading guidelines, please let me know! As I've mentioned before, the grading guidelines may be changed. But if there is no good enough reason to change it, it will stay as it is. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Oct 30 07:56:44 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9UFuicd030878 for ; Sun, 30 Oct 2005 07:56:44 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9UFrcTs012281 for ; Sun, 30 Oct 2005 07:53:38 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9UFrclM012280 for cs551@merlot.usc.edu; Sun, 30 Oct 2005 07:53:38 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9UFrc5s012277 for ; Sun, 30 Oct 2005 07:53:38 -0800 Message-Id: <200510301553.j9UFrc5s012277@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: notify msg [error code = 2] Date: Sun, 30 Oct 2005 07:53:38 -0800 From: william@bourbon.usc.edu Someone wrote: > In notify messages, it is said that error code = 2 if we catch > SIGTERM or SIGINT. I search the spec and could not find any mention of SIGINT. I've said that in an e-mail, but that's a mistake (sorry!). The spec is correct. > But, when a node recieves notify from a neighbour, it will close > the socket connection between these two > nodes. And it is said that when cntrl+C is pressed, the node > should not shutdown. > > here, cntrl+ C generates SIGINT/SIGTERM signals. > so, am i supposed to send notify msg with error code = 2 when > cntrl + C is pressed. > > I did not understand when exactly should the error code in notify > msg be 2. > If i have to send notify msg with error code = 2 when cntrl+C is > pressed, should i terminate the node? The spec is very clear about this: ^C (Control-c) should never cause your program to terminate. > can i send a word document for readme file rather than text > document [ like to include my architecture figure ] No! If you have a picture, save it in JPEG or GIF and include it with your submission and refer to it by filename. Please make sure you do not forget to include it in your submission! If you forgot, you won't get a chance to submit it after the deadline. If you really want to have the pictures inline, you only acceptable formats are Text, PDF, Postscript and HTML. Postscript file generated in Windows often cannot be printed. So, if you cannot view it to verify that it's viewable, please use another format. If you don't have a PDF generator in Windows, you can find some free PDF generators on the net. MS Word also export in HTML, but the figures are kept in separate files. Please maks sure you verify your submission: http://merlot.usc.edu/cs551-f05/submit.html#verify -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Oct 30 07:39:14 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9UFdEh6030419 for ; Sun, 30 Oct 2005 07:39:14 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9UFa8Ma011907 for ; Sun, 30 Oct 2005 07:36:08 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9UFa8CR011906 for cs551@merlot.usc.edu; Sun, 30 Oct 2005 07:36:08 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9UFa8I5011903 for ; Sun, 30 Oct 2005 07:36:08 -0800 Message-Id: <200510301536.j9UFa8I5011903@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: About the grading guideline. Date: Sun, 30 Oct 2005 07:36:08 -0800 From: william@bourbon.usc.edu Someone wrote: > I have some comments on the grading guideline. In many test cases, > beacon nodes and normal nodes usually have the same AutoShutdown value. > This might raise some problem on grading. For example, suppose we want > to test node B 'join function', we start beacon node A first and then > after 10 sec start node B. > Node B successfully performs its join function and writes the output to > 'init_neighbor_list' file. Suppose AutoShutdown period is 60 sec and > JoinTimeout is 5 sec. > At 60th sec, the beacon node A shutdown itself. Node B senses that it > get disconnect from neighbor and flood check-req message. > At 65th sec, check-req timeout, node B will delete it > 'init_neighbor_list' and rejoin the network which ultimately it will > fail to rejoin and shutdown itself. What you said is correct. I don't see how this is in conflict with the grading guidelines. Could you point out exactly which line number or give me a section.subsection.subsubsection. > So, we cannot see the result of node B 'join function' which is our > original intention due to auto-deletion of init_neigbor_list. And that's an expected behavior. > I would like to inform this problem on grading, but if I > misunderstand in any point, please remind me. It's possible that you may have misunderstood the grading guidelines since it's not possible to give *all* details. The TA is suppose to exercise his judgement and grade fairly! The grading guidelines is there to give you an idea how grading is done. You should worry about doing things correctly and not spend too much time on the grading guidelines. If your program is behaving largely correct according to the grading guidelines, you are in pretty good shape! Even after the grading ends, if you see a bug in the grading guidelines, please let me know! As I've mentioned before, the grading guidelines may be changed. But if there is no good enough reason to change it, it will stay as it is. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Oct 30 07:30:32 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9UFUVHI030228 for ; Sun, 30 Oct 2005 07:30:32 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9UFRPoM011840 for ; Sun, 30 Oct 2005 07:27:25 -0800 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9UFRPe7011839 for cs551@merlot.usc.edu; Sun, 30 Oct 2005 07:27:25 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9UFRPcB011836 for ; Sun, 30 Oct 2005 07:27:25 -0800 Message-Id: <200510301527.j9UFRPcB011836@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: error code for notify messages Date: Sun, 30 Oct 2005 07:27:25 -0800 From: william@bourbon.usc.edu Someone wrote: > while getting UOID, is it true that > > all messages (join, hello, etc) have "msg" as the obj_type in > the GetUOID function? It doesn't matter! You can use "msg", or you can use "join", "hello", "foobar", or whatever. > the uniqueness is coming from the seq_no within the function.... Yes! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Oct 29 23:06:51 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9U66pP0026859 for ; Sat, 29 Oct 2005 23:06:51 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9U63kbo021000 for ; Sat, 29 Oct 2005 23:03:46 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9U63kgi020999 for cs551@merlot.usc.edu; Sat, 29 Oct 2005 23:03:46 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9U63kan020996 for ; Sat, 29 Oct 2005 23:03:46 -0700 Message-Id: <200510300603.j9U63kan020996@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: error code for notify messages Date: Sat, 29 Oct 2005 23:03:46 -0700 From: william@bourbon.usc.edu Someone wrote: > According to the previous message...on a keepalive timeout the > error code for notify message shld be 0....lets consider this > scenario....node A is connected to node B....node A goes > down...after some time node B's keepalive timer for A will > expire.....what I dont understand is to whom will B now send a > notify message with error code 0 since A is already down...... If node B gets a NTFY from node A, node B will know that node A will disconnect soon. Therefore, node B should close the connection (or soon A will close the connection anyway). So, there will be no connection left between A and b. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Oct 29 21:00:50 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9U40o1J023377 for ; Sat, 29 Oct 2005 21:00:50 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9U3vkYP020251 for ; Sat, 29 Oct 2005 20:57:46 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9U3vkwh020250 for cs551@merlot.usc.edu; Sat, 29 Oct 2005 20:57:46 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9U3vkeb020231 for ; Sat, 29 Oct 2005 20:57:46 -0700 Message-Id: <200510300357.j9U3vkeb020231@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: error code for notify messages Date: Sat, 29 Oct 2005 20:57:46 -0700 From: william@bourbon.usc.edu Someone wrote: > According to specs ....for notify messages....a error code of 1 > stands for user shutdown and a 2 stands for kill signal.... > Does this mean..that Autoshutdown corresponds to error code > 1...and user entered 'shutdown' corresponds to 2. Please see my message with timestamp "Fri, 21 Oct 21:30". > Also am i supposed to send a notify message in both the cases. You should send NTFY in both cases and more. Before you call close() on a socket, send NTFY. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Oct 29 20:56:30 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9U3uU2F023268 for ; Sat, 29 Oct 2005 20:56:30 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9U3rPrr020169 for ; Sat, 29 Oct 2005 20:53:25 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9U3rPdF020168 for cs551@merlot.usc.edu; Sat, 29 Oct 2005 20:53:25 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9U3rPXO020165 for ; Sat, 29 Oct 2005 20:53:25 -0700 Message-Id: <200510300353.j9U3rPXO020165@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: -reset for beacon (final project question) Date: Sat, 29 Oct 2005 20:53:25 -0700 From: william@bourbon.usc.edu Someone wrote: > 1) what does "-reset " in the commad line argument mean for a > beacon node? (I am asking this because beacon will never send a > joint request to another beacon according to my understanding of > the spec) You may create any files in your HomeDir. So, if a -reset command is issued, you should delete all files created by your node. > 2) will a beacon ever send a join request to another beacon? > if not, isnt -reset invalid for beacon node? A beacon node never sends a join to another beacon. Please see above regarding -reset. > 3) In hello message logging: is port and host name. > Shouldnt it be host and port number of destination instead of > data part of the hello message? It's what's in the message body. > 4)In logging for each entry is == 26 always ? as it should > account for message header. It should be at least 26. It should be actual size of the message. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Oct 29 13:47:47 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9TKllou013508 for ; Sat, 29 Oct 2005 13:47:47 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9TKiinw018991 for ; Sat, 29 Oct 2005 13:44:44 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9TKiijH018990 for cs551@merlot.usc.edu; Sat, 29 Oct 2005 13:44:44 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9TKii6T018987 for ; Sat, 29 Oct 2005 13:44:44 -0700 Message-Id: <200510292044.j9TKii6T018987@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: starting the node in background Date: Sat, 29 Oct 2005 13:44:44 -0700 From: william@bourbon.usc.edu Someone wrote: > my hash tables is configurable. for our current n/w a hash table size of 10 > is also giving a good performance. i am logging collisions that occur and i > have only found a few in last part of test cases. > But if the size of the n/w increases my hash table size can be configured > accordingly. thats why i feel they r giving a good performace.. Well, as long as it's less than or equal to O(log(n)), then it's fine. You should mention what you said above in your README file. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Oct 29 08:51:39 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9TFpda1006823 for ; Sat, 29 Oct 2005 08:51:39 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9TFma0m018305 for ; Sat, 29 Oct 2005 08:48:36 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9TFmaU5018304 for cs551@merlot.usc.edu; Sat, 29 Oct 2005 08:48:36 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9TFmawU018301 for ; Sat, 29 Oct 2005 08:48:36 -0700 Message-Id: <200510291548.j9TFmawU018301@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: timespan for keepalive messages Date: Sat, 29 Oct 2005 08:48:36 -0700 From: william@bourbon.usc.edu Someone wrote: > Can you please tell me the when are we supposed to send keepalive > messages to our neighbours. I mean in what duration......should > it be constant... Please see my message with timestamp "Tue 11 Oct 19:38". -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Oct 29 08:47:46 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9TFlkAF006716 for ; Sat, 29 Oct 2005 08:47:46 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9TFihcT018232 for ; Sat, 29 Oct 2005 08:44:43 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9TFihqo018231 for cs551@merlot.usc.edu; Sat, 29 Oct 2005 08:44:43 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9TFihMD018228 for ; Sat, 29 Oct 2005 08:44:43 -0700 Message-Id: <200510291544.j9TFihMD018228@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Request for Extension Date: Sat, 29 Oct 2005 08:44:43 -0700 From: william@bourbon.usc.edu Someone wrote: > Its a little bit tough to complete first part before Sunday > midnight. It would be great for most of the students if you can > kindly give us 24-48 hrs extension on part 1 with keeping the > deadline for part 2 as it is. My honest suggestion is that please > flood the message of polling on class mailing list and please > take your decision based on majority replies. By doing that I > think whole class will be benefited along with me and we will get > more better code to submit. Unfortunately, this class is graded on a curve. If it's on an absolute scale, then an extension would be possible. I think some students have finished part (1). It would be extremely unfair to them if there is an extension and they don't get a lot of extra points. (Voting is not right at this point because if 90% of the class decides to be unfair to the rest of the class, I must not allow that to happen.) 5 weeks is a lot of time and it was your job to plan your time (and took my warnings seriously). And I do expect you to finish part (1) even if you cannot meet the deadline because part (2) depends on it. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Oct 29 00:06:21 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9T76LR6026749 for ; Sat, 29 Oct 2005 00:06:21 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9T73Kt3016628 for ; Sat, 29 Oct 2005 00:03:20 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9T73KFN016627 for cs551@merlot.usc.edu; Sat, 29 Oct 2005 00:03:20 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9T73KXr016624 for ; Sat, 29 Oct 2005 00:03:20 -0700 Message-Id: <200510290703.j9T73KXr016624@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: starting the node in background Date: Sat, 29 Oct 2005 00:03:20 -0700 From: william@bourbon.usc.edu Someone wrote: > About the hash tables, did you mean to say that hash tables will give a > performance better than O(log(n)) for our project and so they shud be fine. > Or u meant that I shud prove that they r giving a performance better than > log(n). According to me for our assignment hash tables will surely give a > better performance than binary tree. The usual claim for a hash table is that it's O(1). But how do you know it's O(1)? Clearly, if there is only one bucket in the hash table and it uses a linear list to handle collisions, then the performance is O(n). So, are you using an O(1) hash table? Certainly I don't want to see a "proof" in your README file. But you should know how good your hash table is and if it's really that good. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Oct 28 16:57:41 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9SNvfX2016525 for ; Fri, 28 Oct 2005 16:57:41 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9SNsfox014826 for ; Fri, 28 Oct 2005 16:54:41 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9SNsfpj014825 for cs551@merlot.usc.edu; Fri, 28 Oct 2005 16:54:41 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9SNsef7014822 for ; Fri, 28 Oct 2005 16:54:41 -0700 Message-Id: <200510282354.j9SNsef7014822@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: starting the node in background Date: Fri, 28 Oct 2005 16:54:40 -0700 From: william@bourbon.usc.edu Someone wrote: > i was trying to start the node is background to comply with the following > specs - > > You should be able to bootstrap your SERVANT system using a shell script > for several nodes to be running on the same machine. For example, the > following shell script should bootstrap into a SERVANT system with 4 > nodes on the same machine: > > #!/bin/csh -f > > sv_node start-12311.ini & > sleep 2 > sv_node start-12312.ini & > sv_node start-12313.ini & > sleep 3 > sv_node start-12314.ini & > > It could be the case that these 4 nodes are all beacon nodes if the > [beacons] section of the .ini files has all of them cross listed and these > nodes are started on the correct machine. (It should be clear that > multiple nodes will run on the same machine.) > > You might want to think about how to kill all these processes to make it > easy for yourself to restart your experiment. > > *Hint:* If a sv_node is started in the background, it cannot read standard > input. So you might want to feed it an empty file as standard input. For > example, if you create an empty file and call it "null", you can then do: > > sv_node start-12311.ini < null & If this is what you are trying to do, you should make sure that once you read EOF from the keyboard, you don't write the prompt and attempt to read the keyboard any more. > Also will you cut points if I am using a hash table for routing cache? Hash table should have performance better than O(log(n)). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Oct 28 16:53:37 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9SNrbQD016427 for ; Fri, 28 Oct 2005 16:53:37 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9SNobsl014769 for ; Fri, 28 Oct 2005 16:50:37 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9SNobV6014768 for cs551@merlot.usc.edu; Fri, 28 Oct 2005 16:50:37 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9SNoajd014765 for ; Fri, 28 Oct 2005 16:50:36 -0700 Message-Id: <200510282350.j9SNoajd014765@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Broken pipe over connection Date: Fri, 28 Oct 2005 16:50:36 -0700 From: william@bourbon.usc.edu Someone wrote: > yes what leslie mentioned is abt writing after a successful connects. but > the given solution also solves the problem if connect is blocking. I have no > clue why this was happening but, my connect suddenly started blocking one > fine day (ofcourse after i made soem changes to the code:)) and the i tried > to put my socket call inside the for loop and it worked and that is how this > really unexplainable solution came up in the first place. It was never meant > to be for SIGPIPES, but it works for that too. and i am curious to knw why? Well, I don't have a general answer since it probably depends on exactly what your code looks like. > but at the same time - its worth mentioning that at this point of time my > socket was not currupted, i cudnt evn see it on netstat. May be you need to use some other netstat parameters to see it. If it's there, netstat should know about it. > so it was not > blocked or anything. So I thought maybe I cant reuse a socket if connect > fails, which i am sure is not true and whole thing comes down to having some > currupted memory somewhere. which i am too scared to find out where at this > point of time. :) My guess is that it's also very important to close the socket if connect() failed. In general, we do not know exactly how one vendor implements functions such as connect(). So, is a specific behavior vendor dependant? Who knows for sure! All I know is that if you want your connect() to work right, you need to do something like what's in: http://merlot.usc.edu/cs551-f05/projects/connect.html And boy, does it have a lot of #ifdef's! But this is what we have to deal with if we want to do this "professionally". -- Bill Cheng // bill.cheng@usc.edu On 10/28/05, william@bourbon.usc.edu wrote: > > Hi, > > I think what Leslie mentioned is probably the cause of most > of the SIGPIPE problems right after a successful connect(). > "Inside the loop" is the key. Another way to look at it is > to make what's inside the while loop a function. I've > mentioned that you should have checked out the approach taken > in: > > http://merlot.usc.edu/cs551-f05/projects/connect.html > -- > Bill Cheng // bill.cheng@usc.edu > > > > > -----Original Message----- > Date: Fri, 28 Oct 2005 15:50:17 -0700 > From: leslie cheung > To: cs551@merlot.usc.edu > Subject: Re: Broken pipe over connection > > Hi all, > > I debugged a couple SIGPIPE problems, and I hope this information > is useful. > > So I assume if we are unable to connect to the other node (e.g., > it has not been started), we sleep for a while, and try again > later. One problem I saw is that when you try "reusing" a socket, > it is able to complete "connect", but whenever you send something > using that reused socket, you get SIGPIPE. Why? I have no idea > either, but this is how things work > > Instead of saying... > > ------------------------------------- > int sockfd = socket(...); > > while (!done){ > if (connect(sockfd, ...) < 0){ > //cannot connect > } else { > //it won't give you an error for connect, so it comes here > //but if you try to send something, it gives you SIGPIPE > write(sockfd, ...); //this line give you SIGPIPE > } > sleep(10); > } > ------------------------------------- > > You should do > > ------------------------------------- > > while (!done){ > int sockfd = socket(...); > if (connect(sockfd, ...) < 0){ > //cannot connect > //you should now close the socket > close(sockfd); > } else { > //connected > //now if you send something, it should work > write(sockfd, ...); //this should work > } > sleep(10); > } > ------------------------------------- > > In other words, you should create a new socket "inside the loop". > Again, this is just one possible scenario that may give you SIGPIPE. Yours > might be some other problems. > > > Leslie > > ----- Original Message ----- > From: william@bourbon.usc.edu > Date: Friday, October 28, 2005 3:12 pm > Subject: Re: Broken pipe over connection > To: cs551@bourbon.usc.edu > > > Someone wrote: > > > > > I am also getting the same error. I have tried hard enough but > > > cannot find the problem. I am catching SIGPIPE but that still > > > doesnt solve the problem. I dont know what to do. > > > > Well, until you can find the bug, you can simply ignore SIGPIPE. > > Or you can catch it and do nothing but log it. One day, you > > may notice that, "Hey, if I do this and that, there is no SIGPIPE > > in my log file!" Then it may help you further debug your code. > > -- > > Bill Cheng // bill.cheng@usc.edu > > Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Oct 28 16:00:29 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9SN0TjZ015121 for ; Fri, 28 Oct 2005 16:00:29 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9SMvTOo014508 for ; Fri, 28 Oct 2005 15:57:29 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9SMvTOV014507 for cs551@merlot.usc.edu; Fri, 28 Oct 2005 15:57:29 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9SMvTEL014504 for ; Fri, 28 Oct 2005 15:57:29 -0700 Message-Id: <200510282257.j9SMvTEL014504@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Broken pipe over connection Date: Fri, 28 Oct 2005 15:57:29 -0700 From: william@bourbon.usc.edu Hi, I think what Leslie mentioned is probably the cause of most of the SIGPIPE problems right after a successful connect(). "Inside the loop" is the key. Another way to look at it is to make what's inside the while loop a function. I've mentioned that you should have checked out the approach taken in: http://merlot.usc.edu/cs551-f05/projects/connect.html -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Fri, 28 Oct 2005 15:50:17 -0700 From: leslie cheung To: cs551@merlot.usc.edu Subject: Re: Broken pipe over connection Hi all, I debugged a couple SIGPIPE problems, and I hope this information is useful. So I assume if we are unable to connect to the other node (e.g., it has not been started), we sleep for a while, and try again later. One problem I saw is that when you try "reusing" a socket, it is able to complete "connect", but whenever you send something using that reused socket, you get SIGPIPE. Why? I have no idea either, but this is how things work Instead of saying... ------------------------------------- int sockfd = socket(...); while (!done){ if (connect(sockfd, ...) < 0){ //cannot connect } else { //it won't give you an error for connect, so it comes here //but if you try to send something, it gives you SIGPIPE write(sockfd, ...); //this line give you SIGPIPE } sleep(10); } ------------------------------------- You should do ------------------------------------- while (!done){ int sockfd = socket(...); if (connect(sockfd, ...) < 0){ //cannot connect //you should now close the socket close(sockfd); } else { //connected //now if you send something, it should work write(sockfd, ...); //this should work } sleep(10); } ------------------------------------- In other words, you should create a new socket "inside the loop". Again, this is just one possible scenario that may give you SIGPIPE. Yours might be some other problems. Leslie ----- Original Message ----- From: william@bourbon.usc.edu Date: Friday, October 28, 2005 3:12 pm Subject: Re: Broken pipe over connection To: cs551@bourbon.usc.edu > Someone wrote: > > > I am also getting the same error. I have tried hard enough but > > cannot find the problem. I am catching SIGPIPE but that still > > doesnt solve the problem. I dont know what to do. > > Well, until you can find the bug, you can simply ignore SIGPIPE. > Or you can catch it and do nothing but log it. One day, you > may notice that, "Hey, if I do this and that, there is no SIGPIPE > in my log file!" Then it may help you further debug your code. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Oct 28 15:46:46 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9SMkkJx014765 for ; Fri, 28 Oct 2005 15:46:46 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9SMhk0S014376 for ; Fri, 28 Oct 2005 15:43:46 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9SMhkdL014375 for cs551@merlot.usc.edu; Fri, 28 Oct 2005 15:43:46 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9SMhkuo014372 for ; Fri, 28 Oct 2005 15:43:46 -0700 Message-Id: <200510282243.j9SMhkuo014372@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: regarding TTL for Notify Date: Fri, 28 Oct 2005 15:43:46 -0700 From: william@bourbon.usc.edu Someone wrote: > I am confused when the regular node sends a join request msg, it > gets the join response msgs and then it goes down to restart all > over again. when it is going down, should it send a notify msg to > the beacon it has connected ? In this case, you don't need to send a NTFY message because this regular node is *not participating in the network* yet. (But if you are sending it, it should not cause any problem.) -- Bill Cheng // bill.cheng@usc.edu william@bourbon.usc.edu wrote: Someone wrote: > What should be the TTL for Notify? Shouldn't it be one? > Also, when a regular node joins the network, should its neighbour > list consist of the beacon node? I'm not sure what you mean by "neighbor list". But if you mean "init_neighbor_list file", please look at slide 14 of lecture 10 to see that it doesn't have to be the case. > And after joining the network, when the regular node is going > down, should it send the NTFY msg? I'm not sure why you asked about "regular node". Remember, operationally, there is very little difference between a regular node and a beacon node. If a node is going down, it should send NTFY messages to its connected neighbors telling them that it is disconnecting. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Oct 28 15:12:21 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9SMCLGv013829 for ; Fri, 28 Oct 2005 15:12:21 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9SM9LJF011938 for ; Fri, 28 Oct 2005 15:09:21 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9SM9LM6011937 for cs551@merlot.usc.edu; Fri, 28 Oct 2005 15:09:21 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9SM9L1R011934 for ; Fri, 28 Oct 2005 15:09:21 -0700 Message-Id: <200510282209.j9SM9L1R011934@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Broken pipe over connection Date: Fri, 28 Oct 2005 15:09:21 -0700 From: william@bourbon.usc.edu Someone wrote: > I am also getting the same error. I have tried hard enough but > cannot find the problem. I am catching SIGPIPE but that still > doesnt solve the problem. I dont know what to do. Well, until you can find the bug, you can simply ignore SIGPIPE. Or you can catch it and do nothing but log it. One day, you may notice that, "Hey, if I do this and that, there is no SIGPIPE in my log file!" Then it may help you further debug your code. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Oct 28 15:00:09 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9SM09js013548 for ; Fri, 28 Oct 2005 15:00:09 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9SLv9W8011765 for ; Fri, 28 Oct 2005 14:57:09 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9SLv9sR011764 for cs551@merlot.usc.edu; Fri, 28 Oct 2005 14:57:09 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9SLv9eq011761 for ; Fri, 28 Oct 2005 14:57:09 -0700 Message-Id: <200510282157.j9SLv9eq011761@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: starting the node in background Date: Fri, 28 Oct 2005 14:57:09 -0700 From: william@bourbon.usc.edu Someone wrote: > I am not sure what all needs to be dne before starting a node in background. > > If i start my node is background with i/p redirected to an empty file. my > prog simply prints the servent:port> prompt indefinetly. I dnt have a clue > where or how i shud address this .. can u please get me started? I don't know if it makes sense to put a node in the background since it needs to interact with keyboard input. I'm not sure why you would be getting input from the keyboard indefinitely. The only thing I can think of is that if you use non-blocking I/O when you read the keyboard input, you may be getting it returned infinitely often. But I'm not sure about this since it may depend on exactly how it's done. > also can u please mention if there is anything else missing in the grading > guidlines - like the necessity of O(log(n)) search on routing table. > or running all those test cases is all that is expected? The TA may even modify the grading guidelines if he sees that something is missed! So, there is no way I can be complete. (The grading guidelines is already really really long!) Well, the only way I can be complete is to say that if you violate the spec, points *may be* taken off. The O(log(n)) stuff was clearly mentioned in the spec. I added it because something someone said reminded me that I didn't put it in the grading guidelines. *If* you did not use a BST for the route/message cache and *if* you are *not* completely sure that making it work with a BST will not break any of your existing code, I strongly suggest that you should let the 5 ponts go at this point of the project! Risking losing all those positive points just to save 5 negative points is not a good strategy. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Oct 28 14:44:40 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9SLieIO013172 for ; Fri, 28 Oct 2005 14:44:40 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9SLfeLR011704 for ; Fri, 28 Oct 2005 14:41:40 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9SLfecW011703 for cs551@merlot.usc.edu; Fri, 28 Oct 2005 14:41:40 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9SLfeAa011700 for ; Fri, 28 Oct 2005 14:41:40 -0700 Message-Id: <200510282141.j9SLfeAa011700@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: regarding TTL for Notify Date: Fri, 28 Oct 2005 14:41:40 -0700 From: william@bourbon.usc.edu Someone wrote: > What should be the TTL for Notify? Shouldn't it be one? > Also, when a regular node joins the network, should its neighbour > list consist of the beacon node? I'm not sure what you mean by "neighbor list". But if you mean "init_neighbor_list file", please look at slide 14 of lecture 10 to see that it doesn't have to be the case. > And after joining the network, when the regular node is going > down, should it send the NTFY msg? I'm not sure why you asked about "regular node". Remember, operationally, there is very little difference between a regular node and a beacon node. If a node is going down, it should send NTFY messages to its connected neighbors telling them that it is disconnecting. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Oct 28 07:55:34 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9SEtYrk003849 for ; Fri, 28 Oct 2005 07:55:34 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9SEqZIj010554 for ; Fri, 28 Oct 2005 07:52:35 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9SEqZ26010553 for cs551@merlot.usc.edu; Fri, 28 Oct 2005 07:52:35 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9SEqZWV010550 for ; Fri, 28 Oct 2005 07:52:35 -0700 Message-Id: <200510281452.j9SEqZWV010550@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Question Regarding Caching Date: Fri, 28 Oct 2005 07:52:35 -0700 From: william@bourbon.usc.edu Someone wrote: > We need to store UOIDs in to the cache. Specification states that > lookup of UOID in cache requires O(logn) efficeincy. So do we > need to implement a binary tree search? or is there any other > method for the lookup? You should use at least a binary search tree (which is probably the simplest for achieving O(log n) or better). You can also use other trees or hash tables. If you are out of time, you can just use a linked list and mention it in the README file and lose a few points. (I forgot to mention this in the grading guidlines, I'll need to mofidy it.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Oct 28 07:48:55 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9SEmtV6003699 for ; Fri, 28 Oct 2005 07:48:55 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9SEjulE010499 for ; Fri, 28 Oct 2005 07:45:56 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9SEju8D010498 for cs551@merlot.usc.edu; Fri, 28 Oct 2005 07:45:56 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9SEju9Q010495 for ; Fri, 28 Oct 2005 07:45:56 -0700 Message-Id: <200510281445.j9SEju9Q010495@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Broken pipe over connection Date: Fri, 28 Oct 2005 07:45:56 -0700 From: william@bourbon.usc.edu Someone wrote: > When my nodes establishes connection between them and one of the > node tries to send HLLO message, it gets broken pipe and > connection breaks. Any hint why this is happening? First make sure you are catching SIGPIPE. As I explained before, you should think of getting SIGPIPE as "normal" for network programming since you never know when the other size may disconnect. Not catching it is just asking for trouble! Given that you've caught SIGPIPE, I guess you are asking why would you get SIGPIPE if the other side has not closed the connection. Well, my guess is that it's a memory corruption bug that somehow affected your socket calls. Please see the usual URL: http://merlot.usc.edu/cs551-f05/projects.html#segfault -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Oct 27 14:18:07 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9RLI79p010801 for ; Thu, 27 Oct 2005 14:18:07 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9RLFBGY006649 for ; Thu, 27 Oct 2005 14:15:11 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9RLFB40006648 for cs551@merlot.usc.edu; Thu, 27 Oct 2005 14:15:11 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9RLFB3W006645 for ; Thu, 27 Oct 2005 14:15:11 -0700 Message-Id: <200510272115.j9RLFB3W006645@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: autoshut down Date: Thu, 27 Oct 2005 14:15:11 -0700 From: william@bourbon.usc.edu Someone wrote: > If I start 4 nodes one after the other - with my beacon node starting first > - my beacon obviously autoshuts down before the other nodes. Then those > nodes get a notify and they send out checks - if check fails, then go down > delete init_neighbor_list and try to send join to the beacon. But the beacon > is already dead. So join fails and they come out with no init_neighbor_list > file. Is this behavious correct. Or something else is expected when a > neighbor autoshuts down? Sounds right! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Oct 27 14:03:49 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9RL3niK010408 for ; Thu, 27 Oct 2005 14:03:49 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9RL0rXc006578 for ; Thu, 27 Oct 2005 14:00:53 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9RL0rpT006577 for cs551@merlot.usc.edu; Thu, 27 Oct 2005 14:00:53 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9RL0rLK006574 for ; Thu, 27 Oct 2005 14:00:53 -0700 Message-Id: <200510272100.j9RL0rLK006574@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: resetf1 Date: Thu, 27 Oct 2005 14:00:53 -0700 From: william@bourbon.usc.edu Someone wrote: > Is the node not supposed to shutdown for ctr-c in part one too? I am > handling ctr-c to safely shutdown the node. Since the server can take keyboard input and c during normal operation, you should not kill the server when c is entered. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Oct 27 12:35:53 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9RJZqh7008230 for ; Thu, 27 Oct 2005 12:35:53 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9RJWuBM006315 for ; Thu, 27 Oct 2005 12:32:56 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9RJWuCf006314 for cs551@merlot.usc.edu; Thu, 27 Oct 2005 12:32:56 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9RJWu6q006311 for ; Thu, 27 Oct 2005 12:32:56 -0700 Message-Id: <200510271932.j9RJWu6q006311@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: resetf1 Date: Thu, 27 Oct 2005 12:32:56 -0700 From: william@bourbon.usc.edu Someone wrote: > What does the ~/bin/resetf1 command do? Its saying command not found for me. Oops! Please do: mkdir ~/bin cp ~csci551b/bin/resetf1 ~/bin Here's the content of this file: #!/usr/bin/csh -f /bin/rm -rf ~/tmp/final1 mkdir ~/tmp/final1 foreach f (0 1 2 3 4 5 6 7 8 9) mkdir ~/tmp/final1/n0$f end It resets your ~/tmp/final1 directory. As you can see, it creates all the HomeDirs. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Oct 27 11:10:37 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9RIAbde006162 for ; Thu, 27 Oct 2005 11:10:37 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9RI7fSk005325 for ; Thu, 27 Oct 2005 11:07:41 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9RI7fXP005324 for cs551@merlot.usc.edu; Thu, 27 Oct 2005 11:07:41 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9RI7f4Z005321 for ; Thu, 27 Oct 2005 11:07:41 -0700 Message-Id: <200510271807.j9RI7f4Z005321@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Regarding Home Directory in Final project Date: Thu, 27 Oct 2005 11:07:41 -0700 From: william@bourbon.usc.edu Someone wrote: > I am making the homedir if it does not exists. Is that an error? That would be fine. From the grading guidelines, you can see that all the HomeDirs are created. In general, I don't think programatically creating a "top-level" directory is a good idea and would rather report a missing top-level directory as a configuration error. > Also in grading guidelines you have given the distance that we will see in > join reply. But our port numbers are different. Wudnt the distance be > different too? If you implement the calculation of distances correctly, the numbers will be the same when we use our ports. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Oct 27 07:57:54 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9REvst6001289 for ; Thu, 27 Oct 2005 07:57:54 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9REsw36002935 for ; Thu, 27 Oct 2005 07:54:58 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9REswWP002934 for cs551@merlot.usc.edu; Thu, 27 Oct 2005 07:54:58 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9REswpi002931 for ; Thu, 27 Oct 2005 07:54:58 -0700 Message-Id: <200510271454.j9REswpi002931@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Regarding Home Directory in Final project Date: Thu, 27 Oct 2005 07:54:58 -0700 From: william@bourbon.usc.edu Someone wrote: > Do we need to dyanmically create the directory defined in > homepath beacuse each node is having different folders to store > their logfile? > OR the directory already exists and we just need to create > logfile in the directory. I think it's reasonable to assume that if HomeDir does not exist, it's an error in the startup configure file. So, you can assume that HomeDir exists. If it doesn't exist, please make sure you print out an error message before your program exits. If you need to create directories inside HomeDir (for part 2), you can call mkdir() or equivalent. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Oct 26 16:47:23 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9QNlNCv011966 for ; Wed, 26 Oct 2005 16:47:23 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9QNiUIg031075 for ; Wed, 26 Oct 2005 16:44:30 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9QNiUmP031074 for cs551@merlot.usc.edu; Wed, 26 Oct 2005 16:44:30 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9QNiTlH031071 for ; Wed, 26 Oct 2005 16:44:29 -0700 Message-Id: <200510262344.j9QNiTlH031071@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Timout for waiting Status Responses Date: Wed, 26 Oct 2005 16:44:29 -0700 From: william@bourbon.usc.edu Someone wrote: > Which timeout field (i.e JoinTimeout or etc.) should be used for waiting > status response messages from neighbors? JoinTimeout should only be used for joins. For status response messages, you should base it on MsgLifetime because after a small multiple of MsgLifetime, you can assume that response messages will not be forward and there would be no point waiting. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Oct 26 09:52:15 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9QGqFjq002209 for ; Wed, 26 Oct 2005 09:52:15 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9QGnN9i026755 for ; Wed, 26 Oct 2005 09:49:23 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9QGnNHM026754 for cs551@merlot.usc.edu; Wed, 26 Oct 2005 09:49:23 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9QGnNYU026751 for ; Wed, 26 Oct 2005 09:49:23 -0700 Message-Id: <200510261649.j9QGnNYU026751@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Problem with Connect() Date: Wed, 26 Oct 2005 09:49:23 -0700 From: william@bourbon.usc.edu Someone wrote: > i have passed 3 arguments in connect().First one is socket file > descriptor,secound one is address of variable of type struct > sockaddr_in and third one is sizeof(that structure variable).So > its like > > struct sockaddr_in server; > conncet(sockfd,&server,sizeof(server)); That looks right (although I would typecast the 2nd argument to (struct sockaddr*) so that I won't get a compiler warning). Well, I would use the same code on a very very small program (such as warmup #1) and see if the same thing happen. If not, then you can do the binary search and find out where your have corrupted memory. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Wednesday, October 26, 2005 7:34 am Subject: Re: Problem with Connect() > Someone wrote: > > > when i am trying to connect using connect() its gives me error > > number 22 which says invalid arguments.I have already checked all > > the parameters and flow of the system its fine but still i m > > suddenly getting this error.Can yor please provide some guidence > > how can i solve this problem?? > > The man pages for connect() says: > > EINVAL > namelen is not the size of a valid address for the > specified address family. > > Please let me know exactly what you are passing to connect(). > > Are you saying that this works when your node started and > then stopped to work all of a sudden? If that's the case, > then my usual guess is that it's a memory corruption problem. > Please see: > > http://merlot.usc.edu/cs551-f05/projects.html#segfault > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Oct 26 07:51:03 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9QEp31t031889 for ; Wed, 26 Oct 2005 07:51:03 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9QEmBMG026344 for ; Wed, 26 Oct 2005 07:48:11 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9QEmBSH026343 for cs551@merlot.usc.edu; Wed, 26 Oct 2005 07:48:11 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9QEmBAT026340 for ; Wed, 26 Oct 2005 07:48:11 -0700 Message-Id: <200510261448.j9QEmBAT026340@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Question regarding Final project Date: Wed, 26 Oct 2005 07:48:11 -0700 From: william@bourbon.usc.edu Someone wrote: > I am facing a problem when I try to send and receive messages. > When the sender writes 1 byte at time on socket (method which we > have used in warmup project 1) receiver successfully read all the > bytes sent from sender. But when the sender try to send bytes in > burst (such as sender send 15 bytes in one write()) then Receiver > is unable to read all the bytes. Can you explain why this > happened? I don't know what might be causing this. What happens when you do 2 bytes at a time? 3 bytes at a time? Or have you tried all these values and it started to fail at 15? It's perfectly okay to read and write 1 byte at a time. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Oct 26 07:37:00 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9QEb0VV031556 for ; Wed, 26 Oct 2005 07:37:00 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9QEY8wP026237 for ; Wed, 26 Oct 2005 07:34:08 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9QEY89Q026236 for cs551@merlot.usc.edu; Wed, 26 Oct 2005 07:34:08 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9QEY898026233 for ; Wed, 26 Oct 2005 07:34:08 -0700 Message-Id: <200510261434.j9QEY898026233@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Problem with Connect() Date: Wed, 26 Oct 2005 07:34:08 -0700 From: william@bourbon.usc.edu Someone wrote: > when i am trying to connect using connect() its gives me error > number 22 which says invalid arguments.I have already checked all > the parameters and flow of the system its fine but still i m > suddenly getting this error.Can yor please provide some guidence > how can i solve this problem?? The man pages for connect() says: EINVAL namelen is not the size of a valid address for the specified address family. Please let me know exactly what you are passing to connect(). Are you saying that this works when your node started and then stopped to work all of a sudden? If that's the case, then my usual guess is that it's a memory corruption problem. Please see: http://merlot.usc.edu/cs551-f05/projects.html#segfault -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Oct 26 07:31:27 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9QEVRNZ031414 for ; Wed, 26 Oct 2005 07:31:27 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9QESaju026152 for ; Wed, 26 Oct 2005 07:28:36 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9QESara026151 for cs551@merlot.usc.edu; Wed, 26 Oct 2005 07:28:36 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9QESZ5S026148 for ; Wed, 26 Oct 2005 07:28:35 -0700 Message-Id: <200510261428.j9QESZ5S026148@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Question about log file. Date: Wed, 26 Oct 2005 07:28:35 -0700 From: william@bourbon.usc.edu Someone wrote: > I have some question about the log file. > > 1) Do I have to include triangle brackets,<>, in output format of log > file? > a) r 1130307991.780459 nunki.usc.edu_14152 JNRQ 42 255 101caf1f > 14152 nunki.usc.edu > b) r <1130307991.780459> <42> <255> > <101caf1f> <14152 nunki.usc.edu> > Which one is the correct one, a) or b) ? (a) is correct (you must not have <>). > 2) From the spec, the msgid field will show only the last 4 bytes, byte > 16th to 20th of SHA1. > I found that the last 4 bytes of SHA1 tend to be similar for two > input messages that are different only one byte. > On the other hand, in this case, the first 4 bytes tend to vary. > Can I log the first 4 bytes of SHA1 instead of the last 4 bytes? No. Please do it according to spec. For interoperability, you cannot choose what to log. If everyone logs the same way, there is hope to "trace" a packet as it goes across the network. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Oct 25 10:33:30 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9PHXTjN001680 for ; Tue, 25 Oct 2005 10:33:30 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9PHUfx5019693 for ; Tue, 25 Oct 2005 10:30:41 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9PHUf5Y019692 for cs551@merlot.usc.edu; Tue, 25 Oct 2005 10:30:41 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9PHUfta019689 for ; Tue, 25 Oct 2005 10:30:41 -0700 Message-Id: <200510251730.j9PHUfta019689@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: status message Date: Tue, 25 Oct 2005 10:30:41 -0700 From: william@bourbon.usc.edu Someone wrote: > Thank you. But when I get a reply - should I just add the the replying node > with a label 'n' in the nam file? I'm not sure what you mean here. You need to do what's necessary do make the file works with nam. > Or I shud also add all its neighbors as > alive nodes in the nam file? I'm not sure what is an "alive" node is a nam file. > What happens if I have duplicate nodes in nam file? I don't know. But it should be fairly simple to keep a list of nodes you've seen and don't print any duplicates. > I am asking this cuz it might be possible that a node replies to my status > req but its neighbors are beyond the TTL value and do not reply. So now I > knw that there is a link between this node and its neighbors but I do not > have those neighbors as alive nodes in my nam file. Well, let's say the first status reply you got is from A and it says that it has 3 neighbors, B, C, and D. Clearly, you can print the node lines for nodes A, B, C, and D. You can also print the links A-B, A-C, and A-D. If you get no messages from B, C, and D, that would be fine. If you get a message from B saying that it has neighbors A, and F, you should print the node line for node F and the links B-A and B-F. This seems to work. (Extra links in nam do not seem to cause problems.) -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] Sent: Tuesday, October 25, 2005 12:45 PM To: cs551@bourbon.usc.edu Subject: Re: status message Someone wrote: > When I send a status message with some TTL - I will get replies from lots of > nodes. > The reply will have the node's identity and its neighbors info. > What all can I infer from this info? > > That the node is alive? > Can I infer that its connection with its neighbors is alive? > Can I say that the neighbors r alive? I'm not sure why you are trying to use status messages to "infer" something. (This makes me think of the security problem regarding how to know if a node has not been taken over by malicious code... By receiving a message from a node, what do you really know?) > Now what happens when one of the neighbors of this node replies to my status > message? > Shud I just keep a list of info I get form each status reply and then at the > end write it to file? Yes. Since the requirement for is that it must be in the nam format, you can actually have duplicate links. So, if A is B's neighbor and B is A's neighbor, you can have 2 links in . This means that that when you get a status reply, you can just examine the content of the message and write the necessary information to the output file immediately. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Oct 25 07:59:01 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9PEx1wt030599 for ; Tue, 25 Oct 2005 07:59:01 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9PEuDH5018555 for ; Tue, 25 Oct 2005 07:56:13 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9PEuDFL018554 for cs551@merlot.usc.edu; Tue, 25 Oct 2005 07:56:13 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9PEuCFx018551 for ; Tue, 25 Oct 2005 07:56:12 -0700 Message-Id: <200510251456.j9PEuCFx018551@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: A Request Date: Tue, 25 Oct 2005 07:56:12 -0700 From: william@bourbon.usc.edu Someone wrote: > I have a request. Instead of having 30th Oct deadline for part I > and 21st Nov for part II, can we have a combined deadline of 21st > Nov for both the parts.This would give us flexibility and also > enough time.And also for 2nd part we have to have 1st part > ready.So we need to fix the part I after 30th Oct also.That's why > it would be very helpful to have a combined deadline of 21st Nov. I'm sorry, but I think that would be extremely unfair to those who have been working very very hard trying to make the coming deadline. So, I have to say no to the request. There is plenty of time to do part (1), if you start doing it early. Also, you were informed at the beginning about the dependencies between the 2 parts. It's really up to you to plan things to get the most points for both parts (and have enough time to do both). Also, there is no completely dependency between parts (1) and (2). For part (2), join and check do not have to work. You just need to be able to handle init_neighbor_list for a regular node. That's more reason that the 2 parts cannot be combined, as far as grading and scoring goes. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Oct 25 07:48:16 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9PEmGJG030361 for ; Tue, 25 Oct 2005 07:48:16 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9PEjSOU018518 for ; Tue, 25 Oct 2005 07:45:28 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9PEjSfB018517 for cs551@merlot.usc.edu; Tue, 25 Oct 2005 07:45:28 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9PEjSwv018514 for ; Tue, 25 Oct 2005 07:45:28 -0700 Message-Id: <200510251445.j9PEjSwv018514@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: status message Date: Tue, 25 Oct 2005 07:45:28 -0700 From: william@bourbon.usc.edu Someone wrote: > When I send a status message with some TTL - I will get replies from lots of > nodes. > The reply will have the node's identity and its neighbors info. > What all can I infer from this info? > > That the node is alive? > Can I infer that its connection with its neighbors is alive? > Can I say that the neighbors r alive? I'm not sure why you are trying to use status messages to "infer" something. (This makes me think of the security problem regarding how to know if a node has not been taken over by malicious code... By receiving a message from a node, what do you really know?) > Now what happens when one of the neighbors of this node replies to my status > message? > Shud I just keep a list of info I get form each status reply and then at the > end write it to file? Yes. Since the requirement for is that it must be in the nam format, you can actually have duplicate links. So, if A is B's neighbor and B is A's neighbor, you can have 2 links in . This means that that when you get a status reply, you can just examine the content of the message and write the necessary information to the output file immediately. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 24 15:03:05 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9OM35W1006851 for ; Mon, 24 Oct 2005 15:03:05 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9OM0K17014758 for ; Mon, 24 Oct 2005 15:00:20 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9OM0Kqn014757 for cs551@merlot; Mon, 24 Oct 2005 15:00:20 -0700 Date: Mon, 24 Oct 2005 15:00:20 -0700 From: william@bourbon.usc.edu Message-Id: <200510242200.j9OM0Kqn014757@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: "regrade" request for midterm... Hi, I just sent your midterm scores to you. I forgot to mention that there is no usual 1-week deadline to discuss your midterm grade. The deadline for "regrade" request for midterm is the last day of class (11/30/2005). You should probably concentrate on your final project part (1), which is due this coming Sunday, 10/30/2005. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Oct 22 19:33:11 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9N2XBh0019266 for ; Sat, 22 Oct 2005 19:33:11 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9N2UVfo013962 for ; Sat, 22 Oct 2005 19:30:31 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9N2UVUA013961 for cs551@merlot.usc.edu; Sat, 22 Oct 2005 19:30:31 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9N2UVit013958 for ; Sat, 22 Oct 2005 19:30:31 -0700 Message-Id: <200510230230.j9N2UVit013958@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Bi-directionality of neighbors Date: Sat, 22 Oct 2005 19:30:31 -0700 From: william@bourbon.usc.edu Someone wrote: > I was wondering the "meaning" of bi-directional in the neighbor > list > > a) Say A is a neighbor of B. It "might" happen that the neighbor > list of B does not contain A. This might be for multiple reasons, > B might maintain only a smaller subset, or that B might have > neighbors that are actually "closer" than A. for example, let > C,D,E be such that d(B,C or D or E) = 1, but d(A,B)=100. > In this "maintaining of list " sense the neighbor list is NOT > bi-directional. > > that leaves the conclusion > b) bi-directional ONLY for hello-handshake > which props 2 questions > 1. should B add A to list, respond to hello > 2. should B just send a hello response and just act as a means > for A to communicate to the rest of the world > > am i missing something here? I'm not sure what you meant by "neighbor list", so I cannot really answer your question. Do you mean "init_neighbor_list" (which is a file)? Or do you mean a "neighbor list" data structure in memory? Remmeber that the "init_neighbor_list" file is only created when a regular node joins and it's never modified (and deleted at proper times). If A is in B's "init_neighbor_list" file, it's *not* necessary that B will be in A's "init_neighbot_list" file. The "neighbor list" data structure can be modified. If A is in B's "neighbor list", then B must also be in A's "neighbor list". Could you clarify your question? -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Oct 22 08:56:05 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9MFu5Zp004890 for ; Sat, 22 Oct 2005 08:56:05 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9MFrRpN012404 for ; Sat, 22 Oct 2005 08:53:27 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9MFrRjX012403 for cs551@merlot.usc.edu; Sat, 22 Oct 2005 08:53:27 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9MFrRQf012400 for ; Sat, 22 Oct 2005 08:53:27 -0700 Message-Id: <200510221553.j9MFrRQf012400@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: join response msg Date: Sat, 22 Oct 2005 08:53:27 -0700 From: william@bourbon.usc.edu Someone wrote: > I had a question regarding the join response msg... > will the join response msg, directly go to the node who has sent > the join request, or it will be forwarded to every node in the > neighbor list, as it is said in the specs, that all the msgs are > forwarded. If node X got a join request message, even though the hostname and port number of the joining node information is in the join request message, node X must *not* create a connection to the joining node and send a join response message. It should do the usual thing with sending response messages. The only node that should behave differently here is the beacon node that has this "special connection" to the joining node in the sense that it will forward join response messages over this "special connection". (I'm referring this connection as "special" because it's different from a regular connection because the joing node is not participating in the network yet. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Oct 22 08:43:18 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9MFhIt1004565 for ; Sat, 22 Oct 2005 08:43:18 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9MFeeiP012210 for ; Sat, 22 Oct 2005 08:40:40 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9MFeeXq012209 for cs551@merlot.usc.edu; Sat, 22 Oct 2005 08:40:40 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9MFeeff012206 for ; Sat, 22 Oct 2005 08:40:40 -0700 Message-Id: <200510221540.j9MFeeff012206@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: closing socket Date: Sat, 22 Oct 2005 08:40:40 -0700 From: william@bourbon.usc.edu Someone wrote: > just a final clarification. > > When I do not receive keepalive msg from my neighbor for more than > keepalivetimeout time I send this node a notify message with error code = 0. > Is this right? Yes (and you close the connection right after). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Oct 21 21:33:21 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9M4XLg3017807 for ; Fri, 21 Oct 2005 21:33:21 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9M4Uiu7010492 for ; Fri, 21 Oct 2005 21:30:45 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9M4UiIs010491 for cs551@merlot.usc.edu; Fri, 21 Oct 2005 21:30:44 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9M4Ui8p010488 for ; Fri, 21 Oct 2005 21:30:44 -0700 Message-Id: <200510220430.j9M4Ui8p010488@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: closing socket Date: Fri, 21 Oct 2005 21:30:44 -0700 From: william@bourbon.usc.edu Someone wrote: > The error code of notify message has the following fields and I have a > doubt. > > 0 : Unknown > 1 : user shutdown > 2 : unexpected kill signal received > > I am shutting down only on following events - > 1. Auto Shutdown > 2. user says shutdown > 3. I kill my node with say a ctr-c (for now not in part 2). > > So will autoshutdown will go as error code 0 or 1? Auto shutdown and user entering the "shutdown" command should result in a notification code of 1. If you get a SIGINT, SIGTERM, etc., the notification code should be 2. Otherwise, the notification code should be 0. > Another doubt : > > Also will it close if I do not receive keep alive from a node in "keep > alive" time? This would be the "otherwise" condition mentioned above. So, the notification code should be 0. > If that is true then should the keepalive time of the whole > network be constant? Yes. You can assume that. > Or will I consider a node dead depending on my nodes keepalive timeout? You can assume all KeepAlive values are the same. > Or is there a concept like TCP's hold time, which shud be negotiated at > start up? There isn't such a thing here. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Oct 20 07:37:18 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9KEbIjc013170 for ; Thu, 20 Oct 2005 07:37:18 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9KEYmSP017756 for ; Thu, 20 Oct 2005 07:34:48 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9KEYmVQ017755 for cs551@merlot.usc.edu; Thu, 20 Oct 2005 07:34:48 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9KEYl5L017752 for ; Thu, 20 Oct 2005 07:34:47 -0700 Message-Id: <200510201434.j9KEYl5L017752@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: closing socket Date: Thu, 20 Oct 2005 07:34:47 -0700 From: william@bourbon.usc.edu Someone wrote: > i am having a problem in the final project. i am connecting to a > socket and the connection succeeds. but when i am trying to write > to that socket using the socket descriptor, it gives a Broken > Pipe error. > I tried looking the network statistics using netstat. the > connection is in established mode till a write is executed. but > as soon as a write is executed it goes in one of the closing > states. > Why is this happening? And what can be the solution for this? Did you use the same (or similar) code in warmup #1? If not, you should try this out on your warmup #1 and see if it dies the same way there. My guess is that you have memory corruption problem and that somehow manifested in this behavior. How to fix memory corruption problems? Unfortunately, there is no easy way. Please see: http://merlot.usc.edu/cs551-f05/projects.html#segfault -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Oct 18 16:36:48 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9INamD3022639 for ; Tue, 18 Oct 2005 16:36:48 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9INYOO2005822 for ; Tue, 18 Oct 2005 16:34:24 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9INYO2c005821 for cs551@merlot.usc.edu; Tue, 18 Oct 2005 16:34:24 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9INYOfT005818 for ; Tue, 18 Oct 2005 16:34:24 -0700 Message-Id: <200510182334.j9INYOfT005818@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: a doubt in CIDR Date: Tue, 18 Oct 2005 16:34:24 -0700 From: william@bourbon.usc.edu Someone wrote: > I have a doubt in CIDR. what addresses will "150.100.12.0/25" represent? > Is it "150.100.12.64" to "150.100.12.127" 150.100.12.0 is: 10010110 01100100 00001100 00000000 Therefore, the range is: 10010110 01100100 00001100 00000000 10010110 01100100 00001100 01111111 which is 150.100.12.0 through 150.100.12.127. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Oct 18 13:45:22 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9IKjM6I018713 for ; Tue, 18 Oct 2005 13:45:22 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9IKgwUZ005372 for ; Tue, 18 Oct 2005 13:42:58 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9IKgwGi005371 for cs551@merlot.usc.edu; Tue, 18 Oct 2005 13:42:58 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9IKgwxN005368 for ; Tue, 18 Oct 2005 13:42:58 -0700 Message-Id: <200510182042.j9IKgwxN005368@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS 551: Sample midterm? Date: Tue, 18 Oct 2005 13:42:58 -0700 From: william@bourbon.usc.edu Someone wrote: > Did you post a sample midterm? I seem to remember seeing an email about > this, but can¹t find it now. (On the other hand, perhaps I¹m just > confused...) I did not post a sample midterm. And I will not post a sample midterm. Sorry. I have described the format of the midterm at the beginning of yesterday's lecture. Mostly, we will have questions with short and medium length answers. Only the "best" answer will likely to get full credit. You are also strongly encouraged to work through the fair queueing / weighted fair queueing homework problem. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Oct 18 12:11:12 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9IJBCET015121 for ; Tue, 18 Oct 2005 12:11:12 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9IJ8mW7004287 for ; Tue, 18 Oct 2005 12:08:48 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9IJ8mfs004286 for cs551@merlot.usc.edu; Tue, 18 Oct 2005 12:08:48 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9IJ8mSL004283 for ; Tue, 18 Oct 2005 12:08:48 -0700 Message-Id: <200510181908.j9IJ8mSL004283@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: nam and ns Date: Tue, 18 Oct 2005 12:08:48 -0700 From: william@bourbon.usc.edu Someone wrote: > Are we suppose to prepare for nam ans ns questions in the midterm? No! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Oct 18 07:39:03 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9IEd3Yt007200 for ; Tue, 18 Oct 2005 07:39:03 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9IEaeIV002177 for ; Tue, 18 Oct 2005 07:36:40 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9IEaes5002176 for cs551@merlot.usc.edu; Tue, 18 Oct 2005 07:36:40 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9IEae4J002173 for ; Tue, 18 Oct 2005 07:36:40 -0700 Message-Id: <200510181436.j9IEae4J002173@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: BGP and Landmark routing Date: Tue, 18 Oct 2005 07:36:40 -0700 From: william@bourbon.usc.edu Someone wrote: > I have a few doubts in BGP and Landmark routing - > > 1. Where in the LOCAL_PREF value configured and how? I mean does every > router have a > LOCAL_PREF for some frequently visited destinations manually filled in by > the system admin? This is about policy routing. As the examples in the lectures pointed out, you can use it to achieve what you want to achieve (manually). It doesn't matter if a network prefix is frequently visited or not. > 2. In route reflectors, if RRC1 and RRC2 are clients of RR1. will RRC1 and > RRC2 communicate directly (tell each other abt the routes they have learned) > or they can only do this thru RR1? They will not. If there is no BGP session between 2 BGP speakers, they do not communicate directly. > 3. The slides say that landmark routing have the property that they can help > scaling. which is obvious. but then you have mentioned that there is a limit > to how many nodes can be there in a landmark network. isnt this > contradicting each other? or these r two different things? Good point! I think the general architecture of landmark hierarchy is scalable, but the implementation is not. You can probably have a one-million node landmark hierarchy if nodes will not join and leave frequently. The hierarchy can be built but it may take a while. May be people just haven't figured out a clever enough way to get it to built and self configure fast, yet. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 17 21:04:05 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9I445te024474 for ; Mon, 17 Oct 2005 21:04:05 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9I41h0T032542 for ; Mon, 17 Oct 2005 21:01:43 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9I41hLB032541 for cs551@merlot; Mon, 17 Oct 2005 21:01:43 -0700 Date: Mon, 17 Oct 2005 21:01:43 -0700 From: william@bourbon.usc.edu Message-Id: <200510180401.j9I41hLB032541@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: solution for problem3 of HW2 Hi, The solution for problem 3 of HW2 is posted at: http://merlot.usc.edu/cs551-f05/homeworks/sol-wfq.html I strongly suggest that you only look at the solution after you've tried solving the problem yourself. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Oct 17 07:57:48 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9HEvlfu006137 for ; Mon, 17 Oct 2005 07:57:47 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9HEtSKh027976 for ; Mon, 17 Oct 2005 07:55:28 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9HEtS6T027975 for cs551@merlot.usc.edu; Mon, 17 Oct 2005 07:55:28 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9HEtSQm027972 for ; Mon, 17 Oct 2005 07:55:28 -0700 Message-Id: <200510171455.j9HEtSQm027972@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: question about routing table in landmark routing Date: Mon, 17 Oct 2005 07:55:28 -0700 From: william@bourbon.usc.edu Someone wrote: > I have following question regarding landmark routing. > 1) What about interface entry? why is not there? is there > something to do with how the landmark works? is it something in > the protocol makes it infeasible to learn interface about your > connecting peers? As I've mentioned in lectures that it's there but not mentioned. It's whichever the interface it hears the corresponding node from during network self-configuration. > 2) Why is there Level entry in the router table, does it use as > TTL from the message originating for that Level router? No. It needs to know the level of a router during routing, such as the case depicted on slide 56 of lecture 11. > but can > we assume that as seen in landmark routing routes can be changed > inbetween is always better than the original , other wise the TTL > will expire. I don't know what you mean. > 3) If you get multiple learn about your peer from multiple way, > which entry do you keep? Probably the first one. Others are considered "duplicates". -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Oct 15 21:40:05 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9G4e5jU001127 for ; Sat, 15 Oct 2005 21:40:05 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9G4bprL001007 for ; Sat, 15 Oct 2005 21:37:51 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9G4bpjj001006 for cs551@merlot.usc.edu; Sat, 15 Oct 2005 21:37:51 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9G4bpvk001003 for ; Sat, 15 Oct 2005 21:37:51 -0700 Message-Id: <200510160437.j9G4bpvk001003@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: About Origin Path Attribute Date: Sat, 15 Oct 2005 21:37:51 -0700 From: william@bourbon.usc.edu Someone wrote: > What does origin path attribute of BGP update message exactly mean. The > slides say it is the information about how the path was generated at origin > AS. If the path is for say USC, then is USC the origin AS. Is this attribute > about how the path was generated within USC? If you look at slide 35 of lecture 8, it says "how" a prefix was learned and not "where". There are only 3 values for "how" and they are IGP, EGP, and Incomplete. One place you use this value is with rules (5) and (6) on slide 2 of lecture 9 (this is where you need to know if you've learned a prefix from IGP, EGP, or none of the above. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Oct 14 13:11:21 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9EKBLTo020400 for ; Fri, 14 Oct 2005 13:11:21 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9EK9CMm025777 for ; Fri, 14 Oct 2005 13:09:12 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9EK9CKV025776 for cs551@merlot.usc.edu; Fri, 14 Oct 2005 13:09:12 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9EK9C3G025773 for ; Fri, 14 Oct 2005 13:09:12 -0700 Message-Id: <200510142009.j9EK9C3G025773@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Question regarding CIDR Date: Fri, 14 Oct 2005 13:09:12 -0700 From: william@bourbon.usc.edu Someone wrote: > To continue with where the end of this attached mail. > After R1 cached ethernet address of H2, does it get entry in it > router table like > 155.100.12.128/25 - - emd 0 > 150.100.12.128 - - ethernet of H2 > here first entry gives direction to which h2 packet goes, and > second will tell the ethernet address of H2. No. The IP address of H2 is not in the "routing table". Remember, the slides there are about statically and manually configuring the "routing table". Clearly, you do not need to manually enter the IP address of H2 since this can be automatically discovered. > so when next packet comes for H2 , it will first do "Exact Match" > as per algorithm, it finds that is has that IP ( by definiton a > router should contain two entries 1. All the networks it > connected to 2. this network,hosts, interface ) , and just create > a ethernet frame with ethernet address of H2 and sends packet to H2. The exact way how things are done, after the longest prefix match, I would imagine it's implementation dependent. You are probably reading too much into the slides. Again, the lecture slides is about statically and manually configuring the "routing table". -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Friday, October 14, 2005 8:58 am Subject: Re: Question regarding CIDR > Someone wrote: > > > I have a doubt in slides set 25- 29 for CIDR where a static > > routing example is given. I could under stand everything but the > > interface entry in each router table. > > If R1 in the final step wants to deliver a packet to H2, just > > having interface 150.100.12.128/25 which tells R1 that H2 is on > > its north direction how could R1 know that MAC address of H2? > > does not it suppose to run ARP for H2's ip ? or does it just > > broadcast it to that LAN consisting H1 and H2. > > seems confusing to me. > > On slide 29 of lecture 5, you are correct that R1 would use > ARP to find the ethernet address of H2 and deliver the packet > directly to H2 instead of broadcast it on the 150.100.12.128/25 > LAN. > > I think your real question is why is the 3rd entry there if > R1 will just use ARP to learn about H1 and H2. The answer is > that if that entry is not there and R1 gets a packet for H1, > R1 will simply do a longest prefix match in the routing table. > The longest prefix match will result in selecting the 0.0.0.0/0 > (default) entry in the routing table and the packet will be > forwarded to the left. Therefore, you should have an entry > for 150.100.12.128/25 in R1's routing table so that R1 can > run ARP over interface emd0 (and cache the result) when it > gets a prefix match. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Oct 14 09:00:53 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9EG0rI9014703 for ; Fri, 14 Oct 2005 09:00:53 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9EFwieB024700 for ; Fri, 14 Oct 2005 08:58:44 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9EFwibR024699 for cs551@merlot.usc.edu; Fri, 14 Oct 2005 08:58:44 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9EFwi9I024696 for ; Fri, 14 Oct 2005 08:58:44 -0700 Message-Id: <200510141558.j9EFwi9I024696@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Question regarding CIDR Date: Fri, 14 Oct 2005 08:58:44 -0700 From: william@bourbon.usc.edu Someone wrote: > I have a doubt in slides set 25- 29 for CIDR where a static > routing example is given. I could under stand everything but the > interface entry in each router table. > If R1 in the final step wants to deliver a packet to H2, just > having interface 150.100.12.128/25 which tells R1 that H2 is on > its north direction how could R1 know that MAC address of H2? > does not it suppose to run ARP for H2's ip ? or does it just > broadcast it to that LAN consisting H1 and H2. > seems confusing to me. On slide 29 of lecture 5, you are correct that R1 would use ARP to find the ethernet address of H2 and deliver the packet directly to H2 instead of broadcast it on the 150.100.12.128/25 LAN. I think your real question is why is the 3rd entry there if R1 will just use ARP to learn about H1 and H2. The answer is that if that entry is not there and R1 gets a packet for H1, R1 will simply do a longest prefix match in the routing table. The longest prefix match will result in selecting the 0.0.0.0/0 (default) entry in the routing table and the packet will be forwarded to the left. Therefore, you should have an entry for 150.100.12.128/25 in R1's routing table so that R1 can run ARP over interface emd0 (and cache the result) when it gets a prefix match. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Oct 13 15:16:24 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9DMGOIw022302 for ; Thu, 13 Oct 2005 15:16:24 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9DMEIU6012775 for ; Thu, 13 Oct 2005 15:14:18 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9DMEIsX012773 for cs551@merlot; Thu, 13 Oct 2005 15:14:18 -0700 Date: Thu, 13 Oct 2005 15:14:18 -0700 From: william@bourbon.usc.edu Message-Id: <200510132214.j9DMEIsX012773@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: final project part (1) grading guidelines is available... Hi, I've just made the grading guidelines for final project part (1) available on the project spec (near the bottom). The grading guidelines is *very* long (more than 1,000 lines). It's probably not a good idea to read through it. Once your code is in a reasonable shape, you should just cut and paste from this file and see if things are what you expect. If you don't use csh/tcsh, you can simply do "tcsh" before you cut and paste. I've also added additional notes at the bottom of part (1) testdata page. There are some scripts that have been created to help you covert the test data files to use your own ports. The scripts is not bulletproof. So, please follow the instructions carefully and make sure you are in the *correct directory*! If you are in the wrong directory, press c right away! (The script does "rm -rf final1". So, please make sure you don't have a directory named final1 or your current working directory is not just above where all your code is.) It's probably a good idea to make a backup of your work before you run these scripts. If you have questions, please let me know. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Oct 13 07:54:12 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9DEsCeL011753 for ; Thu, 13 Oct 2005 07:54:12 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9DEq7g6001956 for ; Thu, 13 Oct 2005 07:52:07 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9DEq7jT001955 for cs551@merlot.usc.edu; Thu, 13 Oct 2005 07:52:07 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9DEq7RZ001952 for ; Thu, 13 Oct 2005 07:52:07 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9DEq7C6001951 for cs551; Thu, 13 Oct 2005 07:52:07 -0700 Date: Thu, 13 Oct 2005 07:52:07 -0700 From: william@bourbon.usc.edu Message-Id: <200510131452.j9DEq7C6001951@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: midterm exam coverage... Hi, I've just posted the midterm exam coverage on the class web page. I'll briefly talk about the format of the exam at the beginning of next class. Also, as I've mentioned in the last lecture, please work on problem 3 of HW2. I'll post a solution next Monday. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Oct 12 21:30:51 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9D4Up9R029121 for ; Wed, 12 Oct 2005 21:30:51 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9D4Slno032345 for ; Wed, 12 Oct 2005 21:28:47 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9D4SlDH032344 for cs551@merlot.usc.edu; Wed, 12 Oct 2005 21:28:47 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9D4Sl7j032341 for ; Wed, 12 Oct 2005 21:28:47 -0700 Message-Id: <200510130428.j9D4Sl7j032341@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS 551: No beacons? Date: Wed, 12 Oct 2005 21:28:47 -0700 From: william@bourbon.usc.edu Someone wrote: > The specification is silent on the desired behavior if no _beacons_ are > reachable from a non-beacon node. If _neighbors_ are available, the node > could participate until (unless) those connections were lost. What then? > > There are two reasonable behaviors I can see: 1) continue to try contacting > beacons at a TBD interval. 2) gracefully exit. > > Your preference, please? Please do not retry a beacon connection. If a regular node comes up and it does not have a init_neighbor_list file and cannot contact any beacon node, you should just inform the user and may be ask the user to try it at another time. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Oct 11 19:40:47 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9C2elRM024433 for ; Tue, 11 Oct 2005 19:40:47 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9C2cl7p026442 for ; Tue, 11 Oct 2005 19:38:47 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9C2clqH026441 for cs551@merlot.usc.edu; Tue, 11 Oct 2005 19:38:47 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9C2clJd026438 for ; Tue, 11 Oct 2005 19:38:47 -0700 Message-Id: <200510120238.j9C2clJd026438@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: keep alive and check message Date: Tue, 11 Oct 2005 19:38:47 -0700 From: william@bourbon.usc.edu Someone wrote: > 1.It is said in specs that if a node does not recieve any message > from its neighbour till KeepAliveTime > specified in start-up.ini then close the connection with this > neighbour. > This is fine but i did not understand when will a node send/get > keepalive msg? You can assume that all nodes have the same KeepAliveTimeout value. So, if a node's KeepAliveTimeout is 60, it could just send a keep alive message very 30 seconds or whatever you think is reasonable (anything greater or equal to 60 would not be reasonable). > 2.Also when should a node initiate[i.e., send] check and status > messages to another node? For status messages, you must wait for the user to enter a status command from the commeline. The purpose of check messages is to detect network partition. The only time a network can partition is when a connection is lost. Therefore, when a node loses a connection to a neighbor, you should flood a check message to see if it is still part of the SERVANT network. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Oct 11 08:53:13 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9BFrDCK009334 for ; Tue, 11 Oct 2005 08:53:13 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9BFpFwY024155 for ; Tue, 11 Oct 2005 08:51:15 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9BFpFDI024154 for cs551@merlot.usc.edu; Tue, 11 Oct 2005 08:51:15 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9BFpEM4024151 for ; Tue, 11 Oct 2005 08:51:14 -0700 Message-Id: <200510111551.j9BFpEM4024151@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Node ID uniqueness Date: Tue, 11 Oct 2005 08:51:14 -0700 From: william@bourbon.usc.edu Someone wrote: > The specification defines a Node ID as a hostname_port, and makes some > assumptions based on the uniqueness of that pairing. Of course, hostnames > themselves are not unique, as there may be many aliases for the same host. > For example, nunki, nunki.usc.edu, and 128.125.5.168 all refer to the same > host. > > The question is, should we resolve the hostname down to its lowest canonical > form, so that aliases resolve to the same Node ID? Or, should we keep them > as found in the init_neighbor_list, and/or .INI file, so that every name > generates a unique Node ID, even if some refer to the same physical host? You are absolute correct that there can be many names referring to the same host, so hostname is not necessarily unique. For the purpose of this project, please just use gethostname() (or equivalent) and use what's returned. On ISD machines, I think it will not return simply "nunki". Also, "128.125.5.168" should not be considered *the* hostname since it's an IP address (although you are correct that it can be used as a hostname). If we want to deploy this over the Internet, we should replace the hostnames by IP addresses to get every node to agree to on the node IDs. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Oct 9 14:38:52 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j99LcpEu013218 for ; Sun, 9 Oct 2005 14:38:52 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j99Lb080010128 for ; Sun, 9 Oct 2005 14:37:00 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j99Lb032010127 for cs551@merlot.usc.edu; Sun, 9 Oct 2005 14:37:00 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j99Lb01g010124 for ; Sun, 9 Oct 2005 14:37:00 -0700 Message-Id: <200510092137.j99Lb01g010124@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: entry for beacon node Date: Sun, 09 Oct 2005 14:37:00 -0700 From: william@bourbon.usc.edu Someone wrote: > Can we assume that beacon node entry in ini always ends with \n > for example > nunki.usc.edu:3030=\n > nunki.usc.edu:4040=\n I'm not sure what you are asking. The startup configuration file is an ASCII file where each line is, by definition, terminated by a '\n'. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Oct 9 00:03:54 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9973swj003022 for ; Sun, 9 Oct 2005 00:03:54 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j997258g018801 for ; Sun, 9 Oct 2005 00:02:05 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j99725AA018800 for cs551@merlot.usc.edu; Sun, 9 Oct 2005 00:02:05 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j99724eK018797 for ; Sun, 9 Oct 2005 00:02:04 -0700 Message-Id: <200510090702.j99724eK018797@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Beacon start-up Date: Sun, 09 Oct 2005 00:02:04 -0700 From: william@bourbon.usc.edu Someone wrote: > Thanks for the clarification. I have some more questions - > > 1. What should a beacon node do if, for some reason, it is not > able to connect to all other beacons ? Should it keep trying > after the Retry interval for ever ? Excatly! Forever! The reason is that the beacon nodes *must* form a full mesh. > 2. A beacon node would have as its neighbors all other beacons > and some of the non-beacons. Though this beacon does not have > init_neighbor_list, but it would need to maintain a neighbors > list data structure for talking to its neighbors. The question > here is - Should a message which needs to be flooded (say Join > Request) be sent to other beacons that are there in this beacon's > neighbors list data structure ? Of course! You should try to understand the spec, then questions like this will have obvious answers (since it's not reasonable to have other answers)! The spec is not arbitrary. Most things are the way they are for a reason. > 3. Under the commandline interface section of the specs, it says: > > For the status neighbors command, the format of the external file > should be in a form that can be read by nam. A sample of a 2-node > network (named status.out) is provided here. To display the > network, one can simply do: > > nam status.out > > Since we skipped ns and nam HWs, does this requirement still hold > ? Yes! (They are skipped for grading, but you were encouraged to do them.) Just looka t the sample file, run nam on it, and take a guess at the meaning of the entries. Try playing with it and you should be able to figure out what each field is. > 4. From the specs, it is apparent that "Mini File System" is > under Part 2 of this project. But, it is not clear which all > commands should we implement under Part 1 and which all can be > done later under Part 2 ? In the Deadlines section, near the bottom of the spec, it's quite clear what's required, if you have read the spec and understood the spec. If you have more specific questions, please let me know. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Saturday, October 8, 2005 10:47 pm Subject: Re: Beacon start-up > Someone wrote: > > > The specs say that when a beacon starts-up it should not send > > join requests. But again, this beacon should try to connect to > > all other beacons. Does that mean that it should send out "Hello" > > message to these other beacons in its .ini file ? > > Yes. When *any* two operational nodes get connected, the > first message on each direction of a connection must be a > HELLO message. If you see anything else before the first > HELLO message, you should drop it. > > > Also, should > > this beacon write out other beacons to its init_neighbor_list > > (doesn't look like a need for this) ? > > No! A beacon node does *not* have an init_neighbor_list. > > > So, in a sense, is the > > start-up of this beacon node similar to the participating > > start-up state of a non-beacon node ? > > You can think of it like the init_neighbor_list for a beacon > node is the [beacons] section of its startup configuration > file. The different is that if it cannot contact one of > the nodes, it should keep trying after the Retry interval. > > For the non-beacon node, when it comes up, it tries to connect > to all the nodes in its init_neighbor_list, if it cannot talk > to one of them, it never retries. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Oct 8 22:49:42 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j995ng4b000904 for ; Sat, 8 Oct 2005 22:49:42 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j995lqS3031358 for ; Sat, 8 Oct 2005 22:47:52 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j995lqO3031357 for cs551@merlot.usc.edu; Sat, 8 Oct 2005 22:47:52 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j995lqO8031354 for ; Sat, 8 Oct 2005 22:47:52 -0700 Message-Id: <200510090547.j995lqO8031354@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Beacon start-up Date: Sat, 08 Oct 2005 22:47:52 -0700 From: william@bourbon.usc.edu Someone wrote: > The specs say that when a beacon starts-up it should not send > join requests. But again, this beacon should try to connect to > all other beacons. Does that mean that it should send out "Hello" > message to these other beacons in its .ini file ? Yes. When *any* two operational nodes get connected, the first message on each direction of a connection must be a HELLO message. If you see anything else before the first HELLO message, you should drop it. > Also, should > this beacon write out other beacons to its init_neighbor_list > (doesn't look like a need for this) ? No! A beacon node does *not* have an init_neighbor_list. > So, in a sense, is the > start-up of this beacon node similar to the participating > start-up state of a non-beacon node ? You can think of it like the init_neighbor_list for a beacon node is the [beacons] section of its startup configuration file. The different is that if it cannot contact one of the nodes, it should keep trying after the Retry interval. For the non-beacon node, when it comes up, it tries to connect to all the nodes in its init_neighbor_list, if it cannot talk to one of them, it never retries. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Oct 8 08:14:26 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j98FEQom013099 for ; Sat, 8 Oct 2005 08:14:26 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j98FCdiR028917 for ; Sat, 8 Oct 2005 08:12:39 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j98FCd2Y028916 for cs551@merlot.usc.edu; Sat, 8 Oct 2005 08:12:39 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j98FCcZO028913 for ; Sat, 8 Oct 2005 08:12:38 -0700 Message-Id: <200510081512.j98FCcZO028913@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: regarding solving the ties Date: Sat, 08 Oct 2005 08:12:38 -0700 From: william@bourbon.usc.edu Someone wrote: > I had a query regarding solving the ties between the > connection... > > When should it be solved?shuld it be solved when the regular node > connects to a becan node? or just between the neighbours after > regular node comes up after getting the neighbor list and sending > the hello msg? Between *any* pair of operational nodes, your code must guarantee that they will only use one bi-directional connection to communicate. (So, even between a pair of beacon nodes, you need to handle this case.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Oct 8 08:10:10 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j98FAAcM012957 for ; Sat, 8 Oct 2005 08:10:10 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j98F8Nm6028850 for ; Sat, 8 Oct 2005 08:08:23 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j98F8NJK028849 for cs551@merlot.usc.edu; Sat, 8 Oct 2005 08:08:23 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j98F8Mmb028846 for ; Sat, 8 Oct 2005 08:08:22 -0700 Message-Id: <200510081508.j98F8Mmb028846@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Question regarding Init file Date: Sat, 08 Oct 2005 08:08:22 -0700 From: william@bourbon.usc.edu Someone wrote: > i do have one question regarding init file format.i have already > completed parsing of file,but now have following questions . > > Will there be more than 2 sections in init parsing file??I am > talking about initial nodes and beacons nodes.i mean right now we > are having two sections [init] and [beacon].So in any files will > be having only 2 sections?or more than that.As designing of > structures highly depends on this decesions. In general, of course, there can be more (or less) than 2 sections. If you write your code in a general way, you can also use it to parse other information. For grading purposes, you can just look at the test data files since that's pretty much all we are going to use. But where is the fun if you just code for a grade?! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 7 12:10:08 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j97JA5Ds022570 for ; Fri, 7 Oct 2005 12:10:07 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j97J8Lev022130 for ; Fri, 7 Oct 2005 12:08:21 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j97J8LLC022129 for cs551@merlot; Fri, 7 Oct 2005 12:08:21 -0700 Date: Fri, 7 Oct 2005 12:08:21 -0700 From: william@bourbon.usc.edu Message-Id: <200510071908.j97J8LLC022129@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: merlot.usc.edu is up Hi, The class web server is up. The electronic submission system is not running yet, but I don't expect anyone to submit anything soon, so that should be okay for now. If you see any problems, please let me know. Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Oct 5 23:15:37 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j966FbEY026559 for ; Wed, 5 Oct 2005 23:15:37 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j966DY5Y008447 for ; Wed, 5 Oct 2005 23:13:34 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j966DYin008446 for cs551@merlot.usc.edu; Wed, 5 Oct 2005 23:13:34 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j966DYEY008443 for ; Wed, 5 Oct 2005 23:13:34 -0700 Message-Id: <200510060613.j966DYEY008443@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: size of structure Date: Wed, 05 Oct 2005 23:13:34 -0700 From: william@bourbon.usc.edu Someone wrote: > I thinking of having message format with a structure . and > passing that structure as whole to as a message. But due to > complier byte optimization more than 27 bytes gets allocated. So > if receiving node is doing byte by byte reading ( as my code > should work with any standard receiving node) , chances are that > it could not extract exact fields. I dont is there any solution > to overcome this problem. I searched net, and they say something > about pragma setting. I have not ever done that, could you please > help me out here. You should create a 27 byte buffer, put the data in this buffer *carefully*. Go into the debugger and make sure that every byte is placed properly. Then do a single write() to send out the common header. Do the same for the rest of the message. If you cannot handle a 27 byte buffer, create a 1 byte buffer (for MessageType), a 20 byte buffer (for UOID), another 1 byte buffer (for TTL), and another 1 byte buffer (and put a zero there), and a 4 byte buffer (for Data Length), then call write() 5 times so that a total of 27 bytes get sent. Isn't this very similar to what you did for warmup project #1? -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Oct 5 22:45:06 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j965j54B025202 for ; Wed, 5 Oct 2005 22:45:05 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j965h3O1008240 for ; Wed, 5 Oct 2005 22:43:03 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j965h3e1008239 for cs551@merlot.usc.edu; Wed, 5 Oct 2005 22:43:03 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j965h3Dk008236 for ; Wed, 5 Oct 2005 22:43:03 -0700 Message-Id: <200510060543.j965h3Dk008236@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: designing questions Date: Wed, 05 Oct 2005 22:43:03 -0700 From: william@bourbon.usc.edu Someone wrote: > sorry for that abrupt question - i had completely missed out on > gethostname() function. I guess that solved my doubt. It is very straight forward. > just on more thing - > as we r not sending a node id in the hello msg, shud the other node generate > nodeid incase of a tie (for that NA>NB thing) In the HELLO message, you are sending the port number and hostname. You can (and you should) easily construct the node ID from that. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Oct 5 22:42:09 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j965g9kC025105 for ; Wed, 5 Oct 2005 22:42:09 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j965e72G008176 for ; Wed, 5 Oct 2005 22:40:07 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j965e78L008175 for cs551@merlot.usc.edu; Wed, 5 Oct 2005 22:40:07 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j965e6Fx008172 for ; Wed, 5 Oct 2005 22:40:06 -0700 Message-Id: <200510060540.j965e6Fx008172@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: designing questions Date: Wed, 05 Oct 2005 22:40:06 -0700 From: william@bourbon.usc.edu Someone wrote: > quick question - > in the nodeID - shud the hostname shud always be > nunki.usc.edu? > or r we expected to use gethostbyaddr or something like that. honestly this > is getting too complex if we r not going to use > nunki.usc.edu as default. You cannot assume it's going to be nunki.usc.edu. You should at least make sure that you can run one node on aludra.usc.edu. It's fairly easy to use gethostname() to get the hostname of the machine you are running on. You only need to do this once when your node starts up. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Oct 5 17:03:32 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9603WaA009800 for ; Wed, 5 Oct 2005 17:03:32 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9601Vv5007175 for ; Wed, 5 Oct 2005 17:01:31 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j9601VQF007174 for cs551@merlot.usc.edu; Wed, 5 Oct 2005 17:01:31 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j9601Uxj007171 for ; Wed, 5 Oct 2005 17:01:30 -0700 Message-Id: <200510060001.j9601Uxj007171@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: designing questions Date: Wed, 05 Oct 2005 17:01:30 -0700 From: william@bourbon.usc.edu Someone wrote: > Thanks for the quick reply. You gave me answer to my future > questions. But for the first question, I think I asked in the > wrong way. What I wanted to know is the when in the > implementation should thread comes in to the picture? should they > be delayed until they are must to make debugging easier or to > have them as early as possible? I would draw the picture I mentioned first. So, this means that you should think threads right away! What makes debugging easier is to have a clean design. If your shared resources are protected by mutexes and you code it in such a way that there is absolutely no chance for the a thread to access another thread's data, then your debugging will go easier. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Oct 5 16:38:06 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j95Nc6fK008617 for ; Wed, 5 Oct 2005 16:38:06 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j95Na4RG006978 for ; Wed, 5 Oct 2005 16:36:04 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j95Na4Mk006977 for cs551@merlot.usc.edu; Wed, 5 Oct 2005 16:36:04 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j95Na4F3006974 for ; Wed, 5 Oct 2005 16:36:04 -0700 Message-Id: <200510052336.j95Na4F3006974@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: designing questions Date: Wed, 05 Oct 2005 16:36:04 -0700 From: william@bourbon.usc.edu Someone wrote: > From the warmup #2 , I am not that confident playing around with > threads. When threads comes in to picture,debugging gets very > hard. Can you suggest what will be ideal time to make threads to > come in the project? For warmup #2, there is no ideal time to create threads! You must create all 3 threads (one for arrival and two for service) before you start the "simulation". For the final project, if you have no idea how to design your threads and your shared resources, you can look at slide 19 of lecture 10 and start from there. Again, the circles represent threads and the queues represent shared resources. Feel free to change anything there. But you need to decide where all your threads in the worst case. Draw a picture such as slide 19 of lecture 10 for it. After you've drawn that picture, you can decide how and when each thread got created. The way the project goes, you should probably create the network I/O threads dynamically (one thread or one pair of threads per neighbor). But all other threads must be running all the time, and therefore, must be created first. > I think there is a typo in no 2 ini you have provided. Its spells > neighbors in UK way rather than US way.I am sure parser should > not that general that it could consider even both spelling > version of neighbors :-) I've fixed the typos. The parser should only understand exact spelling! If there is a spelling error in the startup file, you can either ignore that line or report an error. (I would print an error to help the user debug the startup file.) > I am still confused about how to use select function to wait for > input in some file descriptor.How does it wait for socket data? Take slide 19 of lecture 10 as an example, all the network I/O threads on the left are just doing socket reads. Some may say that this is too wasteful. You can use one thread for it and use select() to see which socket has data that needs to be read. If you want to know exactly how you should call select(), there are tons of examples all over the web and in all kind of books. Find something that works for you. One place you can start is the Beej's Guide to Network Programming mentioned in: http://merlot.usc.edu/cs551-f05/description.html#resources -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Oct 5 16:12:48 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j95NCmYO007378 for ; Wed, 5 Oct 2005 16:12:48 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j95NAlNe006837 for ; Wed, 5 Oct 2005 16:10:47 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j95NAkRJ006836 for cs551@merlot; Wed, 5 Oct 2005 16:10:46 -0700 Date: Wed, 5 Oct 2005 16:10:46 -0700 From: william@bourbon.usc.edu Message-Id: <200510052310.j95NAkRJ006836@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: class web server down time for 10/6/05 and 10/7/05 Hi, The machine where the class web server resides will be brough down for maintenance starting around 3:30pm tomorrow (10/6/05). It will probably stay down until late night on 10/7/05. Please make a copy of the project spec if you need it! (In general, you should keep a copy of the project specs for future use.) Sorry about the inconvenience. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Oct 5 14:29:43 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j95LThQL002308 for ; Wed, 5 Oct 2005 14:29:43 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j95LRfIY004617 for ; Wed, 5 Oct 2005 14:27:41 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j95LRfdJ004616 for cs551@merlot.usc.edu; Wed, 5 Oct 2005 14:27:41 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j95LRfgH004613 for ; Wed, 5 Oct 2005 14:27:41 -0700 Message-Id: <200510052127.j95LRfgH004613@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: question in final project Date: Wed, 05 Oct 2005 14:27:41 -0700 From: william@bourbon.usc.edu Someone wrote: > 1. When the node comes up and is trying to connect to InitNeighbors, what > happens if one of the neighbor that the node has chosen dies before the node > can connect to it. Does the node compute a sorted list and keeps trying the > next one till it connects to a InitNeighbors number of neighbors? For a regular node, it never retries! (The case you mentioned assume that this node has not established a connection with the other node. So, there is no need to flood a CHECK message.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Oct 4 23:18:24 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j956IOB6023123 for ; Tue, 4 Oct 2005 23:18:24 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j956GPBL003461 for ; Tue, 4 Oct 2005 23:16:25 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j956GPOq003460 for cs551@merlot.usc.edu; Tue, 4 Oct 2005 23:16:25 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j956GOUq003457 for ; Tue, 4 Oct 2005 23:16:24 -0700 Message-Id: <200510050616.j956GOUq003457@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: hello msg Date: Tue, 04 Oct 2005 23:16:24 -0700 From: william@bourbon.usc.edu Someone wrote: > I understood the explanation you provided - differentiating > between "init_neighbor_list" and "neighbor list" data structure. > So once I have the two in place and I need to send a message (say > keepalive), should this message be sent to the neighbors as per > "init_neighbor_list" or as per "neighbor list" data structure ? I > think it should be the latter. Correct. > Also, I am assuming that "neighbor > list" data structure can grow or shrink dynamically i.e. we add > neighbors when we receive hello msg and we delete neighbors when > we receive notify msg. Please clarify Correct. > Moreover, if "neighbor list" data structure is what we use once > an instance is running, what is the point in having InitNeighbors > in the .ini file. Wouldn't MinNeighbors have sufficed as the rest > of the neighbors can anyways be found dynamically? If all nodes in the SERVANT network are up, InitNeighbors determines how spread-out the networks is (basically, related to the network diameter). MinNeighbors is usually 1, unless you want some assurance that the network is "tighter". > Also, one of the beacon nodes can be my neighbors and can get > added to "init_neighbor_list" and/or "neighbor list" - does that > change anything ? Here, a beacon node is just like a regular node. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Friday, September 30, 2005 1:45 pm Subject: Re: hello msg > Someone wrote: > > > I had some doubts about the hello message - > > > > Let the nodes be on same machine for convinience - so idnt > need to mention > > hostname. > > say node n1 is listening on port 1 > > node 2 is listening on port 2 > > > > Now node1 comes up and wants to start a connection with node2. > > 1. node1 will get a tmp port, say 100 from the OS and send a > hello to node2 > > on port 2. > > 2. node2 will accept this connection with node1 on port 2. So > now there is a > > connection between port 2 and port 100. > > 3. does node 2 send a hello msg to node 1 at port 1 or this > new port, port > > 100? > > Port 100. This is where node 2 says hello back to node 1 > on the same connection. > > > Also when node2 hears from node1 and sets up a connection, > will node 2 add > > node1 as its neighbours list? > > The key word is "init_" neighbor list, which is a file sitting > in node 2's HomeDir. The "init_neighbor_list" file is created > when node 2 joins the network. Once created, it is *never* > modified (until it's deleted). > > Therefore, node 2 can be in node 1's "init_neighbor_list" while > node 1 is *not* in node 2's "init_neighbor_list". > > You can also have a "neighbors list" data structure where you > keep track of who your neighbors are. This "neighbors" > relationship (not "init_neighbor_list" relationship) is > symmetric. If A is B's neighbor, then B is A's neighbor. > > So, please make sure you understand the difference between > just being "neighbors" and the "init_neighbor_list" files. > > > I had another doubt regarding join msg. > > If node1 send a join request, and its min neighbours = 3, but > there are no > > three nodes alive in the network at this time(say all beacons > havent come up > > yet), then what should node1 do? shut down? > > So you are talking about the case where InitNeighbors is less > than MinNeighbor. This is a configuration error. Although > you don't need to detect it, you should still work according > to the spec. Therefore, in this case, either you detect this > configuration error, or you can just stay in an infinite loop > of joinning and creating "init_neighbor_list" and restarting > and deleting "init_neighbor_list". > > > Please let me knw if these questions can be answered > differently, according > > to our design or there is a common "right" answer. > > The spec is very specific! These have a common "right" answer. > Please read the spec carefully. When in doubt, please send > me e-mail! > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 2 19:30:14 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j932UDlp013475 for ; Sun, 2 Oct 2005 19:30:14 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j932SLae016121 for ; Sun, 2 Oct 2005 19:28:21 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j932SLcX016120 for cs551@merlot; Sun, 2 Oct 2005 19:28:21 -0700 Date: Sun, 2 Oct 2005 19:28:21 -0700 From: william@bourbon.usc.edu Message-Id: <200510030228.j932SLcX016120@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: canceling office hour on Monday (10/3/05) Hi, I need to cancel another office hour tomorrow (10/3/05) and I won't be on campus in the afternoon. If you would like to see me, please make an appointment for Tuesday (10/4). Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Oct 1 09:08:09 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j91G89ij026947 for ; Sat, 1 Oct 2005 09:08:09 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j91G6MYm016818 for ; Sat, 1 Oct 2005 09:06:22 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j91G6Mk3016817 for cs551@merlot; Sat, 1 Oct 2005 09:06:22 -0700 Date: Sat, 1 Oct 2005 09:06:22 -0700 From: william@bourbon.usc.edu Message-Id: <200510011606.j91G6Mk3016817@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: disk quota increased... Hi, Some students in class had requested to increase disk quota because they are using some large libraries. If your disk quota was less than 100MB, it has been increased to 100MB for this semester *only*. This temporary increase will expire around the end of this year. So, please make sure you clean up your files when the semester ends. Otherwise, ISD might start deleting random files (I don't know what their policy is exactly). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 30 13:46:53 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8UKkrQg001634 for ; Fri, 30 Sep 2005 13:46:53 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8UKj8xp011621 for ; Fri, 30 Sep 2005 13:45:08 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j8UKj8gA011620 for cs551@merlot.usc.edu; Fri, 30 Sep 2005 13:45:08 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8UKj8LR011617 for ; Fri, 30 Sep 2005 13:45:08 -0700 Message-Id: <200509302045.j8UKj8LR011617@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: hello msg Date: Fri, 30 Sep 2005 13:45:08 -0700 From: william@bourbon.usc.edu Someone wrote: > I had some doubts about the hello message - > > Let the nodes be on same machine for convinience - so idnt need to mention > hostname. > say node n1 is listening on port 1 > node 2 is listening on port 2 > > Now node1 comes up and wants to start a connection with node2. > 1. node1 will get a tmp port, say 100 from the OS and send a hello to node2 > on port 2. > 2. node2 will accept this connection with node1 on port 2. So now there is a > connection between port 2 and port 100. > 3. does node 2 send a hello msg to node 1 at port 1 or this new port, port > 100? Port 100. This is where node 2 says hello back to node 1 on the same connection. > Also when node2 hears from node1 and sets up a connection, will node 2 add > node1 as its neighbours list? The key word is "init_" neighbor list, which is a file sitting in node 2's HomeDir. The "init_neighbor_list" file is created when node 2 joins the network. Once created, it is *never* modified (until it's deleted). Therefore, node 2 can be in node 1's "init_neighbor_list" while node 1 is *not* in node 2's "init_neighbor_list". You can also have a "neighbors list" data structure where you keep track of who your neighbors are. This "neighbors" relationship (not "init_neighbor_list" relationship) is symmetric. If A is B's neighbor, then B is A's neighbor. So, please make sure you understand the difference between just being "neighbors" and the "init_neighbor_list" files. > I had another doubt regarding join msg. > If node1 send a join request, and its min neighbours = 3, but there are no > three nodes alive in the network at this time(say all beacons havent come up > yet), then what should node1 do? shut down? So you are talking about the case where InitNeighbors is less than MinNeighbor. This is a configuration error. Although you don't need to detect it, you should still work according to the spec. Therefore, in this case, either you detect this configuration error, or you can just stay in an infinite loop of joinning and creating "init_neighbor_list" and restarting and deleting "init_neighbor_list". > Please let me knw if these questions can be answered differently, according > to our design or there is a common "right" answer. The spec is very specific! These have a common "right" answer. Please read the spec carefully. When in doubt, please send me e-mail! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Sep 29 07:42:07 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8TEg7LW027059 for ; Thu, 29 Sep 2005 07:42:07 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8TEeQla032154 for ; Thu, 29 Sep 2005 07:40:26 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j8TEeQ5K032153 for cs551@merlot.usc.edu; Thu, 29 Sep 2005 07:40:26 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8TEeQ3U032150 for ; Thu, 29 Sep 2005 07:40:26 -0700 Message-Id: <200509291440.j8TEeQ3U032150@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: .ini file format Date: Thu, 29 Sep 2005 07:40:26 -0700 From: william@bourbon.usc.edu Someone wrote: > The parser I am using mentioned the file format as - > > keyword=value; comment > > and i did not realise that the ';' is used only if there r comments, till i > listened to your todays lecture. > sorry again for not being careful enuf before asking tht question. No problem. So, our spec is a subset of the general spec. Any parser that would work with the general spec should also work with ours. If you are doing your own parser and would like to handle ';' anywhere, you can simply do the following immediately after you've read a line into line_buf: char *psz=strchr(line_buf, ';'); if (psz != NULL) *psz = '\0'; So, it's really easy to get rid of comments. -- Bill Cheng // bill.cheng@usc.edu ----Original Message Follows---- From: william@bourbon.usc.edu To: cs551@merlot.usc.edu Subject: Re: .ini file format Date: Wed, 28 Sep 2005 10:17:33 -0700 I forgot to mention something... Since we are not running on Windows, there will be some incompatibilities. For example, in Windows, the backslash character is a directory separator while in UNIX, it's an escape character. So, if the parse you use treated backshashes specifically, you need to fix it. (I don't know if this is an issue for our project or not.) Another incompatibility I can think of is that a line in Windows ends with "\r\n" while a line in UNIX ends with "\n". If your parser insists on ending a line with "\r\n", then you must fix it yourself. You must not require the INI file the TA will use to grade your submission to end each line with "\r\n". -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Wed, 28 Sep 2005 10:13:09 -0700 From: william@bourbon.usc.edu To: cs551@bourbon.usc.edu Subject: Re: .ini file format Someone wrote: > I checked the .ini file format thats commonly used. The only difference > between those and the one specified by you is that every line in the sect ion > ends with a ';'. Can you please add this to the specs, so that we can use > the ini parsers avaliable. I've never seen such a requirement! Here is the top 10 lines of my "C:\windows\win.ini" on my Windows XP machine: ; for 16-bit app support [fonts] [extensions] [mci extensions] [files] [Mail] MAPI=1 MAPIX=1 [MCI Extensions.BAK] aif=MPEGVideo You should try your parser on the INI files in the testcases page. If it works, then great! > Also I had a doubt. How long should a node wait for a check response (or for > that matter any response). ? Since a node in the middle of a network only caches messages for MsgLifetime seconds, one thing you can do is to wait for MsgLifetime+1 seconds or MsgLifetime*1.1 secdons. You can apply this logic to other timeouts, if appropriate. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Sep 28 10:19:10 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8SHJAT1001272 for ; Wed, 28 Sep 2005 10:19:10 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8SHHXXK027519 for ; Wed, 28 Sep 2005 10:17:33 -0700 Message-Id: <200509281717.j8SHHXXK027519@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: .ini file format Date: Wed, 28 Sep 2005 10:17:33 -0700 From: william@bourbon.usc.edu I forgot to mention something... Since we are not running on Windows, there will be some incompatibilities. For example, in Windows, the backslash character is a directory separator while in UNIX, it's an escape character. So, if the parse you use treated backshashes specifically, you need to fix it. (I don't know if this is an issue for our project or not.) Another incompatibility I can think of is that a line in Windows ends with "\r\n" while a line in UNIX ends with "\n". If your parser insists on ending a line with "\r\n", then you must fix it yourself. You must not require the INI file the TA will use to grade your submission to end each line with "\r\n". -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Wed, 28 Sep 2005 10:13:09 -0700 From: william@bourbon.usc.edu To: cs551@bourbon.usc.edu Subject: Re: .ini file format Someone wrote: > I checked the .ini file format thats commonly used. The only difference > between those and the one specified by you is that every line in the sect ion > ends with a ';'. Can you please add this to the specs, so that we can use > the ini parsers avaliable. I've never seen such a requirement! Here is the top 10 lines of my "C:\windows\win.ini" on my Windows XP machine: ; for 16-bit app support [fonts] [extensions] [mci extensions] [files] [Mail] MAPI=1 MAPIX=1 [MCI Extensions.BAK] aif=MPEGVideo You should try your parser on the INI files in the testcases page. If it works, then great! > Also I had a doubt. How long should a node wait for a check response (or for > that matter any response). ? Since a node in the middle of a network only caches messages for MsgLifetime seconds, one thing you can do is to wait for MsgLifetime+1 seconds or MsgLifetime*1.1 secdons. You can apply this logic to other timeouts, if appropriate. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Sep 28 10:14:46 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8SHEkJu001089 for ; Wed, 28 Sep 2005 10:14:46 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8SHD9Su027495 for ; Wed, 28 Sep 2005 10:13:09 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j8SHD9Pg027494 for cs551@merlot.usc.edu; Wed, 28 Sep 2005 10:13:09 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8SHD9Hk027491 for ; Wed, 28 Sep 2005 10:13:09 -0700 Message-Id: <200509281713.j8SHD9Hk027491@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: .ini file format Date: Wed, 28 Sep 2005 10:13:09 -0700 From: william@bourbon.usc.edu Someone wrote: > I checked the .ini file format thats commonly used. The only difference > between those and the one specified by you is that every line in the section > ends with a ';'. Can you please add this to the specs, so that we can use > the ini parsers avaliable. I've never seen such a requirement! Here is the top 10 lines of my "C:\windows\win.ini" on my Windows XP machine: ; for 16-bit app support [fonts] [extensions] [mci extensions] [files] [Mail] MAPI=1 MAPIX=1 [MCI Extensions.BAK] aif=MPEGVideo You should try your parser on the INI files in the testcases page. If it works, then great! > Also I had a doubt. How long should a node wait for a check response (or for > that matter any response). ? Since a node in the middle of a network only caches messages for MsgLifetime seconds, one thing you can do is to wait for MsgLifetime+1 seconds or MsgLifetime*1.1 secdons. You can apply this logic to other timeouts, if appropriate. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Sep 28 07:33:22 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8SEXM16026483 for ; Wed, 28 Sep 2005 07:33:22 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8SEVknE026551 for ; Wed, 28 Sep 2005 07:31:46 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j8SEVk1j026550 for cs551@merlot; Wed, 28 Sep 2005 07:31:46 -0700 Date: Wed, 28 Sep 2005 07:31:46 -0700 From: william@bourbon.usc.edu Message-Id: <200509281431.j8SEVk1j026550@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: office hour canceled today... Hi, I need to cancel office hour today (Wed 9/28). I will be on campus pretty much the whole day today. If you need to see me, please make an appointment for tomorrow. Thanks and sorry about the short notice. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Sep 25 15:17:47 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8PMHlpu012030 for ; Sun, 25 Sep 2005 15:17:47 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8PMGKLP004633 for ; Sun, 25 Sep 2005 15:16:20 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j8PMGKnT004632 for cs551@merlot.usc.edu; Sun, 25 Sep 2005 15:16:20 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8PMGKoE004629 for ; Sun, 25 Sep 2005 15:16:20 -0700 Message-Id: <200509252216.j8PMGKoE004629@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: calculating standard deviation Date: Sun, 25 Sep 2005 15:16:20 -0700 From: william@bourbon.usc.edu Someone wrote: | ----- Original Message ----- | From: william@bourbon.usc.edu | Date: Saturday, September 24, 2005 11:01 pm | Subject: Re: calculating standard deviation | | > ... | > Let's run through a simple example to calculate the average | > number of customers at Q. The following is a sequence of | > durations for Q (which can be derived from events at Q): | > | > Q has 0 customers for 100ms | > Q has 1 customers for 50ms | > Q has 2 customers for 250ms | > Q has 1 customers for 70ms | > Q has 0 customers for 80ms | | does it mean that if customer c2 is present in line2, it | can also be present in line 3 ??? If you number the customers th way I did in the spec, then the customer appeared in line 2 is c1. The only possibility that queue goes from 1 customer in it to 2 customers in it is that c2 arrives. Therefore, during line 3, customers c1 and c2 must have been in Q. Can you think of any other possibilities? -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Sep 25 15:11:32 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8PMBWls011748 for ; Sun, 25 Sep 2005 15:11:32 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8PMA4Z6004606 for ; Sun, 25 Sep 2005 15:10:04 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j8PMA4Bi004605 for cs551@merlot.usc.edu; Sun, 25 Sep 2005 15:10:04 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8PMA4gq004602 for ; Sun, 25 Sep 2005 15:10:04 -0700 Message-Id: <200509252210.j8PMA4gq004602@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: for -d det Date: Sun, 25 Sep 2005 15:10:04 -0700 From: william@bourbon.usc.edu Someone wrote: > I am sorry for sending a question regarding the mail below, so late. i just > read the output of this student carefully and realised that when his > inter-arrival time for c0 is 2000(hope micro secs), his/her display says > > 000000002.010: c0 arrives. Inter-arrival time: 2000 > shouldnt it be - > 000002.010ms: c0 arrives. inter-arrival time = 000002.010ms > > it looks like - > 1. the inter-arrival time he gets from GetInterval function is 2.000 ms and > his book keeping time is 0.01ms which is not considered in the inter-arrival > time or something like that. > > Is that right? Clearly, the previous student's output has many errors. I didn't mention all of them. The spec is very clear about the format. So, let's not look at his/her output for this discussion. The interarrival time is just the time between arrivals. If you print out c1 arrives at t1 and c2 arrives at t2, then the interarrival time you must print is t2-t1. -- Bill Cheng // bill.cheng@usc.edu ----Original Message Follows---- From: william@bourbon.usc.edu To: cs551@bourbon.usc.edu Subject: Re: for -d det Date: Fri, 23 Sep 2005 22:59:01 -0700 Someone wrote: > I executed my program with lambda and mu = 0.5 with -d det > [i.e., fixed inter arrival times and service times = 2000ms] > I have a problem in inter-arrival times. > For every customer, I'm getting a difference of 10ms. > So, c0 is arriving at 2.010s > c1 at 4.020s > c2 at 6.030s > c3 at 8.040s > ... > > Before sleeping, i deducted the bookkeeping time [i.e., the time taken to > add the customer into the Q] from the inter-arrival time. > Is this time difference in inter arrival time acceptable... As I've mentioned before, anything is acceptable. Will you get full credit? I cannot tell you before the submission deadline. > here is part of my output > 000000000.000: emulation begins > 000000002.010: c0 enters Q > 000000002.011: c0 leaves Q. arrtime : 2000.000000 Time in Q 0.001000 > 000000002.011: c0 begin service > 000000004.020: c0 departs. service_time: 2000.000000 > time in system: 2.010000ms > 000000004.020: c1 arrives. Inter-arrival time: 2000 > 000000004.021: c1 leaves Q. arrtime : 4000.000000 Time in Q 0.000000 > 000000004.021: c1 begin service > 000000006.030: c1 departs. service_time: 2000.000000 > time in system: 2.010000ms > 000000006.030: c2 arrives. Inter-arrival time: 2000 > 000000006.031: c2 enters Q > 000000006.031: c2 leaves Q. arrtime : 6000.000000 Time in Q 0.000000 > 000000006.031: c2 begin service > 000000008.040: c2 departs. service_time: 2000.000000 > time in system: 2.010000ms > > 000000008.040: c3 arrives. Inter-arrival time: 2000 > 000000008.040: c3 enters Q The spec is pretty clear about *not* breaking a trace line. I'm not sure why you have the departure lines broken and have different number of leading space characters when they are broken. You also seem to have extra blank lines. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Sep 25 15:04:17 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8PM4Hgi011458 for ; Sun, 25 Sep 2005 15:04:17 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8PM2nli004580 for ; Sun, 25 Sep 2005 15:02:49 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j8PM2nd4004579 for cs551@merlot.usc.edu; Sun, 25 Sep 2005 15:02:49 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8PM2nMN004576 for ; Sun, 25 Sep 2005 15:02:49 -0700 Message-Id: <200509252202.j8PM2nMN004576@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: calculating standard deviation Date: Sun, 25 Sep 2005 15:02:49 -0700 From: william@bourbon.usc.edu Someone wrote: > I had a question regarding the interarrival time for the > exponential as well as the deterministic approach.. > > suppose the interval generated for c1 is 300ms and the > book-keeping time is 50 ms, then the sleeping time shuld be > 250ms. I assume you meant that the generated interarrival time between c1 and c2 is 300ms. Then you would be correct. > after the sleep, if the servers are having the context > then the queue has to wait for the context switch. so in this > case, will the inter-arrivaltime depend on the context getting to > the queue? The interarrival time is the time between arrivals. It has nothing to do with getting into the queue! If you are standing outside the bank recording the interarrival times for the customers, you probably don't even know that customers must get into a queue inside the bank! > same question with the deterministic approach also.... then in > this case, the interarrival time will not be same. is it ok? I'm not sure what "is it okay" mean. Anything that's not wrong is okay. If you are asking about getting full credit, then it all depends. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Sep 24 23:44:01 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8P6i0JS012224 for ; Sat, 24 Sep 2005 23:44:00 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8P6gZ18011642 for ; Sat, 24 Sep 2005 23:42:35 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j8P6gZoK011641 for cs551@merlot.usc.edu; Sat, 24 Sep 2005 23:42:35 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8P6gZkj011638 for ; Sat, 24 Sep 2005 23:42:35 -0700 Message-Id: <200509250642.j8P6gZkj011638@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: calculating standard deviation Date: Sat, 24 Sep 2005 23:42:35 -0700 From: william@bourbon.usc.edu Someone wrote: | On 9/24/05 7:24 PM, "william@bourbon.usc.edu" | wrote: | | ... [Text elided] | | > I would think that the originally way I suggested of using | > just a couple (or more) cummulative values is a lot simpler. | | I don't see how you can calculate these numbers _without_ using binning. | You have no way of knowing that "50% of the time, Q1 has one customer, and | 35% of the time Q1 has two customers," without storing on-the-fly | information about the total queue occupancy at each point in time. In my recent message with timestamp "Sat 24 Sep 23:01", you can see from my example how these percentages came about. For example, in: (0*100+1*50+2*250+1*70+0*80)/(100+50+250+70+80) [eq#1] You can rewrite it to be: (0*100)/(100+50+250+70+80) + (1*50)/(100+50+250+70+80) + (2*250)/(100+50+250+70+80) + (1*70)/(100+50+250+70+80) + (0*80)/(100+50+250+70+80) which is the same as: (0)*(100/(100+50+250+70+80)) + (1)*(50/(100+50+250+70+80)) + (2)*(250/(100+50+250+70+80)) + (1)*(70/(100+50+250+70+80)) + (0)*(80/(100+50+250+70+80)) which is the same as: 0 times fraction of total time the 1st interval took + 1 times fraction of total time the 2nd interval took + 2 times fraction of total time the 3rd interval took + 2 times fraction of total time the 4th interval took + 0 times fraction of total time the 5th interval took Therefore, the percentages are embedded in the cummulative values you keep. Part of it is in the numerator of eq#1 and part of it is in the denominator of eq#1 above. | It seems to me that it is only after the fact that you can determine, based | on the amount of time the queue was occupied by one customer, for example, | that that figure represented 50% of the _total_ time. | | The only way I see to hold these intermediate figures is to keep a list that | totals the time _i_ customers were in the queue (for each i<=n), then to | divide these intermediate totals by the total time to get the weighted | occupancy. | | Now, it could well be that I'm just being obsessive about this, and that | there's a simpler way. I just don't see it, though. In any case, I've | already implemented and submitted this solution, so I _hope_ it's right! :-) Well, if this is the first time you need to calculate this type of statistics, it may be a little strange. After you've figured it out once, then it's not so bad afterwards. These kind of statistics are very important in system analysis. It tells you where the bottlenecks are and if you have resource management problems. For networks, you need to have a fast way that does not use up too much space to calculate them on the fly. Here is a tough one... moving average. For a stock ticker, if you want to keep a 30-minute moving average, or a moving average of the last 500 trades, is there a way to do it with a small number of cummulative values? I cannot think of a cheap way to do this. This is why some would use an "Exponential Weighted Moving Average" instead of the real moving average that we are used to. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Sep 24 23:06:52 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8P66q7v010642 for ; Sat, 24 Sep 2005 23:06:52 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8P65RAD011571 for ; Sat, 24 Sep 2005 23:05:27 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j8P65RPj011570 for cs551@merlot.usc.edu; Sat, 24 Sep 2005 23:05:27 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8P65RQT011567 for ; Sat, 24 Sep 2005 23:05:27 -0700 Message-Id: <200509250605.j8P65RQT011567@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: calculating standard deviation Date: Sat, 24 Sep 2005 23:05:27 -0700 From: william@bourbon.usc.edu Someone wrote: | On 9/24/05 4:56 PM, "william@bourbon.usc.edu" | wrote: | | ... [Text elided] | | > Let's say that lambda is almost 2 and mu is 1 and take the | > simple deterministic case, then the servers are always busy | > (avg number of customers at S1 = avg number of customers at | > S2 = 1). So, only when the system is overloaded (lambda | > >= 2 times mu), the servers are always busy (and the tellers | > should quit and go work for another bank). Otherwise, | > the probability that a server is busy should be < 1. | | This only holds true if the busy-ness of the servers is measured from the | time the first customer reaches the end of the line (is removed from Q1) and | is at the teller window (is being served). | | Otherwise, because the base time of the system begins before the first | inter-arrival time, and due to _some_ queuing time (the time it takes the | customers to walk through the line), the average number of customers at the | tellers themselves will _always_ be less than 1. Yes. I should not have said "= 1". I should have said almost 1. The longer you run the simulation, the closer it gets to 1 (but can never exceed 1). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Sep 24 23:02:40 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8P62exB010459 for ; Sat, 24 Sep 2005 23:02:40 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8P61Fp0011544 for ; Sat, 24 Sep 2005 23:01:15 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j8P61F0F011543 for cs551@merlot.usc.edu; Sat, 24 Sep 2005 23:01:15 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8P61F1B011540 for ; Sat, 24 Sep 2005 23:01:15 -0700 Message-Id: <200509250601.j8P61F1B011540@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: calculating standard deviation Date: Sat, 24 Sep 2005 23:01:15 -0700 From: william@bourbon.usc.edu Someone wrote: | On 9/24/05 7:24 PM, "william@bourbon.usc.edu" | wrote: | | > Hmm... I thought the original question was about customers | > at the server. So, when you said "customers-per-Q", I | > assume you meant servers! If you are actually talking about | > the queue (Q), then using bins won't be a good idea because | > you need to know the total number of bins (unless you let | > it grows dynamically). Looks like you are using n. | | I said "Q" generically, where Q can be "Q1", "S1", or "S2". It seems to me | that the statistic is measured the same way in each case. And, yes, I grow | the number of bins dynamically. (It never shrinks, of course.) | | > I would think that the originally way I suggested of using | > just a couple (or more) cummulative values is a lot simpler. | | Hmmmm. Well, my reading of your calculation required the use of binning. | How much time was one customer in the queue (or being serviced), two | customers, etc. | | > I'm not sure what you meant by "utilization". Usually, | > utilization is a value between 0 and 1. The average of | > number of customers at the queue can certainly be more | > than 1 for a busy bank. | | Poor choice of words on my part. I realize the statistic is measuring the | average size of the queue. Your own interpretation is unclear, too, as you | characterize this statistic as "the probability that S1 is busy" (also 0-1). The difference between the queue and a server is that at any instance, the number of customers at a particular server is either 0 or 1, while the number of customers at the queue can be basically any number. Given that at any instance the number of customers at a particular server is either 0 or 1, the average number of customers at this server must be between 0 and 1. While this is not true for the queue. | I'm still not clear on what you want as the denominator in this calculation. | You may have intentionally avoided answering, so as not to give something | away. Nonetheless, the total time of simulation is an overestimate, I | believe. I'm not sure there is a single "right" answer here. Let's run through a simple example to calculate the average number of customers at Q. The following is a sequence of durations for Q (which can be derived from events at Q): Q has 0 customers for 100ms Q has 1 customers for 50ms Q has 2 customers for 250ms Q has 1 customers for 70ms Q has 0 customers for 80ms What's the average number of customers at Q? It's simply: (0*100+1*50+2*250+1*70+0*80)/(100+50+250+70+80)=1.12727272 If you just look at the first 3 durations, the average number of customers at Q is: (0*100+1*50+2*250)/(100+50+250)=1.375 So, you just need to store 2 numbers to calculate this statistics. The average number of customers at a server can be done in the same way. | In your example, you show the emulation beginning at t(0), but the first | customer arrival at t(312.112). It is hard to consider the bank teller line | "in use" before the first customer arrives! Hence, the start time (in this | example) must be 312.112. Well, I wouldn't say it "must be". The bank opens at 9am. What if no one shows up until 11am? Is it fair reporting to skip the first 2 hours for statistics calculation? | (This raises a larger question of why one would delay before the first | customer's arrival. I did, because you did in your example. It probably | makes more sense in to trigger a customer injection immediately upon | simulation startup, and to wait (and measure) the inter-arrival time from | that point. This is a different problem, though...) | | Looking further, at what point does the queue become inactive (which becomes | the end time for its utilization)? Is it inactive when the last customer is | removed, or when the server (teller) finishes with the customer? Depends on | what you're trying to measure. | | Similarly, at what point do you begin measuring the customers in the server? | When they arrive at the teller window, or when they showed up at the bank | entrance (Q1)? When do you stop measuring? When the bank closes its doors | (the simulation ends), or when the last customer leaves the teller? Determining the end time basically has 2 choices. If the bank closes its door at 5pm, but finishes serving the last customer at 5:10pm, what should be used for statistics calculation? It seems that 5:10pm would be more appropriate (although 5pm would be appropriate for statistics such as interarrival times and drop probabilities). Again, if the last customer leaves the bank at 3pm and the bank closes at 5pm, it would not be a fair statistics to stop counting at 3pm. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Sep 24 19:25:35 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8P2PZQi000759 for ; Sat, 24 Sep 2005 19:25:35 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8P2OA8q011074 for ; Sat, 24 Sep 2005 19:24:10 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j8P2OAFe011073 for cs551@merlot.usc.edu; Sat, 24 Sep 2005 19:24:10 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8P2OAjV011070 for ; Sat, 24 Sep 2005 19:24:10 -0700 Message-Id: <200509250224.j8P2OAjV011070@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: calculating standard deviation Date: Sat, 24 Sep 2005 19:24:10 -0700 From: william@bourbon.usc.edu Hmm... I thought the original question was about customers at the server. So, when you said "customers-per-Q", I assume you meant servers! If you are actually talking about the queue (Q), then using bins won't be a good idea because you need to know the total number of bins (unless you let it grows dynamically). Looks like you are using n. I would think that the originally way I suggested of using just a couple (or more) cummulative values is a lot simpler. I'm not sure what you meant by "utilization". Usually, utilization is a value between 0 and 1. The average of number of customers at the queue can certainly be more than 1 for a busy bank. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Sat, 24 Sep 2005 19:15:22 -0700 To: Bill Cheng Subject: Re: calculating standard deviation On 9/24/05 4:56 PM, "william@bourbon.usc.edu" wrote: > Someone wrote: > >> The "customers-per-Q" calculation did end up requiring a 'bin' type >> approach, though it didn't take long to implement. > > That would certainly work since you only need 2 bins. Perhaps I misunderstand your desired statistic, then. I implemented a set of _n_ bins that record the total amount of time that the queue was occupied by _i_ clients, where 0<=_i_<=_n_. That is, this method records the cumulative time _t_ the queue was occupied by at least _i_ clients, for each _i_. Thus, t(_i_) < t(_j_) for all _i_<_j_. By extension, t(1) then measures the total amount of time the queue was occupied by at least one client, which is the total time the queue was in use at all. The total utilization is then sum( _i_ * t(_i) ) / sum( t(_i_) ), for _i_ from 1 to _n_. (This is the similarity to a statistic with which I'm familiar, called "noise bins" ( L(_n_) ). These measure the amount of time the noise level _L_ is at least _i_ dB in level. Clearly, L(0) is the total measurement time, as the noise level is always (in this case) >= 0 dB.) You seem to suggest a different denominator, though what that should be is unclear. I think that my cumulative times are correct. But whereas I divide by sum( t(_i_) ), I think you divide by T(total), the total time of the simulation. My statistic measures the effective utilization, when the resource was being used at all. Your statistic, I think, measures the overall utilization. Can you please tell me if my presumptions are correct? Thank you. >> Students can tell if >> they got it right if S1 and S2 (if used) always come out to 1.0. (Only >> makes sense, since each server can only process one client at a time.) > > The would not be correct. The average number of customers > at S1 can be interpreted as the probability that S1 is busy. > > Let's say that lambda is almost 2 and mu is 1 and take the > simple deterministic case, then the servers are always busy > (avg number of customers at S1 = avg number of customers at > S2 = 1). So, only when the system is overloaded (lambda >> = 2 times mu), the servers are always busy (and the tellers > should quit and go work for another bank). Otherwise, > the probability that a server is busy should be < 1. > -- > Bill Cheng // bill.cheng@usc.edu > > > > > On 9/24/05 2:58 PM, "william@bourbon.usc.edu" > wrote: > >> Someone wrote: >> >>> I am not storing any customer info any where, and just update >>> stats on the fly when a customer left from the server. Everything >>> will work fine but Standard deviation. For that I have to >>> calculate average first and then apply std deviation formula with >>> each sample. I searched and found that there is a running method >>> for calculating std deviation, is it advisable? >> >> The standard deviation is just the square root of the variance. >> For a random variable X, the variance is the average of X^2 >> (X squared) minus the square of the average of X. If X is >> time spent in the system, and you know how to use a couple of >> variables to calculate the average of X, then it shouldn't be >> difficult to calculate the average of X^2. (By the way, watch >> out for units. Make sure they come out right.) >> >>> What is Avg number of customer at s1 means? is it simply just >>> number of customer served by s1 / total number customer? >> >> No. Please see my message with timestamp "Tue 20 Sep 23:04". >> -- >> Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Sep 24 16:58:18 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8ONwIuI026809 for ; Sat, 24 Sep 2005 16:58:18 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8ONusAL010243 for ; Sat, 24 Sep 2005 16:56:54 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j8ONusqB010242 for cs551@merlot.usc.edu; Sat, 24 Sep 2005 16:56:54 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8ONusTe010239 for ; Sat, 24 Sep 2005 16:56:54 -0700 Message-Id: <200509242356.j8ONusTe010239@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: calculating standard deviation Date: Sat, 24 Sep 2005 16:56:54 -0700 From: william@bourbon.usc.edu Someone wrote: > The "customers-per-Q" calculation did end up requiring a 'bin' type > approach, though it didn't take long to implement. That would certainly work since you only need 2 bins. > Students can tell if > they got it right if S1 and S2 (if used) always come out to 1.0. (Only > makes sense, since each server can only process one client at a time.) The would not be correct. The average number of customers at S1 can be interpreted as the probability that S1 is busy. Let's say that lambda is almost 2 and mu is 1 and take the simple deterministic case, then the servers are always busy (avg number of customers at S1 = avg number of customers at S2 = 1). So, only when the system is overloaded (lambda >= 2 times mu), the servers are always busy (and the tellers should quit and go work for another bank). Otherwise, the probability that a server is busy should be < 1. -- Bill Cheng // bill.cheng@usc.edu On 9/24/05 2:58 PM, "william@bourbon.usc.edu" wrote: > Someone wrote: > >> I am not storing any customer info any where, and just update >> stats on the fly when a customer left from the server. Everything >> will work fine but Standard deviation. For that I have to >> calculate average first and then apply std deviation formula with >> each sample. I searched and found that there is a running method >> for calculating std deviation, is it advisable? > > The standard deviation is just the square root of the variance. > For a random variable X, the variance is the average of X^2 > (X squared) minus the square of the average of X. If X is > time spent in the system, and you know how to use a couple of > variables to calculate the average of X, then it shouldn't be > difficult to calculate the average of X^2. (By the way, watch > out for units. Make sure they come out right.) > >> What is Avg number of customer at s1 means? is it simply just >> number of customer served by s1 / total number customer? > > No. Please see my message with timestamp "Tue 20 Sep 23:04". > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Sep 24 16:36:03 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8ONa3tM025844 for ; Sat, 24 Sep 2005 16:36:03 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8ONYcr8010204 for ; Sat, 24 Sep 2005 16:34:38 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j8ONYciY010203 for cs551@merlot.usc.edu; Sat, 24 Sep 2005 16:34:38 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8ONYc4m010200 for ; Sat, 24 Sep 2005 16:34:38 -0700 Message-Id: <200509242334.j8ONYc4m010200@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: command line arguments Date: Sat, 24 Sep 2005 16:34:38 -0700 From: william@bourbon.usc.edu Hi, Just forwarding a good suggestion from a student. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Sat, 24 Sep 2005 15:09:15 -0700 To: Bill Cheng Subject: Re: command line arguments Prof Cheng, You might tell them to show some initiative and find an open-source command line parsing library. There are _several_ out there. I used one (CmdLine, don't have the URL at my fingertips) to good effect. Took only about an hour to get it built and the required command line options configured. On 9/24/05 3:00 PM, "william@bourbon.usc.edu" wrote: > *This message was transferred with a trial version of CommuniGate(tm) Pro* > Someone wrote: > >> From the guidelines it looks like we dont have to error checking >> for command line arguments for this project. With these many >> options error checking will be very tuff work to code. >> So as long as our programming is working fine with given >> arguments, we should fine right? I mean grading would not be >> intented to break command line giving less number of arguments >> and all that. > > (This is what I'm afraid of when I give away grading > guidelines.) Have some pride in your code! Do it right > and do it for yourself (not for grade)! > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Sep 24 15:01:44 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8OM1iUu021664 for ; Sat, 24 Sep 2005 15:01:44 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8OM0KBp009883 for ; Sat, 24 Sep 2005 15:00:20 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j8OM0KV8009882 for cs551@merlot.usc.edu; Sat, 24 Sep 2005 15:00:20 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8OM0K42009879 for ; Sat, 24 Sep 2005 15:00:20 -0700 Message-Id: <200509242200.j8OM0K42009879@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: command line arguments Date: Sat, 24 Sep 2005 15:00:20 -0700 From: william@bourbon.usc.edu Someone wrote: > From the guidelines it looks like we dont have to error checking > for command line arguments for this project. With these many > options error checking will be very tuff work to code. > So as long as our programming is working fine with given > arguments, we should fine right? I mean grading would not be > intented to break command line giving less number of arguments > and all that. (This is what I'm afraid of when I give away grading guidelines.) Have some pride in your code! Do it right and do it for yourself (not for grade)! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Sep 24 14:59:43 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8OLxhlj021556 for ; Sat, 24 Sep 2005 14:59:43 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8OLwJGN009853 for ; Sat, 24 Sep 2005 14:58:19 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j8OLwJZs009852 for cs551@merlot.usc.edu; Sat, 24 Sep 2005 14:58:19 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8OLwJS1009849 for ; Sat, 24 Sep 2005 14:58:19 -0700 Message-Id: <200509242158.j8OLwJS1009849@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: calculating standard deviation Date: Sat, 24 Sep 2005 14:58:19 -0700 From: william@bourbon.usc.edu Someone wrote: > I am not storing any customer info any where, and just update > stats on the fly when a customer left from the server. Everything > will work fine but Standard deviation. For that I have to > calculate average first and then apply std deviation formula with > each sample. I searched and found that there is a running method > for calculating std deviation, is it advisable? The standard deviation is just the square root of the variance. For a random variable X, the variance is the average of X^2 (X squared) minus the square of the average of X. If X is time spent in the system, and you know how to use a couple of variables to calculate the average of X, then it shouldn't be difficult to calculate the average of X^2. (By the way, watch out for units. Make sure they come out right.) > What is Avg number of customer at s1 means? is it simply just > number of customer served by s1 / total number customer? No. Please see my message with timestamp "Tue 20 Sep 23:04". -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Sep 24 09:31:45 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8OGVjbE007202 for ; Sat, 24 Sep 2005 09:31:45 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8OGUMa5008856 for ; Sat, 24 Sep 2005 09:30:22 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j8OGUMQN008855 for cs551@merlot.usc.edu; Sat, 24 Sep 2005 09:30:22 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8OGUM8P008852 for ; Sat, 24 Sep 2005 09:30:22 -0700 Message-Id: <200509241630.j8OGUM8P008852@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS 551: Bloom filter link Date: Sat, 24 Sep 2005 09:30:22 -0700 From: william@bourbon.usc.edu Someone wrote: > The link to the ³Bloom Filter² website is dead. Fixed! Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Sep 24 09:30:33 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8OGUXfg007193 for ; Sat, 24 Sep 2005 09:30:33 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8OGTAmr008824 for ; Sat, 24 Sep 2005 09:29:10 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j8OGTApS008823 for cs551@merlot.usc.edu; Sat, 24 Sep 2005 09:29:10 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8OGTAtd008820 for ; Sat, 24 Sep 2005 09:29:10 -0700 Message-Id: <200509241629.j8OGTAtd008820@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS 551: Final project Date: Sat, 24 Sep 2005 09:29:10 -0700 From: william@bourbon.usc.edu Someone wrote: > I didn¹t realize you had already posted the final project requirements! > (You¹ve probably mentioned it in lecture, but I¹m running behind...) > > Regarding the INI file format, is this precise format fixed, or flexible? It's fixed and not flexible! The TA will use our own startup configuration (which is in the INI format) to test your program. > I have developed utilities to parse and create INI file structures. > Personally, though, there are more straightforward representations than INI > files, which I prefer if the format is not a given. If you see anything unusual with the INI format in the spec, please let me know. It should be fairly generic. But I might have errors or typo there. For testing, we will not use broken INI files! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Sep 24 09:26:12 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8OGQCat007002 for ; Sat, 24 Sep 2005 09:26:12 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8OGOnoC008793 for ; Sat, 24 Sep 2005 09:24:49 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j8OGOnqY008792 for cs551@merlot.usc.edu; Sat, 24 Sep 2005 09:24:49 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8OGOnIF008789 for ; Sat, 24 Sep 2005 09:24:49 -0700 Message-Id: <200509241624.j8OGOnIF008789@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Possible problem in posix/Monitor.cxx Date: Sat, 24 Sep 2005 09:24:49 -0700 From: william@bourbon.usc.edu Someone wrote: > Ha! I knew you would say that. Thank you for the (mild) ribbing. > > Actually, ZThreads appears to be one of the libraries that has been around > longest. At least as near as I can tell from it's history. Boost::Threads > _is_ probably more stable, but (unless you go to a lot of trouble), you have > to take all (50 MB+ for the _source_!), or nothing. I've used Boost on work > projects, but here it just wasn't worth it. > > I recall that you are not a fan of C++. For good reason, since your > background is more in the system-programming specifics. My background is not in system-programming. When I used to work for a software company, the biggest problem is with getting bug-free (well, as much bug-free as possible) software out the door. Some C++ "features" seemed to stand in the way of debugging and maintenance. My 3 biggest problem with C++ are (1) operator overloading (yuck), (2) templates, and (3) multiple inheritance. I guess I'm not the only person that has problems with these because Java got rid of all these "features". (I heard that someone has introduced templates back into Java.) All these 3 things makes it very difficult to maintain and debug someone else's code. Don't get me wrong, I think object oriented programming is a lot better than C. > But the abstraction > provided by class libraries like ZThread in my opinion greatly clarifies the > resulting programs. In my own business, I'll take clarity over speed or > even reliability any day. If it's clear code, I can usually make it faster, > or more reliable. Speed is usually not a big concern for me either. Speed really matters when you have competition! Once you got the code to work right, you can optimize and try to get the parts to work faster. Although one must makes good design decisions. If you start with an inherientlyl slow design, there is a limit on how fast it can go. > As to debugging, I would say that ZThreads has probably made it simpler than > what many of your students are struggling with. It enabled me to have the > basic multi-threading working the first day. This latest problem I reported > was so abstract and obscure that some may not have even noticed it at all. > I'm using your project as a test case, though, as to whether I'll apply this > library in commercial work. That's good to hear. Just want to make sure that everyone understands that no one gets special treatments in this class (as I've mentioned in the first lecture). If you spent a lot of time debugging code you got from elsewhere, you don't get any credit as far as the project score is concerned! You also cannot get an extension because of it. > I'll be curious to see what you throw at us for the final project. It's been posted. Although there is no link to the grading guidelines. I'll post that in a week or two. -- Bill Cheng // bill.cheng@usc.edu On 9/23/05 11:44 PM, "william@bourbon.usc.edu" wrote: > Well, I guess this is the price for using something that > hasn't been around long enough. I really hope you won't > run into more bugs when the final project rolls around. > -- > Bill Cheng // bill.cheng@usc.edu > > > > -----Original Message----- > Date: Fri, 23 Sep 2005 21:01:25 -0700 > To: Bill Cheng > Subject: FW: Possible problem in posix/Monitor.cxx > > Further updates on my earlier message. Allowing the wait to retry without > permitting the upper-level code to intervene has a potentially undesirable > side effect. It is impossible to issue a message to the user, telling him, > ³Yes, I heard your Ctl-C and am _not_ ignoring you...² > > [ deleted ] Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Sep 24 00:26:54 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8O7Qsg8011939 for ; Sat, 24 Sep 2005 00:26:54 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8O7PWX9003705 for ; Sat, 24 Sep 2005 00:25:32 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j8O7PWos003704 for cs551@merlot.usc.edu; Sat, 24 Sep 2005 00:25:32 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8O7PW5j003701 for ; Sat, 24 Sep 2005 00:25:32 -0700 Message-Id: <200509240725.j8O7PW5j003701@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: for -d det Date: Sat, 24 Sep 2005 00:25:31 -0700 From: william@bourbon.usc.edu Hi, I'm just forwarding a message from a student in class. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Sat, 24 Sep 2005 00:23:28 -0700 To: Bill Cheng Subject: Re: for -d det I found that the largest contributing factor to repeatability was (not surprisingly) the use of I/O inside the critical timing sections. It's easy enough to move these statements outside, and achieve much lower variability. You might suggest this to students struggling with this problem. On 9/23/05 10:59 PM, "william@bourbon.usc.edu" wrote: > *This message was transferred with a trial version of CommuniGate(tm) Pro* > Someone wrote: > >> I executed my program with lambda and mu = 0.5 with -d det >> [i.e., fixed inter arrival times and service times = 2000ms] >> I have a problem in inter-arrival times. >> For every customer, I'm getting a difference of 10ms. >> So, c0 is arriving at 2.010s >> c1 at 4.020s >> c2 at 6.030s >> c3 at 8.040s >> ... >> >> Before sleeping, i deducted the bookkeeping time [i.e., the time taken to >> add the customer into the Q] from the inter-arrival time. >> Is this time difference in inter arrival time acceptable... > > As I've mentioned before, anything is acceptable. Will you > get full credit? I cannot tell you before the submission > deadline. > >> here is part of my output >> 000000000.000: emulation begins >> 000000002.010: c0 arrives. Inter-arrival time: 2000 >> 000000002.010: c0 enters Q >> 000000002.011: c0 leaves Q. arrtime : 2000.000000 Time in Q 0.001000 >> 000000002.011: c0 begin service >> 000000004.020: c0 departs. service_time: 2000.000000 >> time in system: 2.010000ms >> 000000004.020: c1 arrives. Inter-arrival time: 2000 >> 000000004.021: c1 leaves Q. arrtime : 4000.000000 Time in Q 0.000000 >> 000000004.021: c1 begin service >> 000000006.030: c1 departs. service_time: 2000.000000 >> time in system: 2.010000ms >> 000000006.030: c2 arrives. Inter-arrival time: 2000 >> 000000006.031: c2 enters Q >> 000000006.031: c2 leaves Q. arrtime : 6000.000000 Time in Q 0.000000 >> 000000006.031: c2 begin service >> 000000008.040: c2 departs. service_time: 2000.000000 >> time in system: 2.010000ms >> >> 000000008.040: c3 arrives. Inter-arrival time: 2000 >> 000000008.040: c3 enters Q > > The spec is pretty clear about *not* breaking a trace line. > I'm not sure why you have the departure lines broken and > have different number of leading space characters when they > are broken. You also seem to have extra blank lines. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 23 23:47:43 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8O6lh5K010123 for ; Fri, 23 Sep 2005 23:47:43 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8O6kLLY003119 for ; Fri, 23 Sep 2005 23:46:22 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j8O6kLNg003118 for cs551@merlot.usc.edu; Fri, 23 Sep 2005 23:46:21 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8O6kLcs003115 for ; Fri, 23 Sep 2005 23:46:21 -0700 Message-Id: <200509240646.j8O6kLcs003115@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: which server is S1 and which is s2 Date: Fri, 23 Sep 2005 23:46:21 -0700 From: william@bourbon.usc.edu Someone wrote: > For statics of number of customers in s1 / s2. we have to assign > each thread a name. So who will be the s1 ? the first thread to > be excuted , or first thread to server the customer . or is there > something else we need to consider? Well, does it make a difference? -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 23 23:23:07 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8O6N7Yf009069 for ; Fri, 23 Sep 2005 23:23:07 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8O6LjSx003010 for ; Fri, 23 Sep 2005 23:21:45 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j8O6LjAX003009 for cs551@merlot.usc.edu; Fri, 23 Sep 2005 23:21:45 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8O6LjIl003006 for ; Fri, 23 Sep 2005 23:21:45 -0700 Message-Id: <200509240621.j8O6LjIl003006@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Possible problem in posix/Monitor.cxx Date: Fri, 23 Sep 2005 23:21:45 -0700 From: william@bourbon.usc.edu Hi, I'm forwarding a message from a student regarding ZThread. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Fri, 23 Sep 2005 20:34:28 -0700 From: Dan Ingold To: Bill Cheng Subject: FW: Possible problem in posix/Monitor.cxx Prof Cheng, This is probably more detail than most of your students want to get into. But if any of them are using ZThreads, I found and fixed a problem in the library, which caused occasional odd behavior in the presence of signals. I've attached an email to the library's author with the corrections. Please feel free to share this with other students, if any others are using ZThreads. Thank you, Professor. Regards, Dan ------ Forwarded Message From: Dan Ingold Date: Fri, 23 Sep 2005 20:29:02 -0700 To: "eric.crahen@gmail.com" Subject: Possible problem in posix/Monitor.cxx Eric, I think I have found a possible problem in posix/Monitor.cxx. It shows up when a signal occurs while a thread is waiting on a condition variable. On MacOSX (and possibly Solaris 9), a signal causes pthread_cond_wait() and pthread_cond_timedwait() to return prematurely, but not to indicate the usual EINTR status. Instead, they simply return zero. The problem showed up when I trapped SIGINT to set a global ³stop² flag. My threads check this flag periodically to make a graceful exit. If a thread happened to be in a wait-state, though, it woke prematurely (and chaos ensued...). (I hate debugging multi-threaded programs :-). This wait behavior, though, however counter-intuitive, agrees with the man pages, which do not mention EINTR as an expected return. (Looking on the Œnet, I see that some pthreads implementations do specify EINTR as a return value.) I haven¹t checked the standard itself, but the O¹Reilly Pthreads book says pthread_cond_*wait() can prematurely return for any reason. (With a zero status, presumably, as the only return code mentioned is EINVAL.) O¹Reilly says you always have to (re-) check the condition on which you¹re waiting. As a test, in Monitor.cxx I removed the status check in the pthread_cond_wait() loop, and changed the pthread_cond_timedwait() loop to check only ETIMEDOUT. (This in accordance with the man pages.) This change seemed to fix the behavior. Of course, now if one¹s program (because of some other bug) never satisfies the wait condition, the wait state never exits. But that¹s another problem. You shouldn¹t trap SIGINT unless you know how to solve it! Anyway, here are the diffs for the changes in posix/Monitor.cxx: > diff -r1.1.1.1 Monitor.cxx > 93c93,94 > < } while(status == EINTR && !pending(ANYTHING)); > --- >> // } while(status == EINTR && !pending(ANYTHING)); >> } while( !pending(ANYTHING) ); > 120c121,122 > < } while(status == EINTR && !pending(ANYTHING)); > --- >> // } while(status == EINTR && !pending(ANYTHING)); >> } while( !pending(ANYTHING) && ( status != ETIMEDOUT ) ); > (Sorry they¹re not in ³patch² format, but I don¹t know how to make CVS generate it!) You can ignore the re-ordering of the boolean clauses in the while() check. I did that when I was experimenting if this was a C boolean ³short-circuiting² problem. Please let me know if this rambling makes sense, Eric. Thanks for putting together a great package! Regards, Dan ------ End of Forwarded Message Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 23 23:14:10 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8O6EAt0008707 for ; Fri, 23 Sep 2005 23:14:10 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8O6Cmng002860 for ; Fri, 23 Sep 2005 23:12:48 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j8O6Cm2G002859 for cs551@merlot.usc.edu; Fri, 23 Sep 2005 23:12:48 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8O6CmmR002856 for ; Fri, 23 Sep 2005 23:12:48 -0700 Message-Id: <200509240612.j8O6CmmR002856@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS 551: Log messages Date: Fri, 23 Sep 2005 23:12:48 -0700 From: william@bourbon.usc.edu Someone wrote: > I have made some slight additions to the log messages, and want to make sure > they don't violate your requirements that specify their exact format. > > In particular, I added log messages that indicate when a Ctl-C has been > typed, so the user knows the program is not just ignoring him. I also issue > messages that indicate the status of waiting for the server(s) to empty the > queue, and ultimately exit. > > Finally, I augmented the "begin service" message to say, "cn begin service > in Sm," so that you know which of the servers picked up each customer. This > was for my own peace of mind, to persuade me that both servers were actually > doing something! > > These additions are easy enough to remove. Please let me know if that is > your preference. All of your additions make sense and are perfectly okay to add. (The last one should have been in the spec!) Please make sure you use the same format (so things line up). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 23 23:08:19 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8O68J8s008429 for ; Fri, 23 Sep 2005 23:08:19 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8O66vtd002827 for ; Fri, 23 Sep 2005 23:06:57 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j8O66vY0002826 for cs551@merlot.usc.edu; Fri, 23 Sep 2005 23:06:57 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8O66vsY002823 for ; Fri, 23 Sep 2005 23:06:57 -0700 Message-Id: <200509240606.j8O66vsY002823@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: inverse Date: Fri, 23 Sep 2005 23:06:57 -0700 From: william@bourbon.usc.edu Someone wrote: > If i set my lambda value to 4000 and run the simulation for 10,000 clients. > I am getting avg inter arrival time = 8.013 ms, which is 0.008013 sec > and 1/4000 = 0.00025 sec > I am completely confused with this result. I dont think my inverse function > is wrong. > it is > > interval = -(log(1-randon_value) / lambda); > do u see any error? > cuz both my service time and inter- arrival time r giving the same result. I cannot comment on your equation. If you want to see if things are correct, you should not run the simulation. Just generate the random numbers and compute the average and standard deviation! After you've decided that your equation is correct, then you can go ahead with the simulation. Otherwise, you may be debugging two things at the same time. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 23 23:00:23 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8O60NDX008073 for ; Fri, 23 Sep 2005 23:00:23 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8O5x1t3002718 for ; Fri, 23 Sep 2005 22:59:01 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j8O5x1nC002717 for cs551@merlot.usc.edu; Fri, 23 Sep 2005 22:59:01 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8O5x14s002714 for ; Fri, 23 Sep 2005 22:59:01 -0700 Message-Id: <200509240559.j8O5x14s002714@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: for -d det Date: Fri, 23 Sep 2005 22:59:01 -0700 From: william@bourbon.usc.edu Someone wrote: > I executed my program with lambda and mu = 0.5 with -d det > [i.e., fixed inter arrival times and service times = 2000ms] > I have a problem in inter-arrival times. > For every customer, I'm getting a difference of 10ms. > So, c0 is arriving at 2.010s > c1 at 4.020s > c2 at 6.030s > c3 at 8.040s > ... > > Before sleeping, i deducted the bookkeeping time [i.e., the time taken to > add the customer into the Q] from the inter-arrival time. > Is this time difference in inter arrival time acceptable... As I've mentioned before, anything is acceptable. Will you get full credit? I cannot tell you before the submission deadline. > here is part of my output > 000000000.000: emulation begins > 000000002.010: c0 arrives. Inter-arrival time: 2000 > 000000002.010: c0 enters Q > 000000002.011: c0 leaves Q. arrtime : 2000.000000 Time in Q 0.001000 > 000000002.011: c0 begin service > 000000004.020: c0 departs. service_time: 2000.000000 > time in system: 2.010000ms > 000000004.020: c1 arrives. Inter-arrival time: 2000 > 000000004.021: c1 leaves Q. arrtime : 4000.000000 Time in Q 0.000000 > 000000004.021: c1 begin service > 000000006.030: c1 departs. service_time: 2000.000000 > time in system: 2.010000ms > 000000006.030: c2 arrives. Inter-arrival time: 2000 > 000000006.031: c2 enters Q > 000000006.031: c2 leaves Q. arrtime : 6000.000000 Time in Q 0.000000 > 000000006.031: c2 begin service > 000000008.040: c2 departs. service_time: 2000.000000 > time in system: 2.010000ms > > 000000008.040: c3 arrives. Inter-arrival time: 2000 > 000000008.040: c3 enters Q The spec is pretty clear about *not* breaking a trace line. I'm not sure why you have the departure lines broken and have different number of leading space characters when they are broken. You also seem to have extra blank lines. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 23 16:11:00 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8NNB03i021279 for ; Fri, 23 Sep 2005 16:11:00 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8NN9ddq004695 for ; Fri, 23 Sep 2005 16:09:39 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j8NN9dgs004694 for cs551@merlot.usc.edu; Fri, 23 Sep 2005 16:09:39 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j8NN9diW004691 for ; Fri, 23 Sep 2005 16:09:39 -0700 Message-Id: <200509232309.j8NN9diW004691@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: time spent in Q In-reply-to: References: Comments: In-reply-to sruthi poddutur message dated "Fri, 23 Sep 2005 14:52:12 -0700." Date: Fri, 23 Sep 2005 16:09:39 -0700 From: william@bourbon.usc.edu Someone wrote: > I have a doubt regarding time spent in system. > Consider the following output: > 000000000.000 : emulation begins > 000000001.024: c0 arrives. Inter-arrival time: 1022ms > 000000001.024: c0 enters Q > 000000001.025: c0 leaves Q. Time in Q 0.001000s > 000000001.025: c0 begin service > 000000001.264: c0 departs. service_time: 232.000000ms > time in system: ______s > > for the time spent in the system,i'm displaying > wait time in Q + service time = 0.001 + 0.232 = 0.233s. > > I was wondering if this is correct or should i display > Depart time - arrvival time[not *actual* arrival time] = 1.264 - 1.024 = 0.242s It should be the 2nd case. Again, think about the bank line. The time in the system is the time you've spent inside the bank (although we consider you disappear from the bank as soon as you leave the teller). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Sep 22 23:56:41 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8N6uf8V020798 for ; Thu, 22 Sep 2005 23:56: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 j8N6qg1E019574 for ; Thu, 22 Sep 2005 23:52:42 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j8N6qgdK019572 for cs551@merlot.usc.edu; Thu, 22 Sep 2005 23:52: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 j8N6qg1E019569 for ; Thu, 22 Sep 2005 23:52:42 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j8N6qgpM019565 for ; Thu, 22 Sep 2005 23:52:42 -0700 Message-Id: <200509230652.j8N6qgpM019565@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: problem with gettimeofday() Date: Thu, 22 Sep 2005 23:52:42 -0700 From: william@bourbon.usc.edu Someone wrote: > The function for getting system time in usec, gettimeofday() is > returning time as 0.000000. I also checked it's return value > which is 0.And according to the documentation that should be it's > value.Can you please suggest something. > The code I have written is > > k=gettimeofday(&tv,NULL); > if(k==0) > printf("\nTime is %f\n",tv.tv_usec); > else > printf("\nError "); > > Result > > Time is 0.000000 I don't know why it's not working for you. Have you tried not using NULL as the 2nd argument? -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Sep 22 23:53:33 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8N6rXYQ020574 for ; Thu, 22 Sep 2005 23:53: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 j8N6nY1E019487 for ; Thu, 22 Sep 2005 23:49:34 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j8N6nYiH019485 for cs551@merlot.usc.edu; Thu, 22 Sep 2005 23:49: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 j8N6nY1E019482 for ; Thu, 22 Sep 2005 23:49:34 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j8N6nYxQ019478 for ; Thu, 22 Sep 2005 23:49:34 -0700 Message-Id: <200509230649.j8N6nYxQ019478@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: measured interval? Date: Thu, 22 Sep 2005 23:49:34 -0700 From: william@bourbon.usc.edu Someone wrote: > also wud the service time recorded for the client be the actual time it > slept or the time we got from the GetInterval function? > > same for inter arrival time too. You should only report the *actual* time. Otherwise, how should you interpret the output? -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Sep 22 23:50:12 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8N6oC64020459 for ; Thu, 22 Sep 2005 23:50: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 j8N6kE1E019464 for ; Thu, 22 Sep 2005 23:46:14 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j8N6kEDW019462 for cs551@merlot.usc.edu; Thu, 22 Sep 2005 23:46: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 j8N6kE1E019459 for ; Thu, 22 Sep 2005 23:46:14 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j8N6kEWm019455 for ; Thu, 22 Sep 2005 23:46:14 -0700 Message-Id: <200509230646.j8N6kEWm019455@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: service time Date: Thu, 22 Sep 2005 23:46:14 -0700 From: william@bourbon.usc.edu Someone wrote: > This probably is a repeat question, but I still want to be doubly sure of > what I am doing. > > The book keeping time of the server is basically the time it spents between > dequeuing the client and going to the select call. > so does the service time for the client begin the moment it is dequeued? The service time for the client begins when the server starts servicing it. For the banking example, when you leave the queue, you still need time to walk to the teller. The time to walk to the teller should not be counted as service time, right? > eg : ( i have used large whole numbers only for convinience. ) > > 123ms : c2 leaves Q1 > > 125ms : c2 begins service > 130ms : c2 departs. service time = 5 ms > > my stats r somewhere on these lines. So do u mean that i shud start my > service time counter as soon as c2 gets out of queue at 123ms and then when > i get to actual sleep at 125ms i shud just sleep for 3 ms instead of 5? > obviously the statement "c2 begins service" will also move up on the time > line by 2 ms. If the service is 5ms, you should sleep for 5ms. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Sep 22 23:45:38 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8N6jcQ0020183 for ; Thu, 22 Sep 2005 23:45: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 j8N6fd1E019437 for ; Thu, 22 Sep 2005 23:41:39 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j8N6fdcv019435 for cs551@merlot.usc.edu; Thu, 22 Sep 2005 23:41: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 j8N6fd1E019432 for ; Thu, 22 Sep 2005 23:41:39 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j8N6fdnW019428 for ; Thu, 22 Sep 2005 23:41:39 -0700 Message-Id: <200509230641.j8N6fdnW019428@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: question for given example Date: Thu, 22 Sep 2005 23:41:39 -0700 From: william@bourbon.usc.edu Someone wrote: > Example given in the specification say lamdba = 0.15 > customers/ second . that means one customer should arrive > around 6.66 seconds that means 6660 milliseconds. then how > come specs avg arrival time is around 330 milliseconds? The sample output does not come from a simulation run. I just entered some random number. It's there to illustrate the output format. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Sep 22 10:16:44 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8MHGi6D013691 for ; Thu, 22 Sep 2005 10:16: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 j8MHCm1E014154 for ; Thu, 22 Sep 2005 10:12:48 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j8MHCma9014152 for cs551@merlot.usc.edu; Thu, 22 Sep 2005 10:12: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 j8MHCm1E014149 for ; Thu, 22 Sep 2005 10:12:48 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j8MHCmFv014145 for ; Thu, 22 Sep 2005 10:12:48 -0700 Message-Id: <200509221712.j8MHCmFv014145@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS 551: Repeatability Date: Thu, 22 Sep 2005 10:12:48 -0700 From: william@bourbon.usc.edu Someone wrote: > Thank you for your analysis and help. I'll leave the code as is, and simply > comment on your observations. > > Ordering in calls to drand48() certainly would cause the observed behavior. > Since the problem is almost always observed on the last service time (of 3) > in my test, though, and all drand48()-derived numbers up to that point > agree, it is unlikely in this case. > > It is also possible that reentrant calls to drand48() might cause the > observed behavior. On some platforms (HP, for example), drand48() is not > reentrant. It is not (yet) clear whether this is the case for Solaris. > Protecting the drand48() call with a mutex does not solve the problem, > however, so non-reentrancy is an unlikely cause. > > That leaves scheduling as the likely culprit. Since my test machine has > only a single processor, all threads compete for the same resources. Since > system calls (within the sleep and time get functions) are yield points for > threads, I suspect that execution of another thread is interleaved, causing > the discrepancy. Right! After all the analysis, we are still left with guessing. But as long as the guesses are reasonable, that's the best we can do (without spending too much time on this). > The larger issue of software assurance deserves its own email. For a m/m/2 system, there are analytical solutions for the statistics we are calculating. That would take the uncertainty of software assurance out of the equation if the statistics are all we want. Therefore, sometimes we prefer analytical solutions over simulation, if a analytical solution exists and can be efficiently solved. This is the "hidden" message for this project! :-) -- Bill Cheng // bill.cheng@usc.edu On 9/21/05 10:50 PM, "william@bourbon.usc.edu" wrote: > *This message was transferred with a trial version of CommuniGate(tm) Pro* > Someone wrote: > >> It is pretty clear that you want to specify the seed so that you get a >> repeatable sequence of random numbers. This in turn implies that you expect >> a certain degree of run-to-run consistency in the various timings. >> >> I've managed to get sub-millisecond run-to-run consistency, _except_ that >> occasionally one of the timings, in one run only, is off by a large (10-30 >> ms) amount. These types of bizarre behavior in a multi-threaded program >> typically indicate a critical race, though they can be due to scheduling. >> >> I have exhausted the possibilities of finding the problem. It occurs >> between the following three lines (somewhat simplified), which wait for the >> service time: >> >> (1) long start = TimeStamp::nowOffset(); >> (2) nanosleep( Random::interval( drand(), mu ) ); >> (3) long end = TimeStamp::nowOffset(); >> >> Occasionally, ( end - start ), which is measured in uSec, is _substantially_ >> different from other runs at the same point. Now this can happen because >> >> a) the thread is "swapped out" between (1) and (2), or (2) and (3) >> b) nanosleep waits longer than usual, which it's allowed to do >> c) some critical race occurs (which I haven't been able to isolate) >> >> Other than this occasional mis-timing, the values between identical runs are >> consistent within about 10 usec (microseconds). But one value (usually the >> last service time) in one run may differ by 30 msec (milliseconds) from the >> other runs. > > Everything you've mentioned is correct. Another possibility > that I can think of is that your call to drand() may have > generated a different value because another call to drand() > somehow got in before this one. One way to remove this > uncertainty is to pre-generate all the interarrival times > and service times and keep them in lists and fetch them when > needed. Then by seeding the random number generater with > the same seed, your target interarrival times and services > times will always be the same. This is also good for debugging. > >> How hard do I need to work to isolate the inconsistency? Is this something >> you even care about? (It isn't mentioned in the grading guidelines, but >> consistency is clearly a desirable trait in simulations!) > > On a machine like nunki, I would think that 30ms is nothing! > Also, as I've mentioned before, we are doing time-driven > simulation here and it's non-repeatable by the nature of > time-driven simulation. Another thing is that, since this > is a pthreads exercise and not a simulation exercise, getting > things close is good enough. Also, if you run your simulation > long enough, things should average out to have similar results, > if you are coding things correctly. > > Regarding simulation in general, I just want everyone to > think about whether it's possible to be 100% sure that you > have no bugs in your simulation! If not, then how can one > make sure that when others use simulation to validate a > model, how much confidence can one really have? (Of course, > with event-driven simulation, things are under better control. > But if the simulation is complex, how can one be sure it has > no bugs? Who is verifying the correctness of the simulation?) > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Sep 21 22:54:08 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8M5s8TK008800 for ; Wed, 21 Sep 2005 22:54: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 j8M5oE1E005347 for ; Wed, 21 Sep 2005 22:50:14 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j8M5oEsE005345 for cs551@merlot.usc.edu; Wed, 21 Sep 2005 22: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 j8M5oE1E005342 for ; Wed, 21 Sep 2005 22:50:14 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j8M5oE8i005338 for ; Wed, 21 Sep 2005 22:50:14 -0700 Message-Id: <200509220550.j8M5oE8i005338@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS 551: Repeatability Date: Wed, 21 Sep 2005 22:50:14 -0700 From: william@bourbon.usc.edu Someone wrote: > It is pretty clear that you want to specify the seed so that you get a > repeatable sequence of random numbers. This in turn implies that you expect > a certain degree of run-to-run consistency in the various timings. > > I've managed to get sub-millisecond run-to-run consistency, _except_ that > occasionally one of the timings, in one run only, is off by a large (10-30 > ms) amount. These types of bizarre behavior in a multi-threaded program > typically indicate a critical race, though they can be due to scheduling. > > I have exhausted the possibilities of finding the problem. It occurs > between the following three lines (somewhat simplified), which wait for the > service time: > > (1) long start = TimeStamp::nowOffset(); > (2) nanosleep( Random::interval( drand(), mu ) ); > (3) long end = TimeStamp::nowOffset(); > > Occasionally, ( end - start ), which is measured in uSec, is _substantially_ > different from other runs at the same point. Now this can happen because > > a) the thread is "swapped out" between (1) and (2), or (2) and (3) > b) nanosleep waits longer than usual, which it's allowed to do > c) some critical race occurs (which I haven't been able to isolate) > > Other than this occasional mis-timing, the values between identical runs are > consistent within about 10 usec (microseconds). But one value (usually the > last service time) in one run may differ by 30 msec (milliseconds) from the > other runs. Everything you've mentioned is correct. Another possibility that I can think of is that your call to drand() may have generated a different value because another call to drand() somehow got in before this one. One way to remove this uncertainty is to pre-generate all the interarrival times and service times and keep them in lists and fetch them when needed. Then by seeding the random number generater with the same seed, your target interarrival times and services times will always be the same. This is also good for debugging. > How hard do I need to work to isolate the inconsistency? Is this something > you even care about? (It isn't mentioned in the grading guidelines, but > consistency is clearly a desirable trait in simulations!) On a machine like nunki, I would think that 30ms is nothing! Also, as I've mentioned before, we are doing time-driven simulation here and it's non-repeatable by the nature of time-driven simulation. Another thing is that, since this is a pthreads exercise and not a simulation exercise, getting things close is good enough. Also, if you run your simulation long enough, things should average out to have similar results, if you are coding things correctly. Regarding simulation in general, I just want everyone to think about whether it's possible to be 100% sure that you have no bugs in your simulation! If not, then how can one make sure that when others use simulation to validate a model, how much confidence can one really have? (Of course, with event-driven simulation, things are under better control. But if the simulation is complex, how can one be sure it has no bugs? Who is verifying the correctness of the simulation?) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Sep 21 17:15:01 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8M0F0IZ026085 for ; Wed, 21 Sep 2005 17:15: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 j8M0B81E004082 for ; Wed, 21 Sep 2005 17:11:08 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j8M0B8FD004080 for cs551@merlot.usc.edu; Wed, 21 Sep 2005 17:11: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 j8M0B81E004077 for ; Wed, 21 Sep 2005 17:11:08 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j8M0B84U004073 for ; Wed, 21 Sep 2005 17:11:08 -0700 Message-Id: <200509220011.j8M0B84U004073@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS 551: Queue statistics Date: Wed, 21 Sep 2005 17:11:08 -0700 From: william@bourbon.usc.edu Someone wrote: | On 9/20/05 11:04 PM, "william@bourbon.usc.edu" | wrote: | | ... [Text elided] | | > So, if 15% of the time, Q1 has zero customers, 50% of the | > time, Q1 has one customer, and 35% of the time Q1 has two | > customers, the expected number of customers you will see | > in the queue is 0*0.15+1*0.5+2*0.35=1.2. | | To do this accurately, I believe one must sample the size on some fixed time | interval, place the results into "bins", and then analyze the bins to | provide the required statistics. (I work with a piece of monitoring | equipment that does this.) | | Is this what you're looking for, or a more simplistic analysis? Perhaps | based on the (varying) point in time where the top-level code attempts to | insert a new customer into the queue? Still "bin'ing" the data, but not on | a fixed interval. There is an easier way... You just need to keep a sum of products and the total time. For example, if you had 2 customers for 7 seconds and 3 customers for 5 seconds, you just have to remember 2*7+3*5 and 3+5. At the end, you just divide the product by the total time. I think this would work for the average but I'm not completely sure. Please fix it if it's not right. I think most of the statistics can be calcualted this way by only keeping some kind of running average and a total count and duration. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Sep 20 23:25:31 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8L6PV0u007736 for ; Tue, 20 Sep 2005 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 j8L6Lg1E031686 for ; Tue, 20 Sep 2005 23:21:42 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j8L6Lgn7031684 for cs551@merlot.usc.edu; Tue, 20 Sep 2005 23:21: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 j8L6Lg1E031681 for ; Tue, 20 Sep 2005 23:21:42 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j8L6LgCv031677 for ; Tue, 20 Sep 2005 23:21:42 -0700 Message-Id: <200509210621.j8L6LgCv031677@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS 551: Statistic calculations? Date: Tue, 20 Sep 2005 23:21:42 -0700 From: william@bourbon.usc.edu Someone wrote: > It's pretty clear that the "average inter-arrival time" should include > dropped customers. It's also (though less) clear that the "average time in > system" _could_ include dropped customers, but maybe shouldn't. It _seems_ > clear that "average service time" should include only customers that were > serviced. > > Summarizing: > Inter-Arrival: all customers > Time in System: all customers > Service Time: non-dropped customers > > Can you please tell me if these assumptions are correct? The time-in-system should not include dropped customers. Although you are right that it could be argued that it may include dropped customers. But the question to think about is, what would be a good measure of time in the system and what does it really mean? Let's say your favorite bank figured out this great way to discourage customers from stepping inside the bank. As a result, many customers left before even entering the bank. The bank manager then advertises a really low average time in the system and brags about how efficient their operation is. Would you say he/she is honest? -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Sep 20 23:18:53 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8L6IrEB007457 for ; Tue, 20 Sep 2005 23:18: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 j8L6F51E031657 for ; Tue, 20 Sep 2005 23:15:05 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j8L6F5cH031655 for cs551@merlot.usc.edu; Tue, 20 Sep 2005 23:15: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 j8L6F41E031652 for ; Tue, 20 Sep 2005 23:15:04 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j8L6F46q031648 for ; Tue, 20 Sep 2005 23:15:04 -0700 Message-Id: <200509210615.j8L6F46q031648@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS 551: No bookkeeping in server? Date: Tue, 20 Sep 2005 23:15:04 -0700 From: william@bourbon.usc.edu Someone wrote: > I don't understand your assertion that "the bookkeeping time for servers > should be zero!" > > From what point is the service time to be measured? From the _arrival_ > (that is, creation) of the customer, before queuing it? Or from the time > the customer arrives at the _server_ (that is, the time at which the server > dequeues it)? The last one. > The latter interpretation is the only one I can reconcile with your > statement about zero bookkeeping time in the server. Otherwise, one must > account for all the delays from client creation to the point of starting the > service timer. Yes! Let's say that all bank tellers are equal. When you walk into the bank, you have some transaction that needs to be completed. The complexity of your transcation determines your service time. So, this service time is independt of how busy the bank was when you arrived at the bank and how long you wait in the queue. The service time begins when you are called by the first available teller. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Sep 20 23:08:28 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8L68SfF007009 for ; Tue, 20 Sep 2005 23:08: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 j8L64e1E031598 for ; Tue, 20 Sep 2005 23:04:40 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j8L64esd031596 for cs551@merlot.usc.edu; Tue, 20 Sep 2005 23:04: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 j8L64d1E031593 for ; Tue, 20 Sep 2005 23:04:39 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j8L64dSi031589 for ; Tue, 20 Sep 2005 23:04:39 -0700 Message-Id: <200509210604.j8L64dSi031589@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS 551: Queue statistics Date: Tue, 20 Sep 2005 23:04:39 -0700 From: william@bourbon.usc.edu Someone wrote: > Most of the statistics are obvious enough, but a couple elude me. When you > ask for the "average number of customers in Q1," it's not clear what the > denominator is. Average number per second? Average size of the queue when > an item is added? Deleted? Hmm... None of the above (and it's not a rate). The notion here is that if you arrive at the system at a random time, what's the expected number of customers you will see in the queue. So, if 15% of the time, Q1 has zero customers, 50% of the time, Q1 has one customer, and 35% of the time Q1 has two customers, the expected number of customers you will see in the queue is 0*0.15+1*0.5+2*0.35=1.2. > Similarly with the S1/S2 statistics. Since each server processes its > customers serially, there is only one in each server at a time. The only > number that makes sense is customers/second. (Of course, even customers/sec > is just the reciprocal of service time--sec/customer.) Similarly, if 45% of the time S1 is empty and 55% of the time S1 is busy, the average number of customers at S1 is 0*0.45+1*0.55=0.55 (which is the probability that S1 is busy). Customer/second would be the input/output rate of S1. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Sep 20 22:58:58 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8L5wwlw006559 for ; Tue, 20 Sep 2005 22:58: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 j8L5t91E031542 for ; Tue, 20 Sep 2005 22:55:09 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j8L5t9lM031540 for cs551@merlot.usc.edu; Tue, 20 Sep 2005 22:55: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 j8L5t91E031537 for ; Tue, 20 Sep 2005 22:55:09 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j8L5t9Bl031533 for ; Tue, 20 Sep 2005 22:55:09 -0700 Message-Id: <200509210555.j8L5t9Bl031533@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: broadcast Date: Tue, 20 Sep 2005 22:55:09 -0700 From: william@bourbon.usc.edu Someone wrote: > addendum to previous mail > Will thr_setconcurrency() will help any way to break that patterned out > put? No! You don't need to use any of the esoteric pthreads function for this project (or the final project). In general, I would say that if you are not doing anything in real-time (or near real-time), you don't need to mess with thread priority business. Use the clean and simply model of pthreads and you will end up with clean and maintainable code! -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Tuesday, September 20, 2005 10:09 am Subject: Re: broadcast > Someone wrote: > > > As mentioned in specification both servers are ideal , i use > > pthread_cond_wait for that. They are waiting just fine. > > now when arrival thread puts something in queue it > > pthread_cond_broadcast s for those two sleeping server threads. > > They wakes up fine. but when i run my code for any number of > > time, only one thread say thread A gets up. should not OS choose > > thread B to wake up any single run of code? . > > According to broadcast / cond_wait specification i read, if both > > them are sleeping on same cond varible and gets singal to wake, > > any one of it can wakeup. But for me it always some fixed thread > > who will wake up first. and which one wakes up depends on lambda > > and mu values. > > If both threads A and B got woken up, then it's working > properly. It's possible that internally on the Solaris > pthreads implementation, it compares the thread ID for the > threads and always wake up the one with smaller ID first. > (I just made this up. But it would be *a* "correct" > implementation.) The point is that you cannot count of > this specific behavior of the ordering and the correctness > of your program should not depend on this specific behavior. > Your program must work under the general behavior of > pthread_cond_broadcast(), if you choose to use this function. > > > Is it something wrong my implementation? > > Sorry, but I have no way to know! > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Sep 20 22:55:59 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8L5tx1L006377 for ; Tue, 20 Sep 2005 22:55: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 j8L5qA1E031517 for ; Tue, 20 Sep 2005 22:52:10 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j8L5qAW8031515 for cs551@merlot.usc.edu; Tue, 20 Sep 2005 22:52: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 j8L5qA1E031512 for ; Tue, 20 Sep 2005 22:52:10 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j8L5qAT5031508 for ; Tue, 20 Sep 2005 22:52:10 -0700 Message-Id: <200509210552.j8L5qAT5031508@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: broadcast Date: Tue, 20 Sep 2005 22:52:10 -0700 From: william@bourbon.usc.edu Someone wrote: > 1.This is following up my previous message i sent in the morning. > I have done some research on that. And It does follow some > patterns for deterministic model while I broadcast a signal to > two ideal threads. For some fix lambda and mu values with > deterministic arrival , no matter how many times i run my program > , it follows the same pattern that broadcast does not randomly > wake up one of the ideal ( sleeping on sig_wait) threads. Theory > says it should. The point I was trying to make was that you should treat it *as if* you don't know that there is a pattern. Then your code will always work! > 2. When we do cond_broadcast general framework should be following I'm not sure why you say "should be". There are variations that would probably work. It all depends on exactly how you do it. > lock_mutex > check for condition > if true send broadcast signal > modify condition > do soemthing else > unlock_mutex > > --> and at the signal wait thread > lock_mutex > while condition held > wait > modify condition > do something else > unlock_mutex > > Now , suppose condition is true in signal sending thread , so it > sends signal to wait thread so it returns immediately from sig > wait function, and cpu also gives it immediate run. Now as a side > effect of sigwait return it will try to own the lock. But the > signal broadcasting thread is still acquiring the mutex for > "modifying condition" and "do something else", so waiting thread > will go block on locking mutex. > Now to avoid this situation we send broad cast signal after > releasing the mutex from sending thread. Will it be right way to > do it? When you said "sigwait", do you mean sigwait() or you meant pthread_cond_wait()? If you meant sigwait(), then I don't see how it would work. If you meant pthread_cond_wait(), please note that the 2nd argument to pthread_cond_wait() should be a reference to the mutex in question. The idea here is that pthread_cond_wait() will not return until the mutex is acquired. Therefore, when you do the pthread_cond_broadcast() while holding the lock, the waiting threads will not "lose" the signaling of the condition because it hasn't acquired the mutex yet. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Tuesday, September 20, 2005 10:09 am Subject: Re: broadcast > Someone wrote: > > > As mentioned in specification both servers are ideal , i use > > pthread_cond_wait for that. They are waiting just fine. > > now when arrival thread puts something in queue it > > pthread_cond_broadcast s for those two sleeping server threads. > > They wakes up fine. but when i run my code for any number of > > time, only one thread say thread A gets up. should not OS choose > > thread B to wake up any single run of code? . > > According to broadcast / cond_wait specification i read, if both > > them are sleeping on same cond varible and gets singal to wake, > > any one of it can wakeup. But for me it always some fixed thread > > who will wake up first. and which one wakes up depends on lambda > > and mu values. > > If both threads A and B got woken up, then it's working > properly. It's possible that internally on the Solaris > pthreads implementation, it compares the thread ID for the > threads and always wake up the one with smaller ID first. > (I just made this up. But it would be *a* "correct" > implementation.) The point is that you cannot count of > this specific behavior of the ordering and the correctness > of your program should not depend on this specific behavior. > Your program must work under the general behavior of > pthread_cond_broadcast(), if you choose to use this function. > > > Is it something wrong my implementation? > > Sorry, but I have no way to know! > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Sep 20 10:13:01 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8KHD1Pd005018 for ; Tue, 20 Sep 2005 10: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 j8KH9F1E029522 for ; Tue, 20 Sep 2005 10:09:15 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j8KH9Fcm029520 for cs551@merlot.usc.edu; Tue, 20 Sep 2005 10:09: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 j8KH9F1E029517 for ; Tue, 20 Sep 2005 10:09:15 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j8KH9FcG029513 for ; Tue, 20 Sep 2005 10:09:15 -0700 Message-Id: <200509201709.j8KH9FcG029513@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: broadcast Date: Tue, 20 Sep 2005 10:09:15 -0700 From: william@bourbon.usc.edu Someone wrote: > As mentioned in specification both servers are ideal , i use > pthread_cond_wait for that. They are waiting just fine. > now when arrival thread puts something in queue it > pthread_cond_broadcast s for those two sleeping server threads. > They wakes up fine. but when i run my code for any number of > time, only one thread say thread A gets up. should not OS choose > thread B to wake up any single run of code? . > According to broadcast / cond_wait specification i read, if both > them are sleeping on same cond varible and gets singal to wake, > any one of it can wakeup. But for me it always some fixed thread > who will wake up first. and which one wakes up depends on lambda > and mu values. If both threads A and B got woken up, then it's working properly. It's possible that internally on the Solaris pthreads implementation, it compares the thread ID for the threads and always wake up the one with smaller ID first. (I just made this up. But it would be *a* "correct" implementation.) The point is that you cannot count of this specific behavior of the ordering and the correctness of your program should not depend on this specific behavior. Your program must work under the general behavior of pthread_cond_broadcast(), if you choose to use this function. > Is it something wrong my implementation? Sorry, but I have no way to know! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Sep 17 07:50:19 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8HEoJQm013588 for ; Sat, 17 Sep 2005 07:50: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 j8HEklJ4010818 for ; Sat, 17 Sep 2005 07:46:47 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j8HEklcF010816 for cs551@merlot.usc.edu; Sat, 17 Sep 2005 07:46: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 j8HEkkJ4010813 for ; Sat, 17 Sep 2005 07:46:46 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j8HEkkSt010809 for ; Sat, 17 Sep 2005 07:46:46 -0700 Message-Id: <200509171446.j8HEkkSt010809@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS 551: "cn dropped" message Date: Sat, 17 Sep 2005 07:46:46 -0700 From: william@bourbon.usc.edu Someone wrote: > That's exactly what I meant. It wasn't obvious if _n_ was to be substituted > with a value, or to be the literal character 'n'. The spec didn't say in > the text, and those lines didn't visually indicate (say, by italicizing or > underlining the _n_ and the _?_ symbols). Thank you for the clarification. Sorry that it wasn't clear. Thanks for bring it up. -- Bill Cheng // bill.cheng@usc.edu On 9/16/05 11:52 PM, "william@bourbon.usc.edu" wrote: >Someone wrote: > >> I'm curious why you don't print a timestamp for the "cn dropped" message. >> It's easy enough to know (in simulation-relative time) the point at which a >> request is dropped. >> >> Also, is there a special reason you print "cn dropped", instead of (for >> example) "c21 dropped" (if it were the 21st request)? Are you intentionally >> not numbering requests that end up getting dropped? Or is this just a >> side-effect of your implementation? (I was thinking of numbering each >> request as it's _attempted_ to be enqueued, whereas you appear to number >> them when they are _successfully_ enqueued.) Thank you, Professor. > > Hmm... I'm not sure what you meant. You probably misunderstood > what I wrote in the spec. If customer c5 is dropped at > 12345.678ms, you should print: > > 00012345.678ms: c5 dropped Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 16 23:55:34 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8H6tYJI024665 for ; Fri, 16 Sep 2005 23:55: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 j8H6q3J4011600 for ; Fri, 16 Sep 2005 23:52:03 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j8H6q3uS011595 for cs551@merlot.usc.edu; Fri, 16 Sep 2005 23:52: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 j8H6q2J4011589 for ; Fri, 16 Sep 2005 23:52:02 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j8H6q26s011585 for ; Fri, 16 Sep 2005 23:52:02 -0700 Message-Id: <200509170652.j8H6q26s011585@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS 551: "cn dropped" message Date: Fri, 16 Sep 2005 23:52:02 -0700 From: william@bourbon.usc.edu Someone wrote: > I'm curious why you don't print a timestamp for the "cn dropped" message. > It's easy enough to know (in simulation-relative time) the point at which a > request is dropped. > > Also, is there a special reason you print "cn dropped", instead of (for > example) "c21 dropped" (if it were the 21st request)? Are you intentionally > not numbering requests that end up getting dropped? Or is this just a > side-effect of your implementation? (I was thinking of numbering each > request as it's _attempted_ to be enqueued, whereas you appear to number > them when they are _successfully_ enqueued.) Thank you, Professor. Hmm... I'm not sure what you meant. You probably misunderstood what I wrote in the spec. If customer c5 is dropped at 12345.678ms, you should print: 00012345.678ms: c5 dropped -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 16 23:34:03 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8H6Y3ET023785 for ; Fri, 16 Sep 2005 23:34: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 j8H6UXJ4008670 for ; Fri, 16 Sep 2005 23:30:33 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j8H6UXOk008668 for cs551@merlot.usc.edu; Fri, 16 Sep 2005 23: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 j8H6UWJ4008665 for ; Fri, 16 Sep 2005 23:30:32 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j8H6UWLY008661 for ; Fri, 16 Sep 2005 23:30:32 -0700 Message-Id: <200509170630.j8H6UWLY008661@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS 551: select() vs. alternatives Date: Fri, 16 Sep 2005 23:30:32 -0700 From: william@bourbon.usc.edu Someone wrote: > Good points. Nanosleep() is actually pretty standard, though. It's a > POSIX.1b-1993 call, so most POSIX implementations should include it. > Select(), by comparison, is a POSIX.1-2001 call, and potentially (though not > likely) less portable. (Though its common use in BSD-sockets pre-dates its > incorporation into the POSIX standard.) On solaris, nanosleep() is part of the real-time library while select() is part of the standard C library. I'm not sure if this means that select() is in general "more available". > I _would_, however, be quite concerned with using select() just for timing. > It may have worked for you, but its timeout behavior when using null > descriptors is not defined. (It also might have significant overhead, > though I don't know for sure.) One man page states: > > Some code calls select with all three sets empty, n zero, and a non- > null timeout as a FAIRLY portable way to sleep with subsecond preci- > sion [emphasis added]. Since we are not running a real-time application, we are not too concerned with the precision. With a machine like nunki with so many processes running concurrently, I would be surprised if a user process can get better than subsecton precision, no matter what function it calls! > I'm not familiar with any getitimer() issues. I've used it for > high-resolution timing since around 1985 (SunOS days). It's not quite as > useful in this application, though, because it throws a signal on > expiration, which complicates its use. As I recall, it actually pre-dates > select(). > > Just my two cents. You might mention whether the use of select() is a > requirement, or a suggestion. Thank you, Professor. As I've mentioned during lectures, it's merely a suggestion. You can use nanosleep() or even the obsoleted usleep(). If things are off here and there, as long as it's just noise on nunki and not a bug, it's perfectly fine. -- Bill Cheng // bill.cheng@usc.edu > On 9/16/05 10:40 PM, "william@bourbon.usc.edu" > wrote: > > > Someone wrote: > > > >> Out of curiosity, why would you suggest students use the timers built in to > >> select(), rather than something like nanosleep() or getitimer()? It seems a > >> little odd to be using select() for this purpose, since one really isn't > >> examining any descriptors. Reasonable, but odd. Thanks, Professor. > > > > The main reason is portability. Select() is very portable while > > nanosleep() is probably not. > > > > The interval timer is good for waking up at a fixed interval, so > > it's not as general. Also, I recall that there was a problem > > with its implementation on Solaris a while back. I'm not sure > > if it's fixed. > > > > In general, I prefer to write portable code because more than > > often when I try out a new function, I make mistakes! > > -- > > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 16 22:43:58 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8H5hw4u021514 for ; Fri, 16 Sep 2005 22:43: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 j8H5eSJ4031828 for ; Fri, 16 Sep 2005 22:40:28 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j8H5eStX031826 for cs551@merlot.usc.edu; Fri, 16 Sep 2005 22:40: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 j8H5eSJ4031823 for ; Fri, 16 Sep 2005 22:40:28 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j8H5eSb0031819 for ; Fri, 16 Sep 2005 22:40:28 -0700 Message-Id: <200509170540.j8H5eSb0031819@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS 551: select() vs. alternatives Date: Fri, 16 Sep 2005 22:40:28 -0700 From: william@bourbon.usc.edu Someone wrote: > Out of curiosity, why would you suggest students use the timers built in to > select(), rather than something like nanosleep() or getitimer()? It seems a > little odd to be using select() for this purpose, since one really isn't > examining any descriptors. Reasonable, but odd. Thanks, Professor. The main reason is portability. Select() is very portable while nanosleep() is probably not. The interval timer is good for waking up at a fixed interval, so it's not as general. Also, I recall that there was a problem with its implementation on Solaris a while back. I'm not sure if it's fixed. In general, I prefer to write portable code because more than often when I try out a new function, I make mistakes! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 16 21:33:38 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8H4XbTq018373 for ; Fri, 16 Sep 2005 21: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 j8H4U8J4031403 for ; Fri, 16 Sep 2005 21:30:08 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j8H4U8mY031401 for cs551@merlot.usc.edu; Fri, 16 Sep 2005 21:30: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 j8H4U8J4031398 for ; Fri, 16 Sep 2005 21:30:08 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j8H4U8DD031394 for ; Fri, 16 Sep 2005 21:30:08 -0700 Message-Id: <200509170430.j8H4U8DD031394@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS 551: Queue implementation Date: Fri, 16 Sep 2005 21:30:08 -0700 From: william@bourbon.usc.edu Someone wrote: > It occurs to me that no data is actually stored in or retrieved from the > queue. For the purposes of this simulation, the "queue" can be entirely > emulated by a counter (protected by a mutex, of course). Is there any > reason we need to implement an actual queue? Thank you, Professor. I'm not sure how you would do it with just a counter if you need to keep good statistics. I imagine using a customer object to keep track of all the timestamps as it travels through the system. The customer then needs to be enqueued and dequeued. This is also in preparation for the final project where it might be a good idea to make it into an event-based system where an event is a self-contained object and it gets enqueued and dequeues to help the threads synchronized with each other. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 16 21:28:18 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8H4SIIK018182 for ; Fri, 16 Sep 2005 21:28: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 j8H4OmJ4031378 for ; Fri, 16 Sep 2005 21:24:48 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j8H4OmVs031376 for cs551@merlot.usc.edu; Fri, 16 Sep 2005 21:24: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 j8H4OmJ4031373 for ; Fri, 16 Sep 2005 21:24:48 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j8H4OmUH031369 for ; Fri, 16 Sep 2005 21:24:48 -0700 Message-Id: <200509170424.j8H4OmUH031369@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: inter arrival time Date: Fri, 16 Sep 2005 21:24:48 -0700 From: william@bourbon.usc.edu Someone wrote: > In the second warm up project, according to the code that u have given in > the project specs and the description, it looks like the inter arrival time > is returned as a whole interger number in milli seconds. then how is the > sample display shown in the project description have inter arrival times as > floating point number? > > is there something i have not understood? The *desired* interarrival time is an integer. But since we are doing a time-driven simulation, you cannot control the actual interarrival time. So, let's say that an interarrival time is 123ms. Since the last customer arrived, you've spent 7ms doing all kind of bookkeepping and other work and now you are ready to sleep, you should sleep for 116ms. When you wake up, you read the clock and determine that the *actual* interarrival time is 136.772ms, you should report the actual interarrival time and use it in your average interarrival time calculation. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Sep 15 10:29:31 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8FHTV72022424 for ; Thu, 15 Sep 2005 10:29: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 j8FHQ9J4006471 for ; Thu, 15 Sep 2005 10:26:09 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j8FHQ9AW006469 for cs551@merlot.usc.edu; Thu, 15 Sep 2005 10:26: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 j8FHQ8J4006466 for ; Thu, 15 Sep 2005 10:26:08 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j8FHQ8nr006462 for ; Thu, 15 Sep 2005 10:26:08 -0700 Message-Id: <200509151726.j8FHQ8nr006462@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: ExponentialInterval( ) Date: Thu, 15 Sep 2005 10:26:08 -0700 From: william@bourbon.usc.edu Someone wrote: > I have a doubt about poisson process in warm-up 2. > From the description, i understand that the ExponentialInterval( ) > function will take "dval" & "lambd/mu" as i/p args. lambda is the > mean for poisson process. I have no idea what i/p means. Lambda is the mean *rate* for a Poisson process. > Now, dval = F(x). where F(x) = poisson distribution func > [ (e^lambda)* (lambda^x) / x! ] we have to solve this for x > using a numerical process. x is the random number which we > are looking for. > > I wanted to know if my understanding is correct or not. You do not need to solve it numerically. You can derive the equation for the inverse of F (let's call this F^{-1}). From the last picture on the spec, dval is r, then w is F^{-1}(dval). Please do not ask me if your implementation of F^{-1} is correct. You need to convince yourself that you are doing it right. As I've mentioned during the lectures, you should generate a large number of interarrival times and see if the the mean and standard deviation are correct. Please also find some refereces to see what values they should be. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Sep 15 10:19:55 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8FHJtOH021978 for ; Thu, 15 Sep 2005 10:19: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 j8FHGWJ4006388 for ; Thu, 15 Sep 2005 10:16:33 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j8FHGWPw006384 for ; Thu, 15 Sep 2005 10:16:32 -0700 Message-Id: <200509151716.j8FHGWPw006384@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: -n option in warmup #2 Date: Thu, 15 Sep 2005 10:16:32 -0700 From: william@bourbon.usc.edu Someone wrote: > In the sesond warm up project, I am not sure I understand the -n command > line option well. It says -n specifies the number of customers to arrive in > each stream?? which stream? in how much time? It's a typo. I've deleted "in each stream" from that sentense. Thanks for catching it. So, the -n commandline option specified the total number of customer to arrive. How much time depends on the interarrival times and the distribution. You just need to simulate it. You should terminate your simulation when there is no more customer to arrive and the queue is empty and the servers are idle. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Sep 13 23:57:05 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8E6v577025901 for ; Tue, 13 Sep 2005 23:57: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 j8E6roJ4015986 for ; Tue, 13 Sep 2005 23:53:50 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j8E6rojW015982 for ; Tue, 13 Sep 2005 23:53:50 -0700 Message-Id: <200509140653.j8E6rojW015982@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: class web server is down Date: Tue, 13 Sep 2005 23:53:50 -0700 From: william@bourbon.usc.edu Hi, The web server seems to be running fine now. Sorry about the inconvenience. If you see any problem, please let me know. Warmup #2 deadline has been extended for 48 hours. It's now due at 11:45pm on 9/25/2005. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Tue, 13 Sep 2005 13:14:07 -0700 From: william@bourbon.usc.edu To: cs551@merlot.usc.edu Subject: Re: class web server is down Hi, Merlot.usc.edu is up and running now, but I couldn't get the web server to run (different OS). I'll try to get the web server recompile today. I'll send an e-mail tonight to give you all an update. Sorry about the delay. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Mon, 12 Sep 2005 18:13:59 -0700 From: william@bourbon.usc.edu Subject: class web server is down (This message is program-generated. If this e-mail is unreadable, there's probably a bug in the code that generated this e-mail. If that's the case, please send e-mail to . Thanks!) The power outage today killed the class web server. The machine looked pretty dead. :-( I'll probably need to find a replacement machine. Hopefully, it will be up and running tomorrow (noon may be). I'll send everyone a update tomorrow around noon. The deadline for armup #2 will be extended for sure. (As of now, I don't know how many days the extension will be.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Sep 13 13:17:20 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j8DKHK2Y019034 for ; Tue, 13 Sep 2005 13:17: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 j8DKE7J4010972 for ; Tue, 13 Sep 2005 13:14:07 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j8DKE7vH010968 for ; Tue, 13 Sep 2005 13:14:07 -0700 Message-Id: <200509132014.j8DKE7vH010968@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: class web server is down Date: Tue, 13 Sep 2005 13:14:07 -0700 From: william@bourbon.usc.edu Hi, Merlot.usc.edu is up and running now, but I couldn't get the web server to run (different OS). I'll try to get the web server recompile today. I'll send an e-mail tonight to give you all an update. Sorry about the delay. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Mon, 12 Sep 2005 18:13:59 -0700 From: william@bourbon.usc.edu Subject: class web server is down (This message is program-generated. If this e-mail is unreadable, there's probably a bug in the code that generated this e-mail. If that's the case, please send e-mail to . Thanks!) The power outage today killed the class web server. The machine looked pretty dead. :-( I'll probably need to find a replacement machine. Hopefully, it will be up and running tomorrow (noon may be). I'll send everyone a update tomorrow around noon. The deadline for armup #2 will be extended for sure. (As of now, I don't know how many days the extension will be.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sun Sep 11 14:44:13 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j8BLiD3e026350 for ; Sun, 11 Sep 2005 14:44: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 j8BLnMPp016012 for ; Sun, 11 Sep 2005 14:49:23 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j8BLnMmL016009 for cs551@merlot.usc.edu; Sun, 11 Sep 2005 14:49: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 j8BLnLPp016006 for ; Sun, 11 Sep 2005 14:49:21 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j8BLnL9F016002 for ; Sun, 11 Sep 2005 14:49:21 -0700 Message-Id: <200509112149.j8BLnL9F016002@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: submission deadline Date: Sun, 11 Sep 2005 14:49:21 -0700 From: william@bourbon.usc.edu Someone wrote: > Your malicious client #3 and #4 got really hard on many of our > server tumbled! Well, you should never speak for others (unless somehow you represent them)! > I tried to defend my server/client with following > techs agianst malicious client/server ,,, > 1) I tried to creat non blocking socket on both end , so that > when recv does not have any thing to read will throw an error, > though this try somehow did not work. I've mentioned in class that non-blocking socket is a bad idea. The only place I can think of where one should use a non-blocking socket is for real-time applications where you cannot wait and have to time things precisely. I'm not sure what you are trying to achieve with this. If you don't want to block indefinitely, you can use select() with a small timeout (say, 100ms). Please do: man -s 3c select on nunki. > 2) I though, this is a problem of TCP handshake protocol. For > getting half-established connection when client closed off, and > like that. Did not have any clue how to handle it. I'm not sure exactly what problem you are referring to. Are you talking about the case where the server is blocked on read/recv() just like case (1) above? Shouldn't read/recv() return with an error code in this case? > Can you please comment on that? or suggest the better way? > one more thing when try to cat > ~csci551b/public/efence/2.2/README-solaris > it says something about installation change, what we are suppose > to do with it? It's already done to the code in ~csci551b/public/efence/2.2/ElectricFence-2.2.2-15. As mentioned in the web page, I have not used efence, so please don't ask me more questions about it. Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 9 23:05:50 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j8A65o3e013554 for ; Fri, 9 Sep 2005 23:05: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 j8A6B3Pp029385 for ; Fri, 9 Sep 2005 23:11:03 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j8A6B2A4029383 for cs551@merlot.usc.edu; Fri, 9 Sep 2005 23:11: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 j8A6B1Pp029380 for ; Fri, 9 Sep 2005 23:11:01 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j8A6B1uK029374 for ; Fri, 9 Sep 2005 23:11:01 -0700 Message-Id: <200509100611.j8A6B1uK029374@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: submission deadline Date: Fri, 09 Sep 2005 23:11:01 -0700 From: william@bourbon.usc.edu Someone wrote: > I tried to submit something, and told me to configure my email account, > bsubmit config -set email=you@yourdomain > I want to know what this means? > does it means that I will got an receipt from bsubmit to my email account? > however, I did not receive anything in my email account till now. > Please let me know. When you run the "bsubmit config -set e-mail=..." command, you will not get an e-mail. It will simply configure bsubmit so that when you make a submission, it will use the "..." above as your e-mail address of record. If something goes wrong, the system will send e-mail to the "..." above. If nothing goes wrong, no e-mail will be sent. When you make a submission, please examine the printout of bsubmit carefully. The ticket and receipt will go directly into somewhere in your ~/.bistro directory. No e-mail will be sent either. Eventually, when I collect your submission for grading, you will get an e-mail at your USC e-mail address. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Friday, September 9, 2005 10:32 pm Subject: Re: submission deadline > SOmeone wrote: > > > Sorry for this question... > > What time is the deadline today? I cannot see the time anywhere > > on the website. > > It's right on the project spec, at the very top! > > The actual due time is 11:45pm with a 15 minute grace period. > After that, it's 25% off for every 15 minutes. Please see: > > http://merlot.usc.edu/cs551-f05/description.html#late > > It's not worth it to be one second late and I cannot make > exceptions! So, please make sure you submit on time. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 9 22:27:21 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j8A5RL3e010403 for ; Fri, 9 Sep 2005 22:27: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 j8A5WYPp029090 for ; Fri, 9 Sep 2005 22:32:34 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j8A5WXQx029088 for cs551@merlot.usc.edu; Fri, 9 Sep 2005 22:32: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 j8A5WWPp029085 for ; Fri, 9 Sep 2005 22:32:33 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j8A5WWF3029081 for ; Fri, 9 Sep 2005 22:32:32 -0700 Message-Id: <200509100532.j8A5WWF3029081@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: submission deadline Date: Fri, 09 Sep 2005 22:32:32 -0700 From: william@bourbon.usc.edu SOmeone wrote: > Sorry for this question... > What time is the deadline today? I cannot see the time anywhere > on the website. It's right on the project spec, at the very top! The actual due time is 11:45pm with a 15 minute grace period. After that, it's 25% off for every 15 minutes. Please see: http://merlot.usc.edu/cs551-f05/description.html#late It's not worth it to be one second late and I cannot make exceptions! So, please make sure you submit on time. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Sep 9 20:56:57 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j8A3uv3e005330 for ; Fri, 9 Sep 2005 20:56: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 j8A42BPp028561 for ; Fri, 9 Sep 2005 21:02:11 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j8A42Buo028559 for cs551@merlot; Fri, 9 Sep 2005 21:02:11 -0700 Date: Fri, 9 Sep 2005 21:02:11 -0700 From: william@bourbon.usc.edu Message-Id: <200509100402.j8A42Buo028559@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. Please remember that you can submit multiple times, and by default we will grade the last on-time submission. 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! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 9 20:52:37 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j8A3qb3e005099 for ; Fri, 9 Sep 2005 20:52: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 j8A3voPp028528 for ; Fri, 9 Sep 2005 20:57:51 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j8A3vnCI028526 for cs551@merlot.usc.edu; Fri, 9 Sep 2005 20:57: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 j8A3vnPp028523 for ; Fri, 9 Sep 2005 20:57:49 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j8A3vnJ9028519 for ; Fri, 9 Sep 2005 20:57:49 -0700 Message-Id: <200509100357.j8A3vnJ9028519@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Where is libpthread? Date: Fri, 09 Sep 2005 20:57:49 -0700 From: william@bourbon.usc.edu Someone wrote: > I know it's kind of late, but can you tell me where libpthread is on nunki? If I do "whereis libpthread.a" on nunki, I get: libpthread: /usr/lib/libpthread.so -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 9 20:49:41 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j8A3nf3e004853 for ; Fri, 9 Sep 2005 20:49: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 j8A3stPp028500 for ; Fri, 9 Sep 2005 20:54:55 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j8A3ssvx028498 for cs551@merlot.usc.edu; Fri, 9 Sep 2005 20:54: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 j8A3srPp028495 for ; Fri, 9 Sep 2005 20:54:53 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j8A3srmd028491 for ; Fri, 9 Sep 2005 20:54:53 -0700 Message-Id: <200509100354.j8A3srmd028491@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CSCI551-README file for project #1 Date: Fri, 09 Sep 2005 20:54:53 -0700 From: william@bourbon.usc.edu Someone wrote: > What is expected in the README file? I understand that a > description of how to compile and how to run my code should be > included. How about descriptions of handling error conditions, > expected output, etc? Is in-code comment sufficent to explain > such? Please see the TA's posting with timestamp "Fri 09 Sep 20:07". I have a minor correction to the TA's posting. The spec says that doing "make client" should create the client and "make server" should create the server. You should descirbe briefly how you handle signals and any interesting errors. You don't need to say anything about expected output if they are the same with the spec or if they are obvious. Feel free to refer to in-code comments in your README file. Since we have posted the grading guidelines, if your programs do not behave similiar to what's mentioned in the grading guidelines, please mention them if you think it will help you get more partial credits! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 9 15:55:09 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j89Mt83e021182 for ; Fri, 9 Sep 2005 15:55: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 j89N0MPp027048 for ; Fri, 9 Sep 2005 16:00:22 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j89N0L4Y027046 for cs551@merlot.usc.edu; Fri, 9 Sep 2005 16: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 j89N0LPp027043 for ; Fri, 9 Sep 2005 16:00:21 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j89N0LlJ027039 for ; Fri, 9 Sep 2005 16:00:21 -0700 Message-Id: <200509092300.j89N0LlJ027039@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Dear Teacher, Date: Fri, 09 Sep 2005 16:00:21 -0700 From: william@bourbon.usc.edu Someone wrote: > I have a question is when the client send a GET_REQ, > and the server send back the FILESIZE and MD5 value, if GET command works, > which directory should we put the file client requested? Nowhere! You must calculate the MD5 value and the filesize on the fly. You must not write a single byte of this file into the filesystem. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 9 15:28:37 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j89MSb3e019737 for ; Fri, 9 Sep 2005 15:28: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 j89MXpPp026852 for ; Fri, 9 Sep 2005 15:33:51 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j89MXoub026850 for cs551@merlot.usc.edu; Fri, 9 Sep 2005 15: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 j89MXnPp026847 for ; Fri, 9 Sep 2005 15:33:49 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j89MXnFa026843 for ; Fri, 9 Sep 2005 15:33:49 -0700 Message-Id: <200509092233.j89MXnFa026843@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: directory input Date: Fri, 09 Sep 2005 15:33:49 -0700 From: william@bourbon.usc.edu Someone wrote: > What Should the filesize program return if the input parameter is a > directory? Please see my message with timstamp "Sat 03 Sep 13:30". -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Friday, September 9, 2005 10:59 am Subject: Re: Malicious clients > Someone wrote: > > > So I feel as long as my server is not crashing or doing > anything unexpected > > / wrong in a given senario, I shud not fret abt wht the > malicious client is > > upto. > > Yep! The whole point of the malicious client/server exercise > is to get you to think about writing robust server/client code! > -- > Bill Cheng // bill.cheng@usc.edu > > > > > -----Original Message----- > From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] > Sent: Thursday, September 08, 2005 10:54 PM > To: cs551@bourbon.usc.edu > Subject: Re: Malicious clients > > > Someone wrote: > > > Following is an extract from my script - I am trying to run > Malicious client > > '4' - which according to the desciption send 4 bytes and > waits. I shud > be > > sending it ALL_FAIL. > > > > I have put my comments in the actual script with /* -- */ > > > > [ transscript removed ] > > > > I am not asking you what the malicious clients are doing. But > I am > concerned > > as to why its not working, evn though my server is sending > exactly wht > it > > shud. > > You probably think that there is one way to write these > programs correctly and I'm not telling you what the correct > way is! But, as I've mentioned before, there are many many > ways to do these programs. It's pretty much impossible for > me to guess why your program is not doing something or why > it is behaving a certain way. > > May be there is a bug somewhere. May be not. I'm sorry, but > I really just cannot know! > > I guess one thing you can try is to guess what my client is > doing and write another client to simulate it. Then you can > see if the same thing happens with your server. This may > give you a clue whether it's a bug in your server or not. > Of course, this can take time and may be it won't make any > difference. Unfortunately, this is the nature of this type > of programming. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 9 10:54:40 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j89Hse3e004809 for ; Fri, 9 Sep 2005 10:54: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 j89HxtPp025854 for ; Fri, 9 Sep 2005 10:59:55 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j89HxsBw025851 for cs551@merlot.usc.edu; Fri, 9 Sep 2005 10:59: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 j89HxrPp025848 for ; Fri, 9 Sep 2005 10:59:53 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j89HxrAL025844 for ; Fri, 9 Sep 2005 10:59:53 -0700 Message-Id: <200509091759.j89HxrAL025844@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Malicious clients Date: Fri, 09 Sep 2005 10:59:53 -0700 From: william@bourbon.usc.edu Someone wrote: > So I feel as long as my server is not crashing or doing anything unexpected > / wrong in a given senario, I shud not fret abt wht the malicious client is > upto. Yep! The whole point of the malicious client/server exercise is to get you to think about writing robust server/client code! -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] Sent: Thursday, September 08, 2005 10:54 PM To: cs551@bourbon.usc.edu Subject: Re: Malicious clients Someone wrote: > Following is an extract from my script - I am trying to run Malicious client > '4' - which according to the desciption send 4 bytes and waits. I shud be > sending it ALL_FAIL. > > I have put my comments in the actual script with /* -- */ > > [ transscript removed ] > > I am not asking you what the malicious clients are doing. But I am concerned > as to why its not working, evn though my server is sending exactly wht it > shud. You probably think that there is one way to write these programs correctly and I'm not telling you what the correct way is! But, as I've mentioned before, there are many many ways to do these programs. It's pretty much impossible for me to guess why your program is not doing something or why it is behaving a certain way. May be there is a bug somewhere. May be not. I'm sorry, but I really just cannot know! I guess one thing you can try is to guess what my client is doing and write another client to simulate it. Then you can see if the same thing happens with your server. This may give you a clue whether it's a bug in your server or not. Of course, this can take time and may be it won't make any difference. Unfortunately, this is the nature of this type of programming. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 9 10:27:04 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j89HR43e003151 for ; Fri, 9 Sep 2005 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 j89HWJPp025715 for ; Fri, 9 Sep 2005 10:32:19 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j89HWINl025713 for cs551@merlot.usc.edu; Fri, 9 Sep 2005 10: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 j89HWHPp025710 for ; Fri, 9 Sep 2005 10:32:18 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j89HWHlp025706 for ; Fri, 9 Sep 2005 10:32:17 -0700 Message-Id: <200509091732.j89HWHlp025706@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: malicious client #3 ( and #4) Date: Fri, 09 Sep 2005 10:32:17 -0700 From: william@bourbon.usc.edu Someone wrote: > a pactical question about malicious client #3 ( and #4) > > if the client has closed the port (or is in infinite wait, may be > due to network outage), what purpose does it serve to send an > ALL_FAIL response. > > isnt the server better off not sending anything (and saving 4 > bytes of bandwidth!) Since you cannot control the timing between the client and the server, there is no guarantee that the server will see the socket close before it responds. So, the server should try to send ALL_FAIL if it has not detected that the socket has been closed. Of course, if the server knows for sure that the socket has been closed, there is no point of sending anything. > assuming we do send ALL_FAIL, how can we check the presence of > this message (noting that client might have already closed > socket).... does ethereal/network sniffing do it? Probably will. Tcpdump would probably work too. But we won't use either. The main point here is that the server should not crash or hang or get confused. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Sep 8 23:44:59 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j896ix3e032516 for ; Thu, 8 Sep 2005 23:44: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 j896oEPp022328 for ; Thu, 8 Sep 2005 23:50:15 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j896oEMY022326 for cs551@merlot.usc.edu; Thu, 8 Sep 2005 23: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 j896oDPp022323 for ; Thu, 8 Sep 2005 23:50:13 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j896oDlU022319 for ; Thu, 8 Sep 2005 23:50:13 -0700 Message-Id: <200509090650.j896oDlU022319@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: regarding malicious server # 3 Date: Thu, 08 Sep 2005 23:50:13 -0700 From: william@bourbon.usc.edu Someone wrote: > It has been said in the guidelines that server # 3 closes the > socket after sending 4 bytes. but i feel it doesnt not does > this... i am testing my client, so I wanted to know if it really > closes the socket. I understood what you wanted to know. But I cannot tell you more than what's in the grading guidelines. -- Bill Cheng // bill.cheng@usc.edu william@bourbon.usc.edu wrote:Someone wrote: > I have a question regarding the malicious server # 3. Does it > really closes the socket or the server just timeouts and > shutdowns? Please if you could check with it... Thank you. I'm sorry but I cannot tell you anything about what the malicious client or serer is doing. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Sep 8 23:40:36 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j896ea3e032297 for ; Thu, 8 Sep 2005 23:40: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 j896jqPp022195 for ; Thu, 8 Sep 2005 23:45:52 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j896joZE022192 for cs551@merlot.usc.edu; Thu, 8 Sep 2005 23: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 j896joPp022189 for ; Thu, 8 Sep 2005 23:45:50 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j896joff022185 for ; Thu, 8 Sep 2005 23:45:50 -0700 Message-Id: <200509090645.j896joff022185@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: regarding malicious server # 3 Date: Thu, 08 Sep 2005 23:45:50 -0700 From: william@bourbon.usc.edu Someone wrote: > I have a question regarding the malicious server # 3. Does it > really closes the socket or the server just timeouts and > shutdowns? Please if you could check with it... Thank you. I'm sorry but I cannot tell you anything about what the malicious client or serer is doing. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Sep 8 23:27:26 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j896RQ3e031459 for ; Thu, 8 Sep 2005 23: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 j896WfPp021941 for ; Thu, 8 Sep 2005 23:32:42 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j896WfEF021937 for cs551@merlot.usc.edu; Thu, 8 Sep 2005 23:32: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 j896WePp021934 for ; Thu, 8 Sep 2005 23:32:40 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j896WeQf021930 for ; Thu, 8 Sep 2005 23:32:40 -0700 Message-Id: <200509090632.j896WeQf021930@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Various questions Date: Thu, 08 Sep 2005 23:32:40 -0700 From: william@bourbon.usc.edu Someone wrote: > I have following questions regarding our warmup#1. > 1) Just want to comform again ( in case you are planning > > output to some file and run diff to compare the results -) server > reporting error to its console. like if client ask for file not > present , server on its stderr refectling that file not found. I'm not understanding what you are asking. If your program is doing the right stuff and the TA grade it incorrectly, you can just ask for a regrade. > 2) I am getting IP for localhost as 127.0.0.1xx , i know its just > different represtation but is it acceptable? Anything is "acceptable". The submission server would accept anything! :-) If you are asking if you will receive full credit, then it depends on how it works. Do you know if it works? If your server thinks localhost is 127.0.0.100 and your client thinks localhost is 127.0.0.1, I don't see how that can work. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Sep 8 22:48:51 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j895mp3e029271 for ; Thu, 8 Sep 2005 22:48: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 j895s7Pp021583 for ; Thu, 8 Sep 2005 22:54:07 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j895s64a021579 for cs551@merlot.usc.edu; Thu, 8 Sep 2005 22: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 j895s6Pp021576 for ; Thu, 8 Sep 2005 22:54:06 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j895s6ut021572 for ; Thu, 8 Sep 2005 22:54:06 -0700 Message-Id: <200509090554.j895s6ut021572@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Malicious clients Date: Thu, 08 Sep 2005 22:54:05 -0700 From: william@bourbon.usc.edu Someone wrote: > Following is an extract from my script - I am trying to run Malicious client > '4' - which according to the desciption send 4 bytes and waits. I shud be > sending it ALL_FAIL. > > I have put my comments in the actual script with /* -- */ > > [ transscript removed ] > > I am not asking you what the malicious clients are doing. But I am concerned > as to why its not working, evn though my server is sending exactly wht it > shud. You probably think that there is one way to write these programs correctly and I'm not telling you what the correct way is! But, as I've mentioned before, there are many many ways to do these programs. It's pretty much impossible for me to guess why your program is not doing something or why it is behaving a certain way. May be there is a bug somewhere. May be not. I'm sorry, but I really just cannot know! I guess one thing you can try is to guess what my client is doing and write another client to simulate it. Then you can see if the same thing happens with your server. This may give you a clue whether it's a bug in your server or not. Of course, this can take time and may be it won't make any difference. Unfortunately, this is the nature of this type of programming. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Sep 8 11:43:03 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j88Ih33e024585 for ; Thu, 8 Sep 2005 11:43: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 j88ImKPp018387 for ; Thu, 8 Sep 2005 11:48:20 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j88ImKHH018383 for ; Thu, 8 Sep 2005 11:48:20 -0700 Message-Id: <200509081848.j88ImKHH018383@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: extra linking options on SUNos Date: Thu, 08 Sep 2005 11:48:20 -0700 From: william@bourbon.usc.edu Hi, I'm forwarding the last message regarding this libraries compatibility issue. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Thu, 08 Sep 2005 11:39:02 -0700 From: Luke Ravitch To: william@bourbon.usc.edu Subject: Re: extra linking options on SUNos On 2005-09-08 10:50, william@bourbon.usc.edu wrote: > [ I'm not sure if this completely answers the question. I > assume that gcc/g++ on nunki are compiled and built from > scratch (probably with autoconf/automake). Gcc/g++ knows to > link with libc automatically. Why couldn't it do that with > libnsl, libsocket, etc.? ] It probably could except that it's not obviously the Right Thing. First, they would have to detect that you're using sockets stuff or you would risk linking in libraries that you aren't using. I'm not sure the code is there to do that. Especially if you consider the general case of various operating systems spreading features out into different weird libraries. I think POSIX failed to mention which libraries features had to be in, so there's no real standard about linker options. If that's true, it's unfortunate. But hey - we have autoconf ;-) -- Luke Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Sep 8 11:40:29 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j88IeT3e024469 for ; Thu, 8 Sep 2005 11:40: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 j88IjkPp018366 for ; Thu, 8 Sep 2005 11:45:46 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j88Ijk09018362 for ; Thu, 8 Sep 2005 11:45:46 -0700 Message-Id: <200509081845.j88Ijk09018362@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: extra linking options on SUNos Date: Thu, 08 Sep 2005 11:45:46 -0700 From: william@bourbon.usc.edu Hi, I'm forwarding another e-mail from a student regarding the libraries compatibility issue. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Thu, 08 Sep 2005 11:50:58 -0700 From: Luke Ravitch To: william@bourbon.usc.edu Subject: Re: extra linking options on SUNos Here's a simpler historical answer to why Sun uses the seperate libraries. I have it on good authority that it stems from the whole STREAMS/sockets schism. Sun (embracing the losing standard, as usual), was ready for STREAMS to take over the world, so they moved the sockets stuff out of the main libc (expecting STREAMS to move in as the standard way of doing networking). Of course, the world went towards sockets (POSIX even caught up!) and now we get to link to more libraries. -- Luke Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Sep 8 10:31:28 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j88HVS3e020559 for ; Thu, 8 Sep 2005 10: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 j88HakPp017667 for ; Thu, 8 Sep 2005 10:36:46 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j88HaklC017663 for ; Thu, 8 Sep 2005 10:36:46 -0700 Message-Id: <200509081736.j88HaklC017663@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: extra linking options on SUNos Date: Thu, 08 Sep 2005 10:36:46 -0700 From: william@bourbon.usc.edu Hi, I'm just forwarding an e-mail from a student regarding the library compatibility question. [ I'm not sure if this completely answers the question. I assume that gcc/g++ on nunki are compiled and built from scratch (probably with autoconf/automake). Gcc/g++ knows to link with libc automatically. Why couldn't it do that with libnsl, libsocket, etc.? ] -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Thu, 08 Sep 2005 10:24:10 -0700 From: Luke Ravitch To: william@bourbon.usc.edu Subject: Re: extra linking options on SUNos On 2005-09-08 07:40, william@bourbon.usc.edu wrote: > Someone wrote: > > > i am trying to understand some of the extra linking options > > required on the SUNos. > > > > 1. compiling my file (which uses herrror, gethostbyname, etc) > > does NOT require additional linking option (see 2) on linux and > > glibc-2.3 > > 2. compiling the same on SUNos requires "-lnsl -lsocket -lresolv" > > as emphsised in the man page (and google). > > (else i get some 'symbol belongs to implicit dependency' linking > > errors!) > > > > i was wondering why there is a discrepency in linking options > > between the two systems? is it due to older gcc+libraries by any > > chance? > > I'm not sure if this is a "discrepency" or not. It's certainly > an "incompatibility". I don't know the real reason. But I > suspect that it may simply has something to do with license > compatibility. gcc/g++ are GPL'ed software. The GPL license > may not allow them to do certain things. > > If someone knows the real answer, please let me know and I'll > forward it to the class. Thanks! It's simply a matter of the system libraries being different. Glibc includes things in the standard library that Sun puts in seperate libs. Other systems like FreeBSD probably needs a different set of libraries, and so on. This is exactly why the GNU Autotools (autoconf, automake, etc.) exist. The joys of portability! At any rate - it's not a license issue. GCC will gladly build against non-GNU system libs. -- Luke Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Sep 8 07:23:02 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j88EN23e010088 for ; Thu, 8 Sep 2005 07:23: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 j88ESJPp016392 for ; Thu, 8 Sep 2005 07:28:19 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j88ESIx6016389 for cs551@merlot.usc.edu; Thu, 8 Sep 2005 07:28: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 j88ESIPp016386 for ; Thu, 8 Sep 2005 07:28:18 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j88ESHvx016382 for ; Thu, 8 Sep 2005 07:28:17 -0700 Message-Id: <200509081428.j88ESHvx016382@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: extra linking options on SUNos Date: Thu, 08 Sep 2005 07:28:17 -0700 From: william@bourbon.usc.edu Someone wrote: > i am trying to understand some of the extra linking options > required on the SUNos. > > 1. compiling my file (which uses herrror, gethostbyname, etc) > does NOT require additional linking option (see 2) on linux and > glibc-2.3 > 2. compiling the same on SUNos requires "-lnsl -lsocket -lresolv" > as emphsised in the man page (and google). > (else i get some 'symbol belongs to implicit dependency' linking > errors!) > > i was wondering why there is a discrepency in linking options > between the two systems? is it due to older gcc+libraries by any > chance? I'm not sure if this is a "discrepency" or not. It's certainly an "incompatibility". I don't know the real reason. But I suspect that it may simply has something to do with license compatibility. gcc/g++ are GPL'ed software. The GPL license may not allow them to do certain things. If someone knows the real answer, please let me know and I'll forward it to the class. Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Sep 8 07:17:49 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j88EHn3e009739 for ; Thu, 8 Sep 2005 07:17: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 j88EN6Pp016355 for ; Thu, 8 Sep 2005 07:23:06 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j88EN5wI016353 for cs551@merlot.usc.edu; Thu, 8 Sep 2005 07:23: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 j88EN5Pp016350 for ; Thu, 8 Sep 2005 07:23:05 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j88EN59n016346 for ; Thu, 8 Sep 2005 07:23:05 -0700 Message-Id: <200509081423.j88EN59n016346@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: No Data Read Date: Thu, 08 Sep 2005 07:23:05 -0700 From: william@bourbon.usc.edu Someone wrote: > When I am testing my server with the malicious client as > below, I am getting the output as "No data read". ??? > > nunki.usc.edu(6): ~csci551b/public/warmup1/client -1 127.0.0.1:12889 /etc/passwd > No data read. I cannot tell you anything more than that's in the grading guidelines about my malicious server and client because that's the nature of dealing with malicous servers and clients! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Sep 7 22:40:03 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j885e33e013644 for ; Wed, 7 Sep 2005 22:40: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 j885jMPp014325 for ; Wed, 7 Sep 2005 22:45:22 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j885jM9M014323 for cs551@merlot.usc.edu; Wed, 7 Sep 2005 22:45: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 j885jMPp014320 for ; Wed, 7 Sep 2005 22:45:22 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j885jM5A014316 for ; Wed, 7 Sep 2005 22:45:22 -0700 Message-Id: <200509080545.j885jM5A014316@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: error message Date: Wed, 07 Sep 2005 22:45:22 -0700 From: william@bourbon.usc.edu Someone wrote: > When the Client makes an ADDR request, the server can send 0xFE11 > or 0xFE12 or 0xFCFE. Should the error messages for oxFE12 and > 0xFCFE be the same or should it be specific to the return code > i.e Can I display the message ADDR request for 'www.cs.usc.xxx' > failed for both 0xFE12 or 0xFCFE return codes? The reason for giving an error report to the user is to help the user figure out what might have been wrong. Therefore, I think it's better to report them as different type of errors. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Sep 7 21:27:18 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j884RI3e009473 for ; Wed, 7 Sep 2005 21:27: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 j884WbPp014038 for ; Wed, 7 Sep 2005 21:32:37 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j884WbmW014036 for cs551@merlot.usc.edu; Wed, 7 Sep 2005 21:32: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 j884WbPp014033 for ; Wed, 7 Sep 2005 21:32:37 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j884Wbkp014029 for ; Wed, 7 Sep 2005 21:32:37 -0700 Message-Id: <200509080432.j884Wbkp014029@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Malicious clients Date: Wed, 07 Sep 2005 21:32:37 -0700 From: william@bourbon.usc.edu Someone wrote: > when I am trying to run malicious clients 3 and 4 on my server, my > server is printing the correct time out msg but its giving an "Broken pipe" > error and existing. You must catch the broken pipe signal (SIGPIPE) and handle it properly. If you do not handle it, your server will crash. You can probably do a web search to find ways of handling SIGPIPE. > And for client -5 with a '2' sec delay, I am sending the correct reply > header of fe 21 0 0 0 4 but still the client is saying malformed Malformed > FSZ_RPLY message (6 bytes), though the same client with 20 sec delay is > giving ALL_FAIL received. My server time out time is 3 secs. I'm not sure what you are referring to here. "client -5" has a 10 seconds delay. May be you are referring to something else? -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Sep 7 21:22:00 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j884M03e009216 for ; Wed, 7 Sep 2005 21:22: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 j884RJPp013992 for ; Wed, 7 Sep 2005 21:27:19 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j884RJkP013990 for cs551@merlot.usc.edu; Wed, 7 Sep 2005 21:27: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 j884RJPp013987 for ; Wed, 7 Sep 2005 21:27:19 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j884RJDS013983 for ; Wed, 7 Sep 2005 21:27:19 -0700 Message-Id: <200509080427.j884RJDS013983@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Mlicious clients Date: Wed, 07 Sep 2005 21:27:19 -0700 From: william@bourbon.usc.edu Someone wrote: > I'm testing my server with malicious clients in the grading guidelines. > I have some problem with malicious client #3 & #5 > > For #3: > It says tht the client closes the socket after sending header. > Here my server, is trying to send all_fail msg. > Then how should i send ALL_FAIL msg to the client if the socket is closed. Please address this problem in your design. As I've mentioned before, not everything is specified in the spec. You must handle error conditions in a reasonable manner. Your server also should *never* crash or hang! > for #5: > there are 2 cases. > case 1:- with "2" > case 2:- with "10" > > I tested with case1. server got a filesize request.[0xfe20] > But the datalength sent to server [filename in this case] is 117440512. > I want to make sure if what my server read is correct. I cannot help you here. You must find a way to make sure that you are reading the right stuff! One way is to talk to other students and see if they are getting the same thing. > In tht case, the server reads byte-by-byte into a 512 length buffer. > [i.e., data is read in 512 chunks byte-by-byte]. In the mean time, > the client quits with "no data read" msg before the server can send > any data. Please handle this in a reasonable manner. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Sep 7 16:31:53 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j87NVq3e025664 for ; Wed, 7 Sep 2005 16:31: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 j87NbCPp012831 for ; Wed, 7 Sep 2005 16:37:12 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j87NbC3c012829 for cs551@merlot.usc.edu; Wed, 7 Sep 2005 16:37: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 j87NbCPp012826 for ; Wed, 7 Sep 2005 16:37:12 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j87NbC24012822 for ; Wed, 7 Sep 2005 16:37:12 -0700 Message-Id: <200509072337.j87NbC24012822@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Md5 checksum Date: Wed, 07 Sep 2005 16:37:12 -0700 From: william@bourbon.usc.edu Someone wrote: > In the grading guidelines, it was given to set the "port" to PORT. > set port=PORT and run server & clients using it. [ ./server $port ] > I didnt understood this. Should we do this in the makefile. No. Near the top of the grading guidelines, it says: 4) The scripts below are for csh/tcsh. If you use bash, please modify them where necessary. So, if it doesn't work for you, one possible reason is that you are not using csh/tcsh. You can simply do: tcsh to change shell. The grading guidelines are mainly for the TA/grader. So, you don't have to make it work for you. > If yes, I'm making 2 make files. one for server & other for client. Since the answer is no, all this may be irrelevant. But, please do *not* submit 2 makefiles. Obscure procedure to produce your executables may lose points. > So, do i need to include it in both the makefiles. > > I tried to put the following in one makefile. > > set port=14355 > > client: client.o blabla > cc -c blabla > > It was giving me an error "Badly formed macro argument". > This is the first time i'm handling makefile. so, > can you please tell me what to do. You cannot put random stuff into your Makefile and hope that it will work! Your Makefile must conform to the language for Makefile. There are plenty of tutorials out there on creating Makefiles. You should read them, soon. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Sep 7 07:40:44 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j87Eei3e028571 for ; Wed, 7 Sep 2005 07:40: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 j87Ek5Pp010436 for ; Wed, 7 Sep 2005 07:46:05 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j87Ek4wl010432 for ; Wed, 7 Sep 2005 07:46:05 -0700 Message-Id: <200509071446.j87Ek4wl010432@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Md5 checksum Date: Wed, 07 Sep 2005 07:46:04 -0700 From: william@bourbon.usc.edu Hmm... No one complained about my mistake... > shot *a; > a = (short)&md[0]; > printf("%x", a); The 2nd line is not a problem because "a" is not dereferenced. The 3rd line will cause a seg fault because it's trying to dereference "a" and "a" points to a bad place in memory (the higher order bits are uninitialized). -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Tue, 06 Sep 2005 17:36:20 -0700 From: william@bourbon.usc.edu To: cs551@bourbon.usc.edu Subject: Re: Md5 checksum Someone wrote: > I'm trying to get MD5 check sum. When i tried to display the > final value , I'm getting an output of length 16. Then i checked > the actual md5 value from /usr/lsd/openssl/0.9.7g/bin/openssl md5 > /etc/hosts.equiv This displayed 64 characters[all between (0 to > 9) & ( a to f ) ] MD5 output is 16 bytes. If you represent each byte with a hexstring, you get 2 characters each. The first character represents the upper 4 bits of a byte and the 2nd character represents the lower 4 bits of a byte. So, you should get 32 characters. When I run: openssl md5 /etc/hosts.equiv I get: MD5(/etc/hosts.equiv)= 42ccd1847b0a219402cd398179cbc5fc So, the output value is 32 characters long (in hexstring representation). I don't know why you got 64 characters. > Is it tht we have to convert the final [unsigned char*] md value > to hex of 64 bits. If yes, i didnt understood how to do this. Well, write a function like: int foo(unsigned char ch) { /* output upper 4 bits of ch in a single character */ /* output lower 4 bits of ch in a single character */ return something; } Then do: for (i=0; i < 16; i++) { foo(md[i]); } > I tried casting each character of the final md value to short* > > shot *a; > a = (short)&md[0]; > printf("%x", a); > > I got a bus error for this. > Can u plz clear this. Please don't try some random code and see if it works. During the 2nd lecture, I mentioned that you must understand what every line of your code is doing. You must do that if you want to do programming at the system level (or at any level). Your variable "a" is not initialized. Then you copy a value to a location pointed at a random place (beacuse "a" is not initialized). What is the data type of &md[0]? It's (char*) or (unsigned char *). Why do you typecast it to (short)? Is it really compatible? Then you tried to print a value of a pointer. So, none of your lines seem to be doing what you expect! By the way, if you always want to print the lower 8 bits of an integer "i" with 2 hex characters, you should use: printf("%02x", (i & 0x0ff)); -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Sep 6 17:30:59 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j870Ux3e013707 for ; Tue, 6 Sep 2005 17:30: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 j870aLPp007502 for ; Tue, 6 Sep 2005 17:36:21 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j870aLBm007500 for cs551@merlot.usc.edu; Tue, 6 Sep 2005 17:36: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 j870aKPp007497 for ; Tue, 6 Sep 2005 17:36:21 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j870aKmG007493 for ; Tue, 6 Sep 2005 17:36:20 -0700 Message-Id: <200509070036.j870aKmG007493@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Md5 checksum Date: Tue, 06 Sep 2005 17:36:20 -0700 From: william@bourbon.usc.edu Someone wrote: > I'm trying to get MD5 check sum. When i tried to display the > final value , I'm getting an output of length 16. Then i checked > the actual md5 value from /usr/lsd/openssl/0.9.7g/bin/openssl md5 > /etc/hosts.equiv This displayed 64 characters[all between (0 to > 9) & ( a to f ) ] MD5 output is 16 bytes. If you represent each byte with a hexstring, you get 2 characters each. The first character represents the upper 4 bits of a byte and the 2nd character represents the lower 4 bits of a byte. So, you should get 32 characters. When I run: openssl md5 /etc/hosts.equiv I get: MD5(/etc/hosts.equiv)= 42ccd1847b0a219402cd398179cbc5fc So, the output value is 32 characters long (in hexstring representation). I don't know why you got 64 characters. > Is it tht we have to convert the final [unsigned char*] md value > to hex of 64 bits. If yes, i didnt understood how to do this. Well, write a function like: int foo(unsigned char ch) { /* output upper 4 bits of ch in a single character */ /* output lower 4 bits of ch in a single character */ return something; } Then do: for (i=0; i < 16; i++) { foo(md[i]); } > I tried casting each character of the final md value to short* > > shot *a; > a = (short)&md[0]; > printf("%x", a); > > I got a bus error for this. > Can u plz clear this. Please don't try some random code and see if it works. During the 2nd lecture, I mentioned that you must understand what every line of your code is doing. You must do that if you want to do programming at the system level (or at any level). Your variable "a" is not initialized. Then you copy a value to a location pointed at a random place (beacuse "a" is not initialized). What is the data type of &md[0]? It's (char*) or (unsigned char *). Why do you typecast it to (short)? Is it really compatible? Then you tried to print a value of a pointer. So, none of your lines seem to be doing what you expect! By the way, if you always want to print the lower 8 bits of an integer "i" with 2 hex characters, you should use: printf("%02x", (i & 0x0ff)); -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Tue Sep 6 09:33:08 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j86GX83e019988 for ; Tue, 6 Sep 2005 09:33: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 j86GcVPp004238 for ; Tue, 6 Sep 2005 09:38:31 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j86GcVIw004236 for cs551@merlot.usc.edu; Tue, 6 Sep 2005 09:38: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 j86GcVPp004233 for ; Tue, 6 Sep 2005 09:38:31 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j86GcVH1004229 for ; Tue, 6 Sep 2005 09:38:31 -0700 Message-Id: <200509061638.j86GcVH1004229@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: MD5 checksum Date: Tue, 06 Sep 2005 09:38:31 -0700 From: william@bourbon.usc.edu Someone wrote: > I'm trying to use MD5 & get the checksum. > But when i compiled my program [cc filename.c -lsocket -lnsl ] > its giving me an error :- cannot include "openssl/md5.h" > I didnt know how / what library's should i link Have you tried all the stuff mentioned in the Compiling and Linking section of the spec? -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Sep 5 22:56:52 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j865uq3e017141 for ; Mon, 5 Sep 2005 22:56: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 j8662GPp001861 for ; Mon, 5 Sep 2005 23:02:16 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j8662GfG001859 for cs551@merlot.usc.edu; Mon, 5 Sep 2005 23:02: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 j8662FPp001856 for ; Mon, 5 Sep 2005 23:02:15 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j8662Fri001852 for ; Mon, 5 Sep 2005 23:02:15 -0700 Message-Id: <200509060602.j8662Fri001852@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: unsigned char * vs char * Date: Mon, 05 Sep 2005 23:02:15 -0700 From: william@bourbon.usc.edu Someone wrote: > I am getting confused here,between using of unsigned char * and > char * as a buffer for sending to/ receiving from client /server. > Problem is 0xfe will not go in char * as its signed char and its > size is only -127 to 127. ( 0x10 will go fine). So If there is > no other alternative, I have to use unsigned char * for buffer > and then call send function with that buffer. Now will that make > my server/client out of specs from others server/client. > is it ok if i send first six bytes of unsigned char * and then > char * for data portion of packet. I'm not sure exactly what the problem is here. What is the difference between (unsigned char *) and (char *)? In C/C++, you can always typecast one to another without losing any information. Let's say you have a byte in memory with a value of 0xfe. What's the data type of this byte? Well, a byte is just a byte! It has no data type! If you typecast this byte to (char) and then typecast it to integer before your print, you will get -2. If you typecast it to (unsigned char) and then typecast it to integer before you print, you will get 254. -2 and 254 are just different external representations of the same byte of value (0xfe)! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Sep 5 22:48:23 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j865mN3e016689 for ; Mon, 5 Sep 2005 22: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 j865rlPp001809 for ; Mon, 5 Sep 2005 22:53:47 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j865rlpc001807 for cs551@merlot.usc.edu; Mon, 5 Sep 2005 22:53: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 j865rlPp001804 for ; Mon, 5 Sep 2005 22:53:47 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j865rlUX001800 for ; Mon, 5 Sep 2005 22:53:47 -0700 Message-Id: <200509060553.j865rlUX001800@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: 1 byte only transfer Date: Mon, 05 Sep 2005 22:53:47 -0700 From: william@bourbon.usc.edu Someone wrote: > When You said that we have to transfer 1 byte at a time, so in > send we will put 3rd parameter as 1. Does that ,mean that If we > have 200 bytes long message then we need to do send 200 times in > while loop?? You need to do 200 sends. But not necessarily in a single while loop. You can write out the first 2 bytes in one while loop, then write out the next 4 bytes in another while loop, then write out 194 bytes in yet another while loop. > and the same way that many receive at the otherside? Exactly! > One morething is: before sending anything from client side,we put > all bytes in a binary buffer. Does it have some limitation like > Buf[512]; or something? If so then we will have to write 512 > bytes first, then send them, then write more bytes and send again > in case of big file for GET request????? You said "from client side". The client never had to send much data. So, even though it is subject to the 512-byte buffer constraint, you will never have to write that much. When the server sends a GET reply, it needs to handle cases where the file size is greater than 512-6=506 bytes. One thing you can do is to write 2 bytes, then write 4 bytes, then use a 512 bytes buffer to read 512 bytes from the file, send these 512 bytes out, then reuse the buffer and read another 512 bytes from the file and send them out, and so on. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Sep 5 11:31:38 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j85IVc3e011516 for ; Mon, 5 Sep 2005 11:31: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 j85Ib3Pp029926 for ; Mon, 5 Sep 2005 11:37:03 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j85Ib35J029924 for cs551@merlot.usc.edu; Mon, 5 Sep 2005 11:37: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 j85Ib3Pp029921 for ; Mon, 5 Sep 2005 11:37:03 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j85Ib3bM029917 for ; Mon, 5 Sep 2005 11:37:03 -0700 Message-Id: <200509051837.j85Ib3bM029917@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Malicious server Date: Mon, 05 Sep 2005 11:37:02 -0700 From: william@bourbon.usc.edu Someone wrote: > I am trying to test my client against the malacious server > and as soon as I start the malicious server it gives a output > > Out of virtual memory > > And just waits. > > On the client side I am getting an error - Connection Timed out > And then my program is going to me read() error handler. > > Can u please help. I cannot reproduce what you mentioned. What was the exact command you entered for the server? -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Sep 3 17:44:03 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j840i33e023080 for ; Sat, 3 Sep 2005 17:44: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 j840nWPp005888 for ; Sat, 3 Sep 2005 17:49:32 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j840nWMf005886 for cs551@merlot.usc.edu; Sat, 3 Sep 2005 17:49: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 j840nWPp005883 for ; Sat, 3 Sep 2005 17:49:32 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j840nWMB005879 for ; Sat, 3 Sep 2005 17:49:32 -0700 Message-Id: <200509040049.j840nWMB005879@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: converting hostname to IP address Date: Sat, 03 Sep 2005 17:49:32 -0700 From: william@bourbon.usc.edu Someone wrote: > when I try to convert hostname to Ip address by gethostbyname, > while compilation it says undefined symbol gethostbyname > I am trying to find the solution since long. > somebody said i should make some change to link command line but > I dont understand where to make change. Did you try what was suggested in my message with timestamp "Fri 02 Sep 14:18"? Please also do: man -s 3socket socket You need to add all this during the *link* step. If you don't know what the link step is, please see the notes on separate compilation. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Sep 3 14:01:58 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j83L1w3e010841 for ; Sat, 3 Sep 2005 14:01: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 j83L7SPp004737 for ; Sat, 3 Sep 2005 14:07:28 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j83L7Suh004735 for cs551@merlot.usc.edu; Sat, 3 Sep 2005 14:07: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 j83L7RPp004732 for ; Sat, 3 Sep 2005 14:07:27 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j83L7RbH004728 for ; Sat, 3 Sep 2005 14:07:27 -0700 Message-Id: <200509032107.j83L7RbH004728@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS 551: Zero-length file, other special cases Date: Sat, 03 Sep 2005 14:07:27 -0700 From: william@bourbon.usc.edu Someone wrote: | On 9/3/05 1:30 PM, "william@bourbon.usc.edu" | wrote: | | > Someone wrote: | > | >> You did not specify the desired result when the file specified in a GET_REQ | >> is of zero-length. This is perfectly reasonable, as files need not contain | >> data. A GET_RPLY with zero data length and no data can be sent. But the | >> MD5 of such a file is not defined. I chose to "send" the zero-length file, | >> and on the client side report its size as zero, and the MD5 digest as | >> undefined. | > | > I think it would work just fine if GET_RPLY has 0 length data field. | > The MD5 value for something that's zero-length is well defined. If | > you do: | > | > echo -n "" | openssl md5 | > | > you should get "d41d8cd98f00b204e9800998ecf8427e". | | I suspect this is simply the MD5 initialization vector. Arguably, the | digest of "nothing" is ambiguous, at best. Just what does it mean to verify | (with MD5) that two empty files are identical? Try | | % touch empty | % md5 empty | | You will see that the implementers, at least, thought this was a special | case. MD5 is a very specific algorithm. I'm having trouble seeing why it would be ambiguous if it outputs a well-defined value in this case. | >> A more subtle problem occurs if the client specifies a "special" file (e,g, | >> /dev/tty) file in its request. Such files do not have "lengths" (well, at | >> least not lengths that can be stat'd ahead of time, to put the length in the | >> header). Can we trust you not to send such a request, or should we examine | >> the st_mode to make sure? | > | > I think as long as you are consistent with the filesize and | > the GET_RPLY, it should be fine. One easy way to make it | > consistent (and still useful) is to check if it's a regular | > file (using the S_ISREG macro). If not, just return FSZ_FAIL | > (or GET_FAIL) to mean that it's not a regular file. Please | > document your choice in your README file. | | There is no "consistent" (meaningful) file size of most special files. | Stat() probably just returns st_size as zero, though I haven't checked. So | I suppose if you handle the zero-length file problem, you also handle this | one. | | Presumably to "document [our] choice" means to say whether we return a | zero-length file, or a *_FAIL, in the above case? Not just "say", but please explain why your choose this way and not another way (if an explanation is warrented). I've mentioned this in class... Often, a protocol specifies what is correct behavior if business is normal. A protocol spec often does not cover all possible exceptions. So, how can one possibly implement something that will work with all other implementations of the same spec? Jon Postel said: Be liberal in what you accept, and conservative in what you send. May be that's a good way to go! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Sep 3 13:28:02 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j83KS23e009061 for ; Sat, 3 Sep 2005 13:28: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 j83KXVPp004481 for ; Sat, 3 Sep 2005 13:33:31 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j83KXV4G004479 for cs551@merlot.usc.edu; Sat, 3 Sep 2005 13:33: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 j83KXVPp004476 for ; Sat, 3 Sep 2005 13:33:31 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j83KXVqb004472 for ; Sat, 3 Sep 2005 13:33:31 -0700 Message-Id: <200509032033.j83KXVqb004472@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS551: File-read error Date: Sat, 03 Sep 2005 13:33:31 -0700 From: william@bourbon.usc.edu Someone wrote: > In the (relatively unlikely) event of an unrecoverable file read error > (short file, etc.) when the the server is sending the requested file > (GET_RPLY), what would you like us to do? The server should close the connection because it has no choice! > Since the header has already been sent, the only reasonable recovery is to > stop sending immediately and close the connection. The client should detect > the end of connection (either through timeouts, or waiting for the socket to > return an error), and report it to the user. Exactly! The client won't know if the server is being malicious, or of someone in the middle of the network is doing something funny, or this is the expected behavior. But the client should expect something like this to happen. Please see the last bullet in the Miscellaneous section of the spec. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Sep 3 13:25:15 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j83KPF3e008840 for ; Sat, 3 Sep 2005 13:25: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 j83KUjPp004453 for ; Sat, 3 Sep 2005 13:30:45 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j83KUjHE004451 for cs551@merlot.usc.edu; Sat, 3 Sep 2005 13:30: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 j83KUiPp004448 for ; Sat, 3 Sep 2005 13:30:44 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j83KUim7004444 for ; Sat, 3 Sep 2005 13:30:44 -0700 Message-Id: <200509032030.j83KUim7004444@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS 551: Zero-length file, other special cases Date: Sat, 03 Sep 2005 13:30:44 -0700 From: william@bourbon.usc.edu Someone wrote: > You did not specify the desired result when the file specified in a GET_REQ > is of zero-length. This is perfectly reasonable, as files need not contain > data. A GET_RPLY with zero data length and no data can be sent. But the > MD5 of such a file is not defined. I chose to "send" the zero-length file, > and on the client side report its size as zero, and the MD5 digest as > undefined. I think it would work just fine if GET_RPLY has 0 length data field. The MD5 value for something that's zero-length is well defined. If you do: echo -n "" | openssl md5 you should get "d41d8cd98f00b204e9800998ecf8427e". > A more subtle problem occurs if the client specifies a "special" file (e,g, > /dev/tty) file in its request. Such files do not have "lengths" (well, at > least not lengths that can be stat'd ahead of time, to put the length in the > header). Can we trust you not to send such a request, or should we examine > the st_mode to make sure? I think as long as you are consistent with the filesize and the GET_RPLY, it should be fine. One easy way to make it consistent (and still useful) is to check if it's a regular file (using the S_ISREG macro). If not, just return FSZ_FAIL (or GET_FAIL) to mean that it's not a regular file. Please document your choice in your README file. The S_ISREG macro is defined in . Please do: man -s 3head stat -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Sep 3 11:30:12 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j83IUC3e001426 for ; Sat, 3 Sep 2005 11:30: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 j83IZgPp003630 for ; Sat, 3 Sep 2005 11:35:42 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j83IZg9u003628 for cs551@merlot.usc.edu; Sat, 3 Sep 2005 11:35: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 j83IZgPp003625 for ; Sat, 3 Sep 2005 11:35:42 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j83IZgJn003621 for ; Sat, 3 Sep 2005 11:35:42 -0700 Message-Id: <200509031835.j83IZgJn003621@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Question about unsigned int Date: Sat, 03 Sep 2005 11:35:42 -0700 From: william@bourbon.usc.edu Someone wrote: > I am writing to read my buff 1 byte at a time and shifting my > number 8 bits and oring the 8 bits of buff[i] with these lower > 8 bits. > > Eg: > > Unsigned short t; > Buff[0] = 0xfe; > If I do - > t = buff[0]; > > I am getting fffe in t, instead of 00fe. > > Can u pls comment on why this is happening. THis is because buff is of type char* and that's *signed* character! 0xfe with sign extension is 0xfffe if you want to treat it as an 16-bit quantity or 0xfffffffe if you want to treat it as an 32-bit quantity. To make sure, you should typecast (and typecast, and typcast if you must). Therefore, you should probably do: t = (unsigned short)(unsigned char)buff[0]; I usually like to make double (or triple) sure. So, I would do: t = (((unsigned short)(unsigned char)buff[0]) & 0x00ff); Then no compiler in the world would misunderstood it! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Sat Sep 3 11:20:09 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j83IK93e000869 for ; Sat, 3 Sep 2005 11:20: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 j83IPdPp003508 for ; Sat, 3 Sep 2005 11:25:39 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j83IPdxX003506 for cs551@merlot.usc.edu; Sat, 3 Sep 2005 11:25: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 j83IPdPp003503 for ; Sat, 3 Sep 2005 11:25:39 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j83IPdN6003499 for ; Sat, 3 Sep 2005 11:25:39 -0700 Message-Id: <200509031825.j83IPdN6003499@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: regarding sending file data Date: Sat, 03 Sep 2005 11:25:39 -0700 From: william@bourbon.usc.edu Someone wrote: > I am a bit confused about the file request option. is it that we > read the whole first and copy it in the data field... Yes! So, if the file is 2MB long, you need to do 2MB+6 writes (since we are writing one byte at a time). Please make sure you do not violate the maximum buffer size requirement. > or some > other ways..like read a partition of file, send it...read the > remaining file and send it.. in this way, the header willl be > sent again? is it fine? No. Please see slide 7 of lecture 2. When you send data over the network, you must follow the spec. You may not introduce new message formats! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 2 23:02:47 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j8362l3e024131 for ; Fri, 2 Sep 2005 23:02: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 j8368IPp032389 for ; Fri, 2 Sep 2005 23:08:18 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j8368IlK032387 for cs551@merlot.usc.edu; Fri, 2 Sep 2005 23:08: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 j8368IPp032384 for ; Fri, 2 Sep 2005 23:08:18 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j8368ITO032380 for ; Fri, 2 Sep 2005 23:08:18 -0700 Message-Id: <200509030608.j8368ITO032380@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: question for char * buf to unsigned short Date: Fri, 02 Sep 2005 23:08:18 -0700 From: william@bourbon.usc.edu Someone wrote: > I have been trying to run a snippet given by you for a long > time but i dont know what wrong, it gives me strange results. > > char * buf = "12345 "; > unsigned short us; > memcpy (&us, buf, sizeof(unsigned short)); > > and when i do printf ("%u" , us ) , it gives me alway 12596 > instead of 12345/any other value. what I am doing wrong here? Did you go into the debugger and examine *all* the values? What's buf[0], buf[1], ...? What value is the first byte of us? What value is the 2nd byte of us? If you haven't done so, please do it first before reading on. [more follows...] Well, buf has the following value: buf[0] = 0x31 (which is '1') buf[1] = 0x32 (which is '2') buf[2] = 0x33 (which is '3') buf[3] = 0x34 (which is '4') buf[4] = 0x35 (which is '5') buf[5] = 0x20 (which is ' ') buf[6] = 0x00 (which is '\0') Right? If sizeof(unsigned short) is 2, then, memcpy(&us, buf, 2) will put 0x31 in ((char*)&us)[0] and 0x32 in ((char*)&us)[1]. Right? If you don't understand what I just wrote, you need to brush up on C/C++ very quickly! Since Solaris is a Big Endian machine, ((char*)&us)[0] is the high byte and ((char*)&us)[1] is the low byte. Therefore, the value in us is 0x3132 which is 12594 (I'm not sure why you said 12596, I assume it's a typo). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 2 14:13:04 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j82LD43e027339 for ; Fri, 2 Sep 2005 14:13: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 j82LIaPp030291 for ; Fri, 2 Sep 2005 14:18:36 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j82LIaYb030289 for cs551@merlot.usc.edu; Fri, 2 Sep 2005 14:18: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 j82LIaPp030286 for ; Fri, 2 Sep 2005 14:18:36 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j82LIa3h030282 for ; Fri, 2 Sep 2005 14:18:36 -0700 Message-Id: <200509022118.j82LIa3h030282@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Warmup Project#1 Date: Fri, 02 Sep 2005 14:18:36 -0700 From: william@bourbon.usc.edu Someone wrote: > Looks like this person is having problem linking to the socket library. He > can try this command: > > gcc -g server.c -o server -lnsl -lsocket -lresolv I would have thought that this student has already done this. But I'll forward this message just in case he/she did not. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Friday, September 02, 2005 1:47 PM Subject: Re: Warmup Project#1 > Someone wrote: > > > I am trying to run a simple code and still am getting this > > error on compilation : > > > > undefined symbol __xnet_socket first referenced in fie > /var/tmp//ccCFPW74.o > > ld:fatal Symbol referencing errors. > > > > Please can you help me with this error. > > Sorry, but I have no clue what this is! Did you start with > some simple code in Steven's book? > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Fri Sep 2 13:41:45 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j82Kfj3e025543 for ; Fri, 2 Sep 2005 13:41: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 j82KlHPp029836 for ; Fri, 2 Sep 2005 13:47:17 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j82KlHpX029834 for cs551@merlot.usc.edu; Fri, 2 Sep 2005 13:47: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 j82KlHPp029831 for ; Fri, 2 Sep 2005 13:47:17 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j82KlHN2029827 for ; Fri, 2 Sep 2005 13:47:17 -0700 Message-Id: <200509022047.j82KlHN2029827@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Warmup Project#1 Date: Fri, 02 Sep 2005 13:47:17 -0700 From: william@bourbon.usc.edu Someone wrote: > I am trying to run a simple code and still am getting this > error on compilation : > > undefined symbol __xnet_socket first referenced in fie /var/tmp//ccCFPW74.o > ld:fatal Symbol referencing errors. > > Please can you help me with this error. Sorry, but I have no clue what this is! Did you start with some simple code in Steven's book? -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Sep 1 23:09:30 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j8269U3e009921 for ; Thu, 1 Sep 2005 23:09: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 j826F4Pp026515 for ; Thu, 1 Sep 2005 23:15:04 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j826F4b0026513 for cs551@merlot.usc.edu; Thu, 1 Sep 2005 23:15: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 j826F3Pp026510 for ; Thu, 1 Sep 2005 23:15:03 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j826F3LR026506 for ; Thu, 1 Sep 2005 23:15:03 -0700 Message-Id: <200509020615.j826F3LR026506@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS551: open-source question Date: Thu, 01 Sep 2005 23:15:03 -0700 From: william@bourbon.usc.edu Someone wrote: > ZThread can be found at http://zthread.sourceforge.net. There is little > documentation there, however, except for a doxygen-generated class > hierarchy. I looked through the source code to glean their implementation. > > As you know, there are some platform-specific alternatives to pthreads. If > you look at the ZThread implementation, however, you can see that they use > three underlying models: posix, win32, and macosx (see the subdirectories > under src, and the Config.h file, if you download it). > > The SunOS implementation appears to use POSIX pthreads, not Solaris threads. > MacOSX uses some native implementation whose details I ignored. I didn't > look at at the Win32 version. > > The ZThread class interface looks fairly clean. Not as complete as > Washington University's ACE system (which I've played with before), but also > much less complex. By comparison, ZThread has a richer API than the > Boost.Thread library, and you don't have to pull in all of the Boost > baggage. > > Please let me know what you think. I did a little search on the web and it looked like zthreads do use pthreads. Thinking about this some more, I've decided to remove the pthreads requirements for warmup #2 and the final project. This means that you can use any multi-threading library you want. *But*, if you don't use pthreads, you are on your own! Neither the TA nor I will be able to help you if you have problems with any threads related issues. Pthreads is the standard! -- Bill Cheng // bill.cheng@usc.edu On 9/1/05 9:52 AM, "william@bourbon.usc.edu" wrote: > *This message was transferred with a trial version of CommuniGate(tm) Pro* > | > Someone wrote: > | > > | >> I¹ve implemented a pure OO version of Project #1, and was looking to > find > | >> (or develop) a C++ wrapper for my threads. ZThreads is a relatively > simple > | >> (as these things go), publicly-available (SourceForge), open-source > (MIT > | >> License) library for this purpose. > | > > | > I'm not familiar with zthreads. Warmup project #2 and the > | > final project requires pthread. If zthreads is not on top > | > of pthreads, I'm concerned that you won't be able to reuse > | > your code here if you do it in zthreads. > | > | ZThreads appears to be just an OO-wrapper around pthreads. I've not used > it > | before, but if it works I may use it on my own professional projects. > > Could you send me an URL where it says that it's on top of > pthreads? (And make sure you include that in your README files > for the rest of the semister if you will use it everywhere else.) > > Warmup #1 has no restriction. So it's okay as long as you only > submit source! > > | Nevertheless, neither the specification nor the grading criteria for > Project > | #2 requires that pthreads, per se, be used. Presumably any thread > | implementation (for example, Solaris threads) would be acceptable. (Now > | you'll go and change the spec, I suppose... ;-) > > The warmup #2 spec was not suppose to be up! Sorry for my > mistake. I've taken it down and I will put it back up > towards the end of next week. And the pthreads requirement > will be there when it goes back up. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Sep 1 21:23:34 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j824NY3e003883 for ; Thu, 1 Sep 2005 21:23: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 j824T8Pp025588 for ; Thu, 1 Sep 2005 21:29:08 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j824T8bi025586 for cs551@merlot.usc.edu; Thu, 1 Sep 2005 21:29: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 j824T8Pp025583 for ; Thu, 1 Sep 2005 21:29:08 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j824T8Ru025579 for ; Thu, 1 Sep 2005 21:29:08 -0700 Message-Id: <200509020429.j824T8Ru025579@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS551: open-source question Date: Thu, 01 Sep 2005 21:29:08 -0700 From: william@bourbon.usc.edu Someone wrote: | On 9/1/05 9:52 AM, "william@bourbon.usc.edu" | wrote: | | > The warmup #2 spec was not suppose to be up! Sorry for my | > mistake. I've taken it down and I will put it back up | > towards the end of next week. And the pthreads requirement | > will be there when it goes back up. | | ARRGH! Please don't delete it! I, for one (and most others, I presume) | would just as soon do all of your projects right now. Being a DEN student, | I have to squeeze class work into my schedule. Labor Day is a perfect day! | (I'll deal with any specification changes as they arise.) Fair enough... It's back up on the web now. But I've changed it to say pthreads! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Sep 1 21:19:07 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j824J73e003594 for ; Thu, 1 Sep 2005 21:19: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 j824OfPp025510 for ; Thu, 1 Sep 2005 21:24:41 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j824Of5T025508 for cs551@merlot.usc.edu; Thu, 1 Sep 2005 21:24: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 j824OfPp025505 for ; Thu, 1 Sep 2005 21:24:41 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j824Of7p025501 for ; Thu, 1 Sep 2005 21:24:41 -0700 Message-Id: <200509020424.j824Of7p025501@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS 551: warnings Date: Thu, 01 Sep 2005 21:24:41 -0700 From: william@bourbon.usc.edu Someone wrote: > Do I need to correct the warnings generated when compiling the open-source > code I¹m employing? From the warnings, I suspect they compiled under gcc > 2.95, which was much less picky than gcc 3.x or 4.0. The warnings are not > serious in this case, related to a deprecated (but not illegal) way of > handling template parameters. (My own code generates no warnings with > -Wall.) It's not a problem if you document this. It would make things easier for the TA if you keep the downloaded files separate from your code. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Sep 1 09:46:55 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j81Gkt3e030624 for ; Thu, 1 Sep 2005 09:46: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 j81GqUPp023302 for ; Thu, 1 Sep 2005 09:52:30 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j81GqU0m023300 for cs551@merlot.usc.edu; Thu, 1 Sep 2005 09: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 j81GqUPp023297 for ; Thu, 1 Sep 2005 09:52:30 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j81GqUC6023293 for ; Thu, 1 Sep 2005 09:52:30 -0700 Message-Id: <200509011652.j81GqUC6023293@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS551: open-source question Date: Thu, 01 Sep 2005 09:52:30 -0700 From: william@bourbon.usc.edu | > Someone wrote: | > | >> I¹ve implemented a pure OO version of Project #1, and was looking to find | >> (or develop) a C++ wrapper for my threads. ZThreads is a relatively simple | >> (as these things go), publicly-available (SourceForge), open-source (MIT | >> License) library for this purpose. | > | > I'm not familiar with zthreads. Warmup project #2 and the | > final project requires pthread. If zthreads is not on top | > of pthreads, I'm concerned that you won't be able to reuse | > your code here if you do it in zthreads. | | ZThreads appears to be just an OO-wrapper around pthreads. I've not used it | before, but if it works I may use it on my own professional projects. Could you send me an URL where it says that it's on top of pthreads? (And make sure you include that in your README files for the rest of the semister if you will use it everywhere else.) Warmup #1 has no restriction. So it's okay as long as you only submit source! | Nevertheless, neither the specification nor the grading criteria for Project | #2 requires that pthreads, per se, be used. Presumably any thread | implementation (for example, Solaris threads) would be acceptable. (Now | you'll go and change the spec, I suppose... ;-) The warmup #2 spec was not suppose to be up! Sorry for my mistake. I've taken it down and I will put it back up towards the end of next week. And the pthreads requirement will be there when it goes back up. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Sep 1 08:47:24 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j81FlO3e027310 for ; Thu, 1 Sep 2005 08:47: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 j81FqxPp022991 for ; Thu, 1 Sep 2005 08:52:59 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j81FqxwY022989 for cs551@merlot.usc.edu; Thu, 1 Sep 2005 08:52: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 j81FqxPp022986 for ; Thu, 1 Sep 2005 08:52:59 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j81FqxCU022982 for ; Thu, 1 Sep 2005 08:52:59 -0700 Message-Id: <200509011552.j81FqxCU022982@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: Follow-Up: CS551: open-source question Date: Thu, 01 Sep 2005 08:52:59 -0700 From: william@bourbon.usc.edu Someone wrote: > I forgot that GNU configure wants absolute pathnames for its destination > directories. I can hack the resulting makefile(s) to produce relative > paths, or to use an environment variable, if you prefer "option one" below. > This wouldn't be necessary, though, if you will accept the alternative. If the procedure is not too complicated (such as setting environment variables) and you write it down clearly near the top of the README file, that would be fine (no points off). But please make sure it works! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Thu Sep 1 08:45:18 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j81FjI3e027194 for ; Thu, 1 Sep 2005 08:45: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 j81ForPp022946 for ; Thu, 1 Sep 2005 08:50:53 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j81FormR022944 for cs551@merlot.usc.edu; Thu, 1 Sep 2005 08:50: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 j81ForPp022941 for ; Thu, 1 Sep 2005 08:50:53 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j81ForAv022937 for ; Thu, 1 Sep 2005 08:50:53 -0700 Message-Id: <200509011550.j81ForAv022937@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS551: open-source question Date: Thu, 01 Sep 2005 08:50:53 -0700 From: william@bourbon.usc.edu Someone wrote: > I¹ve implemented a pure OO version of Project #1, and was looking to find > (or develop) a C++ wrapper for my threads. ZThreads is a relatively simple > (as these things go), publicly-available (SourceForge), open-source (MIT > License) library for this purpose. I'm not familiar with zthreads. Warmup project #2 and the final project requires pthread. If zthreads is not on top of pthreads, I'm concerned that you won't be able to reuse your code here if you do it in zthreads. > You've noted that we can employ publicly-available software as part of our > implementation. Using the library as-is, however, raises a logistics > question. How should I deploy it for this assignment? > > One option is to pre-configure the library using GNU config, call its > makefile from the main makefile, and let the grader build it on-the-fly when > compiling the rest of my project. > > Another alternative would be to SUPPLY the source code (so you can see I'm > not cheating), but pre-build the library. This saves the grader some time, > and slightly reduces the chance for build problems. > > The second option is the easiest for both me and the grader, but may not > meet your requirements. Do you have a preference, please? The electronic submission guidelines page states that you are only to submit source and documentation files. So, the 2nd option will not work. For the first option, please somehow make sure that the TA can compile without a problem in his grading account because that's the only allow the TA is allowed to grade, to be fair to all students. If you have any special instructions in building your code, you must write it down near the top of your README file. If the TA fails to compile according to your instructions or if the instruction is too complicated, the TA will take off points! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Aug 31 23:07:10 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j8167A3e027623 for ; Wed, 31 Aug 2005 23:07: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 j816CkPp020920 for ; Wed, 31 Aug 2005 23:12:46 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j816Ck0u020918 for cs551@merlot.usc.edu; Wed, 31 Aug 2005 23:12:46 -0700 Date: Wed, 31 Aug 2005 23:12:46 -0700 From: william@bourbon.usc.edu Message-Id: <200509010612.j816Ck0u020918@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: HWs will not be graded! Hi, I've mentioned in class that since our enrollment size is small, we are not getting a grader. The TA will grade the projects. I've also decided that homework assignments will not be graded (and you do not need to submit them). The 5% of the total grade that was assigned to HWs is now moved to the midterm exam: Homeworks: 0% Projects: 35% Midterm Exam: 30% Final Exam: 35% You are strongly encouraged to do the homework assignments in order to learn how to write ns-2 programs. (Although I will not ask questions regarding ns-2 in the exams.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Aug 31 21:22:31 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j814MV3e021739 for ; Wed, 31 Aug 2005 21:22: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 j814S7Pp020337 for ; Wed, 31 Aug 2005 21:28:07 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j814S7MF020335 for cs551@merlot.usc.edu; Wed, 31 Aug 2005 21:28: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 j814S7Pp020332 for ; Wed, 31 Aug 2005 21:28:07 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j814S7cG020328 for ; Wed, 31 Aug 2005 21:28:07 -0700 Message-Id: <200509010428.j814S7cG020328@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS551: Error messages Date: Wed, 31 Aug 2005 21:28:07 -0700 From: william@bourbon.usc.edu Someone wrote: > Do you care if (or, perhaps, do you specifically want) the server to issue > its own messages on stderr when it gets unservicable requests? This would > be in addition to the xxx_FAIL response sent to the client. In general, once the server is up and running, it should never print anything to stderr or stdout! You may output any additional information to a log file. But since we are not using a log file here, outputing to stderr would be fine. A good server should *always* respond with something. In the case of an unexpected error, you should respond with ALL_FAIL. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Aug 31 21:16:52 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j814Gq3e021390 for ; Wed, 31 Aug 2005 21:16: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 j814MSPp020311 for ; Wed, 31 Aug 2005 21:22:28 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j814MS6W020309 for cs551@merlot.usc.edu; Wed, 31 Aug 2005 21:22: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 j814MSPp020306 for ; Wed, 31 Aug 2005 21:22:28 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j814MSxs020302 for ; Wed, 31 Aug 2005 21:22:28 -0700 Message-Id: <200509010422.j814MSxs020302@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: CS551: Need for fork/threads? Date: Wed, 31 Aug 2005 21:22:28 -0700 From: william@bourbon.usc.edu Someone wrote: > The need for using fork() or pthreads in this assignment is unclear. It is > easy enough to create a listen queue, which has the effect of serializing > the handling of requests. > > Each request will take only a fraction of a second to handle. Even sending > the file (unless truly huge, which yours aren't) won't take very long. > Therefore, unless you use incredibly short timeouts in the client, or queue > up many requests (neither of which you are), the requests can be handled > serially. > > That is, unless you're making it a REQUIREMENT to use fork() or threads... Since we are writing a server, it is implied that you must handle simultaneous requests. Please check the grading guidelines... You stand to lose 30 points if you fail the multithreading/multiprocessing test! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Aug 31 21:10:43 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j814Ah3e021068 for ; Wed, 31 Aug 2005 21:10: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 j814GJPp020260 for ; Wed, 31 Aug 2005 21:16:19 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j814GJlM020258 for cs551@merlot.usc.edu; Wed, 31 Aug 2005 21: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 j814GJPp020255 for ; Wed, 31 Aug 2005 21:16:19 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j814GJ3s020251 for ; Wed, 31 Aug 2005 21:16:19 -0700 Message-Id: <200509010416.j814GJ3s020251@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: question Date: Wed, 31 Aug 2005 21:16:19 -0700 From: william@bourbon.usc.edu Someone wrote: > buf[0] = (unsigned char)0xfe; > buf[1] = (unsigned char)0x10; > buf[2] = (unsigned char)((datalen & 0xff000000)>>24); > buf[3] = (unsigned char)((datalen & 0x00ff0000)>>16); > buf[4] = (unsigned char)((datalen & 0x0000ff00)>>8); > buf[5] = (unsigned char)(datalen & 0x000000ff); > > this is my header of packet. > it is printing perfectly correct value for the host www.usc.edu > it gives me 11 as a strlen(www.usc.edu) string. > which is correct > > My problem is: > it is storing 0 in buf[2],buf[3],buf[4] and 11 in buf[5]. > as soon as it reads 0 it takes it as a \0 which is a char value for 0. > so buf breaks at that point giving me only 2 bytes of buf. > > what should i do to remove this error. Are you using something like fgets() to read data? Just like printf(), fgets() assume the input data is in ASCII and it will stop at a '\0'. So, you should not use fgets() to read *binary data*. To read one byte of binary data at a time, you can use read() or fread(). I think fgetc() would also work, but I'm not sure. You can give it a try and see what it does. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Aug 29 23:23:19 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j7U6NJ3e031727 for ; Mon, 29 Aug 2005 23:23: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 j7U6T0Pp006128 for ; Mon, 29 Aug 2005 23:29:00 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j7U6T0FH006126 for cs551@merlot.usc.edu; Mon, 29 Aug 2005 23:29: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 j7U6T0Pp006123 for ; Mon, 29 Aug 2005 23:29:00 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j7U6T0MB006119 for ; Mon, 29 Aug 2005 23:29:00 -0700 Message-Id: <200508300629.j7U6T0MB006119@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: question Date: Mon, 29 Aug 2005 23:29:00 -0700 From: william@bourbon.usc.edu Someone wrote: > Is it legal to use code from a website. website is of some > university, and if so, if i just mention in my code "code > dervided from www.xyz.com " that will be all? I am really want to > be sure on this before using it. It is very important to clearly mark code that you did not write by saying something explicitly like "I did not write this code, it came from this and that". So, please give as much detail as reasonable to give proper credit. If the code has an author, please mention the author's name and e-mail address. If the code has a copyright notice, please make sure you do not violate the copyright notice. If you have doubt if it's okay to use a specific piece of code, please send the URL to me to make sure. Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Aug 29 16:41:50 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j7TNfo3e009664 for ; Mon, 29 Aug 2005 16:41: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 j7TNlWPp003977 for ; Mon, 29 Aug 2005 16:47:32 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j7TNlWXq003975 for cs551@merlot.usc.edu; Mon, 29 Aug 2005 16:47: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 j7TNlWPp003972 for ; Mon, 29 Aug 2005 16:47:32 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j7TNlWj2003968 for ; Mon, 29 Aug 2005 16:47:32 -0700 Message-Id: <200508292347.j7TNlWj2003968@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: use of sprintf()/snprintf()... Date: Mon, 29 Aug 2005 16:47:32 -0700 From: william@bourbon.usc.edu Someone wrote: > I tried the method which you suggested... > buf[3]=char(0xfe); > It is printing this... > þ. > I am not getting what is this and if it is > correct. Please help me with this? What you saw was the character named "thorn" (with ISO Latin-1 encoding). It has the character code 254, which is 0xfe. When you said "it is printing this", you should be more specific about what you meant by "print"! If doing a printf()/fprintf() is what you mean by "print", you need to be very careful because printf() assumes that you are dealing with ASCII characters (just like sprintf()). If you have a binary buffer, it's not very meaningful when you pass it to printf(). One significant problem is that if printf() sees a '\0', it will stop printing. If you are really trying to print binary data, you don't want to stop at a '\0'! This is why I suggested that you should go into a debugger and examine buf[3]. In gdb, I get the following: (gdb) print buf[3] $1 = -2 '�' (gdb) Since buf[3] is a char, -2 means 256-2 and that's exactly what 0xfe is. Therefore, the correct byte got into buf[3]. -- Bill Cheng // bill.cheng@usc.edu --- william@bourbon.usc.edu wrote: > Hi, > > Someone asked me why sprintf() is not putting the > right > pattern into memory. The reason is that sprintf() > is not for > binary output! The output of sprintf() is ASCII. > I've added > the following notes to the spec: > > [BC: Added 8/29/2005] > Do not use sprintf/snprintf() to put a pattern > into a > piece of memory because sprintf() is suppose to > output > ASCII! If you want to put 0xFE into the byte 3 > of buf, do > not do: > > snprintf(&buf[3], sizeof(buf)-3, "%2x", > (int)(0x0fe)) > > You will end up with the character 'f' in > buf[3], the > character 'e' in buf[4], and '\0' in buf[5]. > This happens > because sprintf() is doing exactly what you > asked it to > do. Try > > buf[3] = (char)(0xfe) > > When in doubt, get into the debugger and print > the value > of buf[3] ane make sure you are getting what you > expected. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Aug 29 15:25:02 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j7TMP23e005452 for ; Mon, 29 Aug 2005 15:25: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 j7TMUiPp002895 for ; Mon, 29 Aug 2005 15:30:44 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j7TMUilN002893 for cs551@merlot.usc.edu; Mon, 29 Aug 2005 15:30: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 j7TMUiPp002890 for ; Mon, 29 Aug 2005 15:30:44 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j7TMUiIl002886 for ; Mon, 29 Aug 2005 15:30:44 -0700 Message-Id: <200508292230.j7TMUiIl002886@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: use of sprintf()/snprintf()... Date: Mon, 29 Aug 2005 15:30:44 -0700 From: william@bourbon.usc.edu Someone wrote: > If you use the method you propose of writing directly into the buffer, you > are forcing the programmer to guarantee network byte-order. This is quite > error-prone, and (as you know) there are routines to do this for you. (As > you point out, this isn't really an issue on SPARCs, but would be on x86 > machines.) Correct. The idea is to call htons() right before you copy the bytes into the array. The main point of what I wrote before is *not* to use sprintf(). I strongly recommend students to write small functions to copy a 2-byte (and 4 byte) entity into (and from) a char array. Once you've written these correctly, you'll just call these functions and will never have to worry about them again. -- Bill Cheng // bill.cheng@usc.edu On 8/29/05 1:12 PM, "william@bourbon.usc.edu" wrote: > Hi, > > Someone asked me why sprintf() is not putting the right > pattern into memory. The reason is that sprintf() is not for > binary output! The output of sprintf() is ASCII. I've added > the following notes to the spec: > > [BC: Added 8/29/2005] > Do not use sprintf/snprintf() to put a pattern into a > piece of memory because sprintf() is suppose to output > ASCII! If you want to put 0xFE into the byte 3 of buf, do > not do: > > snprintf(&buf[3], sizeof(buf)-3, "%2x", (int)(0x0fe)) > > You will end up with the character 'f' in buf[3], the > character 'e' in buf[4], and '\0' in buf[5]. This happens > because sprintf() is doing exactly what you asked it to > do. Try > > buf[3] = (char)(0xfe) > > When in doubt, get into the debugger and print the value > of buf[3] ane make sure you are getting what you expected. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Aug 29 13:06:47 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j7TK6l3e029991 for ; Mon, 29 Aug 2005 13:06: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 j7TKCTPp001616 for ; Mon, 29 Aug 2005 13:12:29 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j7TKCT3n001614 for cs551@merlot; Mon, 29 Aug 2005 13:12:29 -0700 Date: Mon, 29 Aug 2005 13:12:29 -0700 From: william@bourbon.usc.edu Message-Id: <200508292012.j7TKCT3n001614@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: use of sprintf()/snprintf()... Hi, Someone asked me why sprintf() is not putting the right pattern into memory. The reason is that sprintf() is not for binary output! The output of sprintf() is ASCII. I've added the following notes to the spec: [BC: Added 8/29/2005] Do not use sprintf/snprintf() to put a pattern into a piece of memory because sprintf() is suppose to output ASCII! If you want to put 0xFE into the byte 3 of buf, do not do: snprintf(&buf[3], sizeof(buf)-3, "%2x", (int)(0x0fe)) You will end up with the character 'f' in buf[3], the character 'e' in buf[4], and '\0' in buf[5]. This happens because sprintf() is doing exactly what you asked it to do. Try buf[3] = (char)(0xfe) When in doubt, get into the debugger and print the value of buf[3] ane make sure you are getting what you expected. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Aug 29 09:56:06 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j7TGu63e019169 for ; Mon, 29 Aug 2005 09:56: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 j7TH1nPp000541 for ; Mon, 29 Aug 2005 10:01:49 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j7TH1nRO000539 for cs551@merlot.usc.edu; Mon, 29 Aug 2005 10:01: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 j7TH1nPp000536 for ; Mon, 29 Aug 2005 10:01:49 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j7TH1nFr000532 for ; Mon, 29 Aug 2005 10:01:49 -0700 Message-Id: <200508291701.j7TH1nFr000532@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: question Date: Mon, 29 Aug 2005 10:01:49 -0700 From: william@bourbon.usc.edu Someone wrote: > Regarding your point below, I presume that it will be acceptable to have > separate makefiles in subdirectories, all invoked from a single top-level > makefile that complies with your guidelines. > > I tend to segregate code into separate subdirectories, which makes it > easier to manage (and reuse). This is the strategy I used in CS530, > which was acceptable to you then. Yes, it is acceptable. But please make sure you share as much code as desirable between your client and server (may be put the common code in a 3rd subdirectory?). Also, please follow the spec so that in the client directory, "make client" will produce the client executable and in the server directory, "make server" will produce the server executable. -- Bill Cheng // bill.cheng@usc.edu On 8/29/05 7:49 AM, "william@bourbon.usc.edu" wrote: > Someone wrote: > >> I have following question regarding warmup ex. >> --> Do we need to bulid to two separate makefiles for client >> and server. or it just once makefile who will create both >> executables for servers and clients? > > You should use a single Makefile. I've just updated the spec > and added the following information: > > [BC: Paragraphs added 8/29/2005] > Please use a single Makefile so that when the grader simply enters: > > make client > > an executable named client is created. If the grader simply enters: > > make server > > an executable named server is created. Please make sure that > your submission conforms to other general compilation requirements. > > In the Makefile web page, I've also made some minor changes > (the language there was too harsh before). Please look for > anything blue that has "BC:" in it. Thanks! > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Mon Aug 29 07:43:48 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j7TEhm3e011848 for ; Mon, 29 Aug 2005 07:43: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 j7TEnVPp032334 for ; Mon, 29 Aug 2005 07:49:31 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j7TEnVrV032332 for cs551@merlot.usc.edu; Mon, 29 Aug 2005 07:49: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 j7TEnVPp032329 for ; Mon, 29 Aug 2005 07:49:31 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j7TEnVLg032325 for ; Mon, 29 Aug 2005 07:49:31 -0700 Message-Id: <200508291449.j7TEnVLg032325@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: Re: question Date: Mon, 29 Aug 2005 07:49:31 -0700 From: william@bourbon.usc.edu Someone wrote: > I have following question regarding warmup ex. > --> Do we need to bulid to two separate makefiles for client > and server. or it just once makefile who will create both > executables for servers and clients? You should use a single Makefile. I've just updated the spec and added the following information: [BC: Paragraphs added 8/29/2005] Please use a single Makefile so that when the grader simply enters: make client an executable named client is created. If the grader simply enters: make server an executable named server is created. Please make sure that your submission conforms to other general compilation requirements. In the Makefile web page, I've also made some minor changes (the language there was too harsh before). Please look for anything blue that has "BC:" in it. Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs551@bourbon.usc.edu Delivery-Date: Wed Aug 24 16:19:27 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j7ONJR3e019086 for ; Wed, 24 Aug 2005 16:19: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 j7ONPLPp028791 for ; Wed, 24 Aug 2005 16:25:21 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j7ONPLIT028789 for cs551@merlot.usc.edu; Wed, 24 Aug 2005 16:25: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 j7ONPLPp028786 for ; Wed, 24 Aug 2005 16:25:21 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j7ONPLUm028784 for cs551; Wed, 24 Aug 2005 16:25:21 -0700 Date: Wed, 24 Aug 2005 16:25:21 -0700 From: william@bourbon.usc.edu Message-Id: <200508242325.j7ONPLUm028784@bourbon.usc.edu> To: cs551@bourbon.usc.edu Subject: added hints for warmup #1... Hi, I've just added the following paragraph near the bottom of the warmup #1 spec: [BC: Added 8/24/2005] If you are having trouble with figuring out how to set a timer to shutdown the server or for the server to break out of the accept() call, here's some information that may be helpful. Hope this is helpful! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Aug 24 13:04:28 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j7OK4S3e008298 for ; Wed, 24 Aug 2005 13:04: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 j7OKANPp027485 for ; Wed, 24 Aug 2005 13:10:23 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j7OKANL8027483 for cs551@merlot; Wed, 24 Aug 2005 13:10:23 -0700 Date: Wed, 24 Aug 2005 13:10:23 -0700 From: william@bourbon.usc.edu Message-Id: <200508242010.j7OKANL8027483@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: warmup #1 grading guidelines changed... Hi, I just made a minor modification to the warmup #1 grading guidelines. Please always look for the following string in the grading guidelines file for changes: [BC: ...] -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Aug 24 12:50:45 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j7OJoi3e007391 for ; Wed, 24 Aug 2005 12:50: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 j7OJudPp027398 for ; Wed, 24 Aug 2005 12:56:39 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j7OJudKH027396 for cs551@merlot; Wed, 24 Aug 2005 12:56:39 -0700 Date: Wed, 24 Aug 2005 12:56:39 -0700 From: william@bourbon.usc.edu Message-Id: <200508241956.j7OJudKH027396@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: question regarding SERVER_PORT for warmup #1... Someone asked me about SERVER_PORT for warmup #1 right after class today and I gave the wrote answer... The port number the server should listen to is specified as an optional commandline argument. If it is not given in the commandline, you should use a port number assigned to you. You should do something like the following in one of your header files: #define SERVER_PORT 14... -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Aug 22 13:45:14 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j7MKjE3e011721 for ; Mon, 22 Aug 2005 13:45: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 j7MKpDPp012971 for ; Mon, 22 Aug 2005 13:51:13 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j7MKpDEP012969 for cs551@merlot; Mon, 22 Aug 2005 13:51:13 -0700 Date: Mon, 22 Aug 2005 13:51:13 -0700 From: william@bourbon.usc.edu Message-Id: <200508222051.j7MKpDEP012969@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: getting on the class mailing list... Hi, If you have not done so, please go to the following page: http://merlot.usc.edu/cs551-f05/mailinglist.html and register with the class mailing list and get your port assignments. Register with this list is *required* for this class. Thanks! -- Bill Cheng // bill.cheng@usc.edu