Return-Path: lccheung@usc.edu Delivery-Date: Tue Nov 15 01:04:44 2005 Received: from msg-mx2.usc.edu (msg-mx2.usc.edu [128.125.137.7]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jAF94iIo032362 for ; Tue, 15 Nov 2005 01:04:44 -0800 Received: from smtp101.sbc.mail.mud.yahoo.com ([68.142.198.200]) by msg-mx2.usc.edu (Sun Java System Messaging Server 6.2-4.01 (built Sep 1 2005)) with SMTP id <0IPZ00BNBNWD9QB0@msg-mx2.usc.edu> for cs551@merlot.usc.edu; Tue, 15 Nov 2005 01:05:01 -0800 (PST) Received: (qmail 26480 invoked from network); Tue, 15 Nov 2005 09:05:01 +0000 Received: from unknown (HELO lesliee502e195) (leslieck@69.231.23.100 with login) by smtp101.sbc.mail.mud.yahoo.com with SMTP; Tue, 15 Nov 2005 09:05:00 +0000 Date: Tue, 15 Nov 2005 01:04:55 -0800 From: Leslie Cheung Subject: canceling office hour, week of 11/21 To: cs551@merlot.usc.edu Message-id: <0IPZ00BNCNWD9QB0@msg-mx2.usc.edu> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Mailer: Microsoft Office Outlook, Build 11.0.6353 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit Thread-index: AcXpw6V6fEnZt3GUS8mNq2hybl7ZTw== Hi all, I will have to cancel my office hour next Monday (Nov 21). Since the deadline of your final project is coming up, I will hold office hour this Friday (Nov 18), 3-5pm. If you need help sooner than that, feel free to make an appointment with me. Good luck on your projects. Leslie Return-Path: lccheung@usc.edu Delivery-Date: Thu Nov 10 14:38:43 2005 Received: from msg-mx3.usc.edu (msg-mx3.usc.edu [128.125.137.8]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id jAAMchcN021426 for ; Thu, 10 Nov 2005 14:38:43 -0800 Received: from smtp108.sbc.mail.mud.yahoo.com ([68.142.198.207]) by msg-mx3.usc.edu (Sun Java System Messaging Server 6.2-4.01 (built Sep 1 2005)) with SMTP id <0IPR00N8BG903X80@msg-mx3.usc.edu> for cs551@merlot.usc.edu; Thu, 10 Nov 2005 14:39:00 -0800 (PST) Received: (qmail 89075 invoked from network); Thu, 10 Nov 2005 22:38:59 +0000 Received: from unknown (HELO lesliee502e195) (leslieck@69.231.23.100 with login) by smtp108.sbc.mail.mud.yahoo.com with SMTP; Thu, 10 Nov 2005 22:38:59 +0000 Date: Thu, 10 Nov 2005 14:38:56 -0800 From: Leslie Cheung Subject: RE: no commets on grading? In-reply-to: To: cs551@merlot.usc.edu Message-id: <0IPR00N8CG903X80@msg-mx3.usc.edu> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Mailer: Microsoft Office Outlook, Build 11.0.6353 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit Thread-index: AcXmPeIPrERYWydPSly/munxnlYwXAACD58g Someone wrote: > Though, I have submitted my project for beacon only network , I would greatly >appreciated if you could provide me where I went wrong. that would help me in >second part. For part 2, you need to make sure your regular node is able to participating in the network when init_neighbor_list is manually fed in. That is, we are going to provide init_neighbor_list for every regular node. You can also assume that all node in init_neighbor_list is up and running (if not, you may print an error message, but please don't let the node creates seg faults). JOIN and CHECK do not need to work. If you have not implemented "status neighbors", please implement it. Otherwise, I am not able to verify that you have got the right network. Also, please make sure the output is readable by NAM (by running "~csci551/nam your_nam_output"). Please let me know if you need help on NAM output. I want to mention that it's very important to get "status files" work. Sending/caching files is what it is all about for part 2. If I am not able to see which node has what files, it's very hard to grade, and you may lose a lot of points. One more thing... output of "status" and "get" has to be in **current working directory**, not home directory of a node. Leslie Return-Path: lccheung@usc.edu Delivery-Date: Fri Oct 28 23:33:41 2005 Received: from msg-mx0.usc.edu (msg-mx0.usc.edu [128.125.137.5]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9T6XfCJ025973 for ; Fri, 28 Oct 2005 23:33:41 -0700 Received: from smtp104.sbc.mail.mud.yahoo.com ([68.142.198.203]) by msg-mx0.usc.edu (Sun Java System Messaging Server 6.2-4.01 (built Sep 1 2005)) with SMTP id <0IP300BQEZKML800@msg-mx0.usc.edu> for cs551@merlot.usc.edu; Fri, 28 Oct 2005 23:33:59 -0700 (PDT) Received: (qmail 84877 invoked from network); Sat, 29 Oct 2005 06:33:58 +0000 Received: from unknown (HELO lesliee502e195) (leslieck@71.130.10.68 with login) by smtp104.sbc.mail.mud.yahoo.com with SMTP; Sat, 29 Oct 2005 06:33:58 +0000 Date: Fri, 28 Oct 2005 23:33:53 -0700 From: Leslie Cheung Subject: RE: Normal node Join message In-reply-to: To: cs551@merlot.usc.edu Message-id: <0IP300BQFZKML800@msg-mx0.usc.edu> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Mailer: Microsoft Office Outlook, Build 11.0.6353 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit Thread-index: AcXcRsftT/Mmcw0IT4OJiDlIe46IVgACwyiw Someone wrote: >Thanks Professor, >seems like the solution Leslie gave is working for broken pipe problem. >One more question is: >When normal node comes up and sees no init_neighbour_list it sends join >message to the SERVANT. Does it send the join message to any one arbitrary >beacon node and then that beacon node will forward the join request to the >SERVANT network? or it sends join request to all beacon nodes by itself? Since the JOIN message is flooded to the whole network anyway, there is no point of sending the message to all beacons by itself. You can pick one beacon to send the message to. >Also, if it only sends reuest to beacon nodes, how will it then connect to other >normal nodes except for when it has init_neighbour_list file ready? Please see slide #7 - #13 in Lec 10 for an example. Remember, when a regular node sends a JOIN message to a beacon, it does _not_ mean that they are neighbors. The regular node has to compare the "distances" from all JOIN replies it receives, and then decide who its neighbors going to be. Leslie > >----- Original Message ----- >From: william@bourbon.usc.edu >Date: Friday, October 28, 2005 4:53 pm >Subject: Re: Broken pipe over connection >To: cs551@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: lccheung@usc.edu Delivery-Date: Fri Oct 28 15:49:59 2005 Received: from msg-mx0.usc.edu (msg-mx0.usc.edu [128.125.137.5]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id j9SMnxJf014829 for ; Fri, 28 Oct 2005 15:49:59 -0700 Received: from usc.edu ([128.125.137.12]) by msg-mx0.usc.edu (Sun Java System Messaging Server 6.2-4.01 (built Sep 1 2005)) with ESMTP id <0IP3000SKE3TCGA0@msg-mx0.usc.edu> for cs551@merlot.usc.edu; Fri, 28 Oct 2005 15:50:18 -0700 (PDT) Received: from [128.125.137.2] (Forwarded-For: [128.125.163.179]) by msg-store1.usc.edu (mshttpd); Fri, 28 Oct 2005 15:50:17 -0700 Date: Fri, 28 Oct 2005 15:50:17 -0700 From: leslie cheung Subject: Re: Broken pipe over connection To: cs551@merlot.usc.edu Message-id: MIME-version: 1.0 X-Mailer: Sun Java(tm) System Messenger Express 6.2-4.01 (built Sep 1 2005) Content-type: text/plain; charset=us-ascii Content-language: en Content-transfer-encoding: 7bit Content-disposition: inline X-Accept-Language: en Priority: normal 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: Mon Oct 3 14: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 j93LS0e2031460 for ; Mon, 3 Oct 2005 14:28: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 j93LQ5iA020880 for ; Mon, 3 Oct 2005 14:26:05 -0700 Received: (from cs551@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id j93LQ5N3020879 for cs551@merlot.usc.edu; Mon, 3 Oct 2005 14:26:05 -0700 Received: from msg-mx1.usc.edu (msg-mx1.usc.edu [128.125.137.6]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id j93LQ5b7020876 for ; Mon, 3 Oct 2005 14:26:05 -0700 Received: from usc.edu ([128.125.137.12]) by msg-mx1.usc.edu (Sun Java System Messaging Server 6.2-4.01 (built Sep 1 2005)) with ESMTP id <0INS004OLZMF6070@msg-mx1.usc.edu> for cs551@bourbon.usc.edu; Mon, 03 Oct 2005 14:27:56 -0700 (PDT) Received: from [128.125.137.4] (Forwarded-For: [68.181.26.114]) by msg-store1.usc.edu (mshttpd); Mon, 03 Oct 2005 14:27:51 -0700 Date: Mon, 03 Oct 2005 14:27:51 -0700 From: leslie cheung Subject: start your CS551 final project TODAY To: cs551@bourbon.usc.edu Message-id: MIME-version: 1.0 X-Mailer: Sun Java(tm) System Messenger Express 6.2-4.01 (built Sep 1 2005) Content-type: text/plain; charset=us-ascii Content-language: en Content-transfer-encoding: 7bit Content-disposition: inline X-Accept-Language: en Priority: normal Hi all, I have heard of too many horror stories about the final project of this class, and this is why I am sending out this email. If you have not started working on the final project, START TODAY. If you have other projects, have to work, or other things that keep you busy, please, read the spec and understand it today. Also, if something is not clear to you, ask questions until you understand. Here is a tip for the project. Make sure you manage resources (such as sockets and memory) correctly. For example, if you open a socket, make sure you close it. If you allocate a chunk of memory, make sure you free it once, and only once. This sounds obvious, but when the size of your code grows and multithreading kicks in, tracing these bugs can take you days. This is why you want to start early. Leslie Return-Path: lccheung@usc.edu Delivery-Date: Fri Sep 9 19:59:09 2005 Received: from msg-mx5.usc.edu (msg-mx5.usc.edu [128.125.137.10]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j8A2x93e002039 for ; Fri, 9 Sep 2005 19:59:09 -0700 Received: from smtp106.sbc.mail.mud.yahoo.com ([68.142.198.205]) by msg-mx5.usc.edu (Sun Java System Messaging Server 6.2-4.01 (built Sep 1 2005)) with SMTP id <0IMK00DQUZC5OD90@msg-mx5.usc.edu> for cs551@merlot.usc.edu; Fri, 09 Sep 2005 20:07:17 -0700 (PDT) Received: (qmail 98153 invoked from network); Sat, 10 Sep 2005 03:07:17 +0000 Received: from unknown (HELO lesliee502e195) (leslieck@71.134.193.169 with login) by smtp106.sbc.mail.mud.yahoo.com with SMTP; Sat, 10 Sep 2005 03:07:16 +0000 Date: Fri, 09 Sep 2005 20:07:12 -0700 From: Leslie Cheung Subject: Re: Readme To: cs551@merlot.usc.edu Message-id: <0IMK00DQVZC5OD90@msg-mx5.usc.edu> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Mailer: Microsoft Office Outlook, Build 11.0.6353 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit Thread-index: AcW1tL1mDm/IKSpYTvG/qAjPcoQAoA== Someone wrote: >I would like to know what must be included in the Readme files, is there any Form >we have to follow? >for example, do we have to show our test results in it? do we have to repeat the >comments which already mentioned in the program file? There is no specific format for your README file. In your README file, you should tell me how to compile your code. If you don't say so, I'll assume typing "make" will compile both server and client. You should also tell me if I have to set certain environment variables to get your code work. In addition, if you deviate from the spec, or did not implement something, or there are known bugs, you should put those in README. For example, you might want to tell me how you handle malicious client/server (since this is not in the spec). You might also want to include the design of your project (e.g., which thread does what). Since this warmup project is small, it's ok if you don't put in the design. I would expect a design in the final project. You do not need to show me your results (you are welcomed to if you want), and you do not need to repeat what's in the spec. If you just can't think of anything to write, please state that the file is intentionally left blank". If you have any questions, please let me know. By the way, if you have not submitted anything, it's a good idea to submit something now. Note that the submission program we use is different from what you have in other classes. So make sure you are familiar with "bsubmit". Don't try to learn using it at the last minute! Leslie Return-Path: lccheung@usc.edu Delivery-Date: Sat Sep 3 19:41:25 2005 Received: from msg-mx4.usc.edu (msg-mx4.usc.edu [128.125.137.9]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j842fP3e029411 for ; Sat, 3 Sep 2005 19:41:25 -0700 Received: from smtp113.sbc.mail.mud.yahoo.com ([68.142.198.212]) by msg-mx4.usc.edu (Sun Java System Messaging Server 6.2-3.03 (built Jun 27 2005)) with SMTP id <0IM900L1PUI7QC90@msg-mx4.usc.edu> for cs551@merlot.usc.edu; Sat, 03 Sep 2005 19:49:19 -0700 (PDT) Received: (qmail 32947 invoked from network); Sun, 04 Sep 2005 02:49:19 +0000 Received: from unknown (HELO lesliee502e195) (leslieck@71.134.193.169 with login) by smtp113.sbc.mail.mud.yahoo.com with SMTP; Sun, 04 Sep 2005 02:49:18 +0000 Date: Sat, 03 Sep 2005 19:51:14 -0700 From: Leslie Cheung Subject: office hour, week of 9/5 To: cs551@merlot.usc.edu Message-id: <0IM900L1QUI7QC90@msg-mx4.usc.edu> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Mailer: Microsoft Office Outlook, Build 11.0.6353 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit Thread-index: AcWw+4O954namDulSSiPPHhvM1qttg== Hi all, Since Monday 9/5 is Labor Day holiday, I won't hold office hour. I also realize that the deadline for warmup 1 is Friday 9/9, so I have decided to hold office hour on Wed 9/7 at 4-5pm in SAL 211. I am going to be on campus on Tue 9/6 and Fri 9/9. If you need help, you can make appointments with me on these days. Thanks, Leslie Return-Path: lccheung@usc.edu Delivery-Date: Wed Aug 31 16:49:01 2005 Received: from msg-mx5.usc.edu (msg-mx5.usc.edu [128.125.137.10]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j7VNn13e006740 for ; Wed, 31 Aug 2005 16:49:01 -0700 Received: from usc.edu ([128.125.137.12]) by msg-mx5.usc.edu (Sun Java System Messaging Server 6.2-3.03 (built Jun 27 2005)) with ESMTP id <0IM4007BL2IN7W90@msg-mx5.usc.edu> for cs551@merlot.usc.edu; Wed, 31 Aug 2005 16:56:47 -0700 (PDT) Received: from [128.125.137.4] (Forwarded-For: [128.125.163.179]) by msg-store1.usc.edu (mshttpd); Wed, 31 Aug 2005 16:56:48 -0700 Date: Wed, 31 Aug 2005 16:56:48 -0700 From: leslie cheung Subject: office hour To: cs551@merlot.usc.edu Message-id: MIME-version: 1.0 X-Mailer: Sun Java(tm) System Messenger Express 6.2-2.07 (built May 25 2005) Content-type: text/plain; charset=us-ascii Content-language: en Content-transfer-encoding: 7bit Content-disposition: inline X-Accept-Language: en Priority: normal Hi class, I am Leslie Cheung, your TA for CS551. I hold office hour in SAL 211 on Mondays at 2-4pm. For this week only, I'll hold office hour on Friday (9/2) at 2-4pm in SAL 211 to help you get started with warmup 1. And of course, you can make appointments with me. Thanks, Leslie